@dcl/governance-site 2.1.0 → 2.1.1-21070875689.commit-17a78cb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{BlockOverrides-3ade36ee.js → BlockOverrides-587dcf26.js} +1 -1
- package/assets/{ConstantsUtil-2eae22d8.js → ConstantsUtil-8502dfc4.js} +1 -1
- package/assets/{ExchangeController-a4603fc6.js → ExchangeController-3fa8deb9.js} +1 -1
- package/assets/{HelpersUtil-5e6b620b.js → HelpersUtil-f4075fb8.js} +1 -1
- package/assets/{NetworkUtil-c435a410.js → NetworkUtil-8af3c123.js} +1 -1
- package/assets/{ReownAuthentication-275fa07f.js → ReownAuthentication-1b1e1840.js} +1 -1
- package/assets/{SwapController-fa850a4d.js → SwapController-0db74c5b.js} +1 -1
- package/assets/{UserAvatar-60a318a7.js → UserAvatar-9d53eb31.js} +1 -1
- package/assets/{ccip-88005127.js → ccip-4ac071b6.js} +1 -1
- package/assets/{data-capture-e5e694d1.js → data-capture-e0e0c9fe.js} +1 -1
- package/assets/{email-c414060f.js → email-c5d25039.js} +1 -1
- package/assets/{embedded-wallet-32db00c1.js → embedded-wallet-2d554e0b.js} +1 -1
- package/assets/features-4b165d70.js +1 -0
- package/assets/{fortmatic-2466dde9.js → fortmatic-0029ba7f.js} +1 -1
- package/assets/{if-defined-7ee25bf3.js → if-defined-4df7702e.js} +1 -1
- package/assets/{index-1ee54883.js → index-00b3eb70.js} +1 -1
- package/assets/{index-6eb9768a.js → index-051a3679.js} +1 -1
- package/assets/{index-1551048c.js → index-1297522a.js} +1 -1
- package/assets/{index-d49598cd.js → index-1592dd7d.js} +1 -1
- package/assets/{index-3810519d.js → index-1ee685c9.js} +1 -1
- package/assets/{index-679c4841.js → index-1ff782ff.js} +1 -1
- package/assets/{index-369dfe1e.js → index-21eb409d.js} +1 -1
- package/assets/{index-3043b678.js → index-28160b9c.js} +1 -1
- package/assets/{index-a1f594bf.js → index-2ba9f922.js} +2 -2
- package/assets/{index-2e57edc1.js → index-3aa4135b.js} +1 -1
- package/assets/{index-dc50d535.js → index-3b221013.js} +1 -1
- package/assets/{index-b1091f71.js → index-450beee4.js} +1 -1
- package/assets/{index-3638fe23.js → index-4bd4ffe7.js} +1 -1
- package/assets/{index-98d91351.js → index-536cacf7.js} +15 -15
- package/assets/{index-4798ca84.js → index-55d1b743.js} +1 -1
- package/assets/{index-a849f342.js → index-5744e825.js} +1 -1
- package/assets/{index-be9130ec.js → index-5a6600b9.js} +1 -1
- package/assets/{index-b32cb0c6.js → index-605976d8.js} +1 -1
- package/assets/{index-47ae4a5e.js → index-62359e66.js} +1 -1
- package/assets/{index-dc12522d.js → index-68cc58aa.js} +1 -1
- package/assets/{index-c3f9fae0.js → index-7cff9225.js} +1 -1
- package/assets/{index-4aeb6c2c.js → index-9b2afd4a.js} +1 -1
- package/assets/{index-7ffb3a1a.css → index-9dc35dce.css} +4 -4
- package/assets/{index-ff39af03.js → index-ab074e31.js} +1 -1
- package/assets/{index-b09d70c0.js → index-acb70d3d.js} +1 -1
- package/assets/{index-52df5c4d.js → index-ad6b7373.js} +1 -1
- package/assets/{index-df0961c1.js → index-b48e71f1.js} +1 -1
- package/assets/{index-d961c329.js → index-b53f2a1f.js} +1 -1
- package/assets/{index-28d7ea5c.js → index-baf77de8.js} +1 -1
- package/assets/{index-222bc7fa.js → index-ccc6e0b8.js} +1 -1
- package/assets/{index-653ef7a1.js → index-d9054d4b.js} +1 -1
- package/assets/{index-f965abd6.js → index-daf4aed5.js} +1 -1
- package/assets/{index-c5a92c24.js → index-db2e4275.js} +1 -1
- package/assets/{index-186174c0.js → index-df735362.js} +1 -1
- package/assets/{index-402670b5.js → index-eba69511.js} +1 -1
- package/assets/{index-e0d8af46.js → index-f7c5a5f8.js} +1 -1
- package/assets/{networks-0bc3b87e.js → networks-c2850a5d.js} +1 -1
- package/assets/{onramp-655634e5.js → onramp-db91d9aa.js} +1 -1
- package/assets/{pay-with-exchange-afd8ad4d.js → pay-with-exchange-3e3d0d35.js} +1 -1
- package/assets/{receive-32cf6ae1.js → receive-6879401e.js} +1 -1
- package/assets/{ref-ccbb85ff.js → ref-e4743dbb.js} +1 -1
- package/assets/{send-2f30192e.js → send-a5df6aaa.js} +1 -1
- package/assets/{socials-abb93a32.js → socials-a60879eb.js} +1 -1
- package/assets/{swaps-037f43fb.js → swaps-9ed4074e.js} +1 -1
- package/assets/{transactions-8d6fddfe.js → transactions-9d6d419c.js} +1 -1
- package/assets/{tslib.es6-25461a70.js → tslib.es6-623dc20e.js} +1 -1
- package/assets/{w3m-modal-c4cf95c4.js → w3m-modal-6538b1d4.js} +1 -1
- package/assets/{zoraTestnet-54cb986e.js → zoraTestnet-6a3d065c.js} +2 -2
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/features-472b8f99.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as gu,c as D,B as U,q as mu,s as _u,v as vu,m as qr,a as qi,y as wn,k as cc,b as bu,g as wu}from"./index-98d91351.js";import{r as yu,a as Dt,b as lc,c as Eu,d as Ji}from"./tslib.es6-25461a70.js";function Su(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Gi={},mn={},gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.walletLogo=void 0;const ku=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};gs.walletLogo=ku;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.LINK_API_URL=void 0;ms.LINK_API_URL="https://www.walletlink.org";var O={},Zi={exports:{}};Zi.exports;(function(e){(function(t,r){function n(E,o){if(!E)throw new Error(o||"Assertion failed")}function s(E,o){E.super_=o;var u=function(){};u.prototype=o.prototype,E.prototype=new u,E.prototype.constructor=E}function i(E,o,u){if(i.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(E||0,o||10,u||"be"))}typeof t=="object"?t.exports=i:r.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=gu.Buffer}catch{}i.isBN=function(o){return o instanceof i?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===i.wordSize&&Array.isArray(o.words)},i.max=function(o,u){return o.cmp(u)>0?o:u},i.min=function(o,u){return o.cmp(u)<0?o:u},i.prototype._init=function(o,u,p){if(typeof o=="number")return this._initNumber(o,u,p);if(typeof o=="object")return this._initArray(o,u,p);u==="hex"&&(u=16),n(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var m=0;o[0]==="-"&&(m++,this.negative=1),m<o.length&&(u===16?this._parseHex(o,m,p):(this._parseBase(o,u,m),p==="le"&&this._initArray(this.toArray(),u,p)))},i.prototype._initNumber=function(o,u,p){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},i.prototype._initArray=function(o,u,p){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v,y,k=0;if(p==="be")for(m=o.length-1,v=0;m>=0;m-=3)y=o[m]|o[m-1]<<8|o[m-2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);else if(p==="le")for(m=0,v=0;m<o.length;m+=3)y=o[m]|o[m+1]<<8|o[m+2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);return this._strip()};function c(E,o){var u=E.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;n(!1,"Invalid character in "+E)}function h(E,o,u){var p=c(E,u);return u-1>=o&&(p|=c(E,u-1)<<4),p}i.prototype._parseHex=function(o,u,p){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v=0,y=0,k;if(p==="be")for(m=o.length-1;m>=u;m-=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8;else{var _=o.length-u;for(m=_%2===0?u+1:u;m<o.length;m+=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8}this._strip()};function d(E,o,u,p){for(var m=0,v=0,y=Math.min(E.length,u),k=o;k<y;k++){var _=E.charCodeAt(k)-48;m*=p,_>=49?v=_-49+10:_>=17?v=_-17+10:v=_,n(_>=0&&v<p,"Invalid character"),m+=v}return m}i.prototype._parseBase=function(o,u,p){this.words=[0],this.length=1;for(var m=0,v=1;v<=67108863;v*=u)m++;m--,v=v/u|0;for(var y=o.length-p,k=y%m,_=Math.min(y,y-k)+p,l=0,b=p;b<_;b+=m)l=d(o,b,b+m,u),this.imuln(v),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(k!==0){var T=1;for(l=d(o,b,o.length,u),b=0;b<k;b++)T*=u;this.imuln(T),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(o){o.words=new Array(this.length);for(var u=0;u<this.length;u++)o.words[u]=this.words[u];o.length=this.length,o.negative=this.negative,o.red=this.red};function f(E,o){E.words=o.words,E.length=o.length,E.negative=o.negative,E.red=o.red}if(i.prototype._move=function(o){f(o,this)},i.prototype.clone=function(){var o=new i(null);return this.copy(o),o},i.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{i.prototype.inspect=g}else i.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],C=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(o,u){o=o||10,u=u|0||1;var p;if(o===16||o==="hex"){p="";for(var m=0,v=0,y=0;y<this.length;y++){var k=this.words[y],_=((k<<m|v)&16777215).toString(16);v=k>>>24-m&16777215,m+=2,m>=26&&(m-=26,y--),v!==0||y!==this.length-1?p=w[6-_.length]+_+p:p=_+p}for(v!==0&&(p=v.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(o===(o|0)&&o>=2&&o<=36){var l=S[o],b=C[o];p="";var T=this.clone();for(T.negative=0;!T.isZero();){var L=T.modrn(b).toString(o);T=T.idivn(b),T.isZero()?p=L+p:p=w[l-L.length]+L+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(o,u){return this.toArrayLike(a,o,u)}),i.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var M=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};i.prototype.toArrayLike=function(o,u,p){this._strip();var m=this.byteLength(),v=p||Math.max(1,m);n(m<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var y=M(o,v),k=u==="le"?"LE":"BE";return this["_toArrayLike"+k](y,m),y},i.prototype._toArrayLikeLE=function(o,u){for(var p=0,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p++]=k&255,p<o.length&&(o[p++]=k>>8&255),p<o.length&&(o[p++]=k>>16&255),y===6?(p<o.length&&(o[p++]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p<o.length)for(o[p++]=m;p<o.length;)o[p++]=0},i.prototype._toArrayLikeBE=function(o,u){for(var p=o.length-1,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p--]=k&255,p>=0&&(o[p--]=k>>8&255),p>=0&&(o[p--]=k>>16&255),y===6?(p>=0&&(o[p--]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p>=0)for(o[p--]=m;p>=0;)o[p--]=0},Math.clz32?i.prototype._countBits=function(o){return 32-Math.clz32(o)}:i.prototype._countBits=function(o){var u=o,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},i.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,p=0;return u&8191||(p+=13,u>>>=13),u&127||(p+=7,u>>>=7),u&15||(p+=4,u>>>=4),u&3||(p+=2,u>>>=2),u&1||p++,p},i.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function I(E){for(var o=new Array(E.bitLength()),u=0;u<o.length;u++){var p=u/26|0,m=u%26;o[u]=E.words[p]>>>m&1}return o}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(o+=p,p!==26)break}return o},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},i.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var u=0;u<o.length;u++)this.words[u]=this.words[u]|o.words[u];return this._strip()},i.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},i.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},i.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},i.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&o.words[p];return this.length=u.length,this._strip()},i.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},i.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},i.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},i.prototype.iuxor=function(o){var u,p;this.length>o.length?(u=this,p=o):(u=o,p=this);for(var m=0;m<p.length;m++)this.words[m]=u.words[m]^p.words[m];if(this!==u)for(;m<u.length;m++)this.words[m]=u.words[m];return this.length=u.length,this._strip()},i.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},i.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},i.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},i.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,p=o%26;this._expand(u),p>0&&u--;for(var m=0;m<u;m++)this.words[m]=~this.words[m]&67108863;return p>0&&(this.words[m]=~this.words[m]&67108863>>26-p),this._strip()},i.prototype.notn=function(o){return this.clone().inotn(o)},i.prototype.setn=function(o,u){n(typeof o=="number"&&o>=0);var p=o/26|0,m=o%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<m:this.words[p]=this.words[p]&~(1<<m),this._strip()},i.prototype.iadd=function(o){var u;if(this.negative!==0&&o.negative===0)return this.negative=0,u=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,u=this.isub(o),o.negative=1,u._normSign();var p,m;this.length>o.length?(p=this,m=o):(p=o,m=this);for(var v=0,y=0;y<m.length;y++)u=(p.words[y]|0)+(m.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;for(;v!==0&&y<p.length;y++)u=(p.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;if(this.length=p.length,v!==0)this.words[this.length]=v,this.length++;else if(p!==this)for(;y<p.length;y++)this.words[y]=p.words[y];return this},i.prototype.add=function(o){var u;return o.negative!==0&&this.negative===0?(o.negative=0,u=this.sub(o),o.negative^=1,u):o.negative===0&&this.negative!==0?(this.negative=0,u=o.sub(this),this.negative=1,u):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},i.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var p=this.cmp(o);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,v;p>0?(m=this,v=o):(m=o,v=this);for(var y=0,k=0;k<v.length;k++)u=(m.words[k]|0)-(v.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;for(;y!==0&&k<m.length;k++)u=(m.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;if(y===0&&k<m.length&&m!==this)for(;k<m.length;k++)this.words[k]=m.words[k];return this.length=Math.max(this.length,k),m!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(o){return this.clone().isub(o)};function A(E,o,u){u.negative=o.negative^E.negative;var p=E.length+o.length|0;u.length=p,p=p-1|0;var m=E.words[0]|0,v=o.words[0]|0,y=m*v,k=y&67108863,_=y/67108864|0;u.words[0]=k;for(var l=1;l<p;l++){for(var b=_>>>26,T=_&67108863,L=Math.min(l,o.length-1),$=Math.max(0,l-E.length+1);$<=L;$++){var K=l-$|0;m=E.words[K]|0,v=o.words[$]|0,y=m*v+T,b+=y/67108864|0,T=y&67108863}u.words[l]=T|0,_=b|0}return _!==0?u.words[l]=_|0:u.length--,u._strip()}var x=function(o,u,p){var m=o.words,v=u.words,y=p.words,k=0,_,l,b,T=m[0]|0,L=T&8191,$=T>>>13,K=m[1]|0,Q=K&8191,X=K>>>13,rn=m[2]|0,Ce=rn&8191,Ie=rn>>>13,nn=m[3]|0,xe=nn&8191,Ae=nn>>>13,sn=m[4]|0,Ne=sn&8191,Le=sn>>>13,on=m[5]|0,$e=on&8191,Te=on>>>13,an=m[6]|0,Pe=an&8191,Oe=an>>>13,cn=m[7]|0,Be=cn&8191,De=cn>>>13,gr=m[8]|0,re=gr&8191,ne=gr>>>13,mr=m[9]|0,se=mr&8191,ie=mr>>>13,_r=v[0]|0,oe=_r&8191,ae=_r>>>13,vr=v[1]|0,ce=vr&8191,le=vr>>>13,br=v[2]|0,ue=br&8191,he=br>>>13,wr=v[3]|0,de=wr&8191,fe=wr>>>13,yr=v[4]|0,pe=yr&8191,ge=yr>>>13,Er=v[5]|0,me=Er&8191,_e=Er>>>13,Sr=v[6]|0,ve=Sr&8191,be=Sr>>>13,kr=v[7]|0,we=kr&8191,ye=kr>>>13,Mr=v[8]|0,Ee=Mr&8191,Se=Mr>>>13,Rr=v[9]|0,ke=Rr&8191,Me=Rr>>>13;p.negative=o.negative^u.negative,p.length=19,_=Math.imul(L,oe),l=Math.imul(L,ae),l=l+Math.imul($,oe)|0,b=Math.imul($,ae);var Ft=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,_=Math.imul(Q,oe),l=Math.imul(Q,ae),l=l+Math.imul(X,oe)|0,b=Math.imul(X,ae),_=_+Math.imul(L,ce)|0,l=l+Math.imul(L,le)|0,l=l+Math.imul($,ce)|0,b=b+Math.imul($,le)|0;var jt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(jt>>>26)|0,jt&=67108863,_=Math.imul(Ce,oe),l=Math.imul(Ce,ae),l=l+Math.imul(Ie,oe)|0,b=Math.imul(Ie,ae),_=_+Math.imul(Q,ce)|0,l=l+Math.imul(Q,le)|0,l=l+Math.imul(X,ce)|0,b=b+Math.imul(X,le)|0,_=_+Math.imul(L,ue)|0,l=l+Math.imul(L,he)|0,l=l+Math.imul($,ue)|0,b=b+Math.imul($,he)|0;var Ht=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,_=Math.imul(xe,oe),l=Math.imul(xe,ae),l=l+Math.imul(Ae,oe)|0,b=Math.imul(Ae,ae),_=_+Math.imul(Ce,ce)|0,l=l+Math.imul(Ce,le)|0,l=l+Math.imul(Ie,ce)|0,b=b+Math.imul(Ie,le)|0,_=_+Math.imul(Q,ue)|0,l=l+Math.imul(Q,he)|0,l=l+Math.imul(X,ue)|0,b=b+Math.imul(X,he)|0,_=_+Math.imul(L,de)|0,l=l+Math.imul(L,fe)|0,l=l+Math.imul($,de)|0,b=b+Math.imul($,fe)|0;var Ut=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,_=Math.imul(Ne,oe),l=Math.imul(Ne,ae),l=l+Math.imul(Le,oe)|0,b=Math.imul(Le,ae),_=_+Math.imul(xe,ce)|0,l=l+Math.imul(xe,le)|0,l=l+Math.imul(Ae,ce)|0,b=b+Math.imul(Ae,le)|0,_=_+Math.imul(Ce,ue)|0,l=l+Math.imul(Ce,he)|0,l=l+Math.imul(Ie,ue)|0,b=b+Math.imul(Ie,he)|0,_=_+Math.imul(Q,de)|0,l=l+Math.imul(Q,fe)|0,l=l+Math.imul(X,de)|0,b=b+Math.imul(X,fe)|0,_=_+Math.imul(L,pe)|0,l=l+Math.imul(L,ge)|0,l=l+Math.imul($,pe)|0,b=b+Math.imul($,ge)|0;var Vt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,_=Math.imul($e,oe),l=Math.imul($e,ae),l=l+Math.imul(Te,oe)|0,b=Math.imul(Te,ae),_=_+Math.imul(Ne,ce)|0,l=l+Math.imul(Ne,le)|0,l=l+Math.imul(Le,ce)|0,b=b+Math.imul(Le,le)|0,_=_+Math.imul(xe,ue)|0,l=l+Math.imul(xe,he)|0,l=l+Math.imul(Ae,ue)|0,b=b+Math.imul(Ae,he)|0,_=_+Math.imul(Ce,de)|0,l=l+Math.imul(Ce,fe)|0,l=l+Math.imul(Ie,de)|0,b=b+Math.imul(Ie,fe)|0,_=_+Math.imul(Q,pe)|0,l=l+Math.imul(Q,ge)|0,l=l+Math.imul(X,pe)|0,b=b+Math.imul(X,ge)|0,_=_+Math.imul(L,me)|0,l=l+Math.imul(L,_e)|0,l=l+Math.imul($,me)|0,b=b+Math.imul($,_e)|0;var zt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(zt>>>26)|0,zt&=67108863,_=Math.imul(Pe,oe),l=Math.imul(Pe,ae),l=l+Math.imul(Oe,oe)|0,b=Math.imul(Oe,ae),_=_+Math.imul($e,ce)|0,l=l+Math.imul($e,le)|0,l=l+Math.imul(Te,ce)|0,b=b+Math.imul(Te,le)|0,_=_+Math.imul(Ne,ue)|0,l=l+Math.imul(Ne,he)|0,l=l+Math.imul(Le,ue)|0,b=b+Math.imul(Le,he)|0,_=_+Math.imul(xe,de)|0,l=l+Math.imul(xe,fe)|0,l=l+Math.imul(Ae,de)|0,b=b+Math.imul(Ae,fe)|0,_=_+Math.imul(Ce,pe)|0,l=l+Math.imul(Ce,ge)|0,l=l+Math.imul(Ie,pe)|0,b=b+Math.imul(Ie,ge)|0,_=_+Math.imul(Q,me)|0,l=l+Math.imul(Q,_e)|0,l=l+Math.imul(X,me)|0,b=b+Math.imul(X,_e)|0,_=_+Math.imul(L,ve)|0,l=l+Math.imul(L,be)|0,l=l+Math.imul($,ve)|0,b=b+Math.imul($,be)|0;var Wt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,_=Math.imul(Be,oe),l=Math.imul(Be,ae),l=l+Math.imul(De,oe)|0,b=Math.imul(De,ae),_=_+Math.imul(Pe,ce)|0,l=l+Math.imul(Pe,le)|0,l=l+Math.imul(Oe,ce)|0,b=b+Math.imul(Oe,le)|0,_=_+Math.imul($e,ue)|0,l=l+Math.imul($e,he)|0,l=l+Math.imul(Te,ue)|0,b=b+Math.imul(Te,he)|0,_=_+Math.imul(Ne,de)|0,l=l+Math.imul(Ne,fe)|0,l=l+Math.imul(Le,de)|0,b=b+Math.imul(Le,fe)|0,_=_+Math.imul(xe,pe)|0,l=l+Math.imul(xe,ge)|0,l=l+Math.imul(Ae,pe)|0,b=b+Math.imul(Ae,ge)|0,_=_+Math.imul(Ce,me)|0,l=l+Math.imul(Ce,_e)|0,l=l+Math.imul(Ie,me)|0,b=b+Math.imul(Ie,_e)|0,_=_+Math.imul(Q,ve)|0,l=l+Math.imul(Q,be)|0,l=l+Math.imul(X,ve)|0,b=b+Math.imul(X,be)|0,_=_+Math.imul(L,we)|0,l=l+Math.imul(L,ye)|0,l=l+Math.imul($,we)|0,b=b+Math.imul($,ye)|0;var qt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(qt>>>26)|0,qt&=67108863,_=Math.imul(re,oe),l=Math.imul(re,ae),l=l+Math.imul(ne,oe)|0,b=Math.imul(ne,ae),_=_+Math.imul(Be,ce)|0,l=l+Math.imul(Be,le)|0,l=l+Math.imul(De,ce)|0,b=b+Math.imul(De,le)|0,_=_+Math.imul(Pe,ue)|0,l=l+Math.imul(Pe,he)|0,l=l+Math.imul(Oe,ue)|0,b=b+Math.imul(Oe,he)|0,_=_+Math.imul($e,de)|0,l=l+Math.imul($e,fe)|0,l=l+Math.imul(Te,de)|0,b=b+Math.imul(Te,fe)|0,_=_+Math.imul(Ne,pe)|0,l=l+Math.imul(Ne,ge)|0,l=l+Math.imul(Le,pe)|0,b=b+Math.imul(Le,ge)|0,_=_+Math.imul(xe,me)|0,l=l+Math.imul(xe,_e)|0,l=l+Math.imul(Ae,me)|0,b=b+Math.imul(Ae,_e)|0,_=_+Math.imul(Ce,ve)|0,l=l+Math.imul(Ce,be)|0,l=l+Math.imul(Ie,ve)|0,b=b+Math.imul(Ie,be)|0,_=_+Math.imul(Q,we)|0,l=l+Math.imul(Q,ye)|0,l=l+Math.imul(X,we)|0,b=b+Math.imul(X,ye)|0,_=_+Math.imul(L,Ee)|0,l=l+Math.imul(L,Se)|0,l=l+Math.imul($,Ee)|0,b=b+Math.imul($,Se)|0;var Jt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,_=Math.imul(se,oe),l=Math.imul(se,ae),l=l+Math.imul(ie,oe)|0,b=Math.imul(ie,ae),_=_+Math.imul(re,ce)|0,l=l+Math.imul(re,le)|0,l=l+Math.imul(ne,ce)|0,b=b+Math.imul(ne,le)|0,_=_+Math.imul(Be,ue)|0,l=l+Math.imul(Be,he)|0,l=l+Math.imul(De,ue)|0,b=b+Math.imul(De,he)|0,_=_+Math.imul(Pe,de)|0,l=l+Math.imul(Pe,fe)|0,l=l+Math.imul(Oe,de)|0,b=b+Math.imul(Oe,fe)|0,_=_+Math.imul($e,pe)|0,l=l+Math.imul($e,ge)|0,l=l+Math.imul(Te,pe)|0,b=b+Math.imul(Te,ge)|0,_=_+Math.imul(Ne,me)|0,l=l+Math.imul(Ne,_e)|0,l=l+Math.imul(Le,me)|0,b=b+Math.imul(Le,_e)|0,_=_+Math.imul(xe,ve)|0,l=l+Math.imul(xe,be)|0,l=l+Math.imul(Ae,ve)|0,b=b+Math.imul(Ae,be)|0,_=_+Math.imul(Ce,we)|0,l=l+Math.imul(Ce,ye)|0,l=l+Math.imul(Ie,we)|0,b=b+Math.imul(Ie,ye)|0,_=_+Math.imul(Q,Ee)|0,l=l+Math.imul(Q,Se)|0,l=l+Math.imul(X,Ee)|0,b=b+Math.imul(X,Se)|0,_=_+Math.imul(L,ke)|0,l=l+Math.imul(L,Me)|0,l=l+Math.imul($,ke)|0,b=b+Math.imul($,Me)|0;var Gt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,_=Math.imul(se,ce),l=Math.imul(se,le),l=l+Math.imul(ie,ce)|0,b=Math.imul(ie,le),_=_+Math.imul(re,ue)|0,l=l+Math.imul(re,he)|0,l=l+Math.imul(ne,ue)|0,b=b+Math.imul(ne,he)|0,_=_+Math.imul(Be,de)|0,l=l+Math.imul(Be,fe)|0,l=l+Math.imul(De,de)|0,b=b+Math.imul(De,fe)|0,_=_+Math.imul(Pe,pe)|0,l=l+Math.imul(Pe,ge)|0,l=l+Math.imul(Oe,pe)|0,b=b+Math.imul(Oe,ge)|0,_=_+Math.imul($e,me)|0,l=l+Math.imul($e,_e)|0,l=l+Math.imul(Te,me)|0,b=b+Math.imul(Te,_e)|0,_=_+Math.imul(Ne,ve)|0,l=l+Math.imul(Ne,be)|0,l=l+Math.imul(Le,ve)|0,b=b+Math.imul(Le,be)|0,_=_+Math.imul(xe,we)|0,l=l+Math.imul(xe,ye)|0,l=l+Math.imul(Ae,we)|0,b=b+Math.imul(Ae,ye)|0,_=_+Math.imul(Ce,Ee)|0,l=l+Math.imul(Ce,Se)|0,l=l+Math.imul(Ie,Ee)|0,b=b+Math.imul(Ie,Se)|0,_=_+Math.imul(Q,ke)|0,l=l+Math.imul(Q,Me)|0,l=l+Math.imul(X,ke)|0,b=b+Math.imul(X,Me)|0;var Zt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,_=Math.imul(se,ue),l=Math.imul(se,he),l=l+Math.imul(ie,ue)|0,b=Math.imul(ie,he),_=_+Math.imul(re,de)|0,l=l+Math.imul(re,fe)|0,l=l+Math.imul(ne,de)|0,b=b+Math.imul(ne,fe)|0,_=_+Math.imul(Be,pe)|0,l=l+Math.imul(Be,ge)|0,l=l+Math.imul(De,pe)|0,b=b+Math.imul(De,ge)|0,_=_+Math.imul(Pe,me)|0,l=l+Math.imul(Pe,_e)|0,l=l+Math.imul(Oe,me)|0,b=b+Math.imul(Oe,_e)|0,_=_+Math.imul($e,ve)|0,l=l+Math.imul($e,be)|0,l=l+Math.imul(Te,ve)|0,b=b+Math.imul(Te,be)|0,_=_+Math.imul(Ne,we)|0,l=l+Math.imul(Ne,ye)|0,l=l+Math.imul(Le,we)|0,b=b+Math.imul(Le,ye)|0,_=_+Math.imul(xe,Ee)|0,l=l+Math.imul(xe,Se)|0,l=l+Math.imul(Ae,Ee)|0,b=b+Math.imul(Ae,Se)|0,_=_+Math.imul(Ce,ke)|0,l=l+Math.imul(Ce,Me)|0,l=l+Math.imul(Ie,ke)|0,b=b+Math.imul(Ie,Me)|0;var Qt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,_=Math.imul(se,de),l=Math.imul(se,fe),l=l+Math.imul(ie,de)|0,b=Math.imul(ie,fe),_=_+Math.imul(re,pe)|0,l=l+Math.imul(re,ge)|0,l=l+Math.imul(ne,pe)|0,b=b+Math.imul(ne,ge)|0,_=_+Math.imul(Be,me)|0,l=l+Math.imul(Be,_e)|0,l=l+Math.imul(De,me)|0,b=b+Math.imul(De,_e)|0,_=_+Math.imul(Pe,ve)|0,l=l+Math.imul(Pe,be)|0,l=l+Math.imul(Oe,ve)|0,b=b+Math.imul(Oe,be)|0,_=_+Math.imul($e,we)|0,l=l+Math.imul($e,ye)|0,l=l+Math.imul(Te,we)|0,b=b+Math.imul(Te,ye)|0,_=_+Math.imul(Ne,Ee)|0,l=l+Math.imul(Ne,Se)|0,l=l+Math.imul(Le,Ee)|0,b=b+Math.imul(Le,Se)|0,_=_+Math.imul(xe,ke)|0,l=l+Math.imul(xe,Me)|0,l=l+Math.imul(Ae,ke)|0,b=b+Math.imul(Ae,Me)|0;var Kt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,_=Math.imul(se,pe),l=Math.imul(se,ge),l=l+Math.imul(ie,pe)|0,b=Math.imul(ie,ge),_=_+Math.imul(re,me)|0,l=l+Math.imul(re,_e)|0,l=l+Math.imul(ne,me)|0,b=b+Math.imul(ne,_e)|0,_=_+Math.imul(Be,ve)|0,l=l+Math.imul(Be,be)|0,l=l+Math.imul(De,ve)|0,b=b+Math.imul(De,be)|0,_=_+Math.imul(Pe,we)|0,l=l+Math.imul(Pe,ye)|0,l=l+Math.imul(Oe,we)|0,b=b+Math.imul(Oe,ye)|0,_=_+Math.imul($e,Ee)|0,l=l+Math.imul($e,Se)|0,l=l+Math.imul(Te,Ee)|0,b=b+Math.imul(Te,Se)|0,_=_+Math.imul(Ne,ke)|0,l=l+Math.imul(Ne,Me)|0,l=l+Math.imul(Le,ke)|0,b=b+Math.imul(Le,Me)|0;var Xt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,_=Math.imul(se,me),l=Math.imul(se,_e),l=l+Math.imul(ie,me)|0,b=Math.imul(ie,_e),_=_+Math.imul(re,ve)|0,l=l+Math.imul(re,be)|0,l=l+Math.imul(ne,ve)|0,b=b+Math.imul(ne,be)|0,_=_+Math.imul(Be,we)|0,l=l+Math.imul(Be,ye)|0,l=l+Math.imul(De,we)|0,b=b+Math.imul(De,ye)|0,_=_+Math.imul(Pe,Ee)|0,l=l+Math.imul(Pe,Se)|0,l=l+Math.imul(Oe,Ee)|0,b=b+Math.imul(Oe,Se)|0,_=_+Math.imul($e,ke)|0,l=l+Math.imul($e,Me)|0,l=l+Math.imul(Te,ke)|0,b=b+Math.imul(Te,Me)|0;var ui=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(ui>>>26)|0,ui&=67108863,_=Math.imul(se,ve),l=Math.imul(se,be),l=l+Math.imul(ie,ve)|0,b=Math.imul(ie,be),_=_+Math.imul(re,we)|0,l=l+Math.imul(re,ye)|0,l=l+Math.imul(ne,we)|0,b=b+Math.imul(ne,ye)|0,_=_+Math.imul(Be,Ee)|0,l=l+Math.imul(Be,Se)|0,l=l+Math.imul(De,Ee)|0,b=b+Math.imul(De,Se)|0,_=_+Math.imul(Pe,ke)|0,l=l+Math.imul(Pe,Me)|0,l=l+Math.imul(Oe,ke)|0,b=b+Math.imul(Oe,Me)|0;var hi=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(hi>>>26)|0,hi&=67108863,_=Math.imul(se,we),l=Math.imul(se,ye),l=l+Math.imul(ie,we)|0,b=Math.imul(ie,ye),_=_+Math.imul(re,Ee)|0,l=l+Math.imul(re,Se)|0,l=l+Math.imul(ne,Ee)|0,b=b+Math.imul(ne,Se)|0,_=_+Math.imul(Be,ke)|0,l=l+Math.imul(Be,Me)|0,l=l+Math.imul(De,ke)|0,b=b+Math.imul(De,Me)|0;var di=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(di>>>26)|0,di&=67108863,_=Math.imul(se,Ee),l=Math.imul(se,Se),l=l+Math.imul(ie,Ee)|0,b=Math.imul(ie,Se),_=_+Math.imul(re,ke)|0,l=l+Math.imul(re,Me)|0,l=l+Math.imul(ne,ke)|0,b=b+Math.imul(ne,Me)|0;var fi=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(fi>>>26)|0,fi&=67108863,_=Math.imul(se,ke),l=Math.imul(se,Me),l=l+Math.imul(ie,ke)|0,b=Math.imul(ie,Me);var pi=(k+_|0)+((l&8191)<<13)|0;return k=(b+(l>>>13)|0)+(pi>>>26)|0,pi&=67108863,y[0]=Ft,y[1]=jt,y[2]=Ht,y[3]=Ut,y[4]=Vt,y[5]=zt,y[6]=Wt,y[7]=qt,y[8]=Jt,y[9]=Gt,y[10]=Zt,y[11]=Qt,y[12]=Kt,y[13]=Xt,y[14]=ui,y[15]=hi,y[16]=di,y[17]=fi,y[18]=pi,k!==0&&(y[19]=k,p.length++),p};Math.imul||(x=A);function R(E,o,u){u.negative=o.negative^E.negative,u.length=E.length+o.length;for(var p=0,m=0,v=0;v<u.length-1;v++){var y=m;m=0;for(var k=p&67108863,_=Math.min(v,o.length-1),l=Math.max(0,v-E.length+1);l<=_;l++){var b=v-l,T=E.words[b]|0,L=o.words[l]|0,$=T*L,K=$&67108863;y=y+($/67108864|0)|0,K=K+k|0,k=K&67108863,y=y+(K>>>26)|0,m+=y>>>26,y&=67108863}u.words[v]=k,p=y,y=m}return p!==0?u.words[v]=p:u.length--,u._strip()}function B(E,o,u){return R(E,o,u)}i.prototype.mulTo=function(o,u){var p,m=this.length+o.length;return this.length===10&&o.length===10?p=x(this,o,u):m<63?p=A(this,o,u):m<1024?p=R(this,o,u):p=B(this,o,u),p},i.prototype.mul=function(o){var u=new i(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},i.prototype.mulf=function(o){var u=new i(null);return u.words=new Array(this.length+o.length),B(this,o,u)},i.prototype.imul=function(o){return this.clone().mulTo(o,this)},i.prototype.imuln=function(o){var u=o<0;u&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var p=0,m=0;m<this.length;m++){var v=(this.words[m]|0)*o,y=(v&67108863)+(p&67108863);p>>=26,p+=v/67108864|0,p+=y>>>26,this.words[m]=y&67108863}return p!==0&&(this.words[m]=p,this.length++),this.length=o===0?1:this.length,u?this.ineg():this},i.prototype.muln=function(o){return this.clone().imuln(o)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(o){var u=I(o);if(u.length===0)return new i(1);for(var p=this,m=0;m<u.length&&u[m]===0;m++,p=p.sqr());if(++m<u.length)for(var v=p.sqr();m<u.length;m++,v=v.sqr())u[m]!==0&&(p=p.mul(v));return p},i.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=67108863>>>26-u<<26-u,v;if(u!==0){var y=0;for(v=0;v<this.length;v++){var k=this.words[v]&m,_=(this.words[v]|0)-k<<u;this.words[v]=_|y,y=k>>>26-u}y&&(this.words[v]=y,this.length++)}if(p!==0){for(v=this.length-1;v>=0;v--)this.words[v+p]=this.words[v];for(v=0;v<p;v++)this.words[v]=0;this.length+=p}return this._strip()},i.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},i.prototype.iushrn=function(o,u,p){n(typeof o=="number"&&o>=0);var m;u?m=(u-u%26)/26:m=0;var v=o%26,y=Math.min((o-v)/26,this.length),k=67108863^67108863>>>v<<v,_=p;if(m-=y,m=Math.max(0,m),_){for(var l=0;l<y;l++)_.words[l]=this.words[l];_.length=y}if(y!==0)if(this.length>y)for(this.length-=y,l=0;l<this.length;l++)this.words[l]=this.words[l+y];else this.words[0]=0,this.length=1;var b=0;for(l=this.length-1;l>=0&&(b!==0||l>=m);l--){var T=this.words[l]|0;this.words[l]=b<<26-v|T>>>v,b=T&k}return _&&b!==0&&(_.words[_.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(o,u,p){return n(this.negative===0),this.iushrn(o,u,p)},i.prototype.shln=function(o){return this.clone().ishln(o)},i.prototype.ushln=function(o){return this.clone().iushln(o)},i.prototype.shrn=function(o){return this.clone().ishrn(o)},i.prototype.ushrn=function(o){return this.clone().iushrn(o)},i.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return!1;var v=this.words[p];return!!(v&m)},i.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var m=67108863^67108863>>>u<<u;this.words[this.length-1]&=m}return this._strip()},i.prototype.maskn=function(o){return this.clone().imaskn(o)},i.prototype.iaddn=function(o){return n(typeof o=="number"),n(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<=o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},i.prototype._iaddn=function(o){this.words[0]+=o;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},i.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},i.prototype.addn=function(o){return this.clone().iaddn(o)},i.prototype.subn=function(o){return this.clone().isubn(o)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(o,u,p){var m=o.length+p,v;this._expand(m);var y,k=0;for(v=0;v<o.length;v++){y=(this.words[v+p]|0)+k;var _=(o.words[v]|0)*u;y-=_&67108863,k=(y>>26)-(_/67108864|0),this.words[v+p]=y&67108863}for(;v<this.length-p;v++)y=(this.words[v+p]|0)+k,k=y>>26,this.words[v+p]=y&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,v=0;v<this.length;v++)y=-(this.words[v]|0)+k,k=y>>26,this.words[v]=y&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(o,u){var p=this.length-o.length,m=this.clone(),v=o,y=v.words[v.length-1]|0,k=this._countBits(y);p=26-k,p!==0&&(v=v.ushln(p),m.iushln(p),y=v.words[v.length-1]|0);var _=m.length-v.length,l;if(u!=="mod"){l=new i(null),l.length=_+1,l.words=new Array(l.length);for(var b=0;b<l.length;b++)l.words[b]=0}var T=m.clone()._ishlnsubmul(v,1,_);T.negative===0&&(m=T,l&&(l.words[_]=1));for(var L=_-1;L>=0;L--){var $=(m.words[v.length+L]|0)*67108864+(m.words[v.length+L-1]|0);for($=Math.min($/y|0,67108863),m._ishlnsubmul(v,$,L);m.negative!==0;)$--,m.negative=0,m._ishlnsubmul(v,1,L),m.isZero()||(m.negative^=1);l&&(l.words[L]=$)}return l&&l._strip(),m._strip(),u!=="div"&&p!==0&&m.iushrn(p),{div:l||null,mod:m}},i.prototype.divmod=function(o,u,p){if(n(!o.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var m,v,y;return this.negative!==0&&o.negative===0?(y=this.neg().divmod(o,u),u!=="mod"&&(m=y.div.neg()),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.iadd(o)),{div:m,mod:v}):this.negative===0&&o.negative!==0?(y=this.divmod(o.neg(),u),u!=="mod"&&(m=y.div.neg()),{div:m,mod:y.mod}):this.negative&o.negative?(y=this.neg().divmod(o.neg(),u),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.isub(o)),{div:y.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new i(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new i(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new i(this.modrn(o.words[0]))}:this._wordDiv(o,u)},i.prototype.div=function(o){return this.divmod(o,"div",!1).div},i.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},i.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},i.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(o):u.mod,m=o.ushrn(1),v=o.andln(1),y=p.cmp(m);return y<0||v===1&&y===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},i.prototype.modrn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=(1<<26)%o,m=0,v=this.length-1;v>=0;v--)m=(p*m+(this.words[v]|0))%o;return u?-m:m},i.prototype.modn=function(o){return this.modrn(o)},i.prototype.idivn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var v=(this.words[m]|0)+p*67108864;this.words[m]=v/o|0,p=v%o}return this._strip(),u?this.ineg():this},i.prototype.divn=function(o){return this.clone().idivn(o)},i.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new i(1),v=new i(0),y=new i(0),k=new i(1),_=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++_;for(var l=p.clone(),b=u.clone();!u.isZero();){for(var T=0,L=1;!(u.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(u.iushrn(T);T-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(l),v.isub(b)),m.iushrn(1),v.iushrn(1);for(var $=0,K=1;!(p.words[0]&K)&&$<26;++$,K<<=1);if($>0)for(p.iushrn($);$-- >0;)(y.isOdd()||k.isOdd())&&(y.iadd(l),k.isub(b)),y.iushrn(1),k.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(y),v.isub(k)):(p.isub(u),y.isub(m),k.isub(v))}return{a:y,b:k,gcd:p.iushln(_)}},i.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new i(1),v=new i(0),y=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var k=0,_=1;!(u.words[0]&_)&&k<26;++k,_<<=1);if(k>0)for(u.iushrn(k);k-- >0;)m.isOdd()&&m.iadd(y),m.iushrn(1);for(var l=0,b=1;!(p.words[0]&b)&&l<26;++l,b<<=1);if(l>0)for(p.iushrn(l);l-- >0;)v.isOdd()&&v.iadd(y),v.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(v)):(p.isub(u),v.isub(m))}var T;return u.cmpn(1)===0?T=m:T=v,T.cmpn(0)<0&&T.iadd(o),T},i.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),p=o.clone();u.negative=0,p.negative=0;for(var m=0;u.isEven()&&p.isEven();m++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var v=u.cmp(p);if(v<0){var y=u;u=p,p=y}else if(v===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(m)},i.prototype.invm=function(o){return this.egcd(o).a.umod(o)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(o){return this.words[0]&o},i.prototype.bincn=function(o){n(typeof o=="number");var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=m,this;for(var v=m,y=p;v!==0&&y<this.length;y++){var k=this.words[y]|0;k+=v,v=k>>>26,k&=67108863,this.words[y]=k}return v!==0&&(this.words[y]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(o=-o),n(o<=67108863,"Number is too big");var m=this.words[0]|0;p=m===o?0:m<o?-1:1}return this.negative!==0?-p|0:p},i.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var u=this.ucmp(o);return this.negative!==0?-u|0:u},i.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var m=this.words[p]|0,v=o.words[p]|0;if(m!==v){m<v?u=-1:m>v&&(u=1);break}}return u},i.prototype.gtn=function(o){return this.cmpn(o)===1},i.prototype.gt=function(o){return this.cmp(o)===1},i.prototype.gten=function(o){return this.cmpn(o)>=0},i.prototype.gte=function(o){return this.cmp(o)>=0},i.prototype.ltn=function(o){return this.cmpn(o)===-1},i.prototype.lt=function(o){return this.cmp(o)===-1},i.prototype.lten=function(o){return this.cmpn(o)<=0},i.prototype.lte=function(o){return this.cmp(o)<=0},i.prototype.eqn=function(o){return this.cmpn(o)===0},i.prototype.eq=function(o){return this.cmp(o)===0},i.red=function(o){return new j(o)},i.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(o){return this.red=o,this},i.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},i.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},i.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},i.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},i.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},i.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},i.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},i.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var N={k256:null,p224:null,p192:null,p25519:null};function P(E,o){this.name=E,this.p=new i(o,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var o=new i(null);return o.words=new Array(Math.ceil(this.n/13)),o},P.prototype.ireduce=function(o){var u=o,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var m=p<this.n?-1:u.ucmp(this.p);return m===0?(u.words[0]=0,u.length=1):m>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},P.prototype.split=function(o,u){o.iushrn(this.n,0,u)},P.prototype.imulK=function(o){return o.imul(this.k)};function W(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(W,P),W.prototype.split=function(o,u){for(var p=4194303,m=Math.min(o.length,9),v=0;v<m;v++)u.words[v]=o.words[v];if(u.length=m,o.length<=9){o.words[0]=0,o.length=1;return}var y=o.words[9];for(u.words[u.length++]=y&p,v=10;v<o.length;v++){var k=o.words[v]|0;o.words[v-10]=(k&p)<<4|y>>>22,y=k}y>>>=22,o.words[v-10]=y,y===0&&o.length>10?o.length-=10:o.length-=9},W.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,p=0;p<o.length;p++){var m=o.words[p]|0;u+=m*977,o.words[p]=u&67108863,u=m*64+(u/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function Y(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Y,P);function Re(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Re,P);function V(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(V,P),V.prototype.imulK=function(o){for(var u=0,p=0;p<o.length;p++){var m=(o.words[p]|0)*19+u,v=m&67108863;m>>>=26,o.words[p]=v,u=m}return u!==0&&(o.words[o.length++]=u),o},i._prime=function(o){if(N[o])return N[o];var u;if(o==="k256")u=new W;else if(o==="p224")u=new Y;else if(o==="p192")u=new Re;else if(o==="p25519")u=new V;else throw new Error("Unknown prime "+o);return N[o]=u,u};function j(E){if(typeof E=="string"){var o=i._prime(E);this.m=o.p,this.prime=o}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}j.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},j.prototype._verify2=function(o,u){n((o.negative|u.negative)===0,"red works only with positives"),n(o.red&&o.red===u.red,"red works only with red numbers")},j.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(f(o,o.umod(this.m)._forceRed(this)),o)},j.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},j.prototype.add=function(o,u){this._verify2(o,u);var p=o.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},j.prototype.iadd=function(o,u){this._verify2(o,u);var p=o.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},j.prototype.sub=function(o,u){this._verify2(o,u);var p=o.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},j.prototype.isub=function(o,u){this._verify2(o,u);var p=o.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},j.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},j.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},j.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},j.prototype.isqr=function(o){return this.imul(o,o.clone())},j.prototype.sqr=function(o){return this.mul(o,o)},j.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(n(u%2===1),u===3){var p=this.m.add(new i(1)).iushrn(2);return this.pow(o,p)}for(var m=this.m.subn(1),v=0;!m.isZero()&&m.andln(1)===0;)v++,m.iushrn(1);n(!m.isZero());var y=new i(1).toRed(this),k=y.redNeg(),_=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);this.pow(l,_).cmp(k)!==0;)l.redIAdd(k);for(var b=this.pow(l,m),T=this.pow(o,m.addn(1).iushrn(1)),L=this.pow(o,m),$=v;L.cmp(y)!==0;){for(var K=L,Q=0;K.cmp(y)!==0;Q++)K=K.redSqr();n(Q<$);var X=this.pow(b,new i(1).iushln($-Q-1));T=T.redMul(X),b=X.redSqr(),L=L.redMul(b),$=Q}return T},j.prototype.invm=function(o){var u=o._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},j.prototype.pow=function(o,u){if(u.isZero())return new i(1).toRed(this);if(u.cmpn(1)===0)return o.clone();var p=4,m=new Array(1<<p);m[0]=new i(1).toRed(this),m[1]=o;for(var v=2;v<m.length;v++)m[v]=this.mul(m[v-1],o);var y=m[0],k=0,_=0,l=u.bitLength()%26;for(l===0&&(l=26),v=u.length-1;v>=0;v--){for(var b=u.words[v],T=l-1;T>=0;T--){var L=b>>T&1;if(y!==m[0]&&(y=this.sqr(y)),L===0&&k===0){_=0;continue}k<<=1,k|=L,_++,!(_!==p&&(v!==0||T!==0))&&(y=this.mul(y,m[k]),_=0,k=0)}l=26}return y},j.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},j.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},i.mont=function(o){return new Z(o)};function Z(E){j.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(Z,j),Z.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},Z.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},Z.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var p=o.imul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},Z.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new i(0)._forceRed(this);var p=o.mul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},Z.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,D)})(Zi);var _s=Zi.exports,yn={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.errorValues=At.standardErrorCodes=void 0;At.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}};At.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var vs={},bs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=At,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(w,S=r){if(w&&Number.isInteger(w)){const C=w.toString();if(f(t.errorValues,C))return t.errorValues[C].message;if(h(w))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return S}e.getMessageFromCode=n;function s(w){if(!Number.isInteger(w))return!1;const S=w.toString();return!!(t.errorValues[S]||h(w))}e.isValidCode=s;function i(w){var S;if(typeof w=="number")return w;if(a(w))return(S=w.code)!==null&&S!==void 0?S:w.errorCode}e.getErrorCode=i;function a(w){return typeof w=="object"&&w!==null&&(typeof w.code=="number"||typeof w.errorCode=="number")}function c(w,{shouldIncludeStack:S=!1}={}){const C={};if(w&&typeof w=="object"&&!Array.isArray(w)&&f(w,"code")&&s(w.code)){const M=w;C.code=M.code,M.message&&typeof M.message=="string"?(C.message=M.message,f(M,"data")&&(C.data=M.data)):(C.message=n(C.code),C.data={originalError:d(w)})}else C.code=t.standardErrorCodes.rpc.internal,C.message=g(w,"message")?w.message:r,C.data={originalError:d(w)};return S&&(C.stack=g(w,"stack")?w.stack:void 0),C}e.serialize=c;function h(w){return w>=-32099&&w<=-32e3}function d(w){return w&&typeof w=="object"&&!Array.isArray(w)?Object.assign({},w):w}function f(w,S){return Object.prototype.hasOwnProperty.call(w,S)}function g(w,S){return typeof w=="object"&&w!==null&&S in w&&typeof w[S]=="string"}})(bs);Object.defineProperty(vs,"__esModule",{value:!0});vs.standardErrors=void 0;const Ze=At,uc=bs;vs.standardErrors={rpc:{parse:e=>at(Ze.standardErrorCodes.rpc.parse,e),invalidRequest:e=>at(Ze.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>at(Ze.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>at(Ze.standardErrorCodes.rpc.methodNotFound,e),internal:e=>at(Ze.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return at(t,e)},invalidInput:e=>at(Ze.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>at(Ze.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>at(Ze.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>at(Ze.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>at(Ze.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>at(Ze.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Cr(Ze.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Cr(Ze.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Cr(Ze.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Cr(Ze.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Cr(Ze.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Cr(Ze.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new fc(t,r,n)}}};function at(e,t){const[r,n]=hc(t);return new dc(e,r||(0,uc.getMessageFromCode)(e),n)}function Cr(e,t){const[r,n]=hc(t);return new fc(e,r||(0,uc.getMessageFromCode)(e),n)}function hc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let dc=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},fc=class extends dc{constructor(t,r,n){if(!Mu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Mu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ws={},Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isErrorResponse=void 0;function Ru(e){return e.errorMessage!==void 0}Jr.isErrorResponse=Ru;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.LIB_VERSION=void 0;Gr.LIB_VERSION="3.9.3";Object.defineProperty(ws,"__esModule",{value:!0});ws.serializeError=void 0;const Cu=Jr,Iu=Gr,xu=At,Au=bs;function Nu(e,t){const r=(0,Au.serialize)(Lu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Iu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=$u(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ws.serializeError=Nu;function Lu(e){return typeof e=="string"?{message:e,code:xu.standardErrorCodes.rpc.internal}:(0,Cu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function $u(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=At;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=vs;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ws;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=bs;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(yn);var We={};Object.defineProperty(We,"__esModule",{value:!0});We.ProviderType=We.RegExpString=We.IntNumber=We.BigIntString=We.AddressString=We.HexString=We.OpaqueType=void 0;function En(){return e=>e}We.OpaqueType=En;We.HexString=En();We.AddressString=En();We.BigIntString=En();function Tu(e){return Math.floor(e)}We.IntNumber=Tu;We.RegExpString=En();var Bo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Bo||(We.ProviderType=Bo={}));var Pu=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};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 Tt=Pu(_s),hr=yn,ht=We,pc=/^[0-9]*$/,gc=/^[a-f0-9]*$/;function Ou(e){return mc(crypto.getRandomValues(new Uint8Array(e)))}O.randomBytesHex=Ou;function mc(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=mc;function Bu(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}O.hexStringToUint8Array=Bu;function Du(e,t=!1){const r=e.toString("hex");return(0,ht.HexString)(t?`0x${r}`:r)}O.hexStringFromBuffer=Du;function Fu(e){return(0,ht.BigIntString)(e.toString(10))}O.bigIntStringFromBN=Fu;function ju(e){return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}O.intNumberFromHexString=ju;function Hu(e){return(0,ht.HexString)(`0x${new Tt.default(e).toString(16)}`)}O.hexStringFromIntNumber=Hu;function Qi(e){return e.startsWith("0x")||e.startsWith("0X")}O.has0xPrefix=Qi;function ys(e){return Qi(e)?e.slice(2):e}O.strip0x=ys;function _c(e){return Qi(e)?`0x${e.slice(2)}`:`0x${e}`}O.prepend0x=_c;function Sn(e){if(typeof e!="string")return!1;const t=ys(e).toLowerCase();return gc.test(t)}O.isHexString=Sn;function vc(e,t=!1){if(typeof e=="string"){const r=ys(e).toLowerCase();if(gc.test(r))return(0,ht.HexString)(t?`0x${r}`:r)}throw hr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}O.ensureHexString=vc;function kn(e,t=!1){let r=vc(e,!1);return r.length%2===1&&(r=(0,ht.HexString)(`0${r}`)),t?(0,ht.HexString)(`0x${r}`):r}O.ensureEvenLengthHexString=kn;function Uu(e){if(typeof e=="string"){const t=ys(e).toLowerCase();if(Sn(t)&&t.length===40)return(0,ht.AddressString)(_c(t))}throw hr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}O.ensureAddressString=Uu;function Vu(e){if(U.isBuffer(e))return e;if(typeof e=="string"){if(Sn(e)){const t=kn(e,!1);return U.from(t,"hex")}return U.from(e,"utf8")}throw hr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}O.ensureBuffer=Vu;function bc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ht.IntNumber)(e);if(typeof e=="string"){if(pc.test(e))return(0,ht.IntNumber)(Number(e));if(Sn(e))return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureIntNumber=bc;function zu(e){if(e instanceof RegExp)return(0,ht.RegExpString)(e.toString());throw hr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}O.ensureRegExpString=zu;function Wu(e){if(e!==null&&(Tt.default.isBN(e)||wc(e)))return new Tt.default(e.toString(10),10);if(typeof e=="number")return new Tt.default(bc(e));if(typeof e=="string"){if(pc.test(e))return new Tt.default(e,10);if(Sn(e))return new Tt.default(kn(e,!1),16)}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureBN=Wu;function qu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw hr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}O.ensureParsedJSONObject=qu;function wc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}O.isBigNumber=wc;function Ju(e,t){return Array.from({length:t-e},(r,n)=>e+n)}O.range=Ju;function Gu(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}O.getFavicon=Gu;function Zu(e,t,r,n,s,i){const a=n?"parent-id":"id",c=new URLSearchParams({[a]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${c}`}O.createQrUrl=Zu;function yc(){try{return window.frameElement!==null}catch{return!1}}O.isInIFrame=yc;function Qu(){try{return yc()&&window.top?window.top.location:window.location}catch{return window.location}}O.getLocation=Qu;function Ku(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}O.isMobileWeb=Ku;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.ScopedLocalStorage=void 0;class Xu{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Es.ScopedLocalStorage=Xu;var Dr={},Ec={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(h,d,f){this.fn=h,this.context=d,this.once=f||!1}function i(h,d,f,g,w){if(typeof f!="function")throw new TypeError("The listener must be a function");var S=new s(f,g||h,w),C=r?r+d:d;return h._events[C]?h._events[C].fn?h._events[C]=[h._events[C],S]:h._events[C].push(S):(h._events[C]=S,h._eventsCount++),h}function a(h,d){--h._eventsCount===0?h._events=new n:delete h._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],f,g;if(this._eventsCount===0)return d;for(g in f=this._events)t.call(f,g)&&d.push(r?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},c.prototype.listeners=function(d){var f=r?r+d:d,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var w=0,S=g.length,C=new Array(S);w<S;w++)C[w]=g[w].fn;return C},c.prototype.listenerCount=function(d){var f=r?r+d:d,g=this._events[f];return g?g.fn?1:g.length:0},c.prototype.emit=function(d,f,g,w,S,C){var M=r?r+d:d;if(!this._events[M])return!1;var I=this._events[M],A=arguments.length,x,R;if(I.fn){switch(I.once&&this.removeListener(d,I.fn,void 0,!0),A){case 1:return I.fn.call(I.context),!0;case 2:return I.fn.call(I.context,f),!0;case 3:return I.fn.call(I.context,f,g),!0;case 4:return I.fn.call(I.context,f,g,w),!0;case 5:return I.fn.call(I.context,f,g,w,S),!0;case 6:return I.fn.call(I.context,f,g,w,S,C),!0}for(R=1,x=new Array(A-1);R<A;R++)x[R-1]=arguments[R];I.fn.apply(I.context,x)}else{var B=I.length,N;for(R=0;R<B;R++)switch(I[R].once&&this.removeListener(d,I[R].fn,void 0,!0),A){case 1:I[R].fn.call(I[R].context);break;case 2:I[R].fn.call(I[R].context,f);break;case 3:I[R].fn.call(I[R].context,f,g);break;case 4:I[R].fn.call(I[R].context,f,g,w);break;default:if(!x)for(N=1,x=new Array(A-1);N<A;N++)x[N-1]=arguments[N];I[R].fn.apply(I[R].context,x)}}return!0},c.prototype.on=function(d,f,g){return i(this,d,f,g,!1)},c.prototype.once=function(d,f,g){return i(this,d,f,g,!0)},c.prototype.removeListener=function(d,f,g,w){var S=r?r+d:d;if(!this._events[S])return this;if(!f)return a(this,S),this;var C=this._events[S];if(C.fn)C.fn===f&&(!w||C.once)&&(!g||C.context===g)&&a(this,S);else{for(var M=0,I=[],A=C.length;M<A;M++)(C[M].fn!==f||w&&!C[M].once||g&&C[M].context!==g)&&I.push(C[M]);I.length?this._events[S]=I.length===1?I[0]:I:a(this,S)}return this},c.prototype.removeAllListeners=function(d){var f;return d?(f=r?r+d:d,this._events[f]&&a(this,f)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,e.exports=c})(Ec);var Yu=Ec.exports,Mn={},Rn={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.EVENTS=void 0;Zr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.RelayAbstract=ut.APP_VERSION_KEY=ut.LOCAL_STORAGE_ADDRESSES_KEY=ut.WALLET_USER_NAME_KEY=void 0;const Do=yn;ut.WALLET_USER_NAME_KEY="walletUsername";ut.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ut.APP_VERSION_KEY="AppVersion";class eh{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Do.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,Do.serializeError)(i,t.method);return s})}}ut.RelayAbstract=eh;var Qr={},Sc={exports:{}},th=mu,rh=_u,nh=rh("TypedArray.prototype.buffer",!0),sh=yu(),ih=nh||function(t){if(!sh(t))throw new th("Not a Typed Array");return t.buffer},gt=Dt().Buffer,oh=vu,ah=ih,ch=ArrayBuffer.isView||function(t){try{return ah(t),!0}catch{return!1}},lh=typeof Uint8Array<"u",kc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",uh=kc&&(gt.prototype instanceof Uint8Array||gt.TYPED_ARRAY_SUPPORT),hh=function(t,r){if(gt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?gt.from(t):t;if(typeof t=="string")return gt.from(t,r);if(kc&&ch(t)){if(t.byteLength===0)return gt.alloc(0);if(uh){var n=gt.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var s=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i=gt.from(s);if(i.length===t.byteLength)return i}if(lh&&t instanceof Uint8Array)return gt.from(t);var a=oh(t);if(a)for(var c=0;c<t.length;c+=1){var h=t[c];if(typeof h!="number"||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||gt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return gt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},dh=Dt().Buffer,fh=hh;function Ss(e,t){this._block=dh.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Ss.prototype.update=function(e,t){e=fh(e,t||"utf8");for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,a=0;a<s;){for(var c=i%n,h=Math.min(s-a,n-c),d=0;d<h;d++)r[c+d]=e[a+d];i+=h,a+=h,i%n===0&&this._update(r)}return this._len+=s,this};Ss.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,s=(r-n)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i};Ss.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Kr=Ss,ph=qr,Mc=Kr,gh=Dt().Buffer,mh=[1518500249,1859775393,-1894007588,-899497514],_h=new Array(80);function Cn(){this.init(),this._w=_h,Mc.call(this,64,56)}ph(Cn,Mc);Cn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vh(e){return e<<5|e>>>27}function bh(e){return e<<30|e>>>2}function wh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Cn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var h=0;h<80;++h){var d=~~(h/20),f=vh(r)+wh(d,n,s,i)+a+t[h]+mh[d]|0;a=i,i=s,s=bh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0};Cn.prototype._hash=function(){var e=gh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var yh=Cn,Eh=qr,Rc=Kr,Sh=Dt().Buffer,kh=[1518500249,1859775393,-1894007588,-899497514],Mh=new Array(80);function In(){this.init(),this._w=Mh,Rc.call(this,64,56)}Eh(In,Rc);In.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Rh(e){return e<<1|e>>>31}function Ch(e){return e<<5|e>>>27}function Ih(e){return e<<30|e>>>2}function xh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}In.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=Rh(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var h=0;h<80;++h){var d=~~(h/20),f=Ch(r)+xh(d,n,s,i)+a+t[h]+kh[d]|0;a=i,i=s,s=Ih(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0};In.prototype._hash=function(){var e=Sh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Ah=In,Nh=qr,Cc=Kr,Lh=Dt().Buffer,$h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Th=new Array(64);function xn(){this.init(),this._w=Th,Cc.call(this,64,56)}Nh(xn,Cc);xn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Ph(e,t,r){return r^e&(t^r)}function Oh(e,t,r){return e&t|r&(e|t)}function Bh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Dh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Fh(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function jh(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}xn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,a=this._e|0,c=this._f|0,h=this._g|0,d=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=jh(t[f-2])+t[f-7]+Fh(t[f-15])+t[f-16]|0;for(var g=0;g<64;++g){var w=d+Dh(a)+Ph(a,c,h)+$h[g]+t[g]|0,S=Bh(r)+Oh(r,n,s)|0;d=h,h=c,c=a,a=i+w|0,i=s,s=n,n=r,r=w+S|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=h+this._g|0,this._h=d+this._h|0};xn.prototype._hash=function(){var e=Lh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Ic=xn,Hh=qr,Uh=Ic,Vh=Kr,zh=Dt().Buffer,Wh=new Array(64);function ks(){this.init(),this._w=Wh,Vh.call(this,64,56)}Hh(ks,Uh);ks.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ks.prototype._hash=function(){var e=zh.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var qh=ks,Jh=qr,xc=Kr,Gh=Dt().Buffer,Fo=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Zh=new Array(160);function An(){this.init(),this._w=Zh,xc.call(this,128,112)}Jh(An,xc);An.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function jo(e,t,r){return r^e&(t^r)}function Ho(e,t,r){return e&t|r&(e|t)}function Uo(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Vo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Qh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Kh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Xh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Yh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Je(e,t){return e>>>0<t>>>0?1:0}An.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,s=this._ch|0,i=this._dh|0,a=this._eh|0,c=this._fh|0,h=this._gh|0,d=this._hh|0,f=this._al|0,g=this._bl|0,w=this._cl|0,S=this._dl|0,C=this._el|0,M=this._fl|0,I=this._gl|0,A=this._hl|0,x=0;x<32;x+=2)t[x]=e.readInt32BE(x*4),t[x+1]=e.readInt32BE(x*4+4);for(;x<160;x+=2){var R=t[x-30],B=t[x-15*2+1],N=Qh(R,B),P=Kh(B,R);R=t[x-2*2],B=t[x-2*2+1];var W=Xh(R,B),Y=Yh(B,R),Re=t[x-7*2],V=t[x-7*2+1],j=t[x-16*2],Z=t[x-16*2+1],E=P+V|0,o=N+Re+Je(E,P)|0;E=E+Y|0,o=o+W+Je(E,Y)|0,E=E+Z|0,o=o+j+Je(E,Z)|0,t[x]=o,t[x+1]=E}for(var u=0;u<160;u+=2){o=t[u],E=t[u+1];var p=Ho(r,n,s),m=Ho(f,g,w),v=Uo(r,f),y=Uo(f,r),k=Vo(a,C),_=Vo(C,a),l=Fo[u],b=Fo[u+1],T=jo(a,c,h),L=jo(C,M,I),$=A+_|0,K=d+k+Je($,A)|0;$=$+L|0,K=K+T+Je($,L)|0,$=$+b|0,K=K+l+Je($,b)|0,$=$+E|0,K=K+o+Je($,E)|0;var Q=y+m|0,X=v+p+Je(Q,y)|0;d=h,A=I,h=c,I=M,c=a,M=C,C=S+$|0,a=i+K+Je(C,S)|0,i=s,S=w,s=n,w=g,n=r,g=f,f=$+Q|0,r=K+X+Je(f,$)|0}this._al=this._al+f|0,this._bl=this._bl+g|0,this._cl=this._cl+w|0,this._dl=this._dl+S|0,this._el=this._el+C|0,this._fl=this._fl+M|0,this._gl=this._gl+I|0,this._hl=this._hl+A|0,this._ah=this._ah+r+Je(this._al,f)|0,this._bh=this._bh+n+Je(this._bl,g)|0,this._ch=this._ch+s+Je(this._cl,w)|0,this._dh=this._dh+i+Je(this._dl,S)|0,this._eh=this._eh+a+Je(this._el,C)|0,this._fh=this._fh+c+Je(this._fl,M)|0,this._gh=this._gh+h+Je(this._gl,I)|0,this._hh=this._hh+d+Je(this._hl,A)|0};An.prototype._hash=function(){var e=Gh.allocUnsafe(64);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ac=An,ed=qr,td=Ac,rd=Kr,nd=Dt().Buffer,sd=new Array(160);function Ms(){this.init(),this._w=sd,rd.call(this,128,112)}ed(Ms,td);Ms.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ms.prototype._hash=function(){var e=nd.allocUnsafe(48);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var id=Ms;(function(e){e.exports=function(r){var n=r.toLowerCase(),s=e.exports[n];if(!s)throw new Error(n+" is not supported (we accept pull requests)");return new s},e.exports.sha=yh,e.exports.sha1=Ah,e.exports.sha224=qh,e.exports.sha256=Ic,e.exports.sha384=id,e.exports.sha512=Ac})(Sc);var od=Sc.exports;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Session=void 0;const zo=od,Wo=O,qo="session:id",Jo="session:secret",Go="session:linked";class Ki{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Wo.randomBytesHex)(16),this._secret=n||(0,Wo.randomBytesHex)(32),this._key=new zo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(qo),n=t.getItem(Go),s=t.getItem(Jo);return r&&s?new Ki(t,r,s,n==="1"):null}static hash(t){return new zo.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(qo,this._id),this._storage.setItem(Jo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Go,this._linked?"1":"0")}}Qr.Session=Ki;var Rs={},Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Cipher=void 0;const Jn=O;class ad{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,Jn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),c=16,h=a.slice(a.byteLength-c),d=a.slice(0,a.byteLength-c),f=new Uint8Array(h),g=new Uint8Array(d),w=new Uint8Array([...n,...f,...g]);return(0,Jn.uint8ArrayToHex)(w)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Jn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,Jn.hexStringToUint8Array)(t),c=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),f=new Uint8Array([...d,...h]),g={name:"AES-GCM",iv:new Uint8Array(c)};try{const w=await window.crypto.subtle.decrypt(g,i,f),S=new TextDecoder;n(S.decode(w))}catch(w){s(w)}})()})}}Cs.Cipher=ad;var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.WalletLinkHTTP=void 0;class cd{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}Is.WalletLinkHTTP=cd;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.WalletLinkWebSocket=Fr.ConnectionState=void 0;var $r;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})($r||(Fr.ConnectionState=$r={}));class ld{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,$r.CONNECTING),s.onclose=i=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.DISCONNECTED)},s.onopen=i=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},s.onmessage=i=>{var a,c;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(i.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,$r.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Fr.WalletLinkWebSocket=ld;Object.defineProperty(Rs,"__esModule",{value:!0});Rs.WalletLinkConnection=void 0;const Ir=We,ud=Cs,vt=Zr,Zo=ut,xr=Qr,hd=Is,Gn=Fr,Qo=1e4,dd=6e4;class fd{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Ir.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>c.JsonRpcUrl&&this.handleChainUpdated(d,c.JsonRpcUrl)]]).forEach((d,f)=>{const g=c[f];g!==void 0&&d(g)})},this.handleDestroyed=c=>{var h,d;c==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:xr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var h,d;try{const f=await this.cipher.decrypt(c);(h=this.listener)===null||h===void 0||h.accountUpdated(f)}catch{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(c,g)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(Zo.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(Zo.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(c),w=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(g,w)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new ud.Cipher(t.secret),this.diagnostic=s,this.listener=n;const a=new Gn.WalletLinkWebSocket(`${r}/rpc`,i);a.setConnectionStateListener(async c=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:xr.Session.hash(t.id)});let d=!1;switch(c){case Gn.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(g=>setTimeout(g,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case Gn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Qo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Gn.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(c=>{var h,d,f;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const g=c.type==="IsLinkedOK"?c.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.LINKED,{sessionIdHash:xr.Session.hash(t.id),linked:g,type:c.type,onlineGuests:c.onlineGuests}),this.linked=g||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:xr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((f=this.requestResolutions.get(c.id))===null||f===void 0||f(c))}),this.ws=a,this.http=new hd.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.STARTED_CONNECTING,{sessionIdHash:xr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.DISCONNECTED,{sessionIdHash:xr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Qo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=dd){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,a)=>{s=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,a=>{clearTimeout(s),i(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Rs.WalletLinkConnection=fd;var Nn={},Ln={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.default=(()=>'@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')();var pd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.injectCssReset=void 0;const gd=pd(Xi);function md(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(gd.default)),document.documentElement.appendChild(e)}Ln.injectCssReset=md;var xs={},$n,te,Nc,Lc,nr,Ko,$c,Pi,Yi,Oi,Bi,Tc,_n={},Pc=[],_d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,As=Array.isArray;function xt(e,t){for(var r in t)e[r]=t[r];return e}function Oc(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Di(e,t,r){var n,s,i,a={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?$n.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return fn(e,a,n,s,null)}function fn(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Nc,__i:-1,__u:0};return s==null&&te.vnode!=null&&te.vnode(i),i}function vd(){return{current:null}}function Tn(e){return e.children}function pn(e,t){this.props=e,this.context=t}function jr(e,t){if(t==null)return e.__?jr(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?jr(e):null}function Bc(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Bc(e)}}function Fi(e){(!e.__d&&(e.__d=!0)&&nr.push(e)&&!hs.__r++||Ko!==te.debounceRendering)&&((Ko=te.debounceRendering)||$c)(hs)}function hs(){var e,t,r,n,s,i,a,c;for(nr.sort(Pi);e=nr.shift();)e.__d&&(t=nr.length,n=void 0,i=(s=(r=e).__v).__e,a=[],c=[],r.__P&&((n=xt({},s)).__v=s.__v+1,te.vnode&&te.vnode(n),eo(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,a,i??jr(s),!!(32&s.__u),c),n.__v=s.__v,n.__.__k[n.__i]=n,Hc(a,n,c),n.__e!=i&&Bc(n)),nr.length>t&&nr.sort(Pi));hs.__r=0}function Dc(e,t,r,n,s,i,a,c,h,d,f){var g,w,S,C,M,I=n&&n.__k||Pc,A=t.length;for(r.__d=h,bd(r,t,I),h=r.__d,g=0;g<A;g++)(S=r.__k[g])!=null&&(w=S.__i===-1?_n:I[S.__i]||_n,S.__i=g,eo(e,S,w,s,i,a,c,h,d,f),C=S.__e,S.ref&&w.ref!=S.ref&&(w.ref&&to(w.ref,null,S),f.push(S.ref,S.__c||C,S)),M==null&&C!=null&&(M=C),65536&S.__u||w.__k===S.__k?h=Fc(S,h,e):typeof S.type=="function"&&S.__d!==void 0?h=S.__d:C&&(h=C.nextSibling),S.__d=void 0,S.__u&=-196609);r.__d=h,r.__e=M}function bd(e,t,r){var n,s,i,a,c,h=t.length,d=r.length,f=d,g=0;for(e.__k=[],n=0;n<h;n++)(s=t[n])!=null&&typeof s!="boolean"&&typeof s!="function"?(a=n+g,(s=e.__k[n]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?fn(null,s,null,null,null):As(s)?fn(Tn,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?fn(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,i=null,(c=s.__i=wd(s,r,a,f))!==-1&&(f--,(i=r[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&g--,typeof s.type!="function"&&(s.__u|=65536)):c!==a&&(c==a-1?g--:c==a+1?g++:(c>a?g--:g++,s.__u|=65536))):s=e.__k[n]=null;if(f)for(n=0;n<d;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=jr(i)),Uc(i,i))}function Fc(e,t,r){var n,s;if(typeof e.type=="function"){for(n=e.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=e,t=Fc(n[s],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=jr(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function jc(e,t){return t=t||[],e==null||typeof e=="boolean"||(As(e)?e.some(function(r){jc(r,t)}):t.push(e)),t}function wd(e,t,r,n){var s=e.key,i=e.type,a=r-1,c=r+1,h=t[r];if(h===null||h&&s==h.key&&i===h.type&&!(131072&h.__u))return r;if(n>(h!=null&&!(131072&h.__u)?1:0))for(;a>=0||c<t.length;){if(a>=0){if((h=t[a])&&!(131072&h.__u)&&s==h.key&&i===h.type)return a;a--}if(c<t.length){if((h=t[c])&&!(131072&h.__u)&&s==h.key&&i===h.type)return c;c++}}return-1}function Xo(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||_d.test(t)?r:r+"px"}function Zn(e,t,r,n,s){var i;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Xo(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Xo(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Yi,e.addEventListener(t,i?Bi:Oi,i)):e.removeEventListener(t,i?Bi:Oi,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Yo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Yi++;else if(t.t<r.u)return;return r(te.event?te.event(t):t)}}}function eo(e,t,r,n,s,i,a,c,h,d){var f,g,w,S,C,M,I,A,x,R,B,N,P,W,Y,Re,V=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(h=!!(32&r.__u),i=[c=t.__e=r.__e]),(f=te.__b)&&f(t);e:if(typeof V=="function")try{if(A=t.props,x="prototype"in V&&V.prototype.render,R=(f=V.contextType)&&n[f.__c],B=f?R?R.props.value:f.__:n,r.__c?I=(g=t.__c=r.__c).__=g.__E:(x?t.__c=g=new V(A,B):(t.__c=g=new pn(A,B),g.constructor=V,g.render=Ed),R&&R.sub(g),g.props=A,g.state||(g.state={}),g.context=B,g.__n=n,w=g.__d=!0,g.__h=[],g._sb=[]),x&&g.__s==null&&(g.__s=g.state),x&&V.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=xt({},g.__s)),xt(g.__s,V.getDerivedStateFromProps(A,g.__s))),S=g.props,C=g.state,g.__v=t,w)x&&V.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),x&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(x&&V.getDerivedStateFromProps==null&&A!==S&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(A,B),!g.__e&&(g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(A,g.__s,B)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(g.props=A,g.state=g.__s,g.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(j){j&&(j.__=t)}),N=0;N<g._sb.length;N++)g.__h.push(g._sb[N]);g._sb=[],g.__h.length&&a.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(A,g.__s,B),x&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(S,C,M)})}if(g.context=B,g.props=A,g.__P=e,g.__e=!1,P=te.__r,W=0,x){for(g.state=g.__s,g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),Y=0;Y<g._sb.length;Y++)g.__h.push(g._sb[Y]);g._sb=[]}else do g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++W<25);g.state=g.__s,g.getChildContext!=null&&(n=xt(xt({},n),g.getChildContext())),x&&!w&&g.getSnapshotBeforeUpdate!=null&&(M=g.getSnapshotBeforeUpdate(S,C)),Dc(e,As(Re=f!=null&&f.type===Tn&&f.key==null?f.props.children:f)?Re:[Re],t,r,n,s,i,a,c,h,d),g.base=t.__e,t.__u&=-161,g.__h.length&&a.push(g),I&&(g.__E=g.__=null)}catch(j){if(t.__v=null,h||i!=null){for(t.__u|=h?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;i[i.indexOf(c)]=null,t.__e=c}else t.__e=r.__e,t.__k=r.__k;te.__e(j,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=yd(r.__e,t,r,n,s,i,a,h,d);(f=te.diffed)&&f(t)}function Hc(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)to(r[n],r[++n],r[++n]);te.__c&&te.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){te.__e(i,s.__v)}})}function yd(e,t,r,n,s,i,a,c,h){var d,f,g,w,S,C,M,I=r.props,A=t.props,x=t.type;if(x==="svg"?s="http://www.w3.org/2000/svg":x==="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((S=i[d])&&"setAttribute"in S==!!x&&(x?S.localName===x:S.nodeType===3)){e=S,i[d]=null;break}}if(e==null){if(x===null)return document.createTextNode(A);e=document.createElementNS(s,x,A.is&&A),c&&(te.__m&&te.__m(t,i),c=!1),i=null}if(x===null)I===A||c&&e.data===A||(e.data=A);else{if(i=i&&$n.call(e.childNodes),I=r.props||_n,!c&&i!=null)for(I={},d=0;d<e.attributes.length;d++)I[(S=e.attributes[d]).name]=S.value;for(d in I)if(S=I[d],d!="children"){if(d=="dangerouslySetInnerHTML")g=S;else if(!(d in A)){if(d=="value"&&"defaultValue"in A||d=="checked"&&"defaultChecked"in A)continue;Zn(e,d,null,S,s)}}for(d in A)S=A[d],d=="children"?w=S:d=="dangerouslySetInnerHTML"?f=S:d=="value"?C=S:d=="checked"?M=S:c&&typeof S!="function"||I[d]===S||Zn(e,d,S,I[d],s);if(f)c||g&&(f.__html===g.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(g&&(e.innerHTML=""),Dc(e,As(w)?w:[w],t,r,n,x==="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,a,i?i[0]:r.__k&&jr(r,0),c,h),i!=null)for(d=i.length;d--;)Oc(i[d]);c||(d="value",x==="progress"&&C==null?e.removeAttribute("value"):C!==void 0&&(C!==e[d]||x==="progress"&&!C||x==="option"&&C!==I[d])&&Zn(e,d,C,I[d],s),d="checked",M!==void 0&&M!==e[d]&&Zn(e,d,M,I[d],s))}return e}function to(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){te.__e(s,r)}}function Uc(e,t,r){var n,s;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||to(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){te.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&Uc(n[s],t,r||typeof e.type!="function");r||Oc(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Ed(e,t,r){return this.constructor(e,r)}function Vc(e,t,r){var n,s,i,a;te.__&&te.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],eo(t,e=(!n&&r||t).__k=Di(Tn,null,[e]),s||_n,_n,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?$n.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,a),Hc(i,e,a)}function zc(e,t){Vc(e,t,zc)}function Sd(e,t,r){var n,s,i,a,c=xt({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?s=t[i]:c[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(c.children=arguments.length>3?$n.call(arguments,2):r),fn(e.type,c,n||e.key,s||e.ref,null)}function kd(e,t){var r={__c:t="__cC"+Tc++,__:e,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=[],(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){s=null},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&s.some(function(c){c.__e=!0,Fi(c)})},this.sub=function(a){s.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){s&&s.splice(s.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}$n=Pc.slice,te={__e:function(e,t,r,n){for(var s,i,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),a=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),a=s.__d),a)return s.__E=s}catch(c){e=c}throw e}},Nc=0,Lc=function(e){return e!=null&&e.constructor==null},pn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=xt({},this.state),typeof e=="function"&&(e=e(xt({},r),this.props)),e&&xt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Fi(this))},pn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Fi(this))},pn.prototype.render=Tn,nr=[],$c=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pi=function(e,t){return e.__v.__b-t.__v.__b},hs.__r=0,Yi=0,Oi=Yo(!1),Bi=Yo(!0),Tc=0;const Md=Object.freeze(Object.defineProperty({__proto__:null,Component:pn,Fragment:Tn,cloneElement:Sd,createContext:kd,createElement:Di,createRef:vd,h:Di,hydrate:zc,get isValidElement(){return Lc},get options(){return te},render:Vc,toChildArray:jc},Symbol.toStringTag,{value:"Module"})),rt=qi(Md);var Ns={},Nt,ee,gi,ea,Hr=0,Wc=[],He=te,ta=He.__b,ra=He.__r,na=He.diffed,sa=He.__c,ia=He.unmount,oa=He.__;function dr(e,t){He.__h&&He.__h(ee,e,Hr||t),Hr=0;var r=ee.__H||(ee.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function qc(e){return Hr=1,Jc(Zc,e)}function Jc(e,t,r){var n=dr(Nt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Zc(void 0,t),function(c){var h=n.__N?n.__N[0]:n.__[0],d=n.t(h,c);h!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ee,!ee.u)){var s=function(c,h,d){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(w){return!!w.__c});if(f.every(function(w){return!w.__N}))return!i||i.call(this,c,h,d);var g=!1;return f.forEach(function(w){if(w.__N){var S=w.__[0];w.__=w.__N,w.__N=void 0,S!==w.__[0]&&(g=!0)}}),!(!g&&n.__c.props===c)&&(!i||i.call(this,c,h,d))};ee.u=!0;var i=ee.shouldComponentUpdate,a=ee.componentWillUpdate;ee.componentWillUpdate=function(c,h,d){if(this.__e){var f=i;i=void 0,s(c,h,d),i=f}a&&a.call(this,c,h,d)},ee.shouldComponentUpdate=s}return n.__N||n.__}function Rd(e,t){var r=dr(Nt++,3);!He.__s&&no(r.__H,t)&&(r.__=e,r.i=t,ee.__H.__h.push(r))}function Gc(e,t){var r=dr(Nt++,4);!He.__s&&no(r.__H,t)&&(r.__=e,r.i=t,ee.__h.push(r))}function Cd(e){return Hr=5,ro(function(){return{current:e}},[])}function Id(e,t,r){Hr=6,Gc(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function ro(e,t){var r=dr(Nt++,7);return no(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function xd(e,t){return Hr=8,ro(function(){return e},t)}function Ad(e){var t=ee.context[e.__c],r=dr(Nt++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(ee)),t.props.value):e.__}function Nd(e,t){He.useDebugValue&&He.useDebugValue(t?t(e):e)}function Ld(e){var t=dr(Nt++,10),r=qc();return t.__=e,ee.componentDidCatch||(ee.componentDidCatch=function(n,s){t.__&&t.__(n,s),r[1](n)}),[r[0],function(){r[1](void 0)}]}function $d(){var e=dr(Nt++,11);if(!e.__){for(var t=ee.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Td(){for(var e;e=Wc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ls),e.__H.__h.forEach(ji),e.__H.__h=[]}catch(t){e.__H.__h=[],He.__e(t,e.__v)}}He.__b=function(e){ee=null,ta&&ta(e)},He.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),oa&&oa(e,t)},He.__r=function(e){ra&&ra(e),Nt=0;var t=(ee=e.__c).__H;t&&(gi===ee?(t.__h=[],ee.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(ls),t.__h.forEach(ji),t.__h=[],Nt=0)),gi=ee},He.diffed=function(e){na&&na(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Wc.push(t)!==1&&ea===He.requestAnimationFrame||((ea=He.requestAnimationFrame)||Pd)(Td)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),gi=ee=null},He.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ls),r.__h=r.__h.filter(function(n){return!n.__||ji(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],He.__e(n,r.__v)}}),sa&&sa(e,t)},He.unmount=function(e){ia&&ia(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ls(n)}catch(s){t=s}}),r.__H=void 0,t&&He.__e(t,r.__v))};var aa=typeof requestAnimationFrame=="function";function Pd(e){var t,r=function(){clearTimeout(n),aa&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);aa&&(t=requestAnimationFrame(r))}function ls(e){var t=ee,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ee=t}function ji(e){var t=ee;e.__c=e.__(),ee=t}function no(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Zc(e,t){return typeof t=="function"?t(e):t}const Od=Object.freeze(Object.defineProperty({__proto__:null,useCallback:xd,useContext:Ad,useDebugValue:Nd,useEffect:Rd,useErrorBoundary:Ld,useId:$d,useImperativeHandle:Id,useLayoutEffect:Gc,useMemo:ro,useReducer:Jc,useRef:Cd,useState:qc},Symbol.toStringTag,{value:"Module"})),Ls=qi(Od);var Ur={},$s={};Object.defineProperty($s,"__esModule",{value:!0});$s.CloseIcon=void 0;const ca=rt;function Bd(e){return(0,ca.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ca.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"}))}$s.CloseIcon=Bd;var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.CoinbaseWalletRound=void 0;const Qn=rt;function Dd(e){return(0,Qn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Qn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Qn.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,Qn.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"}))}Ts.CoinbaseWalletRound=Dd;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.QRCodeIcon=void 0;const ln=rt;function Fd(e){return(0,ln.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,ln.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,ln.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,ln.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,ln.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Ps.QRCodeIcon=Fd;var Os={};function Qc(e){this.mode=it.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Qc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function kt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}kt.prototype={addData:function(e){var t=new Qc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=kt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=je.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var a=i*s,c=0;c<this.modules[i].length;c++){var h=c*s,d=this.modules[i][c];d&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+s,a),n.lineTo(h+s,a+s),n.lineTo(h,a+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=je.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var a=-2;a<=2;a++)i==-2||i==2||a==-2||a==2||i==0&&a==0?this.modules[n+i][s+a]=!0:this.modules[n+i][s+a]=!1}},setupTypeNumber:function(e){for(var t=je.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=je.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var h=!1;i<e.length&&(h=(e[i]>>>s&1)==1);var d=je.getMask(t,n,a-c);d&&(h=!h),this.modules[n][a-c]=h,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};kt.PAD0=236;kt.PAD1=17;kt.createData=function(e,t,r){for(var n=St.getRSBlocks(e,t),s=new Kc,i=0;i<r.length;i++){var a=r[i];s.put(a.mode,4),s.put(a.getLength(),je.getLengthInBits(a.mode,e)),a.write(s)}for(var c=0,i=0;i<n.length;i++)c+=n[i].dataCount;if(s.getLengthInBits()>c*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+c*8+")");for(s.getLengthInBits()+4<=c*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=c*8||(s.put(kt.PAD0,8),s.getLengthInBits()>=c*8));)s.put(kt.PAD1,8);return kt.createBytes(s,n)};kt.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c++){var h=t[c].dataCount,d=t[c].totalCount-h;n=Math.max(n,h),s=Math.max(s,d),i[c]=new Array(h);for(var f=0;f<i[c].length;f++)i[c][f]=255&e.buffer[f+r];r+=h;var g=je.getErrorCorrectPolynomial(d),w=new Tr(i[c],g.getLength()-1),S=w.mod(g);a[c]=new Array(g.getLength()-1);for(var f=0;f<a[c].length;f++){var C=f+S.getLength()-a[c].length;a[c][f]=C>=0?S.get(C):0}}for(var M=0,f=0;f<t.length;f++)M+=t[f].totalCount;for(var I=new Array(M),A=0,f=0;f<n;f++)for(var c=0;c<t.length;c++)f<i[c].length&&(I[A++]=i[c][f]);for(var f=0;f<s;f++)for(var c=0;c<t.length;c++)f<a[c].length&&(I[A++]=a[c][f]);return I};var it={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Pt={L:1,M:0,Q:3,H:2},Lt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},je={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;je.getBCHDigit(t)-je.getBCHDigit(je.G15)>=0;)t^=je.G15<<je.getBCHDigit(t)-je.getBCHDigit(je.G15);return(e<<10|t)^je.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;je.getBCHDigit(t)-je.getBCHDigit(je.G18)>=0;)t^=je.G18<<je.getBCHDigit(t)-je.getBCHDigit(je.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return je.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Lt.PATTERN000:return(t+r)%2==0;case Lt.PATTERN001:return t%2==0;case Lt.PATTERN010:return r%3==0;case Lt.PATTERN011:return(t+r)%3==0;case Lt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Lt.PATTERN101:return t*r%2+t*r%3==0;case Lt.PATTERN110:return(t*r%2+t*r%3)%2==0;case Lt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Tr([1],0),r=0;r<e;r++)t=t.multiply(new Tr([1,Ge.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case it.MODE_NUMBER:return 10;case it.MODE_ALPHA_NUM:return 9;case it.MODE_8BIT_BYTE:return 8;case it.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case it.MODE_NUMBER:return 12;case it.MODE_ALPHA_NUM:return 11;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case it.MODE_NUMBER:return 14;case it.MODE_ALPHA_NUM:return 13;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,a=e.isDark(n,s),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var h=-1;h<=1;h++)s+h<0||t<=s+h||c==0&&h==0||a==e.isDark(n+c,s+h)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var d=0;e.isDark(n,s)&&d++,e.isDark(n+1,s)&&d++,e.isDark(n,s+1)&&d++,e.isDark(n+1,s+1)&&d++,(d==0||d==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var f=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&f++;var g=Math.abs(100*f/t/t-50)/5;return r+=g*10,r}},Ge={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Ge.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Ge.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Qe=0;Qe<8;Qe++)Ge.EXP_TABLE[Qe]=1<<Qe;for(var Qe=8;Qe<256;Qe++)Ge.EXP_TABLE[Qe]=Ge.EXP_TABLE[Qe-4]^Ge.EXP_TABLE[Qe-5]^Ge.EXP_TABLE[Qe-6]^Ge.EXP_TABLE[Qe-8];for(var Qe=0;Qe<255;Qe++)Ge.LOG_TABLE[Ge.EXP_TABLE[Qe]]=Qe;function Tr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Tr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Ge.gexp(Ge.glog(this.get(r))+Ge.glog(e.get(n)));return new Tr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Ge.glog(this.get(0))-Ge.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Ge.gexp(Ge.glog(e.get(n))+t);return new Tr(r,0).mod(e)}};function St(e,t){this.totalCount=e,this.dataCount=t}St.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]];St.getRSBlocks=function(e,t){var r=St.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var a=r[i*3+0],c=r[i*3+1],h=r[i*3+2],d=0;d<a;d++)s.push(new St(c,h));return s};St.getRsBlockTable=function(e,t){switch(t){case Pt.L:return St.RS_BLOCK_TABLE[(e-1)*4+0];case Pt.M:return St.RS_BLOCK_TABLE[(e-1)*4+1];case Pt.Q:return St.RS_BLOCK_TABLE[(e-1)*4+2];case Pt.H:return St.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Kc(){this.buffer=[],this.length=0}Kc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mi=[[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 Xc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Pt.L;case"M":return Pt.M;case"Q":return Pt.Q;case"H":return Pt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var f=s(h),g=1,w=0,S=0,C=mi.length;S<=C;S++){var M=mi[S];if(!M)throw new Error("Content too long: expected "+w+" but got "+f);switch(d){case"L":w=M[0];break;case"M":w=M[1];break;case"Q":w=M[2];break;case"H":w=M[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(f<=w)break;g++}if(g>mi.length)throw new Error("Content too long");return g}function s(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var i=this.options.content,a=n(i,this.options.ecl),c=r(this.options.ecl);this.qrcode=new kt(a,c),this.qrcode.addData(i),this.qrcode.make()}Xc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r
|
|
1
|
+
import{l as gu,c as D,B as U,q as mu,s as _u,v as vu,m as qr,a as qi,y as wn,k as cc,b as bu,g as wu}from"./index-536cacf7.js";import{r as yu,a as Dt,b as lc,c as Eu,d as Ji}from"./tslib.es6-623dc20e.js";function Su(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Gi={},mn={},gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.walletLogo=void 0;const ku=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};gs.walletLogo=ku;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.LINK_API_URL=void 0;ms.LINK_API_URL="https://www.walletlink.org";var O={},Zi={exports:{}};Zi.exports;(function(e){(function(t,r){function n(E,o){if(!E)throw new Error(o||"Assertion failed")}function s(E,o){E.super_=o;var u=function(){};u.prototype=o.prototype,E.prototype=new u,E.prototype.constructor=E}function i(E,o,u){if(i.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(E||0,o||10,u||"be"))}typeof t=="object"?t.exports=i:r.BN=i,i.BN=i,i.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=gu.Buffer}catch{}i.isBN=function(o){return o instanceof i?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===i.wordSize&&Array.isArray(o.words)},i.max=function(o,u){return o.cmp(u)>0?o:u},i.min=function(o,u){return o.cmp(u)<0?o:u},i.prototype._init=function(o,u,p){if(typeof o=="number")return this._initNumber(o,u,p);if(typeof o=="object")return this._initArray(o,u,p);u==="hex"&&(u=16),n(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var m=0;o[0]==="-"&&(m++,this.negative=1),m<o.length&&(u===16?this._parseHex(o,m,p):(this._parseBase(o,u,m),p==="le"&&this._initArray(this.toArray(),u,p)))},i.prototype._initNumber=function(o,u,p){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},i.prototype._initArray=function(o,u,p){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v,y,k=0;if(p==="be")for(m=o.length-1,v=0;m>=0;m-=3)y=o[m]|o[m-1]<<8|o[m-2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);else if(p==="le")for(m=0,v=0;m<o.length;m+=3)y=o[m]|o[m+1]<<8|o[m+2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);return this._strip()};function c(E,o){var u=E.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;n(!1,"Invalid character in "+E)}function h(E,o,u){var p=c(E,u);return u-1>=o&&(p|=c(E,u-1)<<4),p}i.prototype._parseHex=function(o,u,p){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v=0,y=0,k;if(p==="be")for(m=o.length-1;m>=u;m-=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8;else{var _=o.length-u;for(m=_%2===0?u+1:u;m<o.length;m+=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8}this._strip()};function d(E,o,u,p){for(var m=0,v=0,y=Math.min(E.length,u),k=o;k<y;k++){var _=E.charCodeAt(k)-48;m*=p,_>=49?v=_-49+10:_>=17?v=_-17+10:v=_,n(_>=0&&v<p,"Invalid character"),m+=v}return m}i.prototype._parseBase=function(o,u,p){this.words=[0],this.length=1;for(var m=0,v=1;v<=67108863;v*=u)m++;m--,v=v/u|0;for(var y=o.length-p,k=y%m,_=Math.min(y,y-k)+p,l=0,b=p;b<_;b+=m)l=d(o,b,b+m,u),this.imuln(v),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(k!==0){var T=1;for(l=d(o,b,o.length,u),b=0;b<k;b++)T*=u;this.imuln(T),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},i.prototype.copy=function(o){o.words=new Array(this.length);for(var u=0;u<this.length;u++)o.words[u]=this.words[u];o.length=this.length,o.negative=this.negative,o.red=this.red};function f(E,o){E.words=o.words,E.length=o.length,E.negative=o.negative,E.red=o.red}if(i.prototype._move=function(o){f(o,this)},i.prototype.clone=function(){var o=new i(null);return this.copy(o),o},i.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{i.prototype.inspect=g}else i.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],C=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(o,u){o=o||10,u=u|0||1;var p;if(o===16||o==="hex"){p="";for(var m=0,v=0,y=0;y<this.length;y++){var k=this.words[y],_=((k<<m|v)&16777215).toString(16);v=k>>>24-m&16777215,m+=2,m>=26&&(m-=26,y--),v!==0||y!==this.length-1?p=w[6-_.length]+_+p:p=_+p}for(v!==0&&(p=v.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(o===(o|0)&&o>=2&&o<=36){var l=S[o],b=C[o];p="";var T=this.clone();for(T.negative=0;!T.isZero();){var L=T.modrn(b).toString(o);T=T.idivn(b),T.isZero()?p=L+p:p=w[l-L.length]+L+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(o,u){return this.toArrayLike(a,o,u)}),i.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var M=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};i.prototype.toArrayLike=function(o,u,p){this._strip();var m=this.byteLength(),v=p||Math.max(1,m);n(m<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var y=M(o,v),k=u==="le"?"LE":"BE";return this["_toArrayLike"+k](y,m),y},i.prototype._toArrayLikeLE=function(o,u){for(var p=0,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p++]=k&255,p<o.length&&(o[p++]=k>>8&255),p<o.length&&(o[p++]=k>>16&255),y===6?(p<o.length&&(o[p++]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p<o.length)for(o[p++]=m;p<o.length;)o[p++]=0},i.prototype._toArrayLikeBE=function(o,u){for(var p=o.length-1,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p--]=k&255,p>=0&&(o[p--]=k>>8&255),p>=0&&(o[p--]=k>>16&255),y===6?(p>=0&&(o[p--]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p>=0)for(o[p--]=m;p>=0;)o[p--]=0},Math.clz32?i.prototype._countBits=function(o){return 32-Math.clz32(o)}:i.prototype._countBits=function(o){var u=o,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},i.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,p=0;return u&8191||(p+=13,u>>>=13),u&127||(p+=7,u>>>=7),u&15||(p+=4,u>>>=4),u&3||(p+=2,u>>>=2),u&1||p++,p},i.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function I(E){for(var o=new Array(E.bitLength()),u=0;u<o.length;u++){var p=u/26|0,m=u%26;o[u]=E.words[p]>>>m&1}return o}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(o+=p,p!==26)break}return o},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},i.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var u=0;u<o.length;u++)this.words[u]=this.words[u]|o.words[u];return this._strip()},i.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},i.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},i.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},i.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&o.words[p];return this.length=u.length,this._strip()},i.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},i.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},i.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},i.prototype.iuxor=function(o){var u,p;this.length>o.length?(u=this,p=o):(u=o,p=this);for(var m=0;m<p.length;m++)this.words[m]=u.words[m]^p.words[m];if(this!==u)for(;m<u.length;m++)this.words[m]=u.words[m];return this.length=u.length,this._strip()},i.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},i.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},i.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},i.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,p=o%26;this._expand(u),p>0&&u--;for(var m=0;m<u;m++)this.words[m]=~this.words[m]&67108863;return p>0&&(this.words[m]=~this.words[m]&67108863>>26-p),this._strip()},i.prototype.notn=function(o){return this.clone().inotn(o)},i.prototype.setn=function(o,u){n(typeof o=="number"&&o>=0);var p=o/26|0,m=o%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<m:this.words[p]=this.words[p]&~(1<<m),this._strip()},i.prototype.iadd=function(o){var u;if(this.negative!==0&&o.negative===0)return this.negative=0,u=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,u=this.isub(o),o.negative=1,u._normSign();var p,m;this.length>o.length?(p=this,m=o):(p=o,m=this);for(var v=0,y=0;y<m.length;y++)u=(p.words[y]|0)+(m.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;for(;v!==0&&y<p.length;y++)u=(p.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;if(this.length=p.length,v!==0)this.words[this.length]=v,this.length++;else if(p!==this)for(;y<p.length;y++)this.words[y]=p.words[y];return this},i.prototype.add=function(o){var u;return o.negative!==0&&this.negative===0?(o.negative=0,u=this.sub(o),o.negative^=1,u):o.negative===0&&this.negative!==0?(this.negative=0,u=o.sub(this),this.negative=1,u):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},i.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var p=this.cmp(o);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,v;p>0?(m=this,v=o):(m=o,v=this);for(var y=0,k=0;k<v.length;k++)u=(m.words[k]|0)-(v.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;for(;y!==0&&k<m.length;k++)u=(m.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;if(y===0&&k<m.length&&m!==this)for(;k<m.length;k++)this.words[k]=m.words[k];return this.length=Math.max(this.length,k),m!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(o){return this.clone().isub(o)};function A(E,o,u){u.negative=o.negative^E.negative;var p=E.length+o.length|0;u.length=p,p=p-1|0;var m=E.words[0]|0,v=o.words[0]|0,y=m*v,k=y&67108863,_=y/67108864|0;u.words[0]=k;for(var l=1;l<p;l++){for(var b=_>>>26,T=_&67108863,L=Math.min(l,o.length-1),$=Math.max(0,l-E.length+1);$<=L;$++){var K=l-$|0;m=E.words[K]|0,v=o.words[$]|0,y=m*v+T,b+=y/67108864|0,T=y&67108863}u.words[l]=T|0,_=b|0}return _!==0?u.words[l]=_|0:u.length--,u._strip()}var x=function(o,u,p){var m=o.words,v=u.words,y=p.words,k=0,_,l,b,T=m[0]|0,L=T&8191,$=T>>>13,K=m[1]|0,Q=K&8191,X=K>>>13,rn=m[2]|0,Ce=rn&8191,Ie=rn>>>13,nn=m[3]|0,xe=nn&8191,Ae=nn>>>13,sn=m[4]|0,Ne=sn&8191,Le=sn>>>13,on=m[5]|0,$e=on&8191,Te=on>>>13,an=m[6]|0,Pe=an&8191,Oe=an>>>13,cn=m[7]|0,Be=cn&8191,De=cn>>>13,gr=m[8]|0,re=gr&8191,ne=gr>>>13,mr=m[9]|0,se=mr&8191,ie=mr>>>13,_r=v[0]|0,oe=_r&8191,ae=_r>>>13,vr=v[1]|0,ce=vr&8191,le=vr>>>13,br=v[2]|0,ue=br&8191,he=br>>>13,wr=v[3]|0,de=wr&8191,fe=wr>>>13,yr=v[4]|0,pe=yr&8191,ge=yr>>>13,Er=v[5]|0,me=Er&8191,_e=Er>>>13,Sr=v[6]|0,ve=Sr&8191,be=Sr>>>13,kr=v[7]|0,we=kr&8191,ye=kr>>>13,Mr=v[8]|0,Ee=Mr&8191,Se=Mr>>>13,Rr=v[9]|0,ke=Rr&8191,Me=Rr>>>13;p.negative=o.negative^u.negative,p.length=19,_=Math.imul(L,oe),l=Math.imul(L,ae),l=l+Math.imul($,oe)|0,b=Math.imul($,ae);var Ft=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,_=Math.imul(Q,oe),l=Math.imul(Q,ae),l=l+Math.imul(X,oe)|0,b=Math.imul(X,ae),_=_+Math.imul(L,ce)|0,l=l+Math.imul(L,le)|0,l=l+Math.imul($,ce)|0,b=b+Math.imul($,le)|0;var jt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(jt>>>26)|0,jt&=67108863,_=Math.imul(Ce,oe),l=Math.imul(Ce,ae),l=l+Math.imul(Ie,oe)|0,b=Math.imul(Ie,ae),_=_+Math.imul(Q,ce)|0,l=l+Math.imul(Q,le)|0,l=l+Math.imul(X,ce)|0,b=b+Math.imul(X,le)|0,_=_+Math.imul(L,ue)|0,l=l+Math.imul(L,he)|0,l=l+Math.imul($,ue)|0,b=b+Math.imul($,he)|0;var Ht=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,_=Math.imul(xe,oe),l=Math.imul(xe,ae),l=l+Math.imul(Ae,oe)|0,b=Math.imul(Ae,ae),_=_+Math.imul(Ce,ce)|0,l=l+Math.imul(Ce,le)|0,l=l+Math.imul(Ie,ce)|0,b=b+Math.imul(Ie,le)|0,_=_+Math.imul(Q,ue)|0,l=l+Math.imul(Q,he)|0,l=l+Math.imul(X,ue)|0,b=b+Math.imul(X,he)|0,_=_+Math.imul(L,de)|0,l=l+Math.imul(L,fe)|0,l=l+Math.imul($,de)|0,b=b+Math.imul($,fe)|0;var Ut=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,_=Math.imul(Ne,oe),l=Math.imul(Ne,ae),l=l+Math.imul(Le,oe)|0,b=Math.imul(Le,ae),_=_+Math.imul(xe,ce)|0,l=l+Math.imul(xe,le)|0,l=l+Math.imul(Ae,ce)|0,b=b+Math.imul(Ae,le)|0,_=_+Math.imul(Ce,ue)|0,l=l+Math.imul(Ce,he)|0,l=l+Math.imul(Ie,ue)|0,b=b+Math.imul(Ie,he)|0,_=_+Math.imul(Q,de)|0,l=l+Math.imul(Q,fe)|0,l=l+Math.imul(X,de)|0,b=b+Math.imul(X,fe)|0,_=_+Math.imul(L,pe)|0,l=l+Math.imul(L,ge)|0,l=l+Math.imul($,pe)|0,b=b+Math.imul($,ge)|0;var Vt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,_=Math.imul($e,oe),l=Math.imul($e,ae),l=l+Math.imul(Te,oe)|0,b=Math.imul(Te,ae),_=_+Math.imul(Ne,ce)|0,l=l+Math.imul(Ne,le)|0,l=l+Math.imul(Le,ce)|0,b=b+Math.imul(Le,le)|0,_=_+Math.imul(xe,ue)|0,l=l+Math.imul(xe,he)|0,l=l+Math.imul(Ae,ue)|0,b=b+Math.imul(Ae,he)|0,_=_+Math.imul(Ce,de)|0,l=l+Math.imul(Ce,fe)|0,l=l+Math.imul(Ie,de)|0,b=b+Math.imul(Ie,fe)|0,_=_+Math.imul(Q,pe)|0,l=l+Math.imul(Q,ge)|0,l=l+Math.imul(X,pe)|0,b=b+Math.imul(X,ge)|0,_=_+Math.imul(L,me)|0,l=l+Math.imul(L,_e)|0,l=l+Math.imul($,me)|0,b=b+Math.imul($,_e)|0;var zt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(zt>>>26)|0,zt&=67108863,_=Math.imul(Pe,oe),l=Math.imul(Pe,ae),l=l+Math.imul(Oe,oe)|0,b=Math.imul(Oe,ae),_=_+Math.imul($e,ce)|0,l=l+Math.imul($e,le)|0,l=l+Math.imul(Te,ce)|0,b=b+Math.imul(Te,le)|0,_=_+Math.imul(Ne,ue)|0,l=l+Math.imul(Ne,he)|0,l=l+Math.imul(Le,ue)|0,b=b+Math.imul(Le,he)|0,_=_+Math.imul(xe,de)|0,l=l+Math.imul(xe,fe)|0,l=l+Math.imul(Ae,de)|0,b=b+Math.imul(Ae,fe)|0,_=_+Math.imul(Ce,pe)|0,l=l+Math.imul(Ce,ge)|0,l=l+Math.imul(Ie,pe)|0,b=b+Math.imul(Ie,ge)|0,_=_+Math.imul(Q,me)|0,l=l+Math.imul(Q,_e)|0,l=l+Math.imul(X,me)|0,b=b+Math.imul(X,_e)|0,_=_+Math.imul(L,ve)|0,l=l+Math.imul(L,be)|0,l=l+Math.imul($,ve)|0,b=b+Math.imul($,be)|0;var Wt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,_=Math.imul(Be,oe),l=Math.imul(Be,ae),l=l+Math.imul(De,oe)|0,b=Math.imul(De,ae),_=_+Math.imul(Pe,ce)|0,l=l+Math.imul(Pe,le)|0,l=l+Math.imul(Oe,ce)|0,b=b+Math.imul(Oe,le)|0,_=_+Math.imul($e,ue)|0,l=l+Math.imul($e,he)|0,l=l+Math.imul(Te,ue)|0,b=b+Math.imul(Te,he)|0,_=_+Math.imul(Ne,de)|0,l=l+Math.imul(Ne,fe)|0,l=l+Math.imul(Le,de)|0,b=b+Math.imul(Le,fe)|0,_=_+Math.imul(xe,pe)|0,l=l+Math.imul(xe,ge)|0,l=l+Math.imul(Ae,pe)|0,b=b+Math.imul(Ae,ge)|0,_=_+Math.imul(Ce,me)|0,l=l+Math.imul(Ce,_e)|0,l=l+Math.imul(Ie,me)|0,b=b+Math.imul(Ie,_e)|0,_=_+Math.imul(Q,ve)|0,l=l+Math.imul(Q,be)|0,l=l+Math.imul(X,ve)|0,b=b+Math.imul(X,be)|0,_=_+Math.imul(L,we)|0,l=l+Math.imul(L,ye)|0,l=l+Math.imul($,we)|0,b=b+Math.imul($,ye)|0;var qt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(qt>>>26)|0,qt&=67108863,_=Math.imul(re,oe),l=Math.imul(re,ae),l=l+Math.imul(ne,oe)|0,b=Math.imul(ne,ae),_=_+Math.imul(Be,ce)|0,l=l+Math.imul(Be,le)|0,l=l+Math.imul(De,ce)|0,b=b+Math.imul(De,le)|0,_=_+Math.imul(Pe,ue)|0,l=l+Math.imul(Pe,he)|0,l=l+Math.imul(Oe,ue)|0,b=b+Math.imul(Oe,he)|0,_=_+Math.imul($e,de)|0,l=l+Math.imul($e,fe)|0,l=l+Math.imul(Te,de)|0,b=b+Math.imul(Te,fe)|0,_=_+Math.imul(Ne,pe)|0,l=l+Math.imul(Ne,ge)|0,l=l+Math.imul(Le,pe)|0,b=b+Math.imul(Le,ge)|0,_=_+Math.imul(xe,me)|0,l=l+Math.imul(xe,_e)|0,l=l+Math.imul(Ae,me)|0,b=b+Math.imul(Ae,_e)|0,_=_+Math.imul(Ce,ve)|0,l=l+Math.imul(Ce,be)|0,l=l+Math.imul(Ie,ve)|0,b=b+Math.imul(Ie,be)|0,_=_+Math.imul(Q,we)|0,l=l+Math.imul(Q,ye)|0,l=l+Math.imul(X,we)|0,b=b+Math.imul(X,ye)|0,_=_+Math.imul(L,Ee)|0,l=l+Math.imul(L,Se)|0,l=l+Math.imul($,Ee)|0,b=b+Math.imul($,Se)|0;var Jt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,_=Math.imul(se,oe),l=Math.imul(se,ae),l=l+Math.imul(ie,oe)|0,b=Math.imul(ie,ae),_=_+Math.imul(re,ce)|0,l=l+Math.imul(re,le)|0,l=l+Math.imul(ne,ce)|0,b=b+Math.imul(ne,le)|0,_=_+Math.imul(Be,ue)|0,l=l+Math.imul(Be,he)|0,l=l+Math.imul(De,ue)|0,b=b+Math.imul(De,he)|0,_=_+Math.imul(Pe,de)|0,l=l+Math.imul(Pe,fe)|0,l=l+Math.imul(Oe,de)|0,b=b+Math.imul(Oe,fe)|0,_=_+Math.imul($e,pe)|0,l=l+Math.imul($e,ge)|0,l=l+Math.imul(Te,pe)|0,b=b+Math.imul(Te,ge)|0,_=_+Math.imul(Ne,me)|0,l=l+Math.imul(Ne,_e)|0,l=l+Math.imul(Le,me)|0,b=b+Math.imul(Le,_e)|0,_=_+Math.imul(xe,ve)|0,l=l+Math.imul(xe,be)|0,l=l+Math.imul(Ae,ve)|0,b=b+Math.imul(Ae,be)|0,_=_+Math.imul(Ce,we)|0,l=l+Math.imul(Ce,ye)|0,l=l+Math.imul(Ie,we)|0,b=b+Math.imul(Ie,ye)|0,_=_+Math.imul(Q,Ee)|0,l=l+Math.imul(Q,Se)|0,l=l+Math.imul(X,Ee)|0,b=b+Math.imul(X,Se)|0,_=_+Math.imul(L,ke)|0,l=l+Math.imul(L,Me)|0,l=l+Math.imul($,ke)|0,b=b+Math.imul($,Me)|0;var Gt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,_=Math.imul(se,ce),l=Math.imul(se,le),l=l+Math.imul(ie,ce)|0,b=Math.imul(ie,le),_=_+Math.imul(re,ue)|0,l=l+Math.imul(re,he)|0,l=l+Math.imul(ne,ue)|0,b=b+Math.imul(ne,he)|0,_=_+Math.imul(Be,de)|0,l=l+Math.imul(Be,fe)|0,l=l+Math.imul(De,de)|0,b=b+Math.imul(De,fe)|0,_=_+Math.imul(Pe,pe)|0,l=l+Math.imul(Pe,ge)|0,l=l+Math.imul(Oe,pe)|0,b=b+Math.imul(Oe,ge)|0,_=_+Math.imul($e,me)|0,l=l+Math.imul($e,_e)|0,l=l+Math.imul(Te,me)|0,b=b+Math.imul(Te,_e)|0,_=_+Math.imul(Ne,ve)|0,l=l+Math.imul(Ne,be)|0,l=l+Math.imul(Le,ve)|0,b=b+Math.imul(Le,be)|0,_=_+Math.imul(xe,we)|0,l=l+Math.imul(xe,ye)|0,l=l+Math.imul(Ae,we)|0,b=b+Math.imul(Ae,ye)|0,_=_+Math.imul(Ce,Ee)|0,l=l+Math.imul(Ce,Se)|0,l=l+Math.imul(Ie,Ee)|0,b=b+Math.imul(Ie,Se)|0,_=_+Math.imul(Q,ke)|0,l=l+Math.imul(Q,Me)|0,l=l+Math.imul(X,ke)|0,b=b+Math.imul(X,Me)|0;var Zt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,_=Math.imul(se,ue),l=Math.imul(se,he),l=l+Math.imul(ie,ue)|0,b=Math.imul(ie,he),_=_+Math.imul(re,de)|0,l=l+Math.imul(re,fe)|0,l=l+Math.imul(ne,de)|0,b=b+Math.imul(ne,fe)|0,_=_+Math.imul(Be,pe)|0,l=l+Math.imul(Be,ge)|0,l=l+Math.imul(De,pe)|0,b=b+Math.imul(De,ge)|0,_=_+Math.imul(Pe,me)|0,l=l+Math.imul(Pe,_e)|0,l=l+Math.imul(Oe,me)|0,b=b+Math.imul(Oe,_e)|0,_=_+Math.imul($e,ve)|0,l=l+Math.imul($e,be)|0,l=l+Math.imul(Te,ve)|0,b=b+Math.imul(Te,be)|0,_=_+Math.imul(Ne,we)|0,l=l+Math.imul(Ne,ye)|0,l=l+Math.imul(Le,we)|0,b=b+Math.imul(Le,ye)|0,_=_+Math.imul(xe,Ee)|0,l=l+Math.imul(xe,Se)|0,l=l+Math.imul(Ae,Ee)|0,b=b+Math.imul(Ae,Se)|0,_=_+Math.imul(Ce,ke)|0,l=l+Math.imul(Ce,Me)|0,l=l+Math.imul(Ie,ke)|0,b=b+Math.imul(Ie,Me)|0;var Qt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,_=Math.imul(se,de),l=Math.imul(se,fe),l=l+Math.imul(ie,de)|0,b=Math.imul(ie,fe),_=_+Math.imul(re,pe)|0,l=l+Math.imul(re,ge)|0,l=l+Math.imul(ne,pe)|0,b=b+Math.imul(ne,ge)|0,_=_+Math.imul(Be,me)|0,l=l+Math.imul(Be,_e)|0,l=l+Math.imul(De,me)|0,b=b+Math.imul(De,_e)|0,_=_+Math.imul(Pe,ve)|0,l=l+Math.imul(Pe,be)|0,l=l+Math.imul(Oe,ve)|0,b=b+Math.imul(Oe,be)|0,_=_+Math.imul($e,we)|0,l=l+Math.imul($e,ye)|0,l=l+Math.imul(Te,we)|0,b=b+Math.imul(Te,ye)|0,_=_+Math.imul(Ne,Ee)|0,l=l+Math.imul(Ne,Se)|0,l=l+Math.imul(Le,Ee)|0,b=b+Math.imul(Le,Se)|0,_=_+Math.imul(xe,ke)|0,l=l+Math.imul(xe,Me)|0,l=l+Math.imul(Ae,ke)|0,b=b+Math.imul(Ae,Me)|0;var Kt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,_=Math.imul(se,pe),l=Math.imul(se,ge),l=l+Math.imul(ie,pe)|0,b=Math.imul(ie,ge),_=_+Math.imul(re,me)|0,l=l+Math.imul(re,_e)|0,l=l+Math.imul(ne,me)|0,b=b+Math.imul(ne,_e)|0,_=_+Math.imul(Be,ve)|0,l=l+Math.imul(Be,be)|0,l=l+Math.imul(De,ve)|0,b=b+Math.imul(De,be)|0,_=_+Math.imul(Pe,we)|0,l=l+Math.imul(Pe,ye)|0,l=l+Math.imul(Oe,we)|0,b=b+Math.imul(Oe,ye)|0,_=_+Math.imul($e,Ee)|0,l=l+Math.imul($e,Se)|0,l=l+Math.imul(Te,Ee)|0,b=b+Math.imul(Te,Se)|0,_=_+Math.imul(Ne,ke)|0,l=l+Math.imul(Ne,Me)|0,l=l+Math.imul(Le,ke)|0,b=b+Math.imul(Le,Me)|0;var Xt=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,_=Math.imul(se,me),l=Math.imul(se,_e),l=l+Math.imul(ie,me)|0,b=Math.imul(ie,_e),_=_+Math.imul(re,ve)|0,l=l+Math.imul(re,be)|0,l=l+Math.imul(ne,ve)|0,b=b+Math.imul(ne,be)|0,_=_+Math.imul(Be,we)|0,l=l+Math.imul(Be,ye)|0,l=l+Math.imul(De,we)|0,b=b+Math.imul(De,ye)|0,_=_+Math.imul(Pe,Ee)|0,l=l+Math.imul(Pe,Se)|0,l=l+Math.imul(Oe,Ee)|0,b=b+Math.imul(Oe,Se)|0,_=_+Math.imul($e,ke)|0,l=l+Math.imul($e,Me)|0,l=l+Math.imul(Te,ke)|0,b=b+Math.imul(Te,Me)|0;var ui=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(ui>>>26)|0,ui&=67108863,_=Math.imul(se,ve),l=Math.imul(se,be),l=l+Math.imul(ie,ve)|0,b=Math.imul(ie,be),_=_+Math.imul(re,we)|0,l=l+Math.imul(re,ye)|0,l=l+Math.imul(ne,we)|0,b=b+Math.imul(ne,ye)|0,_=_+Math.imul(Be,Ee)|0,l=l+Math.imul(Be,Se)|0,l=l+Math.imul(De,Ee)|0,b=b+Math.imul(De,Se)|0,_=_+Math.imul(Pe,ke)|0,l=l+Math.imul(Pe,Me)|0,l=l+Math.imul(Oe,ke)|0,b=b+Math.imul(Oe,Me)|0;var hi=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(hi>>>26)|0,hi&=67108863,_=Math.imul(se,we),l=Math.imul(se,ye),l=l+Math.imul(ie,we)|0,b=Math.imul(ie,ye),_=_+Math.imul(re,Ee)|0,l=l+Math.imul(re,Se)|0,l=l+Math.imul(ne,Ee)|0,b=b+Math.imul(ne,Se)|0,_=_+Math.imul(Be,ke)|0,l=l+Math.imul(Be,Me)|0,l=l+Math.imul(De,ke)|0,b=b+Math.imul(De,Me)|0;var di=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(di>>>26)|0,di&=67108863,_=Math.imul(se,Ee),l=Math.imul(se,Se),l=l+Math.imul(ie,Ee)|0,b=Math.imul(ie,Se),_=_+Math.imul(re,ke)|0,l=l+Math.imul(re,Me)|0,l=l+Math.imul(ne,ke)|0,b=b+Math.imul(ne,Me)|0;var fi=(k+_|0)+((l&8191)<<13)|0;k=(b+(l>>>13)|0)+(fi>>>26)|0,fi&=67108863,_=Math.imul(se,ke),l=Math.imul(se,Me),l=l+Math.imul(ie,ke)|0,b=Math.imul(ie,Me);var pi=(k+_|0)+((l&8191)<<13)|0;return k=(b+(l>>>13)|0)+(pi>>>26)|0,pi&=67108863,y[0]=Ft,y[1]=jt,y[2]=Ht,y[3]=Ut,y[4]=Vt,y[5]=zt,y[6]=Wt,y[7]=qt,y[8]=Jt,y[9]=Gt,y[10]=Zt,y[11]=Qt,y[12]=Kt,y[13]=Xt,y[14]=ui,y[15]=hi,y[16]=di,y[17]=fi,y[18]=pi,k!==0&&(y[19]=k,p.length++),p};Math.imul||(x=A);function R(E,o,u){u.negative=o.negative^E.negative,u.length=E.length+o.length;for(var p=0,m=0,v=0;v<u.length-1;v++){var y=m;m=0;for(var k=p&67108863,_=Math.min(v,o.length-1),l=Math.max(0,v-E.length+1);l<=_;l++){var b=v-l,T=E.words[b]|0,L=o.words[l]|0,$=T*L,K=$&67108863;y=y+($/67108864|0)|0,K=K+k|0,k=K&67108863,y=y+(K>>>26)|0,m+=y>>>26,y&=67108863}u.words[v]=k,p=y,y=m}return p!==0?u.words[v]=p:u.length--,u._strip()}function B(E,o,u){return R(E,o,u)}i.prototype.mulTo=function(o,u){var p,m=this.length+o.length;return this.length===10&&o.length===10?p=x(this,o,u):m<63?p=A(this,o,u):m<1024?p=R(this,o,u):p=B(this,o,u),p},i.prototype.mul=function(o){var u=new i(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},i.prototype.mulf=function(o){var u=new i(null);return u.words=new Array(this.length+o.length),B(this,o,u)},i.prototype.imul=function(o){return this.clone().mulTo(o,this)},i.prototype.imuln=function(o){var u=o<0;u&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var p=0,m=0;m<this.length;m++){var v=(this.words[m]|0)*o,y=(v&67108863)+(p&67108863);p>>=26,p+=v/67108864|0,p+=y>>>26,this.words[m]=y&67108863}return p!==0&&(this.words[m]=p,this.length++),this.length=o===0?1:this.length,u?this.ineg():this},i.prototype.muln=function(o){return this.clone().imuln(o)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(o){var u=I(o);if(u.length===0)return new i(1);for(var p=this,m=0;m<u.length&&u[m]===0;m++,p=p.sqr());if(++m<u.length)for(var v=p.sqr();m<u.length;m++,v=v.sqr())u[m]!==0&&(p=p.mul(v));return p},i.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=67108863>>>26-u<<26-u,v;if(u!==0){var y=0;for(v=0;v<this.length;v++){var k=this.words[v]&m,_=(this.words[v]|0)-k<<u;this.words[v]=_|y,y=k>>>26-u}y&&(this.words[v]=y,this.length++)}if(p!==0){for(v=this.length-1;v>=0;v--)this.words[v+p]=this.words[v];for(v=0;v<p;v++)this.words[v]=0;this.length+=p}return this._strip()},i.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},i.prototype.iushrn=function(o,u,p){n(typeof o=="number"&&o>=0);var m;u?m=(u-u%26)/26:m=0;var v=o%26,y=Math.min((o-v)/26,this.length),k=67108863^67108863>>>v<<v,_=p;if(m-=y,m=Math.max(0,m),_){for(var l=0;l<y;l++)_.words[l]=this.words[l];_.length=y}if(y!==0)if(this.length>y)for(this.length-=y,l=0;l<this.length;l++)this.words[l]=this.words[l+y];else this.words[0]=0,this.length=1;var b=0;for(l=this.length-1;l>=0&&(b!==0||l>=m);l--){var T=this.words[l]|0;this.words[l]=b<<26-v|T>>>v,b=T&k}return _&&b!==0&&(_.words[_.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(o,u,p){return n(this.negative===0),this.iushrn(o,u,p)},i.prototype.shln=function(o){return this.clone().ishln(o)},i.prototype.ushln=function(o){return this.clone().iushln(o)},i.prototype.shrn=function(o){return this.clone().ishrn(o)},i.prototype.ushrn=function(o){return this.clone().iushrn(o)},i.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return!1;var v=this.words[p];return!!(v&m)},i.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var m=67108863^67108863>>>u<<u;this.words[this.length-1]&=m}return this._strip()},i.prototype.maskn=function(o){return this.clone().imaskn(o)},i.prototype.iaddn=function(o){return n(typeof o=="number"),n(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<=o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},i.prototype._iaddn=function(o){this.words[0]+=o;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},i.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},i.prototype.addn=function(o){return this.clone().iaddn(o)},i.prototype.subn=function(o){return this.clone().isubn(o)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(o,u,p){var m=o.length+p,v;this._expand(m);var y,k=0;for(v=0;v<o.length;v++){y=(this.words[v+p]|0)+k;var _=(o.words[v]|0)*u;y-=_&67108863,k=(y>>26)-(_/67108864|0),this.words[v+p]=y&67108863}for(;v<this.length-p;v++)y=(this.words[v+p]|0)+k,k=y>>26,this.words[v+p]=y&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,v=0;v<this.length;v++)y=-(this.words[v]|0)+k,k=y>>26,this.words[v]=y&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(o,u){var p=this.length-o.length,m=this.clone(),v=o,y=v.words[v.length-1]|0,k=this._countBits(y);p=26-k,p!==0&&(v=v.ushln(p),m.iushln(p),y=v.words[v.length-1]|0);var _=m.length-v.length,l;if(u!=="mod"){l=new i(null),l.length=_+1,l.words=new Array(l.length);for(var b=0;b<l.length;b++)l.words[b]=0}var T=m.clone()._ishlnsubmul(v,1,_);T.negative===0&&(m=T,l&&(l.words[_]=1));for(var L=_-1;L>=0;L--){var $=(m.words[v.length+L]|0)*67108864+(m.words[v.length+L-1]|0);for($=Math.min($/y|0,67108863),m._ishlnsubmul(v,$,L);m.negative!==0;)$--,m.negative=0,m._ishlnsubmul(v,1,L),m.isZero()||(m.negative^=1);l&&(l.words[L]=$)}return l&&l._strip(),m._strip(),u!=="div"&&p!==0&&m.iushrn(p),{div:l||null,mod:m}},i.prototype.divmod=function(o,u,p){if(n(!o.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var m,v,y;return this.negative!==0&&o.negative===0?(y=this.neg().divmod(o,u),u!=="mod"&&(m=y.div.neg()),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.iadd(o)),{div:m,mod:v}):this.negative===0&&o.negative!==0?(y=this.divmod(o.neg(),u),u!=="mod"&&(m=y.div.neg()),{div:m,mod:y.mod}):this.negative&o.negative?(y=this.neg().divmod(o.neg(),u),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.isub(o)),{div:y.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new i(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new i(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new i(this.modrn(o.words[0]))}:this._wordDiv(o,u)},i.prototype.div=function(o){return this.divmod(o,"div",!1).div},i.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},i.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},i.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(o):u.mod,m=o.ushrn(1),v=o.andln(1),y=p.cmp(m);return y<0||v===1&&y===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},i.prototype.modrn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=(1<<26)%o,m=0,v=this.length-1;v>=0;v--)m=(p*m+(this.words[v]|0))%o;return u?-m:m},i.prototype.modn=function(o){return this.modrn(o)},i.prototype.idivn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var v=(this.words[m]|0)+p*67108864;this.words[m]=v/o|0,p=v%o}return this._strip(),u?this.ineg():this},i.prototype.divn=function(o){return this.clone().idivn(o)},i.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new i(1),v=new i(0),y=new i(0),k=new i(1),_=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++_;for(var l=p.clone(),b=u.clone();!u.isZero();){for(var T=0,L=1;!(u.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(u.iushrn(T);T-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(l),v.isub(b)),m.iushrn(1),v.iushrn(1);for(var $=0,K=1;!(p.words[0]&K)&&$<26;++$,K<<=1);if($>0)for(p.iushrn($);$-- >0;)(y.isOdd()||k.isOdd())&&(y.iadd(l),k.isub(b)),y.iushrn(1),k.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(y),v.isub(k)):(p.isub(u),y.isub(m),k.isub(v))}return{a:y,b:k,gcd:p.iushln(_)}},i.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new i(1),v=new i(0),y=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var k=0,_=1;!(u.words[0]&_)&&k<26;++k,_<<=1);if(k>0)for(u.iushrn(k);k-- >0;)m.isOdd()&&m.iadd(y),m.iushrn(1);for(var l=0,b=1;!(p.words[0]&b)&&l<26;++l,b<<=1);if(l>0)for(p.iushrn(l);l-- >0;)v.isOdd()&&v.iadd(y),v.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(v)):(p.isub(u),v.isub(m))}var T;return u.cmpn(1)===0?T=m:T=v,T.cmpn(0)<0&&T.iadd(o),T},i.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),p=o.clone();u.negative=0,p.negative=0;for(var m=0;u.isEven()&&p.isEven();m++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var v=u.cmp(p);if(v<0){var y=u;u=p,p=y}else if(v===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(m)},i.prototype.invm=function(o){return this.egcd(o).a.umod(o)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(o){return this.words[0]&o},i.prototype.bincn=function(o){n(typeof o=="number");var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=m,this;for(var v=m,y=p;v!==0&&y<this.length;y++){var k=this.words[y]|0;k+=v,v=k>>>26,k&=67108863,this.words[y]=k}return v!==0&&(this.words[y]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(o=-o),n(o<=67108863,"Number is too big");var m=this.words[0]|0;p=m===o?0:m<o?-1:1}return this.negative!==0?-p|0:p},i.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var u=this.ucmp(o);return this.negative!==0?-u|0:u},i.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var m=this.words[p]|0,v=o.words[p]|0;if(m!==v){m<v?u=-1:m>v&&(u=1);break}}return u},i.prototype.gtn=function(o){return this.cmpn(o)===1},i.prototype.gt=function(o){return this.cmp(o)===1},i.prototype.gten=function(o){return this.cmpn(o)>=0},i.prototype.gte=function(o){return this.cmp(o)>=0},i.prototype.ltn=function(o){return this.cmpn(o)===-1},i.prototype.lt=function(o){return this.cmp(o)===-1},i.prototype.lten=function(o){return this.cmpn(o)<=0},i.prototype.lte=function(o){return this.cmp(o)<=0},i.prototype.eqn=function(o){return this.cmpn(o)===0},i.prototype.eq=function(o){return this.cmp(o)===0},i.red=function(o){return new j(o)},i.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(o){return this.red=o,this},i.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},i.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},i.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},i.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},i.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},i.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},i.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},i.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var N={k256:null,p224:null,p192:null,p25519:null};function P(E,o){this.name=E,this.p=new i(o,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var o=new i(null);return o.words=new Array(Math.ceil(this.n/13)),o},P.prototype.ireduce=function(o){var u=o,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var m=p<this.n?-1:u.ucmp(this.p);return m===0?(u.words[0]=0,u.length=1):m>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},P.prototype.split=function(o,u){o.iushrn(this.n,0,u)},P.prototype.imulK=function(o){return o.imul(this.k)};function W(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(W,P),W.prototype.split=function(o,u){for(var p=4194303,m=Math.min(o.length,9),v=0;v<m;v++)u.words[v]=o.words[v];if(u.length=m,o.length<=9){o.words[0]=0,o.length=1;return}var y=o.words[9];for(u.words[u.length++]=y&p,v=10;v<o.length;v++){var k=o.words[v]|0;o.words[v-10]=(k&p)<<4|y>>>22,y=k}y>>>=22,o.words[v-10]=y,y===0&&o.length>10?o.length-=10:o.length-=9},W.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,p=0;p<o.length;p++){var m=o.words[p]|0;u+=m*977,o.words[p]=u&67108863,u=m*64+(u/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function Y(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(Y,P);function Re(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(Re,P);function V(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(V,P),V.prototype.imulK=function(o){for(var u=0,p=0;p<o.length;p++){var m=(o.words[p]|0)*19+u,v=m&67108863;m>>>=26,o.words[p]=v,u=m}return u!==0&&(o.words[o.length++]=u),o},i._prime=function(o){if(N[o])return N[o];var u;if(o==="k256")u=new W;else if(o==="p224")u=new Y;else if(o==="p192")u=new Re;else if(o==="p25519")u=new V;else throw new Error("Unknown prime "+o);return N[o]=u,u};function j(E){if(typeof E=="string"){var o=i._prime(E);this.m=o.p,this.prime=o}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}j.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},j.prototype._verify2=function(o,u){n((o.negative|u.negative)===0,"red works only with positives"),n(o.red&&o.red===u.red,"red works only with red numbers")},j.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(f(o,o.umod(this.m)._forceRed(this)),o)},j.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},j.prototype.add=function(o,u){this._verify2(o,u);var p=o.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},j.prototype.iadd=function(o,u){this._verify2(o,u);var p=o.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},j.prototype.sub=function(o,u){this._verify2(o,u);var p=o.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},j.prototype.isub=function(o,u){this._verify2(o,u);var p=o.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},j.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},j.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},j.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},j.prototype.isqr=function(o){return this.imul(o,o.clone())},j.prototype.sqr=function(o){return this.mul(o,o)},j.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(n(u%2===1),u===3){var p=this.m.add(new i(1)).iushrn(2);return this.pow(o,p)}for(var m=this.m.subn(1),v=0;!m.isZero()&&m.andln(1)===0;)v++,m.iushrn(1);n(!m.isZero());var y=new i(1).toRed(this),k=y.redNeg(),_=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);this.pow(l,_).cmp(k)!==0;)l.redIAdd(k);for(var b=this.pow(l,m),T=this.pow(o,m.addn(1).iushrn(1)),L=this.pow(o,m),$=v;L.cmp(y)!==0;){for(var K=L,Q=0;K.cmp(y)!==0;Q++)K=K.redSqr();n(Q<$);var X=this.pow(b,new i(1).iushln($-Q-1));T=T.redMul(X),b=X.redSqr(),L=L.redMul(b),$=Q}return T},j.prototype.invm=function(o){var u=o._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},j.prototype.pow=function(o,u){if(u.isZero())return new i(1).toRed(this);if(u.cmpn(1)===0)return o.clone();var p=4,m=new Array(1<<p);m[0]=new i(1).toRed(this),m[1]=o;for(var v=2;v<m.length;v++)m[v]=this.mul(m[v-1],o);var y=m[0],k=0,_=0,l=u.bitLength()%26;for(l===0&&(l=26),v=u.length-1;v>=0;v--){for(var b=u.words[v],T=l-1;T>=0;T--){var L=b>>T&1;if(y!==m[0]&&(y=this.sqr(y)),L===0&&k===0){_=0;continue}k<<=1,k|=L,_++,!(_!==p&&(v!==0||T!==0))&&(y=this.mul(y,m[k]),_=0,k=0)}l=26}return y},j.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},j.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},i.mont=function(o){return new Z(o)};function Z(E){j.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(Z,j),Z.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},Z.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},Z.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var p=o.imul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},Z.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new i(0)._forceRed(this);var p=o.mul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},Z.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,D)})(Zi);var _s=Zi.exports,yn={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.errorValues=At.standardErrorCodes=void 0;At.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}};At.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var vs={},bs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=At,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(w,S=r){if(w&&Number.isInteger(w)){const C=w.toString();if(f(t.errorValues,C))return t.errorValues[C].message;if(h(w))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return S}e.getMessageFromCode=n;function s(w){if(!Number.isInteger(w))return!1;const S=w.toString();return!!(t.errorValues[S]||h(w))}e.isValidCode=s;function i(w){var S;if(typeof w=="number")return w;if(a(w))return(S=w.code)!==null&&S!==void 0?S:w.errorCode}e.getErrorCode=i;function a(w){return typeof w=="object"&&w!==null&&(typeof w.code=="number"||typeof w.errorCode=="number")}function c(w,{shouldIncludeStack:S=!1}={}){const C={};if(w&&typeof w=="object"&&!Array.isArray(w)&&f(w,"code")&&s(w.code)){const M=w;C.code=M.code,M.message&&typeof M.message=="string"?(C.message=M.message,f(M,"data")&&(C.data=M.data)):(C.message=n(C.code),C.data={originalError:d(w)})}else C.code=t.standardErrorCodes.rpc.internal,C.message=g(w,"message")?w.message:r,C.data={originalError:d(w)};return S&&(C.stack=g(w,"stack")?w.stack:void 0),C}e.serialize=c;function h(w){return w>=-32099&&w<=-32e3}function d(w){return w&&typeof w=="object"&&!Array.isArray(w)?Object.assign({},w):w}function f(w,S){return Object.prototype.hasOwnProperty.call(w,S)}function g(w,S){return typeof w=="object"&&w!==null&&S in w&&typeof w[S]=="string"}})(bs);Object.defineProperty(vs,"__esModule",{value:!0});vs.standardErrors=void 0;const Ze=At,uc=bs;vs.standardErrors={rpc:{parse:e=>at(Ze.standardErrorCodes.rpc.parse,e),invalidRequest:e=>at(Ze.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>at(Ze.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>at(Ze.standardErrorCodes.rpc.methodNotFound,e),internal:e=>at(Ze.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return at(t,e)},invalidInput:e=>at(Ze.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>at(Ze.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>at(Ze.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>at(Ze.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>at(Ze.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>at(Ze.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Cr(Ze.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Cr(Ze.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Cr(Ze.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Cr(Ze.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Cr(Ze.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Cr(Ze.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new fc(t,r,n)}}};function at(e,t){const[r,n]=hc(t);return new dc(e,r||(0,uc.getMessageFromCode)(e),n)}function Cr(e,t){const[r,n]=hc(t);return new fc(e,r||(0,uc.getMessageFromCode)(e),n)}function hc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let dc=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},fc=class extends dc{constructor(t,r,n){if(!Mu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Mu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ws={},Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isErrorResponse=void 0;function Ru(e){return e.errorMessage!==void 0}Jr.isErrorResponse=Ru;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.LIB_VERSION=void 0;Gr.LIB_VERSION="3.9.3";Object.defineProperty(ws,"__esModule",{value:!0});ws.serializeError=void 0;const Cu=Jr,Iu=Gr,xu=At,Au=bs;function Nu(e,t){const r=(0,Au.serialize)(Lu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Iu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=$u(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ws.serializeError=Nu;function Lu(e){return typeof e=="string"?{message:e,code:xu.standardErrorCodes.rpc.internal}:(0,Cu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function $u(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=At;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=vs;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ws;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=bs;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(yn);var We={};Object.defineProperty(We,"__esModule",{value:!0});We.ProviderType=We.RegExpString=We.IntNumber=We.BigIntString=We.AddressString=We.HexString=We.OpaqueType=void 0;function En(){return e=>e}We.OpaqueType=En;We.HexString=En();We.AddressString=En();We.BigIntString=En();function Tu(e){return Math.floor(e)}We.IntNumber=Tu;We.RegExpString=En();var Bo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Bo||(We.ProviderType=Bo={}));var Pu=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};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 Tt=Pu(_s),hr=yn,ht=We,pc=/^[0-9]*$/,gc=/^[a-f0-9]*$/;function Ou(e){return mc(crypto.getRandomValues(new Uint8Array(e)))}O.randomBytesHex=Ou;function mc(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=mc;function Bu(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}O.hexStringToUint8Array=Bu;function Du(e,t=!1){const r=e.toString("hex");return(0,ht.HexString)(t?`0x${r}`:r)}O.hexStringFromBuffer=Du;function Fu(e){return(0,ht.BigIntString)(e.toString(10))}O.bigIntStringFromBN=Fu;function ju(e){return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}O.intNumberFromHexString=ju;function Hu(e){return(0,ht.HexString)(`0x${new Tt.default(e).toString(16)}`)}O.hexStringFromIntNumber=Hu;function Qi(e){return e.startsWith("0x")||e.startsWith("0X")}O.has0xPrefix=Qi;function ys(e){return Qi(e)?e.slice(2):e}O.strip0x=ys;function _c(e){return Qi(e)?`0x${e.slice(2)}`:`0x${e}`}O.prepend0x=_c;function Sn(e){if(typeof e!="string")return!1;const t=ys(e).toLowerCase();return gc.test(t)}O.isHexString=Sn;function vc(e,t=!1){if(typeof e=="string"){const r=ys(e).toLowerCase();if(gc.test(r))return(0,ht.HexString)(t?`0x${r}`:r)}throw hr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}O.ensureHexString=vc;function kn(e,t=!1){let r=vc(e,!1);return r.length%2===1&&(r=(0,ht.HexString)(`0${r}`)),t?(0,ht.HexString)(`0x${r}`):r}O.ensureEvenLengthHexString=kn;function Uu(e){if(typeof e=="string"){const t=ys(e).toLowerCase();if(Sn(t)&&t.length===40)return(0,ht.AddressString)(_c(t))}throw hr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}O.ensureAddressString=Uu;function Vu(e){if(U.isBuffer(e))return e;if(typeof e=="string"){if(Sn(e)){const t=kn(e,!1);return U.from(t,"hex")}return U.from(e,"utf8")}throw hr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}O.ensureBuffer=Vu;function bc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ht.IntNumber)(e);if(typeof e=="string"){if(pc.test(e))return(0,ht.IntNumber)(Number(e));if(Sn(e))return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureIntNumber=bc;function zu(e){if(e instanceof RegExp)return(0,ht.RegExpString)(e.toString());throw hr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}O.ensureRegExpString=zu;function Wu(e){if(e!==null&&(Tt.default.isBN(e)||wc(e)))return new Tt.default(e.toString(10),10);if(typeof e=="number")return new Tt.default(bc(e));if(typeof e=="string"){if(pc.test(e))return new Tt.default(e,10);if(Sn(e))return new Tt.default(kn(e,!1),16)}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureBN=Wu;function qu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw hr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}O.ensureParsedJSONObject=qu;function wc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}O.isBigNumber=wc;function Ju(e,t){return Array.from({length:t-e},(r,n)=>e+n)}O.range=Ju;function Gu(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}O.getFavicon=Gu;function Zu(e,t,r,n,s,i){const a=n?"parent-id":"id",c=new URLSearchParams({[a]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${c}`}O.createQrUrl=Zu;function yc(){try{return window.frameElement!==null}catch{return!1}}O.isInIFrame=yc;function Qu(){try{return yc()&&window.top?window.top.location:window.location}catch{return window.location}}O.getLocation=Qu;function Ku(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}O.isMobileWeb=Ku;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.ScopedLocalStorage=void 0;class Xu{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Es.ScopedLocalStorage=Xu;var Dr={},Ec={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(h,d,f){this.fn=h,this.context=d,this.once=f||!1}function i(h,d,f,g,w){if(typeof f!="function")throw new TypeError("The listener must be a function");var S=new s(f,g||h,w),C=r?r+d:d;return h._events[C]?h._events[C].fn?h._events[C]=[h._events[C],S]:h._events[C].push(S):(h._events[C]=S,h._eventsCount++),h}function a(h,d){--h._eventsCount===0?h._events=new n:delete h._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],f,g;if(this._eventsCount===0)return d;for(g in f=this._events)t.call(f,g)&&d.push(r?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},c.prototype.listeners=function(d){var f=r?r+d:d,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var w=0,S=g.length,C=new Array(S);w<S;w++)C[w]=g[w].fn;return C},c.prototype.listenerCount=function(d){var f=r?r+d:d,g=this._events[f];return g?g.fn?1:g.length:0},c.prototype.emit=function(d,f,g,w,S,C){var M=r?r+d:d;if(!this._events[M])return!1;var I=this._events[M],A=arguments.length,x,R;if(I.fn){switch(I.once&&this.removeListener(d,I.fn,void 0,!0),A){case 1:return I.fn.call(I.context),!0;case 2:return I.fn.call(I.context,f),!0;case 3:return I.fn.call(I.context,f,g),!0;case 4:return I.fn.call(I.context,f,g,w),!0;case 5:return I.fn.call(I.context,f,g,w,S),!0;case 6:return I.fn.call(I.context,f,g,w,S,C),!0}for(R=1,x=new Array(A-1);R<A;R++)x[R-1]=arguments[R];I.fn.apply(I.context,x)}else{var B=I.length,N;for(R=0;R<B;R++)switch(I[R].once&&this.removeListener(d,I[R].fn,void 0,!0),A){case 1:I[R].fn.call(I[R].context);break;case 2:I[R].fn.call(I[R].context,f);break;case 3:I[R].fn.call(I[R].context,f,g);break;case 4:I[R].fn.call(I[R].context,f,g,w);break;default:if(!x)for(N=1,x=new Array(A-1);N<A;N++)x[N-1]=arguments[N];I[R].fn.apply(I[R].context,x)}}return!0},c.prototype.on=function(d,f,g){return i(this,d,f,g,!1)},c.prototype.once=function(d,f,g){return i(this,d,f,g,!0)},c.prototype.removeListener=function(d,f,g,w){var S=r?r+d:d;if(!this._events[S])return this;if(!f)return a(this,S),this;var C=this._events[S];if(C.fn)C.fn===f&&(!w||C.once)&&(!g||C.context===g)&&a(this,S);else{for(var M=0,I=[],A=C.length;M<A;M++)(C[M].fn!==f||w&&!C[M].once||g&&C[M].context!==g)&&I.push(C[M]);I.length?this._events[S]=I.length===1?I[0]:I:a(this,S)}return this},c.prototype.removeAllListeners=function(d){var f;return d?(f=r?r+d:d,this._events[f]&&a(this,f)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,e.exports=c})(Ec);var Yu=Ec.exports,Mn={},Rn={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.EVENTS=void 0;Zr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.RelayAbstract=ut.APP_VERSION_KEY=ut.LOCAL_STORAGE_ADDRESSES_KEY=ut.WALLET_USER_NAME_KEY=void 0;const Do=yn;ut.WALLET_USER_NAME_KEY="walletUsername";ut.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ut.APP_VERSION_KEY="AppVersion";class eh{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Do.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,Do.serializeError)(i,t.method);return s})}}ut.RelayAbstract=eh;var Qr={},Sc={exports:{}},th=mu,rh=_u,nh=rh("TypedArray.prototype.buffer",!0),sh=yu(),ih=nh||function(t){if(!sh(t))throw new th("Not a Typed Array");return t.buffer},gt=Dt().Buffer,oh=vu,ah=ih,ch=ArrayBuffer.isView||function(t){try{return ah(t),!0}catch{return!1}},lh=typeof Uint8Array<"u",kc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",uh=kc&&(gt.prototype instanceof Uint8Array||gt.TYPED_ARRAY_SUPPORT),hh=function(t,r){if(gt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?gt.from(t):t;if(typeof t=="string")return gt.from(t,r);if(kc&&ch(t)){if(t.byteLength===0)return gt.alloc(0);if(uh){var n=gt.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var s=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),i=gt.from(s);if(i.length===t.byteLength)return i}if(lh&&t instanceof Uint8Array)return gt.from(t);var a=oh(t);if(a)for(var c=0;c<t.length;c+=1){var h=t[c];if(typeof h!="number"||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||gt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return gt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},dh=Dt().Buffer,fh=hh;function Ss(e,t){this._block=dh.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Ss.prototype.update=function(e,t){e=fh(e,t||"utf8");for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,a=0;a<s;){for(var c=i%n,h=Math.min(s-a,n-c),d=0;d<h;d++)r[c+d]=e[a+d];i+=h,a+=h,i%n===0&&this._update(r)}return this._len+=s,this};Ss.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,s=(r-n)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i};Ss.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Kr=Ss,ph=qr,Mc=Kr,gh=Dt().Buffer,mh=[1518500249,1859775393,-1894007588,-899497514],_h=new Array(80);function Cn(){this.init(),this._w=_h,Mc.call(this,64,56)}ph(Cn,Mc);Cn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vh(e){return e<<5|e>>>27}function bh(e){return e<<30|e>>>2}function wh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Cn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var h=0;h<80;++h){var d=~~(h/20),f=vh(r)+wh(d,n,s,i)+a+t[h]+mh[d]|0;a=i,i=s,s=bh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0};Cn.prototype._hash=function(){var e=gh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var yh=Cn,Eh=qr,Rc=Kr,Sh=Dt().Buffer,kh=[1518500249,1859775393,-1894007588,-899497514],Mh=new Array(80);function In(){this.init(),this._w=Mh,Rc.call(this,64,56)}Eh(In,Rc);In.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Rh(e){return e<<1|e>>>31}function Ch(e){return e<<5|e>>>27}function Ih(e){return e<<30|e>>>2}function xh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}In.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=Rh(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var h=0;h<80;++h){var d=~~(h/20),f=Ch(r)+xh(d,n,s,i)+a+t[h]+kh[d]|0;a=i,i=s,s=Ih(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0};In.prototype._hash=function(){var e=Sh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Ah=In,Nh=qr,Cc=Kr,Lh=Dt().Buffer,$h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Th=new Array(64);function xn(){this.init(),this._w=Th,Cc.call(this,64,56)}Nh(xn,Cc);xn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Ph(e,t,r){return r^e&(t^r)}function Oh(e,t,r){return e&t|r&(e|t)}function Bh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Dh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Fh(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function jh(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}xn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,a=this._e|0,c=this._f|0,h=this._g|0,d=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=jh(t[f-2])+t[f-7]+Fh(t[f-15])+t[f-16]|0;for(var g=0;g<64;++g){var w=d+Dh(a)+Ph(a,c,h)+$h[g]+t[g]|0,S=Bh(r)+Oh(r,n,s)|0;d=h,h=c,c=a,a=i+w|0,i=s,s=n,n=r,r=w+S|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=h+this._g|0,this._h=d+this._h|0};xn.prototype._hash=function(){var e=Lh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Ic=xn,Hh=qr,Uh=Ic,Vh=Kr,zh=Dt().Buffer,Wh=new Array(64);function ks(){this.init(),this._w=Wh,Vh.call(this,64,56)}Hh(ks,Uh);ks.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ks.prototype._hash=function(){var e=zh.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var qh=ks,Jh=qr,xc=Kr,Gh=Dt().Buffer,Fo=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Zh=new Array(160);function An(){this.init(),this._w=Zh,xc.call(this,128,112)}Jh(An,xc);An.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function jo(e,t,r){return r^e&(t^r)}function Ho(e,t,r){return e&t|r&(e|t)}function Uo(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Vo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Qh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Kh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Xh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Yh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Je(e,t){return e>>>0<t>>>0?1:0}An.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,s=this._ch|0,i=this._dh|0,a=this._eh|0,c=this._fh|0,h=this._gh|0,d=this._hh|0,f=this._al|0,g=this._bl|0,w=this._cl|0,S=this._dl|0,C=this._el|0,M=this._fl|0,I=this._gl|0,A=this._hl|0,x=0;x<32;x+=2)t[x]=e.readInt32BE(x*4),t[x+1]=e.readInt32BE(x*4+4);for(;x<160;x+=2){var R=t[x-30],B=t[x-15*2+1],N=Qh(R,B),P=Kh(B,R);R=t[x-2*2],B=t[x-2*2+1];var W=Xh(R,B),Y=Yh(B,R),Re=t[x-7*2],V=t[x-7*2+1],j=t[x-16*2],Z=t[x-16*2+1],E=P+V|0,o=N+Re+Je(E,P)|0;E=E+Y|0,o=o+W+Je(E,Y)|0,E=E+Z|0,o=o+j+Je(E,Z)|0,t[x]=o,t[x+1]=E}for(var u=0;u<160;u+=2){o=t[u],E=t[u+1];var p=Ho(r,n,s),m=Ho(f,g,w),v=Uo(r,f),y=Uo(f,r),k=Vo(a,C),_=Vo(C,a),l=Fo[u],b=Fo[u+1],T=jo(a,c,h),L=jo(C,M,I),$=A+_|0,K=d+k+Je($,A)|0;$=$+L|0,K=K+T+Je($,L)|0,$=$+b|0,K=K+l+Je($,b)|0,$=$+E|0,K=K+o+Je($,E)|0;var Q=y+m|0,X=v+p+Je(Q,y)|0;d=h,A=I,h=c,I=M,c=a,M=C,C=S+$|0,a=i+K+Je(C,S)|0,i=s,S=w,s=n,w=g,n=r,g=f,f=$+Q|0,r=K+X+Je(f,$)|0}this._al=this._al+f|0,this._bl=this._bl+g|0,this._cl=this._cl+w|0,this._dl=this._dl+S|0,this._el=this._el+C|0,this._fl=this._fl+M|0,this._gl=this._gl+I|0,this._hl=this._hl+A|0,this._ah=this._ah+r+Je(this._al,f)|0,this._bh=this._bh+n+Je(this._bl,g)|0,this._ch=this._ch+s+Je(this._cl,w)|0,this._dh=this._dh+i+Je(this._dl,S)|0,this._eh=this._eh+a+Je(this._el,C)|0,this._fh=this._fh+c+Je(this._fl,M)|0,this._gh=this._gh+h+Je(this._gl,I)|0,this._hh=this._hh+d+Je(this._hl,A)|0};An.prototype._hash=function(){var e=Gh.allocUnsafe(64);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ac=An,ed=qr,td=Ac,rd=Kr,nd=Dt().Buffer,sd=new Array(160);function Ms(){this.init(),this._w=sd,rd.call(this,128,112)}ed(Ms,td);Ms.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ms.prototype._hash=function(){var e=nd.allocUnsafe(48);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var id=Ms;(function(e){e.exports=function(r){var n=r.toLowerCase(),s=e.exports[n];if(!s)throw new Error(n+" is not supported (we accept pull requests)");return new s},e.exports.sha=yh,e.exports.sha1=Ah,e.exports.sha224=qh,e.exports.sha256=Ic,e.exports.sha384=id,e.exports.sha512=Ac})(Sc);var od=Sc.exports;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Session=void 0;const zo=od,Wo=O,qo="session:id",Jo="session:secret",Go="session:linked";class Ki{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Wo.randomBytesHex)(16),this._secret=n||(0,Wo.randomBytesHex)(32),this._key=new zo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(qo),n=t.getItem(Go),s=t.getItem(Jo);return r&&s?new Ki(t,r,s,n==="1"):null}static hash(t){return new zo.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(qo,this._id),this._storage.setItem(Jo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Go,this._linked?"1":"0")}}Qr.Session=Ki;var Rs={},Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Cipher=void 0;const Jn=O;class ad{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,Jn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),c=16,h=a.slice(a.byteLength-c),d=a.slice(0,a.byteLength-c),f=new Uint8Array(h),g=new Uint8Array(d),w=new Uint8Array([...n,...f,...g]);return(0,Jn.uint8ArrayToHex)(w)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Jn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,Jn.hexStringToUint8Array)(t),c=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),f=new Uint8Array([...d,...h]),g={name:"AES-GCM",iv:new Uint8Array(c)};try{const w=await window.crypto.subtle.decrypt(g,i,f),S=new TextDecoder;n(S.decode(w))}catch(w){s(w)}})()})}}Cs.Cipher=ad;var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.WalletLinkHTTP=void 0;class cd{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}Is.WalletLinkHTTP=cd;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.WalletLinkWebSocket=Fr.ConnectionState=void 0;var $r;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})($r||(Fr.ConnectionState=$r={}));class ld{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,$r.CONNECTING),s.onclose=i=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.DISCONNECTED)},s.onopen=i=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},s.onmessage=i=>{var a,c;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(i.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,$r.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Fr.WalletLinkWebSocket=ld;Object.defineProperty(Rs,"__esModule",{value:!0});Rs.WalletLinkConnection=void 0;const Ir=We,ud=Cs,vt=Zr,Zo=ut,xr=Qr,hd=Is,Gn=Fr,Qo=1e4,dd=6e4;class fd{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Ir.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>c.JsonRpcUrl&&this.handleChainUpdated(d,c.JsonRpcUrl)]]).forEach((d,f)=>{const g=c[f];g!==void 0&&d(g)})},this.handleDestroyed=c=>{var h,d;c==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:xr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var h,d;try{const f=await this.cipher.decrypt(c);(h=this.listener)===null||h===void 0||h.accountUpdated(f)}catch{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(c,g)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(Zo.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(Zo.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(c),w=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(g,w)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new ud.Cipher(t.secret),this.diagnostic=s,this.listener=n;const a=new Gn.WalletLinkWebSocket(`${r}/rpc`,i);a.setConnectionStateListener(async c=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:xr.Session.hash(t.id)});let d=!1;switch(c){case Gn.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(g=>setTimeout(g,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case Gn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Qo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Gn.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(c=>{var h,d,f;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const g=c.type==="IsLinkedOK"?c.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.LINKED,{sessionIdHash:xr.Session.hash(t.id),linked:g,type:c.type,onlineGuests:c.onlineGuests}),this.linked=g||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:xr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((f=this.requestResolutions.get(c.id))===null||f===void 0||f(c))}),this.ws=a,this.http=new hd.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.STARTED_CONNECTING,{sessionIdHash:xr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.DISCONNECTED,{sessionIdHash:xr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Qo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=dd){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,a)=>{s=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,a=>{clearTimeout(s),i(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Rs.WalletLinkConnection=fd;var Nn={},Ln={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.default=(()=>'@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')();var pd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.injectCssReset=void 0;const gd=pd(Xi);function md(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(gd.default)),document.documentElement.appendChild(e)}Ln.injectCssReset=md;var xs={},$n,te,Nc,Lc,nr,Ko,$c,Pi,Yi,Oi,Bi,Tc,_n={},Pc=[],_d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,As=Array.isArray;function xt(e,t){for(var r in t)e[r]=t[r];return e}function Oc(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Di(e,t,r){var n,s,i,a={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?$n.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return fn(e,a,n,s,null)}function fn(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Nc,__i:-1,__u:0};return s==null&&te.vnode!=null&&te.vnode(i),i}function vd(){return{current:null}}function Tn(e){return e.children}function pn(e,t){this.props=e,this.context=t}function jr(e,t){if(t==null)return e.__?jr(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?jr(e):null}function Bc(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Bc(e)}}function Fi(e){(!e.__d&&(e.__d=!0)&&nr.push(e)&&!hs.__r++||Ko!==te.debounceRendering)&&((Ko=te.debounceRendering)||$c)(hs)}function hs(){var e,t,r,n,s,i,a,c;for(nr.sort(Pi);e=nr.shift();)e.__d&&(t=nr.length,n=void 0,i=(s=(r=e).__v).__e,a=[],c=[],r.__P&&((n=xt({},s)).__v=s.__v+1,te.vnode&&te.vnode(n),eo(r.__P,n,s,r.__n,r.__P.namespaceURI,32&s.__u?[i]:null,a,i??jr(s),!!(32&s.__u),c),n.__v=s.__v,n.__.__k[n.__i]=n,Hc(a,n,c),n.__e!=i&&Bc(n)),nr.length>t&&nr.sort(Pi));hs.__r=0}function Dc(e,t,r,n,s,i,a,c,h,d,f){var g,w,S,C,M,I=n&&n.__k||Pc,A=t.length;for(r.__d=h,bd(r,t,I),h=r.__d,g=0;g<A;g++)(S=r.__k[g])!=null&&(w=S.__i===-1?_n:I[S.__i]||_n,S.__i=g,eo(e,S,w,s,i,a,c,h,d,f),C=S.__e,S.ref&&w.ref!=S.ref&&(w.ref&&to(w.ref,null,S),f.push(S.ref,S.__c||C,S)),M==null&&C!=null&&(M=C),65536&S.__u||w.__k===S.__k?h=Fc(S,h,e):typeof S.type=="function"&&S.__d!==void 0?h=S.__d:C&&(h=C.nextSibling),S.__d=void 0,S.__u&=-196609);r.__d=h,r.__e=M}function bd(e,t,r){var n,s,i,a,c,h=t.length,d=r.length,f=d,g=0;for(e.__k=[],n=0;n<h;n++)(s=t[n])!=null&&typeof s!="boolean"&&typeof s!="function"?(a=n+g,(s=e.__k[n]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?fn(null,s,null,null,null):As(s)?fn(Tn,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?fn(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,i=null,(c=s.__i=wd(s,r,a,f))!==-1&&(f--,(i=r[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&g--,typeof s.type!="function"&&(s.__u|=65536)):c!==a&&(c==a-1?g--:c==a+1?g++:(c>a?g--:g++,s.__u|=65536))):s=e.__k[n]=null;if(f)for(n=0;n<d;n++)(i=r[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=jr(i)),Uc(i,i))}function Fc(e,t,r){var n,s;if(typeof e.type=="function"){for(n=e.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=e,t=Fc(n[s],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=jr(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function jc(e,t){return t=t||[],e==null||typeof e=="boolean"||(As(e)?e.some(function(r){jc(r,t)}):t.push(e)),t}function wd(e,t,r,n){var s=e.key,i=e.type,a=r-1,c=r+1,h=t[r];if(h===null||h&&s==h.key&&i===h.type&&!(131072&h.__u))return r;if(n>(h!=null&&!(131072&h.__u)?1:0))for(;a>=0||c<t.length;){if(a>=0){if((h=t[a])&&!(131072&h.__u)&&s==h.key&&i===h.type)return a;a--}if(c<t.length){if((h=t[c])&&!(131072&h.__u)&&s==h.key&&i===h.type)return c;c++}}return-1}function Xo(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||_d.test(t)?r:r+"px"}function Zn(e,t,r,n,s){var i;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Xo(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Xo(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Yi,e.addEventListener(t,i?Bi:Oi,i)):e.removeEventListener(t,i?Bi:Oi,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Yo(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Yi++;else if(t.t<r.u)return;return r(te.event?te.event(t):t)}}}function eo(e,t,r,n,s,i,a,c,h,d){var f,g,w,S,C,M,I,A,x,R,B,N,P,W,Y,Re,V=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(h=!!(32&r.__u),i=[c=t.__e=r.__e]),(f=te.__b)&&f(t);e:if(typeof V=="function")try{if(A=t.props,x="prototype"in V&&V.prototype.render,R=(f=V.contextType)&&n[f.__c],B=f?R?R.props.value:f.__:n,r.__c?I=(g=t.__c=r.__c).__=g.__E:(x?t.__c=g=new V(A,B):(t.__c=g=new pn(A,B),g.constructor=V,g.render=Ed),R&&R.sub(g),g.props=A,g.state||(g.state={}),g.context=B,g.__n=n,w=g.__d=!0,g.__h=[],g._sb=[]),x&&g.__s==null&&(g.__s=g.state),x&&V.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=xt({},g.__s)),xt(g.__s,V.getDerivedStateFromProps(A,g.__s))),S=g.props,C=g.state,g.__v=t,w)x&&V.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),x&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(x&&V.getDerivedStateFromProps==null&&A!==S&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(A,B),!g.__e&&(g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(A,g.__s,B)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(g.props=A,g.state=g.__s,g.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(j){j&&(j.__=t)}),N=0;N<g._sb.length;N++)g.__h.push(g._sb[N]);g._sb=[],g.__h.length&&a.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(A,g.__s,B),x&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(S,C,M)})}if(g.context=B,g.props=A,g.__P=e,g.__e=!1,P=te.__r,W=0,x){for(g.state=g.__s,g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),Y=0;Y<g._sb.length;Y++)g.__h.push(g._sb[Y]);g._sb=[]}else do g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++W<25);g.state=g.__s,g.getChildContext!=null&&(n=xt(xt({},n),g.getChildContext())),x&&!w&&g.getSnapshotBeforeUpdate!=null&&(M=g.getSnapshotBeforeUpdate(S,C)),Dc(e,As(Re=f!=null&&f.type===Tn&&f.key==null?f.props.children:f)?Re:[Re],t,r,n,s,i,a,c,h,d),g.base=t.__e,t.__u&=-161,g.__h.length&&a.push(g),I&&(g.__E=g.__=null)}catch(j){if(t.__v=null,h||i!=null){for(t.__u|=h?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;i[i.indexOf(c)]=null,t.__e=c}else t.__e=r.__e,t.__k=r.__k;te.__e(j,t,r)}else i==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=yd(r.__e,t,r,n,s,i,a,h,d);(f=te.diffed)&&f(t)}function Hc(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)to(r[n],r[++n],r[++n]);te.__c&&te.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){te.__e(i,s.__v)}})}function yd(e,t,r,n,s,i,a,c,h){var d,f,g,w,S,C,M,I=r.props,A=t.props,x=t.type;if(x==="svg"?s="http://www.w3.org/2000/svg":x==="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((S=i[d])&&"setAttribute"in S==!!x&&(x?S.localName===x:S.nodeType===3)){e=S,i[d]=null;break}}if(e==null){if(x===null)return document.createTextNode(A);e=document.createElementNS(s,x,A.is&&A),c&&(te.__m&&te.__m(t,i),c=!1),i=null}if(x===null)I===A||c&&e.data===A||(e.data=A);else{if(i=i&&$n.call(e.childNodes),I=r.props||_n,!c&&i!=null)for(I={},d=0;d<e.attributes.length;d++)I[(S=e.attributes[d]).name]=S.value;for(d in I)if(S=I[d],d!="children"){if(d=="dangerouslySetInnerHTML")g=S;else if(!(d in A)){if(d=="value"&&"defaultValue"in A||d=="checked"&&"defaultChecked"in A)continue;Zn(e,d,null,S,s)}}for(d in A)S=A[d],d=="children"?w=S:d=="dangerouslySetInnerHTML"?f=S:d=="value"?C=S:d=="checked"?M=S:c&&typeof S!="function"||I[d]===S||Zn(e,d,S,I[d],s);if(f)c||g&&(f.__html===g.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(g&&(e.innerHTML=""),Dc(e,As(w)?w:[w],t,r,n,x==="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,a,i?i[0]:r.__k&&jr(r,0),c,h),i!=null)for(d=i.length;d--;)Oc(i[d]);c||(d="value",x==="progress"&&C==null?e.removeAttribute("value"):C!==void 0&&(C!==e[d]||x==="progress"&&!C||x==="option"&&C!==I[d])&&Zn(e,d,C,I[d],s),d="checked",M!==void 0&&M!==e[d]&&Zn(e,d,M,I[d],s))}return e}function to(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){te.__e(s,r)}}function Uc(e,t,r){var n,s;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||to(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){te.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&Uc(n[s],t,r||typeof e.type!="function");r||Oc(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Ed(e,t,r){return this.constructor(e,r)}function Vc(e,t,r){var n,s,i,a;te.__&&te.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],eo(t,e=(!n&&r||t).__k=Di(Tn,null,[e]),s||_n,_n,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?$n.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,a),Hc(i,e,a)}function zc(e,t){Vc(e,t,zc)}function Sd(e,t,r){var n,s,i,a,c=xt({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?s=t[i]:c[i]=t[i]===void 0&&a!==void 0?a[i]:t[i];return arguments.length>2&&(c.children=arguments.length>3?$n.call(arguments,2):r),fn(e.type,c,n||e.key,s||e.ref,null)}function kd(e,t){var r={__c:t="__cC"+Tc++,__:e,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=[],(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){s=null},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&s.some(function(c){c.__e=!0,Fi(c)})},this.sub=function(a){s.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){s&&s.splice(s.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}$n=Pc.slice,te={__e:function(e,t,r,n){for(var s,i,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),a=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),a=s.__d),a)return s.__E=s}catch(c){e=c}throw e}},Nc=0,Lc=function(e){return e!=null&&e.constructor==null},pn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=xt({},this.state),typeof e=="function"&&(e=e(xt({},r),this.props)),e&&xt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Fi(this))},pn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Fi(this))},pn.prototype.render=Tn,nr=[],$c=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pi=function(e,t){return e.__v.__b-t.__v.__b},hs.__r=0,Yi=0,Oi=Yo(!1),Bi=Yo(!0),Tc=0;const Md=Object.freeze(Object.defineProperty({__proto__:null,Component:pn,Fragment:Tn,cloneElement:Sd,createContext:kd,createElement:Di,createRef:vd,h:Di,hydrate:zc,get isValidElement(){return Lc},get options(){return te},render:Vc,toChildArray:jc},Symbol.toStringTag,{value:"Module"})),rt=qi(Md);var Ns={},Nt,ee,gi,ea,Hr=0,Wc=[],He=te,ta=He.__b,ra=He.__r,na=He.diffed,sa=He.__c,ia=He.unmount,oa=He.__;function dr(e,t){He.__h&&He.__h(ee,e,Hr||t),Hr=0;var r=ee.__H||(ee.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function qc(e){return Hr=1,Jc(Zc,e)}function Jc(e,t,r){var n=dr(Nt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Zc(void 0,t),function(c){var h=n.__N?n.__N[0]:n.__[0],d=n.t(h,c);h!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ee,!ee.u)){var s=function(c,h,d){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(w){return!!w.__c});if(f.every(function(w){return!w.__N}))return!i||i.call(this,c,h,d);var g=!1;return f.forEach(function(w){if(w.__N){var S=w.__[0];w.__=w.__N,w.__N=void 0,S!==w.__[0]&&(g=!0)}}),!(!g&&n.__c.props===c)&&(!i||i.call(this,c,h,d))};ee.u=!0;var i=ee.shouldComponentUpdate,a=ee.componentWillUpdate;ee.componentWillUpdate=function(c,h,d){if(this.__e){var f=i;i=void 0,s(c,h,d),i=f}a&&a.call(this,c,h,d)},ee.shouldComponentUpdate=s}return n.__N||n.__}function Rd(e,t){var r=dr(Nt++,3);!He.__s&&no(r.__H,t)&&(r.__=e,r.i=t,ee.__H.__h.push(r))}function Gc(e,t){var r=dr(Nt++,4);!He.__s&&no(r.__H,t)&&(r.__=e,r.i=t,ee.__h.push(r))}function Cd(e){return Hr=5,ro(function(){return{current:e}},[])}function Id(e,t,r){Hr=6,Gc(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function ro(e,t){var r=dr(Nt++,7);return no(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function xd(e,t){return Hr=8,ro(function(){return e},t)}function Ad(e){var t=ee.context[e.__c],r=dr(Nt++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(ee)),t.props.value):e.__}function Nd(e,t){He.useDebugValue&&He.useDebugValue(t?t(e):e)}function Ld(e){var t=dr(Nt++,10),r=qc();return t.__=e,ee.componentDidCatch||(ee.componentDidCatch=function(n,s){t.__&&t.__(n,s),r[1](n)}),[r[0],function(){r[1](void 0)}]}function $d(){var e=dr(Nt++,11);if(!e.__){for(var t=ee.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Td(){for(var e;e=Wc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ls),e.__H.__h.forEach(ji),e.__H.__h=[]}catch(t){e.__H.__h=[],He.__e(t,e.__v)}}He.__b=function(e){ee=null,ta&&ta(e)},He.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),oa&&oa(e,t)},He.__r=function(e){ra&&ra(e),Nt=0;var t=(ee=e.__c).__H;t&&(gi===ee?(t.__h=[],ee.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(ls),t.__h.forEach(ji),t.__h=[],Nt=0)),gi=ee},He.diffed=function(e){na&&na(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Wc.push(t)!==1&&ea===He.requestAnimationFrame||((ea=He.requestAnimationFrame)||Pd)(Td)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),gi=ee=null},He.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ls),r.__h=r.__h.filter(function(n){return!n.__||ji(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],He.__e(n,r.__v)}}),sa&&sa(e,t)},He.unmount=function(e){ia&&ia(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ls(n)}catch(s){t=s}}),r.__H=void 0,t&&He.__e(t,r.__v))};var aa=typeof requestAnimationFrame=="function";function Pd(e){var t,r=function(){clearTimeout(n),aa&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);aa&&(t=requestAnimationFrame(r))}function ls(e){var t=ee,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ee=t}function ji(e){var t=ee;e.__c=e.__(),ee=t}function no(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Zc(e,t){return typeof t=="function"?t(e):t}const Od=Object.freeze(Object.defineProperty({__proto__:null,useCallback:xd,useContext:Ad,useDebugValue:Nd,useEffect:Rd,useErrorBoundary:Ld,useId:$d,useImperativeHandle:Id,useLayoutEffect:Gc,useMemo:ro,useReducer:Jc,useRef:Cd,useState:qc},Symbol.toStringTag,{value:"Module"})),Ls=qi(Od);var Ur={},$s={};Object.defineProperty($s,"__esModule",{value:!0});$s.CloseIcon=void 0;const ca=rt;function Bd(e){return(0,ca.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ca.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"}))}$s.CloseIcon=Bd;var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.CoinbaseWalletRound=void 0;const Qn=rt;function Dd(e){return(0,Qn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Qn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Qn.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,Qn.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"}))}Ts.CoinbaseWalletRound=Dd;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.QRCodeIcon=void 0;const ln=rt;function Fd(e){return(0,ln.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,ln.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,ln.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,ln.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,ln.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Ps.QRCodeIcon=Fd;var Os={};function Qc(e){this.mode=it.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Qc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function kt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}kt.prototype={addData:function(e){var t=new Qc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=kt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=je.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var a=i*s,c=0;c<this.modules[i].length;c++){var h=c*s,d=this.modules[i][c];d&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+s,a),n.lineTo(h+s,a+s),n.lineTo(h,a+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=je.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var a=-2;a<=2;a++)i==-2||i==2||a==-2||a==2||i==0&&a==0?this.modules[n+i][s+a]=!0:this.modules[n+i][s+a]=!1}},setupTypeNumber:function(e){for(var t=je.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=je.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var h=!1;i<e.length&&(h=(e[i]>>>s&1)==1);var d=je.getMask(t,n,a-c);d&&(h=!h),this.modules[n][a-c]=h,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};kt.PAD0=236;kt.PAD1=17;kt.createData=function(e,t,r){for(var n=St.getRSBlocks(e,t),s=new Kc,i=0;i<r.length;i++){var a=r[i];s.put(a.mode,4),s.put(a.getLength(),je.getLengthInBits(a.mode,e)),a.write(s)}for(var c=0,i=0;i<n.length;i++)c+=n[i].dataCount;if(s.getLengthInBits()>c*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+c*8+")");for(s.getLengthInBits()+4<=c*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=c*8||(s.put(kt.PAD0,8),s.getLengthInBits()>=c*8));)s.put(kt.PAD1,8);return kt.createBytes(s,n)};kt.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c++){var h=t[c].dataCount,d=t[c].totalCount-h;n=Math.max(n,h),s=Math.max(s,d),i[c]=new Array(h);for(var f=0;f<i[c].length;f++)i[c][f]=255&e.buffer[f+r];r+=h;var g=je.getErrorCorrectPolynomial(d),w=new Tr(i[c],g.getLength()-1),S=w.mod(g);a[c]=new Array(g.getLength()-1);for(var f=0;f<a[c].length;f++){var C=f+S.getLength()-a[c].length;a[c][f]=C>=0?S.get(C):0}}for(var M=0,f=0;f<t.length;f++)M+=t[f].totalCount;for(var I=new Array(M),A=0,f=0;f<n;f++)for(var c=0;c<t.length;c++)f<i[c].length&&(I[A++]=i[c][f]);for(var f=0;f<s;f++)for(var c=0;c<t.length;c++)f<a[c].length&&(I[A++]=a[c][f]);return I};var it={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Pt={L:1,M:0,Q:3,H:2},Lt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},je={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;je.getBCHDigit(t)-je.getBCHDigit(je.G15)>=0;)t^=je.G15<<je.getBCHDigit(t)-je.getBCHDigit(je.G15);return(e<<10|t)^je.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;je.getBCHDigit(t)-je.getBCHDigit(je.G18)>=0;)t^=je.G18<<je.getBCHDigit(t)-je.getBCHDigit(je.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return je.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Lt.PATTERN000:return(t+r)%2==0;case Lt.PATTERN001:return t%2==0;case Lt.PATTERN010:return r%3==0;case Lt.PATTERN011:return(t+r)%3==0;case Lt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Lt.PATTERN101:return t*r%2+t*r%3==0;case Lt.PATTERN110:return(t*r%2+t*r%3)%2==0;case Lt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Tr([1],0),r=0;r<e;r++)t=t.multiply(new Tr([1,Ge.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case it.MODE_NUMBER:return 10;case it.MODE_ALPHA_NUM:return 9;case it.MODE_8BIT_BYTE:return 8;case it.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case it.MODE_NUMBER:return 12;case it.MODE_ALPHA_NUM:return 11;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case it.MODE_NUMBER:return 14;case it.MODE_ALPHA_NUM:return 13;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,a=e.isDark(n,s),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var h=-1;h<=1;h++)s+h<0||t<=s+h||c==0&&h==0||a==e.isDark(n+c,s+h)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var d=0;e.isDark(n,s)&&d++,e.isDark(n+1,s)&&d++,e.isDark(n,s+1)&&d++,e.isDark(n+1,s+1)&&d++,(d==0||d==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var f=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&f++;var g=Math.abs(100*f/t/t-50)/5;return r+=g*10,r}},Ge={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Ge.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Ge.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Qe=0;Qe<8;Qe++)Ge.EXP_TABLE[Qe]=1<<Qe;for(var Qe=8;Qe<256;Qe++)Ge.EXP_TABLE[Qe]=Ge.EXP_TABLE[Qe-4]^Ge.EXP_TABLE[Qe-5]^Ge.EXP_TABLE[Qe-6]^Ge.EXP_TABLE[Qe-8];for(var Qe=0;Qe<255;Qe++)Ge.LOG_TABLE[Ge.EXP_TABLE[Qe]]=Qe;function Tr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Tr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Ge.gexp(Ge.glog(this.get(r))+Ge.glog(e.get(n)));return new Tr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Ge.glog(this.get(0))-Ge.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Ge.gexp(Ge.glog(e.get(n))+t);return new Tr(r,0).mod(e)}};function St(e,t){this.totalCount=e,this.dataCount=t}St.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]];St.getRSBlocks=function(e,t){var r=St.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var a=r[i*3+0],c=r[i*3+1],h=r[i*3+2],d=0;d<a;d++)s.push(new St(c,h));return s};St.getRsBlockTable=function(e,t){switch(t){case Pt.L:return St.RS_BLOCK_TABLE[(e-1)*4+0];case Pt.M:return St.RS_BLOCK_TABLE[(e-1)*4+1];case Pt.Q:return St.RS_BLOCK_TABLE[(e-1)*4+2];case Pt.H:return St.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Kc(){this.buffer=[],this.length=0}Kc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mi=[[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 Xc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Pt.L;case"M":return Pt.M;case"Q":return Pt.Q;case"H":return Pt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var f=s(h),g=1,w=0,S=0,C=mi.length;S<=C;S++){var M=mi[S];if(!M)throw new Error("Content too long: expected "+w+" but got "+f);switch(d){case"L":w=M[0];break;case"M":w=M[1];break;case"Q":w=M[2];break;case"H":w=M[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(f<=w)break;g++}if(g>mi.length)throw new Error("Content too long");return g}function s(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var i=this.options.content,a=n(i,this.options.ecl),c=r(this.options.ecl);this.qrcode=new kt(a,c),this.qrcode.addData(i),this.qrcode.make()}Xc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r
|
|
2
2
|
`:"",a=t.width,c=t.height,h=r.length,d=a/(h+2*t.padding),f=c/(h+2*t.padding),g=typeof t.join<"u"?!!t.join:!1,w=typeof t.swap<"u"?!!t.swap:!1,S=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,C=typeof t.predefined<"u"?!!t.predefined:!1,M=C?s+'<defs><path id="qrmodule" d="M0 0 h'+f+" v"+d+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",I=s+'<rect x="0" y="0" width="'+a+'" height="'+c+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,A="",x="",R=0;R<h;R++)for(var B=0;B<h;B++){var N=r[B][R];if(N){var P=B*d+t.padding*d,W=R*f+t.padding*f;if(w){var Y=P;P=W,W=Y}if(g){var Re=d+P,V=f+W;P=Number.isInteger(P)?Number(P):P.toFixed(2),W=Number.isInteger(W)?Number(W):W.toFixed(2),Re=Number.isInteger(Re)?Number(Re):Re.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),x+="M"+P+","+W+" V"+V+" H"+Re+" V"+W+" H"+P+" Z "}else C?A+=s+'<use x="'+P.toString()+'" y="'+W.toString()+'" href="#qrmodule" />'+i:A+=s+'<rect x="'+P.toString()+'" y="'+W.toString()+'" width="'+d+'" height="'+f+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}g&&(A=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+x+'" />');let j="";if(this.options.image!==void 0&&this.options.image.svg){const E=a*this.options.image.width/100,o=c*this.options.image.height/100,u=a/2-E/2,p=c/2-o/2;j+=`<svg x="${u}" y="${p}" width="${E}" height="${o}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,j+=this.options.image.svg+i,j+="</svg>"}var Z="";switch(e.container){case"svg":S&&(Z+='<?xml version="1.0" standalone="yes"?>'+i),Z+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+c+'">'+i,Z+=M+I+A,Z+=j,Z+="</svg>";break;case"svg-viewbox":S&&(Z+='<?xml version="1.0" standalone="yes"?>'+i),Z+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+c+'">'+i,Z+=M+I+A,Z+=j,Z+="</svg>";break;case"g":Z+='<g width="'+a+'" height="'+c+'">'+i,Z+=M+I+A,Z+=j,Z+="</g>";break;default:Z+=(M+I+A+j).replace(/^\s+/,"");break}return Z};var jd=Xc,Hd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Os,"__esModule",{value:!0});Os.QRCode=void 0;const Ud=rt,la=Ls,Vd=Hd(jd),zd=e=>{const[t,r]=(0,la.useState)("");return(0,la.useEffect)(()=>{var n,s;const i=new Vd.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(s=e.height)!==null&&s!==void 0?s:256,padding:0,image:e.image}),a=U.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Ud.h)("img",{src:t,alt:"QR Code"}):null};Os.QRCode=zd;var Bs={},so={};Object.defineProperty(so,"__esModule",{value:!0});so.default=(()=>".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}")();var Wd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.Spinner=void 0;const Kn=rt,qd=Wd(so),Jd=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Kn.h)("div",{class:"-cbwsdk-spinner"},(0,Kn.h)("style",null,qd.default),(0,Kn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Kn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Bs.Spinner=Jd;var io={};Object.defineProperty(io,"__esModule",{value:!0});io.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}")();var Yc=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.CoinbaseWalletSteps=Ur.ConnectContent=void 0;const cr=Yc(wn),J=rt,Gd=O,Zd=Gr,Qd=$s,Kd=Ts,Xd=Ps,Yd=Os,e0=Bs,t0=Yc(io),_i={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:el},r0=e=>e==="light"?"#FFFFFF":"#0A0B0D";function n0(e){const{theme:t}=e,r=(0,Gd.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=_i.steps;return(0,J.h)("div",{"data-testid":"connect-content",className:(0,cr.default)("-cbwsdk-connect-content",t)},(0,J.h)("style",null,t0.default),(0,J.h)("div",{className:"-cbwsdk-connect-content-header"},(0,J.h)("h2",{className:(0,cr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,J.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,J.h)(Qd.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,J.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,J.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,J.h)(s0,{title:_i.title,description:_i.description,theme:t})),(0,J.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,J.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,J.h)(Yd.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,J.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Zd.LIB_VERSION}),(0,J.h)("input",{type:"hidden",value:r})),(0,J.h)(n,{theme:t}),!e.isConnected&&(0,J.h)("div",{"data-testid":"connecting-spinner",className:(0,cr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,J.h)(e0.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,J.h)("p",null,"Connecting...")))))}Ur.ConnectContent=n0;function s0({title:e,description:t,theme:r}){return(0,J.h)("div",{className:(0,cr.default)("-cbwsdk-connect-item",r)},(0,J.h)("div",null,(0,J.h)(Kd.CoinbaseWalletRound,null)),(0,J.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,J.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,J.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function el({theme:e}){return(0,J.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,J.h)("li",{className:(0,cr.default)("-cbwsdk-wallet-steps-item",e)},(0,J.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,J.h)("li",{className:(0,cr.default)("-cbwsdk-wallet-steps-item",e)},(0,J.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,J.h)("span",null,"Tap ",(0,J.h)("strong",null,"Scan")," "),(0,J.h)("span",{className:(0,cr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,J.h)(Xd.QRCodeIcon,{fill:r0(e)})))))}Ur.CoinbaseWalletSteps=el;var Ds={},Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ArrowLeftIcon=void 0;const ua=rt;function i0(e){return(0,ua.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,ua.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"}))}Fs.ArrowLeftIcon=i0;var js={};Object.defineProperty(js,"__esModule",{value:!0});js.LaptopIcon=void 0;const vi=rt;function o0(e){return(0,vi.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,vi.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,vi.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"}))}js.LaptopIcon=o0;var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.SafeIcon=void 0;const ha=rt;function a0(e){return(0,ha.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,ha.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"}))}Hs.SafeIcon=a0;var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.default=(()=>".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}")();var tl=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.TryExtensionContent=void 0;const Yt=tl(wn),ze=rt,bi=Ls,c0=Fs,l0=js,u0=Hs,h0=tl(oo);function d0({theme:e}){const[t,r]=(0,bi.useState)(!1),n=(0,bi.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,bi.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,ze.h)("div",{class:(0,Yt.default)("-cbwsdk-try-extension",e)},(0,ze.h)("style",null,h0.default),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("h3",{class:(0,Yt.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,ze.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ze.h)("button",{class:(0,Yt.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,ze.h)("div",null,!t&&(0,ze.h)(c0.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(l0.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(u0.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Ds.TryExtensionContent=d0;var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}")();var rl=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.ConnectDialog=void 0;const wi=rl(wn),er=rt,yi=Ls,f0=Ur,p0=Ds,g0=rl(ao),m0=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,yi.useState)(!t),[i,a]=(0,yi.useState)(!t);(0,yi.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!t)},10)];return t?s(!1):h.push(window.setTimeout(()=>{s(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[t]);const c=r?"dark":"light";return(0,er.h)("div",{class:(0,wi.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,er.h)("style",null,g0.default),(0,er.h)("div",{class:(0,wi.default)("-cbwsdk-connect-dialog-backdrop",c,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,er.h)("div",{class:"-cbwsdk-connect-dialog"},(0,er.h)("div",{class:(0,wi.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,er.h)(f0.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,er.h)(p0.TryExtensionContent,{theme:c}))))};Ns.ConnectDialog=m0;Object.defineProperty(xs,"__esModule",{value:!0});xs.LinkFlow=void 0;const Ei=rt,_0=Ns;class v0{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Ei.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ei.render)((0,Ei.h)(_0.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)}}xs.LinkFlow=v0;var co={},lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.default=(()=>".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}")();(function(e){var t=D&&D.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(wn),n=rt,s=Ls,i=t(lo),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(w){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=w.darkMode}attach(w){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",w.appendChild(this.root),this.render()}presentItem(w){const S=this.nextItemKey++;return this.items.set(S,w),this.render(),()=>{this.items.delete(S),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([w,S])=>(0,n.h)(e.SnackbarInstance,Object.assign({},S,{key:w}))))),this.root)}}e.Snackbar=h;const d=g=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},g.children));e.SnackbarContainer=d;const f=({autoExpand:g,message:w,menuItems:S})=>{const[C,M]=(0,s.useState)(!0),[I,A]=(0,s.useState)(g??!1);(0,s.useEffect)(()=>{const R=[window.setTimeout(()=>{M(!1)},1),window.setTimeout(()=>{A(!0)},1e4)];return()=>{R.forEach(window.clearTimeout)}});const x=()=>{A(!I)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",C&&"-cbwsdk-snackbar-instance-hidden",I&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:x},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},w),(0,n.h)("div",{class:"-gear-container"},!I&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),S&&S.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},S.map((R,B)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:R.onClick,key:B},(0,n.h)("svg",{width:R.svgWidth,height:R.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":R.defaultFillRule,"clip-rule":R.defaultClipRule,d:R.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},R.info)))))};e.SnackbarInstance=f})(co);Object.defineProperty(Nn,"__esModule",{value:!0});Nn.WalletLinkRelayUI=void 0;const b0=Ln,w0=xs,y0=co;class E0{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new y0.Snackbar({darkMode:t.darkMode}),this.linkFlow=new w0.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,b0.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Nn.WalletLinkRelayUI=E0;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.WalletLinkRelay=void 0;const Ar=yn,S0=We,Fe=O,tr=Zr,da=ut,$t=Qr,k0=Rs,rr=Jr,M0=Nn;class It extends da.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var c;this.isLinked=a;const h=this.storage.getItem(da.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const d=h.split(" "),f=this.storage.getItem("IsStandaloneSigning")==="true";if(d[0]!==""&&!a&&this.session.linked&&!f){this.isUnlinkedErrorState=!0;const g=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(tr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:g})}}},this.metadataUpdated=(a,c)=>{this.storage.setItem(a,c)},this.chainUpdated=(a,c)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:a,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(a,c))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),It.accountRequestCallbackIds.size>0&&(Array.from(It.accountRequestCallbackIds.values()).forEach(c=>{const h={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:c}))}),It.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:s,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=s}subscribe(){const t=$t.Session.load(this.storage)||new $t.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new k0.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:a}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:a,session:t});return s.connect(),{session:t,ui:c,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(tr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=$t.Session.load(this.storage);if((s==null?void 0:s.id)===this._session.id?this.storage.clear():s&&((r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:$t.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:a,connection:c}=this.subscribe();this._session=i,this.connection=c,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Fe.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Fe.hexStringFromBuffer)(t,!0),signature:(0,Fe.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Fe.bigIntStringFromBN)(t.weiValue),data:(0,Fe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Fe.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Fe.bigIntStringFromBN)(t.weiValue),data:(0,Fe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Fe.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Fe.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Fe.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Fe.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Fe.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Fe.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r==null||r()};return{promise:new Promise((a,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r==null||r(),(0,rr.isErrorResponse)(h))return c(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:s}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof M0.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=$t.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(tr.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?$t.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(tr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?$t.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){It.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),It.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,s){var i;const a=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:(0,Ar.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:a,errorCode:s}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Fe.randomBytesHex)(8),n=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,i)};return{promise:new Promise((i,a)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,rr.isErrorResponse)(c))return a(new Error(c.errorMessage));i(c)}),this.ui.inlineAccountsResponse()){const c=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=Ar.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}It.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Fe.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},i=new Promise((a,c)=>{this.relayEventManager.callbacks.set(n,f=>{if((0,rr.isErrorResponse)(f))return c(new Error(f.errorMessage));a(f)});const h=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:S0.ProviderType.Unselected}})},d=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:f}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:d,onCancel:h,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,a){const c={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:a}};let h=null;const d=(0,Fe.randomBytesHex)(8),f=w=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,c.method,w),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload}));const g=new Promise((w,S)=>{this.relayEventManager.callbacks.set(d,I=>{if(h==null||h(),(0,rr.isErrorResponse)(I))return S(new Error(I.errorMessage));w(I)});const C=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!1}})},M=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:M,onCancel:C,type:t,address:r,symbol:n,decimals:s,image:i,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,c)});return{cancel:f,promise:g}}addEthereumChain(t,r,n,s,i,a){const c={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:a}};let h=null;const d=(0,Fe.randomBytesHex)(8),f=w=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,c.method,w),h==null||h()};return this.ui.inlineAddEthereumChain(t)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload})),{promise:new Promise((w,S)=>{this.relayEventManager.callbacks.set(d,I=>{if(h==null||h(),(0,rr.isErrorResponse)(I))return S(new Error(I.errorMessage));w(I)});const C=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},M=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:I}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:C,onApprove:M,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,c)}),cancel:f}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,Fe.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,c)};return{promise:new Promise((c,h)=>{this.relayEventManager.callbacks.set(s,g=>{if((0,rr.isErrorResponse)(g)&&g.errorCode)return h(Ar.standardErrors.provider.custom({code:g.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,rr.isErrorResponse)(g))return h(new Error(g.errorMessage));c(g)});const d=g=>{var w;if(g){const S=(w=(0,Ar.getErrorCode)(g))!==null&&w!==void 0?w:Ar.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",g instanceof Error?g:Ar.standardErrors.provider.unsupportedChain(t),S)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},f=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:g}}})};this.ui.switchEthereumChain({onCancel:d,onApprove:f,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(s,n)}),cancel:i}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return $t.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=i=>{this.handleErrorResponse(t,r.method,i)},s=i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:i})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:s,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:s});break;default:n();break}}}Rn.WalletLinkRelay=It;It.accountRequestCallbackIds=new Set;var Pn={},Us={},nl={};(function(e){var t=D&&D.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,c)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=D&&D.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(co,e)})(nl);var uo={};Object.defineProperty(uo,"__esModule",{value:!0});uo.default=(()=>".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}")();var sl=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.RedirectDialog=void 0;const R0=sl(wn),Et=rt,C0=Ln,I0=nl,x0=sl(uo);class A0{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,C0.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Et.render)(null,this.root),t&&(0,Et.render)((0,Et.h)(N0,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Us.RedirectDialog=A0;const N0=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,Et.h)(I0.SnackbarContainer,{darkMode:r},(0,Et.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Et.h)("style",null,x0.default),(0,Et.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,Et.h)("div",{class:(0,R0.default)("-cbwsdk-redirect-dialog-box",i)},(0,Et.h)("p",null,e),(0,Et.h)("button",{onClick:n},t))))};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.MobileRelayUI=void 0;const L0=Us;class $0{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new L0.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Pn.MobileRelayUI=$0;Object.defineProperty(Mn,"__esModule",{value:!0});Mn.MobileRelay=void 0;const T0=O,P0=Rn,O0=Pn;class B0 extends P0.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,T0.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof O0.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Mn.MobileRelay=B0;const{Transform:D0}=lc();var F0=e=>class il extends D0{constructor(r,n,s,i,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._hashBitLength=i,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(a){i=a}s(i)}_flush(r){let n=null;try{this.push(this.digest())}catch(s){n=s}r(n)}update(r,n){if(!U.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return U.isBuffer(r)||(r=U.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new il(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:j0}=lc();var H0=e=>class ol extends j0{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(a){i=a}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!U.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return U.isBuffer(r)||(r=U.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(r);return n!==void 0&&(s=s.toString(n)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ol(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const U0=F0,V0=H0;var z0=function(e){const t=U0(e),r=V0(e);return function(n,s){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,s);case"keccak256":return new t(1088,512,null,256,s);case"keccak384":return new t(832,768,null,384,s);case"keccak512":return new t(576,1024,null,512,s);case"sha3-224":return new t(1152,448,6,224,s);case"sha3-256":return new t(1088,512,6,256,s);case"sha3-384":return new t(832,768,6,384,s);case"sha3-512":return new t(576,1024,6,512,s);case"shake128":return new r(1344,256,31,s);case"shake256":return new r(1088,512,31,s);default:throw new Error("Invald algorithm: "+n)}}},al={};const fa=[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];al.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],g=e[9]^e[19]^e[29]^e[39]^e[49];let w=f^(s<<1|i>>>31),S=g^(i<<1|s>>>31);const C=e[0]^w,M=e[1]^S,I=e[10]^w,A=e[11]^S,x=e[20]^w,R=e[21]^S,B=e[30]^w,N=e[31]^S,P=e[40]^w,W=e[41]^S;w=r^(a<<1|c>>>31),S=n^(c<<1|a>>>31);const Y=e[2]^w,Re=e[3]^S,V=e[12]^w,j=e[13]^S,Z=e[22]^w,E=e[23]^S,o=e[32]^w,u=e[33]^S,p=e[42]^w,m=e[43]^S;w=s^(h<<1|d>>>31),S=i^(d<<1|h>>>31);const v=e[4]^w,y=e[5]^S,k=e[14]^w,_=e[15]^S,l=e[24]^w,b=e[25]^S,T=e[34]^w,L=e[35]^S,$=e[44]^w,K=e[45]^S;w=a^(f<<1|g>>>31),S=c^(g<<1|f>>>31);const Q=e[6]^w,X=e[7]^S,rn=e[16]^w,Ce=e[17]^S,Ie=e[26]^w,nn=e[27]^S,xe=e[36]^w,Ae=e[37]^S,sn=e[46]^w,Ne=e[47]^S;w=h^(r<<1|n>>>31),S=d^(n<<1|r>>>31);const Le=e[8]^w,on=e[9]^S,$e=e[18]^w,Te=e[19]^S,an=e[28]^w,Pe=e[29]^S,Oe=e[38]^w,cn=e[39]^S,Be=e[48]^w,De=e[49]^S,gr=C,re=M,ne=A<<4|I>>>28,mr=I<<4|A>>>28,se=x<<3|R>>>29,ie=R<<3|x>>>29,_r=N<<9|B>>>23,oe=B<<9|N>>>23,ae=P<<18|W>>>14,vr=W<<18|P>>>14,ce=Y<<1|Re>>>31,le=Re<<1|Y>>>31,br=j<<12|V>>>20,ue=V<<12|j>>>20,he=Z<<10|E>>>22,wr=E<<10|Z>>>22,de=u<<13|o>>>19,fe=o<<13|u>>>19,yr=p<<2|m>>>30,pe=m<<2|p>>>30,ge=y<<30|v>>>2,Er=v<<30|y>>>2,me=k<<6|_>>>26,_e=_<<6|k>>>26,Sr=b<<11|l>>>21,ve=l<<11|b>>>21,be=T<<15|L>>>17,kr=L<<15|T>>>17,we=K<<29|$>>>3,ye=$<<29|K>>>3,Mr=Q<<28|X>>>4,Ee=X<<28|Q>>>4,Se=Ce<<23|rn>>>9,Rr=rn<<23|Ce>>>9,ke=Ie<<25|nn>>>7,Me=nn<<25|Ie>>>7,Ft=xe<<21|Ae>>>11,jt=Ae<<21|xe>>>11,Ht=Ne<<24|sn>>>8,Ut=sn<<24|Ne>>>8,Vt=Le<<27|on>>>5,zt=on<<27|Le>>>5,Wt=$e<<20|Te>>>12,qt=Te<<20|$e>>>12,Jt=Pe<<7|an>>>25,Gt=an<<7|Pe>>>25,Zt=Oe<<8|cn>>>24,Qt=cn<<8|Oe>>>24,Kt=Be<<14|De>>>18,Xt=De<<14|Be>>>18;e[0]=gr^~br&Sr,e[1]=re^~ue&ve,e[10]=Mr^~Wt&se,e[11]=Ee^~qt&ie,e[20]=ce^~me&ke,e[21]=le^~_e&Me,e[30]=Vt^~ne&he,e[31]=zt^~mr&wr,e[40]=ge^~Se&Jt,e[41]=Er^~Rr&Gt,e[2]=br^~Sr&Ft,e[3]=ue^~ve&jt,e[12]=Wt^~se&de,e[13]=qt^~ie&fe,e[22]=me^~ke&Zt,e[23]=_e^~Me&Qt,e[32]=ne^~he&be,e[33]=mr^~wr&kr,e[42]=Se^~Jt&_r,e[43]=Rr^~Gt&oe,e[4]=Sr^~Ft&Kt,e[5]=ve^~jt&Xt,e[14]=se^~de&we,e[15]=ie^~fe&ye,e[24]=ke^~Zt&ae,e[25]=Me^~Qt&vr,e[34]=he^~be&Ht,e[35]=wr^~kr&Ut,e[44]=Jt^~_r&yr,e[45]=Gt^~oe&pe,e[6]=Ft^~Kt&gr,e[7]=jt^~Xt&re,e[16]=de^~we&Mr,e[17]=fe^~ye&Ee,e[26]=Zt^~ae&ce,e[27]=Qt^~vr&le,e[36]=be^~Ht&Vt,e[37]=kr^~Ut&zt,e[46]=_r^~yr&ge,e[47]=oe^~pe&Er,e[8]=Kt^~gr&br,e[9]=Xt^~re&ue,e[18]=we^~Mr&Wt,e[19]=ye^~Ee&qt,e[28]=ae^~ce&me,e[29]=vr^~le&_e,e[38]=Ht^~Vt&ne,e[39]=Ut^~zt&mr,e[48]=yr^~ge&Se,e[49]=pe^~Er&Rr,e[0]^=fa[t*2],e[1]^=fa[t*2+1]}};const ds=al;function Xr(){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}Xr.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Xr.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(ds.p1600(this.state),this.count=0)};Xr.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&ds.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),ds.p1600(this.state),this.count=0,this.squeezing=!0};Xr.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=U.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(ds.p1600(this.state),this.count=0);return t};Xr.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var W0=Xr,q0=z0(W0);const J0=q0,G0=_s;function cl(e){return U.allocUnsafe(e).fill(0)}function ll(e,t,r){const n=cl(t);return e=Vs(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Z0(e,t){return ll(e,t,!0)}function Vs(e){if(!U.isBuffer(e))if(Array.isArray(e))e=U.from(e);else if(typeof e=="string")ul(e)?e=U.from(X0(hl(e)),"hex"):e=U.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=U.allocUnsafe(0);else if(G0.isBN(e))e=e.toArrayLike(U);else if(e.toArray)e=U.from(e.toArray());else throw new Error("invalid type");return e}function Q0(e){return e=Vs(e),"0x"+e.toString("hex")}function K0(e,t){return e=Vs(e),t||(t=256),J0("keccak"+t).update(e).digest()}function X0(e){return e.length%2?"0"+e:e}function ul(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function hl(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var dl={zeros:cl,setLength:ll,setLengthRight:Z0,isHexString:ul,stripHexPrefix:hl,toBuffer:Vs,bufferToHex:Q0,keccak:K0};const lr=dl,or=_s;function fl(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Pr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function pa(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function pl(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function sr(e){var t=typeof e;if(t==="string")return lr.isHexString(e)?new or(lr.stripHexPrefix(e),16):new or(e,10);if(t==="number")return new or(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function yt(e,t){var r,n,s,i;if(e==="address")return yt("uint160",sr(t));if(e==="bool")return yt("uint8",t?1:0);if(e==="string")return yt("bytes",new U(t,"utf8"));if(ef(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=pl(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);s=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(i in t)s.push(yt(e,t[i]));if(r==="dynamic"){var a=yt("uint256",t.length);s.unshift(a)}return U.concat(s)}else{if(e==="bytes")return t=new U(t),s=U.concat([yt("uint256",t.length),t]),t.length%32!==0&&(s=U.concat([s,lr.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=Pr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return lr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Pr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=sr(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(U,"be",32)}else if(e.startsWith("int")){if(r=Pr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=sr(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(U,"be",32)}else if(e.startsWith("ufixed")){if(r=pa(e),n=sr(t),n<0)throw new Error("Supplied ufixed is negative");return yt("uint256",n.mul(new or(2).pow(new or(r[1]))))}else if(e.startsWith("fixed"))return r=pa(e),yt("int256",sr(t).mul(new or(2).pow(new or(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Y0(e){return e==="string"||e==="bytes"||pl(e)==="dynamic"}function ef(e){return e.lastIndexOf("]")===e.length-1}function tf(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var a=fl(e[i]),c=t[i],h=yt(a,c);Y0(a)?(r.push(yt("uint256",s)),n.push(h),s+=h.length):r.push(h)}return U.concat(r.concat(n))}function gl(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,s=[],i=0;i<e.length;i++){var a=fl(e[i]),c=t[i];if(a==="bytes")s.push(c);else if(a==="string")s.push(new U(c,"utf8"));else if(a==="bool")s.push(new U(c?"01":"00","hex"));else if(a==="address")s.push(lr.setLength(c,20));else if(a.startsWith("bytes")){if(r=Pr(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(lr.setLengthRight(c,r))}else if(a.startsWith("uint")){if(r=Pr(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=sr(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());s.push(n.toArrayLike(U,"be",r/8))}else if(a.startsWith("int")){if(r=Pr(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=sr(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());s.push(n.toTwos(r).toArrayLike(U,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return U.concat(s)}function rf(e,t){return lr.keccak(gl(e,t))}var nf={rawEncode:tf,solidityPack:gl,soliditySHA3:rf};const pt=dl,gn=nf,ml={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"]},Si={encodeData(e,t,r,n=!0){const s=["bytes32"],i=[this.hashType(e,r)];if(n){const a=(c,h,d)=>{if(r[h]!==void 0)return["bytes32",d==null?"0x0000000000000000000000000000000000000000000000000000000000000000":pt.keccak(this.encodeData(h,d,r,n))];if(d===void 0)throw new Error(`missing value for field ${c} of type ${h}`);if(h==="bytes")return["bytes32",pt.keccak(d)];if(h==="string")return typeof d=="string"&&(d=U.from(d,"utf8")),["bytes32",pt.keccak(d)];if(h.lastIndexOf("]")===h.length-1){const f=h.slice(0,h.lastIndexOf("[")),g=d.map(w=>a(c,f,w));return["bytes32",pt.keccak(gn.rawEncode(g.map(([w])=>w),g.map(([,w])=>w)))]}return[h,d]};for(const c of r[e]){const[h,d]=a(c.name,c.type,t[c.name]);s.push(h),i.push(d)}}else for(const a of r[e]){let c=t[a.name];if(c!==void 0)if(a.type==="bytes")s.push("bytes32"),c=pt.keccak(c),i.push(c);else if(a.type==="string")s.push("bytes32"),typeof c=="string"&&(c=U.from(c,"utf8")),c=pt.keccak(c),i.push(c);else if(r[a.type]!==void 0)s.push("bytes32"),c=pt.keccak(this.encodeData(a.type,c,r,n)),i.push(c);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(c)}}return gn.rawEncode(s,i)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(s=>s!==e);n=[e].concat(n.sort());for(const s of n){if(!t[s])throw new Error("No type definition specified: "+s);r+=s+"("+t[s].map(({name:a,type:c})=>c+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const s of this.findTypeDependencies(n.type,t,r))!r.includes(s)&&r.push(s);return r},hashStruct(e,t,r,n=!0){return pt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return pt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in ml.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[U.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),pt.keccak(U.concat(n))}};var sf={TYPED_MESSAGE_SCHEMA:ml,TypedDataUtils:Si,hashForSignTypedDataLegacy:function(e){return of(e.data)},hashForSignTypedData_v3:function(e){return Si.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Si.hash(e.data)}};function of(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(i){return i.type==="bytes"?pt.toBuffer(i.value):i.value}),n=e.map(function(i){return i.type}),s=e.map(function(i){if(!i.name)throw t;return i.type+" "+i.name});return gn.soliditySHA3(["bytes32","bytes32"],[gn.soliditySHA3(new Array(e.length).fill("string"),s),gn.soliditySHA3(n,r)])}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.filterFromParam=Vr.FilterPolyfill=void 0;const Lr=We,Ye=O,af=5*60*1e3,ir={jsonrpc:"2.0",id:0};class cf{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Lr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=_l(t),n=this.makeFilterId(),s=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",s),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ye.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Ye.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Ye.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,Ye.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,Ye.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Xn())}async getFilterLogs(t){const r=(0,Ye.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_getLogs",params:[ga(n)]})):Xn()}makeFilterId(){return(0,Lr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(s,i)=>{if(s)return n(s);if(Array.isArray(i)||i==null)return n(new Error(`unexpected response received: ${JSON.stringify(i)}`));r(i)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return Xn();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return Yn();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_getLogs",params:[ga(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(a.result)){const c=a.result.map(d=>(0,Ye.intNumberFromHexString)(d.blockNumber||"0x0")),h=Math.max(...c);if(h&&h>n){const d=(0,Lr.IntNumber)(h+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${d}`),this.cursors.set(t,d)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Xn();const n=await this.getCurrentBlockHeight();if(r>n)return Yn();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,Ye.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Lr.IntNumber)(a))))).filter(a=>!!a),i=(0,Lr.IntNumber)(r+s.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},ir),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Yn())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),s=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,s),s}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},af);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_blockNumber",params:[]}));return(0,Ye.intNumberFromHexString)((0,Ye.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_getBlockByNumber",params:[(0,Ye.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ye.ensureHexString)(r.result.hash):null}}Vr.FilterPolyfill=cf;function _l(e){return{fromBlock:ma(e.fromBlock),toBlock:ma(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Vr.filterFromParam=_l;function ga(e){const t={fromBlock:_a(e.fromBlock),toBlock:_a(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function ma(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Lr.IntNumber)(0);if((0,Ye.isHexString)(e))return(0,Ye.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function _a(e){return e==="latest"?e:(0,Ye.hexStringFromIntNumber)(e)}function Xn(){return Object.assign(Object.assign({},ir),{error:{code:-32e3,message:"filter not found"}})}function Yn(){return Object.assign(Object.assign({},ir),{result:[]})}var zs={},vl={},Ws={},ho=lf;function lf(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const va=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let s=0;s<arguments.length;s++)n[s]=arguments[s];return new r((s,i)=>{t.errorFirst?n.push(function(a,c){if(t.multiArgs){const h=new Array(arguments.length-1);for(let d=1;d<arguments.length;d++)h[d-1]=arguments[d];a?(h.unshift(a),i(h)):s(h)}else a?i(a):s(c)}):n.push(function(a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let h=0;h<arguments.length;h++)c[h]=arguments[h];s(c)}else s(a)}),e.apply(this,n)})};var uf=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=s=>{const i=a=>typeof a=="string"?s===a:a.test(s);return t.include?t.include.some(i):!t.exclude.some(i)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):va(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const s in e){const i=e[s];n[s]=typeof i=="function"&&r(s)?va(i,t):i}return n},On={},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});const hf=cc;function ba(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function df(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let ff=class extends hf.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")ba(i,this,r);else{const a=i.length,c=df(i);for(let h=0;h<a;h+=1)ba(c[h],this,r)}return!0}};Bn.default=ff;var pf=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(On,"__esModule",{value:!0});On.BaseBlockTracker=void 0;const gf=pf(Bn),mf=1e3,_f=(e,t)=>e+t,wa=["sync","latest"];class vf extends gf.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*mf,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){wa.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return wa.map(t=>this.listenerCount(t)).reduce(_f)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=ya(t),s=ya(r);return this._usePastBlocks&&n<s||n>s}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}On.BaseBlockTracker=vf;function ya(e){return Number.parseInt(e,16)}var bl={},wl={},Ke={};class yl extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...a}=t,{path:c}=t,h=c.length===0?s:`At path: ${c.join(".")} -- ${s}`;super(i??h),i!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function bf(e){return dt(e)&&typeof e[Symbol.iterator]=="function"}function dt(e){return typeof e=="object"&&e!=null}function Ea(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function qe(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function wf(e){const{done:t,value:r}=e.next();return t?void 0:r}function yf(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:i}=t,{type:a}=r,{refinement:c,message:h=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${qe(n)}\``}=e;return{value:n,type:a,refinement:c,key:s[s.length-1],path:s,branch:i,...e,message:h}}function*Hi(e,t,r,n){bf(e)||(e=[e]);for(const s of e){const i=yf(s,t,r,n);i&&(yield i)}}function*fo(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:a=!1}=r,c={path:n,branch:s};if(i&&(e=t.coercer(e,c),a&&t.type!=="type"&&dt(t.schema)&&dt(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let h="valid";for(const d of t.validator(e,c))d.explanation=r.message,h="not_valid",yield[d,void 0];for(let[d,f,g]of t.entries(e,c)){const w=fo(f,g,{path:d===void 0?n:[...n,d],branch:d===void 0?s:[...s,f],coerce:i,mask:a,message:r.message});for(const S of w)S[0]?(h=S[0].refinement!=null?"not_refined":"not_valid",yield[S[0],void 0]):i&&(f=S[1],d===void 0?e=f:e instanceof Map?e.set(d,f):e instanceof Set?e.add(f):dt(e)&&(f!==void 0||d in e)&&(e[d]=f))}if(h!=="not_valid")for(const d of t.refiner(e,c))d.explanation=r.message,h="not_refined",yield[d,void 0];h==="valid"&&(yield[void 0,e])}class Ve{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:a=h=>h,entries:c=function*(){}}=t;this.type=r,this.schema=n,this.entries=c,this.coercer=a,s?this.validator=(h,d)=>{const f=s(h,d);return Hi(f,d,this,h)}:this.validator=()=>[],i?this.refiner=(h,d)=>{const f=i(h,d);return Hi(f,d,this,h)}:this.refiner=()=>[]}assert(t,r){return El(t,this,r)}create(t,r){return Sl(t,this,r)}is(t){return po(t,this)}mask(t,r){return kl(t,this,r)}validate(t,r={}){return Yr(t,this,r)}}function El(e,t,r){const n=Yr(e,t,{message:r});if(n[0])throw n[0]}function Sl(e,t,r){const n=Yr(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function kl(e,t,r){const n=Yr(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function po(e,t){return!Yr(e,t)[0]}function Yr(e,t,r={}){const n=fo(e,t,r),s=wf(n);return s[0]?[new yl(s[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,s[1]]}function Ef(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?Fn(n):Dn(n)}function nt(e,t){return new Ve({type:e,schema:null,validator:t})}function Sf(e,t){return new Ve({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function kf(e){return new Ve({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function Mf(e){let t;return new Ve({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function Rf(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return Fn(n);default:return Dn(n)}}function Cf(e){const t=e instanceof Ve,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Ml(r[n]);return t&&e.type==="type"?Fn(r):Dn(r)}function If(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];switch(e.type){case"type":return Fn(n);default:return Dn(n)}}function xf(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),nt(e,t)}function Af(){return nt("any",()=>!0)}function Nf(e){return new Ve({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${qe(t)}`}})}function Lf(){return nt("bigint",e=>typeof e=="bigint")}function $f(){return nt("boolean",e=>typeof e=="boolean")}function Tf(){return nt("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${qe(e)}`)}function Pf(e){const t={},r=e.map(n=>qe(n)).join();for(const n of e)t[n]=n;return new Ve({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${qe(n)}`}})}function Of(){return nt("func",e=>typeof e=="function"||`Expected a function, but received: ${qe(e)}`)}function Bf(e){return nt("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${qe(t)}`)}function Df(){return nt("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${qe(e)}`)}function Ff(e){return new Ve({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function jf(e){const t=qe(e),r=typeof e;return new Ve({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${qe(n)}`}})}function Hf(e,t){return new Ve({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${qe(r)}`}})}function go(){return nt("never",()=>!1)}function Uf(e){return new Ve({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function Vf(){return nt("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${qe(e)}`)}function Dn(e){const t=e?Object.keys(e):[],r=go();return new Ve({type:"object",schema:e||null,*entries(n){if(e&&dt(n)){const s=new Set(Object.keys(n));for(const i of t)s.delete(i),yield[i,n[i],e[i]];for(const i of s)yield[i,n[i],r]}},validator(n){return dt(n)||`Expected an object, but received: ${qe(n)}`},coercer(n){return dt(n)?{...n}:n}})}function Ml(e){return new Ve({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function zf(e,t){return new Ve({type:"record",schema:null,*entries(r){if(dt(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return dt(r)||`Expected an object, but received: ${qe(r)}`}})}function Wf(){return nt("regexp",e=>e instanceof RegExp)}function qf(e){return new Ve({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${qe(t)}`}})}function Rl(){return nt("string",e=>typeof e=="string"||`Expected a string, but received: ${qe(e)}`)}function Jf(e){const t=go();return new Ve({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${qe(r)}`}})}function Fn(e){const t=Object.keys(e);return new Ve({type:"type",schema:e,*entries(r){if(dt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return dt(r)||`Expected an object, but received: ${qe(r)}`},coercer(r){return dt(r)?{...r}:r}})}function Gf(e){const t=e.map(r=>r.type).join(" | ");return new Ve({type:"union",schema:null,coercer(r){for(const n of e){const[s,i]=n.validate(r,{coerce:!0});if(!s)return i}return r},validator(r,n){const s=[];for(const i of e){const[...a]=fo(r,i,n),[c]=a;if(c[0])for(const[h]of a)h&&s.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${qe(r)}`,...s]}})}function Cl(){return nt("unknown",()=>!0)}function mo(e,t,r){return new Ve({...e,coercer:(n,s)=>po(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function Zf(e,t,r={}){return mo(e,Cl(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&Ea(n)&&Ea(s)){const i={...n};let a=!1;for(const c in s)i[c]===void 0&&(i[c]=s[c],a=!0);if(a)return i}return n})}function Qf(e){return mo(e,Rl(),t=>t.trim())}function Kf(e){return fr(e,"empty",t=>{const r=Il(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Il(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Xf(e,t,r={}){const{exclusive:n}=r;return fr(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function Yf(e,t,r={}){const{exclusive:n}=r;return fr(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function e1(e){return fr(e,"nonempty",t=>Il(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function t1(e,t){return fr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function r1(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return fr(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${s} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:a}=i;return t<=a&&a<=r||`${n} with a size ${s} but received one with a size of \`${a}\``}else{const{length:a}=i;return t<=a&&a<=r||`${n} with a length ${s} but received one with a length of \`${a}\``}})}function fr(e,t,r){return new Ve({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),a=Hi(i,s,e,n);for(const c of a)yield{...c,refinement:t}}})}const n1=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ve,StructError:yl,any:Af,array:Nf,assert:El,assign:Ef,bigint:Lf,boolean:$f,coerce:mo,create:Sl,date:Tf,defaulted:Zf,define:nt,deprecated:Sf,dynamic:kf,empty:Kf,enums:Pf,func:Of,instance:Bf,integer:Df,intersection:Ff,is:po,lazy:Mf,literal:jf,map:Hf,mask:kl,max:Xf,min:Yf,never:go,nonempty:e1,nullable:Uf,number:Vf,object:Dn,omit:Rf,optional:Ml,partial:Cf,pattern:t1,pick:If,record:zf,refine:fr,regexp:Wf,set:qf,size:r1,string:Rl,struct:xf,trimmed:Qf,tuple:Jf,type:Fn,union:Gf,unknown:Cl,validate:Yr},Symbol.toStringTag,{value:"Module"})),pr=qi(n1);Object.defineProperty(Ke,"__esModule",{value:!0});Ke.assertExhaustive=Ke.assertStruct=Ke.assert=Ke.AssertionError=void 0;const s1=pr;function i1(e){return typeof e=="object"&&e!==null&&"message"in e}function o1(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function a1(e){const t=i1(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function xl(e,t){return o1(e)?new e({message:t}):e({message:t})}class _o extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Ke.AssertionError=_o;function c1(e,t="Assertion failed.",r=_o){if(!e)throw t instanceof Error?t:xl(r,t)}Ke.assert=c1;function l1(e,t,r="Assertion failed",n=_o){try{(0,s1.assert)(e,t)}catch(s){throw xl(n,`${r}: ${a1(s)}.`)}}Ke.assertStruct=l1;function u1(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ke.assertExhaustive=u1;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.base64=void 0;const h1=pr,d1=Ke,f1=(e,t={})=>{var r,n;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let a;i==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,d1.assert)(i==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let c;return s?c=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):c=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,h1.pattern)(e,c)};jn.base64=f1;var G={},Hn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=pr,r=Ke;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(d){return(0,t.is)(d,e.HexStruct)}e.isHexString=n;function s(d){return(0,t.is)(d,e.StrictHexStruct)}e.isStrictHexString=s;function i(d){(0,r.assert)(n(d),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function a(d){(0,r.assert)(s(d),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function c(d){return d.startsWith("0x")?d:d.startsWith("0X")?`0x${d.substring(2)}`:`0x${d}`}e.add0x=c;function h(d){return d.startsWith("0x")||d.startsWith("0X")?d.substring(2):d}e.remove0x=h})(Hn);Object.defineProperty(G,"__esModule",{value:!0});G.createDataView=G.concatBytes=G.valueToBytes=G.stringToBytes=G.numberToBytes=G.signedBigIntToBytes=G.bigIntToBytes=G.hexToBytes=G.bytesToString=G.bytesToNumber=G.bytesToSignedBigInt=G.bytesToBigInt=G.bytesToHex=G.assertIsBytes=G.isBytes=void 0;const ot=Ke,Ui=Hn,Sa=48,ka=58,Ma=87;function p1(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const g1=p1();function vo(e){return e instanceof Uint8Array}G.isBytes=vo;function en(e){(0,ot.assert)(vo(e),"Value must be a Uint8Array.")}G.assertIsBytes=en;function Al(e){if(en(e),e.length===0)return"0x";const t=g1(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Ui.add0x)(r.join(""))}G.bytesToHex=Al;function Nl(e){en(e);const t=Al(e);return BigInt(t)}G.bytesToBigInt=Nl;function m1(e){en(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}G.bytesToSignedBigInt=m1;function _1(e){en(e);const t=Nl(e);return(0,ot.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}G.bytesToNumber=_1;function v1(e){return en(e),new TextDecoder().decode(e)}G.bytesToString=v1;function qs(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Ui.assertIsHexString)(e);const r=(0,Ui.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,s=new Uint8Array(n.length/2);for(let i=0;i<s.length;i++){const a=n.charCodeAt(i*2),c=n.charCodeAt(i*2+1),h=a-(a<ka?Sa:Ma),d=c-(c<ka?Sa:Ma);s[i]=h*16+d}return s}G.hexToBytes=qs;function Ll(e){(0,ot.assert)(typeof e=="bigint","Value must be a bigint."),(0,ot.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return qs(t)}G.bigIntToBytes=Ll;function b1(e,t){(0,ot.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function w1(e,t){(0,ot.assert)(typeof e=="bigint","Value must be a bigint."),(0,ot.assert)(typeof t=="number","Byte length must be a number."),(0,ot.assert)(t>0,"Byte length must be greater than 0."),(0,ot.assert)(b1(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let s=0;s<n.length;s++)n[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}G.signedBigIntToBytes=w1;function $l(e){(0,ot.assert)(typeof e=="number","Value must be a number."),(0,ot.assert)(e>=0,"Value must be a non-negative number."),(0,ot.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return qs(t)}G.numberToBytes=$l;function Tl(e){return(0,ot.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}G.stringToBytes=Tl;function Pl(e){if(typeof e=="bigint")return Ll(e);if(typeof e=="number")return $l(e);if(typeof e=="string")return e.startsWith("0x")?qs(e):Tl(e);if(vo(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}G.valueToBytes=Pl;function y1(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=Pl(e[s]);t[s]=i,r+=i.length}const n=new Uint8Array(r);for(let s=0,i=0;s<t.length;s++)n.set(t[s],i),i+=t[s].length;return n}G.concatBytes=y1;function E1(e){if(typeof U<"u"&&e instanceof U){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}G.createDataView=E1;var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.ChecksumStruct=void 0;const Ra=pr,S1=jn;Js.ChecksumStruct=(0,Ra.size)((0,S1.base64)((0,Ra.string)(),{paddingRequired:!0}),44,44);var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.createHex=Mt.createBytes=Mt.createBigInt=Mt.createNumber=void 0;const Ue=pr,k1=Ke,Ol=G,Gs=Hn,Bl=(0,Ue.union)([(0,Ue.number)(),(0,Ue.bigint)(),(0,Ue.string)(),Gs.StrictHexStruct]),M1=(0,Ue.coerce)((0,Ue.number)(),Bl,Number),R1=(0,Ue.coerce)((0,Ue.bigint)(),Bl,BigInt);(0,Ue.union)([Gs.StrictHexStruct,(0,Ue.instance)(Uint8Array)]);const C1=(0,Ue.coerce)((0,Ue.instance)(Uint8Array),(0,Ue.union)([Gs.StrictHexStruct]),Ol.hexToBytes),I1=(0,Ue.coerce)(Gs.StrictHexStruct,(0,Ue.instance)(Uint8Array),Ol.bytesToHex);function x1(e){try{const t=(0,Ue.create)(e,M1);return(0,k1.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Mt.createNumber=x1;function A1(e){try{return(0,Ue.create)(e,R1)}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Mt.createBigInt=A1;function N1(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Ue.create)(e,C1)}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Mt.createBytes=N1;function L1(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Ue.create)(e,I1)}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Mt.createHex=L1;var zr={},Dl=D&&D.__classPrivateFieldSet||function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},et=D&&D.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ft,bt;Object.defineProperty(zr,"__esModule",{value:!0});zr.FrozenSet=zr.FrozenMap=void 0;class bo{constructor(t){ft.set(this,void 0),Dl(this,ft,new Map(t),"f"),Object.freeze(this)}get size(){return et(this,ft,"f").size}[(ft=new WeakMap,Symbol.iterator)](){return et(this,ft,"f")[Symbol.iterator]()}entries(){return et(this,ft,"f").entries()}forEach(t,r){return et(this,ft,"f").forEach((n,s,i)=>t.call(r,n,s,this))}get(t){return et(this,ft,"f").get(t)}has(t){return et(this,ft,"f").has(t)}keys(){return et(this,ft,"f").keys()}values(){return et(this,ft,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}zr.FrozenMap=bo;class wo{constructor(t){bt.set(this,void 0),Dl(this,bt,new Set(t),"f"),Object.freeze(this)}get size(){return et(this,bt,"f").size}[(bt=new WeakMap,Symbol.iterator)](){return et(this,bt,"f")[Symbol.iterator]()}entries(){return et(this,bt,"f").entries()}forEach(t,r){return et(this,bt,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return et(this,bt,"f").has(t)}keys(){return et(this,bt,"f").keys()}values(){return et(this,bt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}zr.FrozenSet=wo;Object.freeze(bo);Object.freeze(bo.prototype);Object.freeze(wo);Object.freeze(wo.prototype);var Fl={};Object.defineProperty(Fl,"__esModule",{value:!0});var jl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=pr,r=Ke,n=()=>(0,t.define)("finite number",N=>(0,t.is)(N,(0,t.number)())&&Number.isFinite(N));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(N,P)=>{function W(Y,Re){const j=[...Re.validator(Y,P)];return j.length>0?j:!0}try{const Y=W(N,e.UnsafeJsonStruct);return Y!==!0?Y:W(JSON.parse(JSON.stringify(N)),e.UnsafeJsonStruct)}catch(Y){return Y instanceof RangeError?"Circular reference detected":!1}});function s(N){return(0,t.is)(N,e.JsonStruct)}e.isValidJson=s;function i(N){(0,r.assertStruct)(N,e.JsonStruct,"Invalid JSON value");const P=JSON.stringify(N);return new TextEncoder().encode(P).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function a(N){return(0,t.is)(N,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function c(N,P){(0,r.assertStruct)(N,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",P)}e.assertIsJsonRpcNotification=c;function h(N){return(0,t.is)(N,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function d(N,P){(0,r.assertStruct)(N,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",P)}e.assertIsJsonRpcRequest=d,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function f(N){return(0,t.is)(N,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=f;function g(N,P){(0,r.assertStruct)(N,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",P)}e.assertIsPendingJsonRpcResponse=g;function w(N){return(0,t.is)(N,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=w;function S(N,P){(0,r.assertStruct)(N,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",P)}e.assertIsJsonRpcResponse=S;function C(N){return(0,t.is)(N,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=C;function M(N,P){(0,r.assertStruct)(N,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",P)}e.assertIsJsonRpcSuccess=M;function I(N){return(0,t.is)(N,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=I;function A(N,P){(0,r.assertStruct)(N,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",P)}e.assertIsJsonRpcFailure=A;function x(N){return(0,t.is)(N,e.JsonRpcErrorStruct)}e.isJsonRpcError=x;function R(N,P){(0,r.assertStruct)(N,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",P)}e.assertIsJsonRpcError=R;function B(N){const{permitEmptyString:P,permitFractions:W,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},N);return V=>!!(typeof V=="number"&&(W||Number.isInteger(V))||typeof V=="string"&&(P||V.length>0)||Y&&V===null)}e.getJsonRpcIdValidator=B})(jl);var Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});var Wr={},$1=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createModuleLogger=Wr.createProjectLogger=void 0;const T1=$1(Eu()),P1=(0,T1.default)("metamask");function O1(e){return P1.extend(e)}Wr.createProjectLogger=O1;function B1(e,t){return e.extend(t)}Wr.createModuleLogger=B1;var Ul={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(d){return Array.isArray(d)&&d.length>0}e.isNonEmptyArray=t;function r(d){return d==null}e.isNullOrUndefined=r;function n(d){return!!d&&typeof d=="object"&&!Array.isArray(d)}e.isObject=n;const s=(d,f)=>Object.hasOwnProperty.call(d,f);e.hasProperty=s,function(d){d[d.Null=4]="Null",d[d.Comma=1]="Comma",d[d.Wrapper=1]="Wrapper",d[d.True=4]="True",d[d.False=5]="False",d[d.Quote=1]="Quote",d[d.Colon=1]="Colon",d[d.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(d){if(typeof d!="object"||d===null)return!1;try{let f=d;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(d)===f}catch{return!1}}e.isPlainObject=i;function a(d){return d.charCodeAt(0)<=127}e.isASCII=a;function c(d){var f;return d.split("").reduce((w,S)=>a(S)?w+1:w+2,0)+((f=d.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&f!==void 0?f:[]).length}e.calculateStringSize=c;function h(d){return d.toString().length}e.calculateNumberSize=h})(Ul);var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.hexToBigInt=Rt.hexToNumber=Rt.bigIntToHex=Rt.numberToHex=void 0;const Or=Ke,vn=Hn,D1=e=>((0,Or.assert)(typeof e=="number","Value must be a number."),(0,Or.assert)(e>=0,"Value must be a non-negative number."),(0,Or.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,vn.add0x)(e.toString(16)));Rt.numberToHex=D1;const F1=e=>((0,Or.assert)(typeof e=="bigint","Value must be a bigint."),(0,Or.assert)(e>=0,"Value must be a non-negative bigint."),(0,vn.add0x)(e.toString(16)));Rt.bigIntToHex=F1;const j1=e=>{(0,vn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Or.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Rt.hexToNumber=j1;const H1=e=>((0,vn.assertIsHexString)(e),BigInt((0,vn.add0x)(e)));Rt.hexToBigInt=H1;var Vl={};Object.defineProperty(Vl,"__esModule",{value:!0});var zl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,a)=>{if(!t(i))throw new Error(`"${a}" must be a non-negative integer. Received: "${i}".`)};function n(i,a){return r(i,"count"),i*a}e.inMilliseconds=n;function s(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=s})(zl);var Wl={};Object.defineProperty(Wl,"__esModule",{value:!0});var ql={},Vi={exports:{}};const U1="2.0.0",Jl=256,V1=Number.MAX_SAFE_INTEGER||9007199254740991,z1=16,W1=Jl-6,q1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Zs={MAX_LENGTH:Jl,MAX_SAFE_COMPONENT_LENGTH:z1,MAX_SAFE_BUILD_LENGTH:W1,MAX_SAFE_INTEGER:V1,RELEASE_TYPES:q1,SEMVER_SPEC_VERSION:U1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const J1=typeof bu=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Qs=J1;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Zs,i=Qs;t=e.exports={};const a=t.re=[],c=t.safeRe=[],h=t.src=[],d=t.safeSrc=[],f=t.t={};let g=0;const w="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",s],[w,n]],C=I=>{for(const[A,x]of S)I=I.split(`${A}*`).join(`${A}{0,${x}}`).split(`${A}+`).join(`${A}{1,${x}}`);return I},M=(I,A,x)=>{const R=C(A),B=g++;i(I,B,A),f[I]=B,h[B]=A,d[B]=R,a[B]=new RegExp(A,x?"g":void 0),c[B]=new RegExp(R,x?"g":void 0)};M("NUMERICIDENTIFIER","0|[1-9]\\d*"),M("NUMERICIDENTIFIERLOOSE","\\d+"),M("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w}*`),M("MAINVERSION",`(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})`),M("MAINVERSIONLOOSE",`(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})`),M("PRERELEASEIDENTIFIER",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIER]})`),M("PRERELEASEIDENTIFIERLOOSE",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIERLOOSE]})`),M("PRERELEASE",`(?:-(${h[f.PRERELEASEIDENTIFIER]}(?:\\.${h[f.PRERELEASEIDENTIFIER]})*))`),M("PRERELEASELOOSE",`(?:-?(${h[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[f.PRERELEASEIDENTIFIERLOOSE]})*))`),M("BUILDIDENTIFIER",`${w}+`),M("BUILD",`(?:\\+(${h[f.BUILDIDENTIFIER]}(?:\\.${h[f.BUILDIDENTIFIER]})*))`),M("FULLPLAIN",`v?${h[f.MAINVERSION]}${h[f.PRERELEASE]}?${h[f.BUILD]}?`),M("FULL",`^${h[f.FULLPLAIN]}$`),M("LOOSEPLAIN",`[v=\\s]*${h[f.MAINVERSIONLOOSE]}${h[f.PRERELEASELOOSE]}?${h[f.BUILD]}?`),M("LOOSE",`^${h[f.LOOSEPLAIN]}$`),M("GTLT","((?:<|>)?=?)"),M("XRANGEIDENTIFIERLOOSE",`${h[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),M("XRANGEIDENTIFIER",`${h[f.NUMERICIDENTIFIER]}|x|X|\\*`),M("XRANGEPLAIN",`[v=\\s]*(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:${h[f.PRERELEASE]})?${h[f.BUILD]}?)?)?`),M("XRANGEPLAINLOOSE",`[v=\\s]*(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:${h[f.PRERELEASELOOSE]})?${h[f.BUILD]}?)?)?`),M("XRANGE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAIN]}$`),M("XRANGELOOSE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAINLOOSE]}$`),M("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),M("COERCE",`${h[f.COERCEPLAIN]}(?:$|[^\\d])`),M("COERCEFULL",h[f.COERCEPLAIN]+`(?:${h[f.PRERELEASE]})?(?:${h[f.BUILD]})?(?:$|[^\\d])`),M("COERCERTL",h[f.COERCE],!0),M("COERCERTLFULL",h[f.COERCEFULL],!0),M("LONETILDE","(?:~>?)"),M("TILDETRIM",`(\\s*)${h[f.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",M("TILDE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAIN]}$`),M("TILDELOOSE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAINLOOSE]}$`),M("LONECARET","(?:\\^)"),M("CARETTRIM",`(\\s*)${h[f.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",M("CARET",`^${h[f.LONECARET]}${h[f.XRANGEPLAIN]}$`),M("CARETLOOSE",`^${h[f.LONECARET]}${h[f.XRANGEPLAINLOOSE]}$`),M("COMPARATORLOOSE",`^${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]})$|^$`),M("COMPARATOR",`^${h[f.GTLT]}\\s*(${h[f.FULLPLAIN]})$|^$`),M("COMPARATORTRIM",`(\\s*)${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]}|${h[f.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",M("HYPHENRANGE",`^\\s*(${h[f.XRANGEPLAIN]})\\s+-\\s+(${h[f.XRANGEPLAIN]})\\s*$`),M("HYPHENRANGELOOSE",`^\\s*(${h[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[f.XRANGEPLAINLOOSE]})\\s*$`),M("STAR","(<|>)?=?\\s*\\*"),M("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),M("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Vi,Vi.exports);var Un=Vi.exports;const G1=Object.freeze({loose:!0}),Z1=Object.freeze({}),Q1=e=>e?typeof e!="object"?G1:e:Z1;var yo=Q1;const Ca=/^[0-9]+$/,Gl=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=Ca.test(e),n=Ca.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},K1=(e,t)=>Gl(t,e);var Zl={compareIdentifiers:Gl,rcompareIdentifiers:K1};const es=Qs,{MAX_LENGTH:Ia,MAX_SAFE_INTEGER:ts}=Zs,{safeRe:rs,t:ns}=Un,X1=yo,{compareIdentifiers:ki}=Zl;let Y1=class wt{constructor(t,r){if(r=X1(r),t instanceof wt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ia)throw new TypeError(`version is longer than ${Ia} characters`);es("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?rs[ns.LOOSE]:rs[ns.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ts||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ts||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ts||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<ts)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(es("SemVer.compare",this.version,this.options,t),!(t instanceof wt)){if(typeof t=="string"&&t===this.version)return 0;t=new wt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof wt||(t=new wt(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof wt||(t=new wt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(es("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return ki(n,s)}while(++r)}compareBuild(t){t instanceof wt||(t=new wt(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(es("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return ki(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const s=`-${r}`.match(this.options.loose?rs[ns.PRERELEASELOOSE]:rs[ns.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),ki(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var tt=Y1;const xa=tt,ep=(e,t,r=!1)=>{if(e instanceof xa)return e;try{return new xa(e,t)}catch(n){if(!r)return null;throw n}};var tn=ep;const tp=tn,rp=(e,t)=>{const r=tp(e,t);return r?r.version:null};var np=rp;const sp=tn,ip=(e,t)=>{const r=sp(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var op=ip;const Aa=tt,ap=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Aa(e instanceof Aa?e.version:e,r).inc(t,n,s).version}catch{return null}};var cp=ap;const Na=tn,lp=(e,t)=>{const r=Na(e,null,!0),n=Na(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,a=i?r:n,c=i?n:r,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}const f=h?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};var up=lp;const hp=tt,dp=(e,t)=>new hp(e,t).major;var fp=dp;const pp=tt,gp=(e,t)=>new pp(e,t).minor;var mp=gp;const _p=tt,vp=(e,t)=>new _p(e,t).patch;var bp=vp;const wp=tn,yp=(e,t)=>{const r=wp(e,t);return r&&r.prerelease.length?r.prerelease:null};var Ep=yp;const La=tt,Sp=(e,t,r)=>new La(e,r).compare(new La(t,r));var mt=Sp;const kp=mt,Mp=(e,t,r)=>kp(t,e,r);var Rp=Mp;const Cp=mt,Ip=(e,t)=>Cp(e,t,!0);var xp=Ip;const $a=tt,Ap=(e,t,r)=>{const n=new $a(e,r),s=new $a(t,r);return n.compare(s)||n.compareBuild(s)};var Eo=Ap;const Np=Eo,Lp=(e,t)=>e.sort((r,n)=>Np(r,n,t));var $p=Lp;const Tp=Eo,Pp=(e,t)=>e.sort((r,n)=>Tp(n,r,t));var Op=Pp;const Bp=mt,Dp=(e,t,r)=>Bp(e,t,r)>0;var Ks=Dp;const Fp=mt,jp=(e,t,r)=>Fp(e,t,r)<0;var So=jp;const Hp=mt,Up=(e,t,r)=>Hp(e,t,r)===0;var Ql=Up;const Vp=mt,zp=(e,t,r)=>Vp(e,t,r)!==0;var Kl=zp;const Wp=mt,qp=(e,t,r)=>Wp(e,t,r)>=0;var ko=qp;const Jp=mt,Gp=(e,t,r)=>Jp(e,t,r)<=0;var Mo=Gp;const Zp=Ql,Qp=Kl,Kp=Ks,Xp=ko,Yp=So,eg=Mo,tg=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Zp(e,r,n);case"!=":return Qp(e,r,n);case">":return Kp(e,r,n);case">=":return Xp(e,r,n);case"<":return Yp(e,r,n);case"<=":return eg(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Xl=tg;const rg=tt,ng=tn,{safeRe:ss,t:is}=Un,sg=(e,t)=>{if(e instanceof rg)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?ss[is.COERCEFULL]:ss[is.COERCE]);else{const h=t.includePrerelease?ss[is.COERCERTLFULL]:ss[is.COERCERTL];let d;for(;(d=h.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),h.lastIndex=d.index+d[1].length+d[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return ng(`${n}.${s}.${i}${a}${c}`,t)};var ig=sg;class og{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var ag=og,Mi,Ta;function _t(){if(Ta)return Mi;Ta=1;const e=/\s+/g;class t{constructor(u,p){if(p=s(p),u instanceof t)return u.loose===!!p.loose&&u.includePrerelease===!!p.includePrerelease?u:new t(u.raw,p);if(u instanceof i)return this.raw=u.value,this.set=[[u]],this.formatted=void 0,this;if(this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease,this.raw=u.trim().replace(e," "),this.set=this.raw.split("||").map(m=>this.parseRange(m.trim())).filter(m=>m.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const m=this.set[0];if(this.set=this.set.filter(v=>!M(v[0])),this.set.length===0)this.set=[m];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&I(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let u=0;u<this.set.length;u++){u>0&&(this.formatted+="||");const p=this.set[u];for(let m=0;m<p.length;m++)m>0&&(this.formatted+=" "),this.formatted+=p[m].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(u){const m=((this.options.includePrerelease&&S)|(this.options.loose&&C))+":"+u,v=n.get(m);if(v)return v;const y=this.options.loose,k=y?h[d.HYPHENRANGELOOSE]:h[d.HYPHENRANGE];u=u.replace(k,Z(this.options.includePrerelease)),a("hyphen replace",u),u=u.replace(h[d.COMPARATORTRIM],f),a("comparator trim",u),u=u.replace(h[d.TILDETRIM],g),a("tilde trim",u),u=u.replace(h[d.CARETTRIM],w),a("caret trim",u);let _=u.split(" ").map(L=>x(L,this.options)).join(" ").split(/\s+/).map(L=>j(L,this.options));y&&(_=_.filter(L=>(a("loose invalid filter",L,this.options),!!L.match(h[d.COMPARATORLOOSE])))),a("range list",_);const l=new Map,b=_.map(L=>new i(L,this.options));for(const L of b){if(M(L))return[L];l.set(L.value,L)}l.size>1&&l.has("")&&l.delete("");const T=[...l.values()];return n.set(m,T),T}intersects(u,p){if(!(u instanceof t))throw new TypeError("a Range is required");return this.set.some(m=>A(m,p)&&u.set.some(v=>A(v,p)&&m.every(y=>v.every(k=>y.intersects(k,p)))))}test(u){if(!u)return!1;if(typeof u=="string")try{u=new c(u,this.options)}catch{return!1}for(let p=0;p<this.set.length;p++)if(E(this.set[p],u,this.options))return!0;return!1}}Mi=t;const r=ag,n=new r,s=yo,i=Xs(),a=Qs,c=tt,{safeRe:h,t:d,comparatorTrimReplace:f,tildeTrimReplace:g,caretTrimReplace:w}=Un,{FLAG_INCLUDE_PRERELEASE:S,FLAG_LOOSE:C}=Zs,M=o=>o.value==="<0.0.0-0",I=o=>o.value==="",A=(o,u)=>{let p=!0;const m=o.slice();let v=m.pop();for(;p&&m.length;)p=m.every(y=>v.intersects(y,u)),v=m.pop();return p},x=(o,u)=>(o=o.replace(h[d.BUILD],""),a("comp",o,u),o=P(o,u),a("caret",o),o=B(o,u),a("tildes",o),o=Y(o,u),a("xrange",o),o=V(o,u),a("stars",o),o),R=o=>!o||o.toLowerCase()==="x"||o==="*",B=(o,u)=>o.trim().split(/\s+/).map(p=>N(p,u)).join(" "),N=(o,u)=>{const p=u.loose?h[d.TILDELOOSE]:h[d.TILDE];return o.replace(p,(m,v,y,k,_)=>{a("tilde",o,m,v,y,k,_);let l;return R(v)?l="":R(y)?l=`>=${v}.0.0 <${+v+1}.0.0-0`:R(k)?l=`>=${v}.${y}.0 <${v}.${+y+1}.0-0`:_?(a("replaceTilde pr",_),l=`>=${v}.${y}.${k}-${_} <${v}.${+y+1}.0-0`):l=`>=${v}.${y}.${k} <${v}.${+y+1}.0-0`,a("tilde return",l),l})},P=(o,u)=>o.trim().split(/\s+/).map(p=>W(p,u)).join(" "),W=(o,u)=>{a("caret",o,u);const p=u.loose?h[d.CARETLOOSE]:h[d.CARET],m=u.includePrerelease?"-0":"";return o.replace(p,(v,y,k,_,l)=>{a("caret",o,v,y,k,_,l);let b;return R(y)?b="":R(k)?b=`>=${y}.0.0${m} <${+y+1}.0.0-0`:R(_)?y==="0"?b=`>=${y}.${k}.0${m} <${y}.${+k+1}.0-0`:b=`>=${y}.${k}.0${m} <${+y+1}.0.0-0`:l?(a("replaceCaret pr",l),y==="0"?k==="0"?b=`>=${y}.${k}.${_}-${l} <${y}.${k}.${+_+1}-0`:b=`>=${y}.${k}.${_}-${l} <${y}.${+k+1}.0-0`:b=`>=${y}.${k}.${_}-${l} <${+y+1}.0.0-0`):(a("no pr"),y==="0"?k==="0"?b=`>=${y}.${k}.${_}${m} <${y}.${k}.${+_+1}-0`:b=`>=${y}.${k}.${_}${m} <${y}.${+k+1}.0-0`:b=`>=${y}.${k}.${_} <${+y+1}.0.0-0`),a("caret return",b),b})},Y=(o,u)=>(a("replaceXRanges",o,u),o.split(/\s+/).map(p=>Re(p,u)).join(" ")),Re=(o,u)=>{o=o.trim();const p=u.loose?h[d.XRANGELOOSE]:h[d.XRANGE];return o.replace(p,(m,v,y,k,_,l)=>{a("xRange",o,m,v,y,k,_,l);const b=R(y),T=b||R(k),L=T||R(_),$=L;return v==="="&&$&&(v=""),l=u.includePrerelease?"-0":"",b?v===">"||v==="<"?m="<0.0.0-0":m="*":v&&$?(T&&(k=0),_=0,v===">"?(v=">=",T?(y=+y+1,k=0,_=0):(k=+k+1,_=0)):v==="<="&&(v="<",T?y=+y+1:k=+k+1),v==="<"&&(l="-0"),m=`${v+y}.${k}.${_}${l}`):T?m=`>=${y}.0.0${l} <${+y+1}.0.0-0`:L&&(m=`>=${y}.${k}.0${l} <${y}.${+k+1}.0-0`),a("xRange return",m),m})},V=(o,u)=>(a("replaceStars",o,u),o.trim().replace(h[d.STAR],"")),j=(o,u)=>(a("replaceGTE0",o,u),o.trim().replace(h[u.includePrerelease?d.GTE0PRE:d.GTE0],"")),Z=o=>(u,p,m,v,y,k,_,l,b,T,L,$)=>(R(m)?p="":R(v)?p=`>=${m}.0.0${o?"-0":""}`:R(y)?p=`>=${m}.${v}.0${o?"-0":""}`:k?p=`>=${p}`:p=`>=${p}${o?"-0":""}`,R(b)?l="":R(T)?l=`<${+b+1}.0.0-0`:R(L)?l=`<${b}.${+T+1}.0-0`:$?l=`<=${b}.${T}.${L}-${$}`:o?l=`<${b}.${T}.${+L+1}-0`:l=`<=${l}`,`${p} ${l}`.trim()),E=(o,u,p)=>{for(let m=0;m<o.length;m++)if(!o[m].test(u))return!1;if(u.prerelease.length&&!p.includePrerelease){for(let m=0;m<o.length;m++)if(a(o[m].semver),o[m].semver!==i.ANY&&o[m].semver.prerelease.length>0){const v=o[m].semver;if(v.major===u.major&&v.minor===u.minor&&v.patch===u.patch)return!0}return!1}return!0};return Mi}var Ri,Pa;function Xs(){if(Pa)return Ri;Pa=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,g){if(g=r(g),f instanceof t){if(f.loose===!!g.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),a("comparator",f,g),this.options=g,this.loose=!!g.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(f){const g=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],w=f.match(g);if(!w)throw new TypeError(`Invalid comparator: ${f}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new c(w[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(a("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new c(f,this.options)}catch{return!1}return i(f,this.operator,this.semver,this.options)}intersects(f,g){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(f.value,g).test(this.value):f.operator===""?f.value===""?!0:new h(this.value,g).test(f.semver):(g=r(g),g.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!g.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||i(this.semver,"<",f.semver,g)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||i(this.semver,">",f.semver,g)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}Ri=t;const r=yo,{safeRe:n,t:s}=Un,i=Xl,a=Qs,c=tt,h=_t();return Ri}const cg=_t(),lg=(e,t,r)=>{try{t=new cg(t,r)}catch{return!1}return t.test(e)};var Ys=lg;const ug=_t(),hg=(e,t)=>new ug(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var dg=hg;const fg=tt,pg=_t(),gg=(e,t,r)=>{let n=null,s=null,i=null;try{i=new pg(t,r)}catch{return null}return e.forEach(a=>{i.test(a)&&(!n||s.compare(a)===-1)&&(n=a,s=new fg(n,r))}),n};var mg=gg;const _g=tt,vg=_t(),bg=(e,t,r)=>{let n=null,s=null,i=null;try{i=new vg(t,r)}catch{return null}return e.forEach(a=>{i.test(a)&&(!n||s.compare(a)===1)&&(n=a,s=new _g(n,r))}),n};var wg=bg;const Ci=tt,yg=_t(),Oa=Ks,Eg=(e,t)=>{e=new yg(e,t);let r=new Ci("0.0.0");if(e.test(r)||(r=new Ci("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(a=>{const c=new Ci(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!i||Oa(c,i))&&(i=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),i&&(!r||Oa(r,i))&&(r=i)}return r&&e.test(r)?r:null};var Sg=Eg;const kg=_t(),Mg=(e,t)=>{try{return new kg(e,t).range||"*"}catch{return null}};var Rg=Mg;const Cg=tt,Yl=Xs(),{ANY:Ig}=Yl,xg=_t(),Ag=Ys,Ba=Ks,Da=So,Ng=Mo,Lg=ko,$g=(e,t,r,n)=>{e=new Cg(e,n),t=new xg(t,n);let s,i,a,c,h;switch(r){case">":s=Ba,i=Ng,a=Da,c=">",h=">=";break;case"<":s=Da,i=Lg,a=Ba,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ag(e,t,n))return!1;for(let d=0;d<t.set.length;++d){const f=t.set[d];let g=null,w=null;if(f.forEach(S=>{S.semver===Ig&&(S=new Yl(">=0.0.0")),g=g||S,w=w||S,s(S.semver,g.semver,n)?g=S:a(S.semver,w.semver,n)&&(w=S)}),g.operator===c||g.operator===h||(!w.operator||w.operator===c)&&i(e,w.semver))return!1;if(w.operator===h&&a(e,w.semver))return!1}return!0};var Ro=$g;const Tg=Ro,Pg=(e,t,r)=>Tg(e,t,">",r);var Og=Pg;const Bg=Ro,Dg=(e,t,r)=>Bg(e,t,"<",r);var Fg=Dg;const Fa=_t(),jg=(e,t,r)=>(e=new Fa(e,r),t=new Fa(t,r),e.intersects(t,r));var Hg=jg;const Ug=Ys,Vg=mt;var zg=(e,t,r)=>{const n=[];let s=null,i=null;const a=e.sort((f,g)=>Vg(f,g,r));for(const f of a)Ug(f,t,r)?(i=f,s||(s=f)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const c=[];for(const[f,g]of n)f===g?c.push(f):!g&&f===a[0]?c.push("*"):g?f===a[0]?c.push(`<=${g}`):c.push(`${f} - ${g}`):c.push(`>=${f}`);const h=c.join(" || "),d=typeof t.raw=="string"?t.raw:String(t);return h.length<d.length?h:t};const ja=_t(),Co=Xs(),{ANY:Ii}=Co,un=Ys,Io=mt,Wg=(e,t,r={})=>{if(e===t)return!0;e=new ja(e,r),t=new ja(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const a=Jg(s,i,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},qg=[new Co(">=0.0.0-0")],Ha=[new Co(">=0.0.0")],Jg=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Ii){if(t.length===1&&t[0].semver===Ii)return!0;r.includePrerelease?e=qg:e=Ha}if(t.length===1&&t[0].semver===Ii){if(r.includePrerelease)return!0;t=Ha}const n=new Set;let s,i;for(const S of e)S.operator===">"||S.operator===">="?s=Ua(s,S,r):S.operator==="<"||S.operator==="<="?i=Va(i,S,r):n.add(S.semver);if(n.size>1)return null;let a;if(s&&i){if(a=Io(s.semver,i.semver,r),a>0)return null;if(a===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const S of n){if(s&&!un(S,String(s),r)||i&&!un(S,String(i),r))return null;for(const C of t)if(!un(S,String(C),r))return!1;return!0}let c,h,d,f,g=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,w=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;g&&g.prerelease.length===1&&i.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(const S of t){if(f=f||S.operator===">"||S.operator===">=",d=d||S.operator==="<"||S.operator==="<=",s){if(w&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===w.major&&S.semver.minor===w.minor&&S.semver.patch===w.patch&&(w=!1),S.operator===">"||S.operator===">="){if(c=Ua(s,S,r),c===S&&c!==s)return!1}else if(s.operator===">="&&!un(s.semver,String(S),r))return!1}if(i){if(g&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===g.major&&S.semver.minor===g.minor&&S.semver.patch===g.patch&&(g=!1),S.operator==="<"||S.operator==="<="){if(h=Va(i,S,r),h===S&&h!==i)return!1}else if(i.operator==="<="&&!un(i.semver,String(S),r))return!1}if(!S.operator&&(i||s)&&a!==0)return!1}return!(s&&d&&!i&&a!==0||i&&f&&!s&&a!==0||w||g)},Ua=(e,t,r)=>{if(!e)return t;const n=Io(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Va=(e,t,r)=>{if(!e)return t;const n=Io(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Gg=Wg;const xi=Un,za=Zs,Zg=tt,Wa=Zl,Qg=tn,Kg=np,Xg=op,Yg=cp,em=up,tm=fp,rm=mp,nm=bp,sm=Ep,im=mt,om=Rp,am=xp,cm=Eo,lm=$p,um=Op,hm=Ks,dm=So,fm=Ql,pm=Kl,gm=ko,mm=Mo,_m=Xl,vm=ig,bm=Xs(),wm=_t(),ym=Ys,Em=dg,Sm=mg,km=wg,Mm=Sg,Rm=Rg,Cm=Ro,Im=Og,xm=Fg,Am=Hg,Nm=zg,Lm=Gg;var $m={parse:Qg,valid:Kg,clean:Xg,inc:Yg,diff:em,major:tm,minor:rm,patch:nm,prerelease:sm,compare:im,rcompare:om,compareLoose:am,compareBuild:cm,sort:lm,rsort:um,gt:hm,lt:dm,eq:fm,neq:pm,gte:gm,lte:mm,cmp:_m,coerce:vm,Comparator:bm,Range:wm,satisfies:ym,toComparators:Em,maxSatisfying:Sm,minSatisfying:km,minVersion:Mm,validRange:Rm,outside:Cm,gtr:Im,ltr:xm,intersects:Am,simplifyRange:Nm,subset:Lm,SemVer:Zg,re:xi.re,src:xi.src,tokens:xi.t,SEMVER_SPEC_VERSION:za.SEMVER_SPEC_VERSION,RELEASE_TYPES:za.RELEASE_TYPES,compareIdentifiers:Wa.compareIdentifiers,rcompareIdentifiers:Wa.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=$m,r=pr,n=Ke;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",g=>(0,t.valid)(g)===null?`Expected SemVer version, got "${g}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",g=>(0,t.validRange)(g)===null?`Expected SemVer range, got "${g}"`:!0);function s(g){return(0,r.is)(g,e.VersionStruct)}e.isValidSemVerVersion=s;function i(g){return(0,r.is)(g,e.VersionRangeStruct)}e.isValidSemVerRange=i;function a(g){(0,n.assertStruct)(g,e.VersionStruct)}e.assertIsSemVerVersion=a;function c(g){(0,n.assertStruct)(g,e.VersionRangeStruct)}e.assertIsSemVerRange=c;function h(g,w){return(0,t.gt)(g,w)}e.gtVersion=h;function d(g,w){return(0,t.gtr)(g,w)}e.gtRange=d;function f(g,w){return(0,t.satisfies)(g,w,{includePrerelease:!0})}e.satisfiesVersionRange=f})(ql);(function(e){var t=D&&D.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,c)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=D&&D.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ke,e),r(jn,e),r(G,e),r(Js,e),r(Mt,e),r(zr,e),r(Fl,e),r(Hn,e),r(jl,e),r(Hl,e),r(Wr,e),r(Ul,e),r(Rt,e),r(Vl,e),r(zl,e),r(Wl,e),r(ql,e)})(wl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=wl;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(bl);var eu=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.PollingBlockTracker=void 0;const Tm=eu(ho),Pm=eu(uf),Om=On,qa=bl,Ja=(0,qa.createModuleLogger)(qa.projectLogger,"polling-block-tracker"),Bm=(0,Tm.default)(),Dm=1e3;class Fm extends Om.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Dm,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=Ga(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
3
3
|
${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=Ga(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Bm(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Ja("Making request",t);const r=await(0,Pm.default)(n=>this._provider.sendAsync(t,n))();if(Ja("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
4
|
${r.error.message}`);return r.result}}Ws.PollingBlockTracker=Fm;function Ga(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var ei={},jm=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ei,"__esModule",{value:!0});ei.SubscribeBlockTracker=void 0;const Hm=jm(ho),Um=On,Vm=(0,Hm.default)();class zm extends Um.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,s)=>{this._provider.sendAsync({id:Vm(),method:t,params:r,jsonrpc:"2.0"},(i,a)=>{i?s(i):n(a.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}ei.SubscribeBlockTracker=zm;(function(e){var t=D&&D.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i),Object.defineProperty(n,a,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=D&&D.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ws,e),r(ei,e)})(vl);var xo={},ti={},Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getUniqueId=void 0;const tu=4294967295;let Ai=Math.floor(Math.random()*tu);function Wm(){return Ai=(Ai+1)%tu,Ai}Vn.getUniqueId=Wm;Object.defineProperty(ti,"__esModule",{value:!0});ti.createIdRemapMiddleware=void 0;const qm=Vn;function Jm(){return(e,t,r,n)=>{const s=e.id,i=qm.getUniqueId();e.id=i,t.id=i,r(a=>{e.id=s,t.id=s,a()})}}ti.createIdRemapMiddleware=Jm;var ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.createAsyncMiddleware=void 0;function Gm(e){return async(t,r,n,s)=>{let i;const a=new Promise(f=>{i=f});let c=null,h=!1;const d=async()=>{h=!0,n(f=>{c=f,i()}),await a};try{await e(t,r,d),h?(await a,c(null)):s(null)}catch(f){c?c(f):s(f)}}}ri.createAsyncMiddleware=Gm;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.createScaffoldMiddleware=void 0;function Zm(e){return(t,r,n,s)=>{const i=e[t.method];return i===void 0?n():typeof i=="function"?i(t,r,n,s):(r.result=i,s())}}ni.createScaffoldMiddleware=Zm;var zn={},Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});const Qm=cc;function Za(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Km(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Xm=class extends Qm.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")Za(i,this,r);else{const a=i.length,c=Km(i);for(let h=0;h<a;h+=1)Za(c[h],this,r)}return!0}};Ao.default=Xm;var ru={},Ot={},Ym=bn;bn.default=bn;bn.stable=iu;bn.stableStringify=iu;var fs="[...]",nu="[Circular]",ur=[],ar=[];function su(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function bn(e,t,r,n){typeof n>"u"&&(n=su()),zi(e,"",0,[],void 0,0,n);var s;try{ar.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,ou(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ur.length!==0;){var i=ur.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function Br(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),ur.push([n,r,t,s])):ar.push([t,r,e]):(n[r]=e,ur.push([n,r,t]))}function zi(e,t,r,n,s,i,a){i+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Br(nu,e,t,s);return}if(typeof a.depthLimit<"u"&&i>a.depthLimit){Br(fs,e,t,s);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Br(fs,e,t,s);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)zi(e[c],c,c,n,e,i,a);else{var h=Object.keys(e);for(c=0;c<h.length;c++){var d=h[c];zi(e[d],d,c,n,e,i,a)}}n.pop()}}function e_(e,t){return e<t?-1:e>t?1:0}function iu(e,t,r,n){typeof n>"u"&&(n=su());var s=Wi(e,"",0,[],void 0,0,n)||e,i;try{ar.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,ou(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ur.length!==0;){var a=ur.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return i}function Wi(e,t,r,n,s,i,a){i+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Br(nu,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&i>a.depthLimit){Br(fs,e,t,s);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Br(fs,e,t,s);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)Wi(e[c],c,c,n,e,i,a);else{var h={},d=Object.keys(e).sort(e_);for(c=0;c<d.length;c++){var f=d[c];Wi(e[f],f,c,n,e,i,a),h[f]=e[f]}if(typeof s<"u")ur.push([s,t,e]),s[t]=h;else return h}n.pop()}}function ou(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(ar.length>0)for(var n=0;n<ar.length;n++){var s=ar[n];if(s[1]===t&&s[0]===r){r=s[2],ar.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Ot,"__esModule",{value:!0});Ot.EthereumProviderError=Ot.EthereumRpcError=void 0;const t_=Ym;class au extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return t_.default(this.serialize(),s_,2)}}Ot.EthereumRpcError=au;class r_ extends au{constructor(t,r,n){if(!n_(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Ot.EthereumProviderError=r_;function n_(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function s_(e,t){if(t!=="[Circular]")return t}var No={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.errorValues=Bt.errorCodes=void 0;Bt.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}};Bt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Bt,r=Ot,n=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",i={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(w,S=s){if(Number.isInteger(w)){const C=w.toString();if(g(t.errorValues,C))return t.errorValues[C].message;if(d(w))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return S}e.getMessageFromCode=a;function c(w){if(!Number.isInteger(w))return!1;const S=w.toString();return!!(t.errorValues[S]||d(w))}e.isValidCode=c;function h(w,{fallbackError:S=i,shouldIncludeStack:C=!1}={}){var M,I;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(w instanceof r.EthereumRpcError)return w.serialize();const A={};if(w&&typeof w=="object"&&!Array.isArray(w)&&g(w,"code")&&c(w.code)){const R=w;A.code=R.code,R.message&&typeof R.message=="string"?(A.message=R.message,g(R,"data")&&(A.data=R.data)):(A.message=a(A.code),A.data={originalError:f(w)})}else{A.code=S.code;const R=(M=w)===null||M===void 0?void 0:M.message;A.message=R&&typeof R=="string"?R:S.message,A.data={originalError:f(w)}}const x=(I=w)===null||I===void 0?void 0:I.stack;return C&&w&&x&&typeof x=="string"&&(A.stack=x),A}e.serializeError=h;function d(w){return w>=-32099&&w<=-32e3}function f(w){return w&&typeof w=="object"&&!Array.isArray(w)?Object.assign({},w):w}function g(w,S){return Object.prototype.hasOwnProperty.call(w,S)}})(No);var si={};Object.defineProperty(si,"__esModule",{value:!0});si.ethErrors=void 0;const Lo=Ot,cu=No,Xe=Bt;si.ethErrors={rpc:{parse:e=>ct(Xe.errorCodes.rpc.parse,e),invalidRequest:e=>ct(Xe.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ct(Xe.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ct(Xe.errorCodes.rpc.methodNotFound,e),internal:e=>ct(Xe.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ct(t,e)},invalidInput:e=>ct(Xe.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ct(Xe.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ct(Xe.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ct(Xe.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ct(Xe.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ct(Xe.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>hn(Xe.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>hn(Xe.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>hn(Xe.errorCodes.provider.unsupportedMethod,e),disconnected:e=>hn(Xe.errorCodes.provider.disconnected,e),chainDisconnected:e=>hn(Xe.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Lo.EthereumProviderError(t,r,n)}}};function ct(e,t){const[r,n]=lu(t);return new Lo.EthereumRpcError(e,r||cu.getMessageFromCode(e),n)}function hn(e,t){const[r,n]=lu(t);return new Lo.EthereumProviderError(e,r||cu.getMessageFromCode(e),n)}function lu(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ot;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=No;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=si;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=Bt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(ru);var i_=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zn,"__esModule",{value:!0});zn.JsonRpcEngine=void 0;const o_=i_(Ao),lt=ru;class Ct extends o_.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,a,c]=await Ct._runAllMiddleware(t,r,this._middleware);return a?(await Ct._runReturnHandlers(c),s(i)):n(async h=>{try{await Ct._runReturnHandlers(c)}catch(d){return h(d)}return h()})}catch(i){return s(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const a=new lt.EthereumRpcError(lt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){const a=new lt.EthereumRpcError(lt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},t),s={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,s)}catch(a){i=a}return i&&(delete s.result,s.error||(s.error=lt.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await Ct._runAllMiddleware(t,r,this._middleware);if(Ct._checkForCompletion(t,r,s),await Ct._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,a=!1;for(const c of n)if([i,a]=await Ct._runMiddleware(t,r,c,s),a)break;return[i,a,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const a=h=>{const d=h||r.error;d&&(r.error=lt.serializeError(d)),i([d,!0])},c=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new lt.EthereumRpcError(lt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request:
|