@dcl/governance-site 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{BlockOverrides-5aa03deb.js → BlockOverrides-20fed6f4.js} +1 -1
- package/assets/{ConstantsUtil-e755f570.js → ConstantsUtil-5b007dc6.js} +1 -1
- package/assets/{ExchangeController-07ca0dff.js → ExchangeController-7e00faa3.js} +1 -1
- package/assets/{HelpersUtil-1d3b358c.js → HelpersUtil-619fe34c.js} +1 -1
- package/assets/{NetworkUtil-ac31bde2.js → NetworkUtil-02b4425a.js} +1 -1
- package/assets/{ReownAuthentication-13884452.js → ReownAuthentication-1b062588.js} +1 -1
- package/assets/{SwapController-5d2aa497.js → SwapController-967c3bb7.js} +1 -1
- package/assets/{UserAvatar-4ba08812.js → UserAvatar-9f3237d1.js} +1 -1
- package/assets/{browser-9930fa4f.js → browser-38882dd1.js} +1 -1
- package/assets/{ccip-427b9703.js → ccip-764d5507.js} +1 -1
- package/assets/{ccip-b78370d2.js → ccip-f1cad225.js} +1 -1
- package/assets/{data-capture-fd593049.js → data-capture-b76da51a.js} +1 -1
- package/assets/{email-225a204e.js → email-65fe5ba2.js} +1 -1
- package/assets/{embedded-wallet-57623b5b.js → embedded-wallet-d76a09b7.js} +1 -1
- package/assets/features-a44be130.js +1 -0
- package/assets/{fortmatic-b0db237f.js → fortmatic-16e19888.js} +1 -1
- package/assets/{if-defined-d80070a2.js → if-defined-92244c26.js} +1 -1
- package/assets/{index-588af472.js → index-026a802e.js} +1 -1
- package/assets/{index-9316262b.js → index-03870cad.js} +1 -1
- package/assets/{index-582b123e.js → index-27925a2f.js} +1 -1
- package/assets/{index-c1778978.js → index-28c16ace.js} +1 -1
- package/assets/{index-58a87c33.js → index-29a16f18.js} +1 -1
- package/assets/{index-e1227808.js → index-3157a25f.js} +1 -1
- package/assets/{index-72f469a0.js → index-33c90fff.js} +1 -1
- package/assets/{index-7d6a72b6.js → index-33d1eb17.js} +1 -1
- package/assets/{index-15a9f4ff.js → index-34752e67.js} +1 -1
- package/assets/{index-c8dd3770.js → index-3cc40d48.js} +1 -1
- package/assets/{index-0670054e.js → index-52e013c4.js} +1 -1
- package/assets/{index-c979183a.js → index-57e0dc54.js} +1 -1
- package/assets/{index-d859de90.js → index-5a81d007.js} +1 -1
- package/assets/{index-10ae3d90.js → index-60a03db2.js} +1 -1
- package/assets/{index-e56d4bd2.js → index-67ef8b4a.js} +1 -1
- package/assets/{index-00ad18d3.js → index-714a675d.js} +1 -1
- package/assets/{index-11bcf729.js → index-7b68384a.js} +12 -12
- package/assets/{index-0a7a7ba7.js → index-7bb70dc0.js} +1 -1
- package/assets/{index-2fa762db.js → index-7fd459dc.js} +1 -1
- package/assets/{index-ac0bb06c.js → index-81e632eb.js} +1 -1
- package/assets/{index-76a41282.js → index-94114b1d.js} +1 -1
- package/assets/{index-fbf5b7e7.js → index-9622e3f7.js} +1 -1
- package/assets/{index-03d093fc.js → index-97685b09.js} +1 -1
- package/assets/{index-af3f5ea8.js → index-9d7b64c5.js} +1 -1
- package/assets/{index-5f12374f.js → index-a0eaa57b.js} +2 -2
- package/assets/{index-394e4efc.css → index-ab9ba68c.css} +4 -4
- package/assets/{index-c2a3bd8a.js → index-b60004aa.js} +1 -1
- package/assets/{index-e8ce8a93.js → index-b7ff7f7f.js} +1 -1
- package/assets/{index-d358a4b7.js → index-c4d19ff7.js} +1 -1
- package/assets/{index-8083b9d1.js → index-c698c1f5.js} +1 -1
- package/assets/{index-41fd5150.js → index-c7587657.js} +1 -1
- package/assets/{index-ceb7074a.js → index-cfb33cb3.js} +1 -1
- package/assets/{index-85272239.js → index-d149e016.js} +1 -1
- package/assets/{index-e575374c.js → index-dd806019.js} +1 -1
- package/assets/{index-24a2ccf1.js → index-dea98de6.js} +1 -1
- package/assets/{index-2e4dd1f3.js → index-ee0b5500.js} +1 -1
- package/assets/{index-e714c2f7.js → index-ff100d2b.js} +1 -1
- package/assets/{index-66ca5bf6.js → index-ff62bbe7.js} +1 -1
- package/assets/{index.web-6c9e24b4.js → index.web-0b5f4697.js} +1 -1
- package/assets/{networks-f45884af.js → networks-9f3446a4.js} +1 -1
- package/assets/{onramp-35f79bb2.js → onramp-7dc355d5.js} +1 -1
- package/assets/{pay-with-exchange-f2de4e96.js → pay-with-exchange-4b9eb30a.js} +1 -1
- package/assets/{receive-ab837906.js → receive-b6c8e808.js} +1 -1
- package/assets/{ref-9b058653.js → ref-3aacfb42.js} +1 -1
- package/assets/{secp256k1-068579d6.js → secp256k1-eed662a5.js} +1 -1
- package/assets/{send-6967b31e.js → send-46dbb49f.js} +1 -1
- package/assets/{socials-94fb5d87.js → socials-85d095dc.js} +1 -1
- package/assets/{swaps-b40dcb0f.js → swaps-d413a89f.js} +1 -1
- package/assets/{transactions-be032750.js → transactions-342a8d38.js} +1 -1
- package/assets/{w3m-modal-dfc25d32.js → w3m-modal-98fb6186.js} +1 -1
- package/assets/{zoraTestnet-5800eec8.js → zoraTestnet-a66d1115.js} +2 -2
- package/index.html +4 -4
- package/package.json +3 -3
- package/assets/features-48b2fca5.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a2 as cl,_ as B,ax as U,t as ll,c as ul,a3 as Br,a9 as _i,a_ as hl,a$ as dl,b0 as cn,a1 as _a,b as fl,b1 as Ei,b2 as gl,g as pl}from"./index-11bcf729.js";import{r as ml,a as Tt,b as Ea,c as vl}from"./browser-9930fa4f.js";import{i as bl}from"./index-980812a4.js";function wl(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 Si={},sn={},Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.walletLogo=void 0;const yl=(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 `}};Xn.walletLogo=yl;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.LINK_API_URL=void 0;Yn.LINK_API_URL="https://www.walletlink.org";var T={},ki={exports:{}};ki.exports;(function(e){(function(t,r){function n(y,o){if(!y)throw new Error(o||"Assertion failed")}function s(y,o){y.super_=o;var l=function(){};l.prototype=o.prototype,y.prototype=new l,y.prototype.constructor=y}function i(y,o,l){if(i.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((o==="le"||o==="be")&&(l=o,o=10),this._init(y||0,o||10,l||"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=cl.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,l){return o.cmp(l)>0?o:l},i.min=function(o,l){return o.cmp(l)<0?o:l},i.prototype._init=function(o,l,d){if(typeof o=="number")return this._initNumber(o,l,d);if(typeof o=="object")return this._initArray(o,l,d);l==="hex"&&(l=16),n(l===(l|0)&&l>=2&&l<=36),o=o.toString().replace(/\s+/g,"");var p=0;o[0]==="-"&&(p++,this.negative=1),p<o.length&&(l===16?this._parseHex(o,p,d):(this._parseBase(o,l,p),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(o,l,d){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),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(o,l,d){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 p=0;p<this.length;p++)this.words[p]=0;var v,w,E=0;if(d==="be")for(p=o.length-1,v=0;p>=0;p-=3)w=o[p]|o[p-1]<<8|o[p-2]<<16,this.words[v]|=w<<E&67108863,this.words[v+1]=w>>>26-E&67108863,E+=24,E>=26&&(E-=26,v++);else if(d==="le")for(p=0,v=0;p<o.length;p+=3)w=o[p]|o[p+1]<<8|o[p+2]<<16,this.words[v]|=w<<E&67108863,this.words[v+1]=w>>>26-E&67108863,E+=24,E>=26&&(E-=26,v++);return this._strip()};function u(y,o){var l=y.charCodeAt(o);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;n(!1,"Invalid character in "+y)}function h(y,o,l){var d=u(y,l);return l-1>=o&&(d|=u(y,l-1)<<4),d}i.prototype._parseHex=function(o,l,d){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var v=0,w=0,E;if(d==="be")for(p=o.length-1;p>=l;p-=2)E=h(o,l,p)<<v,this.words[w]|=E&67108863,v>=18?(v-=18,w+=1,this.words[w]|=E>>>26):v+=8;else{var m=o.length-l;for(p=m%2===0?l+1:l;p<o.length;p+=2)E=h(o,l,p)<<v,this.words[w]|=E&67108863,v>=18?(v-=18,w+=1,this.words[w]|=E>>>26):v+=8}this._strip()};function g(y,o,l,d){for(var p=0,v=0,w=Math.min(y.length,l),E=o;E<w;E++){var m=y.charCodeAt(E)-48;p*=d,m>=49?v=m-49+10:m>=17?v=m-17+10:v=m,n(m>=0&&v<d,"Invalid character"),p+=v}return p}i.prototype._parseBase=function(o,l,d){this.words=[0],this.length=1;for(var p=0,v=1;v<=67108863;v*=l)p++;p--,v=v/l|0;for(var w=o.length-d,E=w%p,m=Math.min(w,w-E)+d,c=0,b=d;b<m;b+=p)c=g(o,b,b+p,l),this.imuln(v),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(E!==0){var L=1;for(c=g(o,b,o.length,l),b=0;b<E;b++)L*=l;this.imuln(L),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(o){o.words=new Array(this.length);for(var l=0;l<this.length;l++)o.words[l]=this.words[l];o.length=this.length,o.negative=this.negative,o.red=this.red};function f(y,o){y.words=o.words,y.length=o.length,y.negative=o.negative,y.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")]=S}catch{i.prototype.inspect=S}else i.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var _=["","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"],k=[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],x=[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,l){o=o||10,l=l|0||1;var d;if(o===16||o==="hex"){d="";for(var p=0,v=0,w=0;w<this.length;w++){var E=this.words[w],m=((E<<p|v)&16777215).toString(16);v=E>>>24-p&16777215,p+=2,p>=26&&(p-=26,w--),v!==0||w!==this.length-1?d=_[6-m.length]+m+d:d=m+d}for(v!==0&&(d=v.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(o===(o|0)&&o>=2&&o<=36){var c=k[o],b=x[o];d="";var L=this.clone();for(L.negative=0;!L.isZero();){var C=L.modrn(b).toString(o);L=L.idivn(b),L.isZero()?d=C+d:d=_[c-C.length]+C+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}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,l){return this.toArrayLike(a,o,l)}),i.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)};var M=function(o,l){return o.allocUnsafe?o.allocUnsafe(l):new o(l)};i.prototype.toArrayLike=function(o,l,d){this._strip();var p=this.byteLength(),v=d||Math.max(1,p);n(p<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var w=M(o,v),E=l==="le"?"LE":"BE";return this["_toArrayLike"+E](w,p),w},i.prototype._toArrayLikeLE=function(o,l){for(var d=0,p=0,v=0,w=0;v<this.length;v++){var E=this.words[v]<<w|p;o[d++]=E&255,d<o.length&&(o[d++]=E>>8&255),d<o.length&&(o[d++]=E>>16&255),w===6?(d<o.length&&(o[d++]=E>>24&255),p=0,w=0):(p=E>>>24,w+=2)}if(d<o.length)for(o[d++]=p;d<o.length;)o[d++]=0},i.prototype._toArrayLikeBE=function(o,l){for(var d=o.length-1,p=0,v=0,w=0;v<this.length;v++){var E=this.words[v]<<w|p;o[d--]=E&255,d>=0&&(o[d--]=E>>8&255),d>=0&&(o[d--]=E>>16&255),w===6?(d>=0&&(o[d--]=E>>24&255),p=0,w=0):(p=E>>>24,w+=2)}if(d>=0)for(o[d--]=p;d>=0;)o[d--]=0},Math.clz32?i.prototype._countBits=function(o){return 32-Math.clz32(o)}:i.prototype._countBits=function(o){var l=o,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(o){if(o===0)return 26;var l=o,d=0;return l&8191||(d+=13,l>>>=13),l&127||(d+=7,l>>>=7),l&15||(d+=4,l>>>=4),l&3||(d+=2,l>>>=2),l&1||d++,d},i.prototype.bitLength=function(){var o=this.words[this.length-1],l=this._countBits(o);return(this.length-1)*26+l};function O(y){for(var o=new Array(y.bitLength()),l=0;l<o.length;l++){var d=l/26|0,p=l%26;o[l]=y.words[d]>>>p&1}return o}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(o+=d,d!==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 l=0;l<o.length;l++)this.words[l]=this.words[l]|o.words[l];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 l;this.length>o.length?l=o:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&o.words[d];return this.length=l.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 l,d;this.length>o.length?(l=this,d=o):(l=o,d=this);for(var p=0;p<d.length;p++)this.words[p]=l.words[p]^d.words[p];if(this!==l)for(;p<l.length;p++)this.words[p]=l.words[p];return this.length=l.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 l=Math.ceil(o/26)|0,d=o%26;this._expand(l),d>0&&l--;for(var p=0;p<l;p++)this.words[p]=~this.words[p]&67108863;return d>0&&(this.words[p]=~this.words[p]&67108863>>26-d),this._strip()},i.prototype.notn=function(o){return this.clone().inotn(o)},i.prototype.setn=function(o,l){n(typeof o=="number"&&o>=0);var d=o/26|0,p=o%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<p:this.words[d]=this.words[d]&~(1<<p),this._strip()},i.prototype.iadd=function(o){var l;if(this.negative!==0&&o.negative===0)return this.negative=0,l=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,l=this.isub(o),o.negative=1,l._normSign();var d,p;this.length>o.length?(d=this,p=o):(d=o,p=this);for(var v=0,w=0;w<p.length;w++)l=(d.words[w]|0)+(p.words[w]|0)+v,this.words[w]=l&67108863,v=l>>>26;for(;v!==0&&w<d.length;w++)l=(d.words[w]|0)+v,this.words[w]=l&67108863,v=l>>>26;if(this.length=d.length,v!==0)this.words[this.length]=v,this.length++;else if(d!==this)for(;w<d.length;w++)this.words[w]=d.words[w];return this},i.prototype.add=function(o){var l;return o.negative!==0&&this.negative===0?(o.negative=0,l=this.sub(o),o.negative^=1,l):o.negative===0&&this.negative!==0?(this.negative=0,l=o.sub(this),this.negative=1,l):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 l=this.iadd(o);return o.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var d=this.cmp(o);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,v;d>0?(p=this,v=o):(p=o,v=this);for(var w=0,E=0;E<v.length;E++)l=(p.words[E]|0)-(v.words[E]|0)+w,w=l>>26,this.words[E]=l&67108863;for(;w!==0&&E<p.length;E++)l=(p.words[E]|0)+w,w=l>>26,this.words[E]=l&67108863;if(w===0&&E<p.length&&p!==this)for(;E<p.length;E++)this.words[E]=p.words[E];return this.length=Math.max(this.length,E),p!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(o){return this.clone().isub(o)};function $(y,o,l){l.negative=o.negative^y.negative;var d=y.length+o.length|0;l.length=d,d=d-1|0;var p=y.words[0]|0,v=o.words[0]|0,w=p*v,E=w&67108863,m=w/67108864|0;l.words[0]=E;for(var c=1;c<d;c++){for(var b=m>>>26,L=m&67108863,C=Math.min(c,o.length-1),N=Math.max(0,c-y.length+1);N<=C;N++){var Q=c-N|0;p=y.words[Q]|0,v=o.words[N]|0,w=p*v+L,b+=w/67108864|0,L=w&67108863}l.words[c]=L|0,m=b|0}return m!==0?l.words[c]=m|0:l.length--,l._strip()}var I=function(o,l,d){var p=o.words,v=l.words,w=d.words,E=0,m,c,b,L=p[0]|0,C=L&8191,N=L>>>13,Q=p[1]|0,G=Q&8191,K=Q>>>13,Jr=p[2]|0,Se=Jr&8191,ke=Jr>>>13,Gr=p[3]|0,Me=Gr&8191,Re=Gr>>>13,Zr=p[4]|0,Ie=Zr&8191,Ce=Zr>>>13,Qr=p[5]|0,xe=Qr&8191,Ae=Qr>>>13,Kr=p[6]|0,Ne=Kr&8191,Le=Kr>>>13,Xr=p[7]|0,Te=Xr&8191,$e=Xr>>>13,cr=p[8]|0,Y=cr&8191,ee=cr>>>13,lr=p[9]|0,te=lr&8191,re=lr>>>13,ur=v[0]|0,ne=ur&8191,se=ur>>>13,hr=v[1]|0,ie=hr&8191,oe=hr>>>13,dr=v[2]|0,ae=dr&8191,ce=dr>>>13,fr=v[3]|0,le=fr&8191,ue=fr>>>13,gr=v[4]|0,he=gr&8191,de=gr>>>13,pr=v[5]|0,fe=pr&8191,ge=pr>>>13,mr=v[6]|0,pe=mr&8191,me=mr>>>13,vr=v[7]|0,ve=vr&8191,be=vr>>>13,br=v[8]|0,we=br&8191,ye=br>>>13,wr=v[9]|0,_e=wr&8191,Ee=wr>>>13;d.negative=o.negative^l.negative,d.length=19,m=Math.imul(C,ne),c=Math.imul(C,se),c=c+Math.imul(N,ne)|0,b=Math.imul(N,se);var $t=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+($t>>>26)|0,$t&=67108863,m=Math.imul(G,ne),c=Math.imul(G,se),c=c+Math.imul(K,ne)|0,b=Math.imul(K,se),m=m+Math.imul(C,ie)|0,c=c+Math.imul(C,oe)|0,c=c+Math.imul(N,ie)|0,b=b+Math.imul(N,oe)|0;var Pt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,m=Math.imul(Se,ne),c=Math.imul(Se,se),c=c+Math.imul(ke,ne)|0,b=Math.imul(ke,se),m=m+Math.imul(G,ie)|0,c=c+Math.imul(G,oe)|0,c=c+Math.imul(K,ie)|0,b=b+Math.imul(K,oe)|0,m=m+Math.imul(C,ae)|0,c=c+Math.imul(C,ce)|0,c=c+Math.imul(N,ae)|0,b=b+Math.imul(N,ce)|0;var Ot=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,m=Math.imul(Me,ne),c=Math.imul(Me,se),c=c+Math.imul(Re,ne)|0,b=Math.imul(Re,se),m=m+Math.imul(Se,ie)|0,c=c+Math.imul(Se,oe)|0,c=c+Math.imul(ke,ie)|0,b=b+Math.imul(ke,oe)|0,m=m+Math.imul(G,ae)|0,c=c+Math.imul(G,ce)|0,c=c+Math.imul(K,ae)|0,b=b+Math.imul(K,ce)|0,m=m+Math.imul(C,le)|0,c=c+Math.imul(C,ue)|0,c=c+Math.imul(N,le)|0,b=b+Math.imul(N,ue)|0;var Bt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,m=Math.imul(Ie,ne),c=Math.imul(Ie,se),c=c+Math.imul(Ce,ne)|0,b=Math.imul(Ce,se),m=m+Math.imul(Me,ie)|0,c=c+Math.imul(Me,oe)|0,c=c+Math.imul(Re,ie)|0,b=b+Math.imul(Re,oe)|0,m=m+Math.imul(Se,ae)|0,c=c+Math.imul(Se,ce)|0,c=c+Math.imul(ke,ae)|0,b=b+Math.imul(ke,ce)|0,m=m+Math.imul(G,le)|0,c=c+Math.imul(G,ue)|0,c=c+Math.imul(K,le)|0,b=b+Math.imul(K,ue)|0,m=m+Math.imul(C,he)|0,c=c+Math.imul(C,de)|0,c=c+Math.imul(N,he)|0,b=b+Math.imul(N,de)|0;var Dt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,m=Math.imul(xe,ne),c=Math.imul(xe,se),c=c+Math.imul(Ae,ne)|0,b=Math.imul(Ae,se),m=m+Math.imul(Ie,ie)|0,c=c+Math.imul(Ie,oe)|0,c=c+Math.imul(Ce,ie)|0,b=b+Math.imul(Ce,oe)|0,m=m+Math.imul(Me,ae)|0,c=c+Math.imul(Me,ce)|0,c=c+Math.imul(Re,ae)|0,b=b+Math.imul(Re,ce)|0,m=m+Math.imul(Se,le)|0,c=c+Math.imul(Se,ue)|0,c=c+Math.imul(ke,le)|0,b=b+Math.imul(ke,ue)|0,m=m+Math.imul(G,he)|0,c=c+Math.imul(G,de)|0,c=c+Math.imul(K,he)|0,b=b+Math.imul(K,de)|0,m=m+Math.imul(C,fe)|0,c=c+Math.imul(C,ge)|0,c=c+Math.imul(N,fe)|0,b=b+Math.imul(N,ge)|0;var Ft=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,m=Math.imul(Ne,ne),c=Math.imul(Ne,se),c=c+Math.imul(Le,ne)|0,b=Math.imul(Le,se),m=m+Math.imul(xe,ie)|0,c=c+Math.imul(xe,oe)|0,c=c+Math.imul(Ae,ie)|0,b=b+Math.imul(Ae,oe)|0,m=m+Math.imul(Ie,ae)|0,c=c+Math.imul(Ie,ce)|0,c=c+Math.imul(Ce,ae)|0,b=b+Math.imul(Ce,ce)|0,m=m+Math.imul(Me,le)|0,c=c+Math.imul(Me,ue)|0,c=c+Math.imul(Re,le)|0,b=b+Math.imul(Re,ue)|0,m=m+Math.imul(Se,he)|0,c=c+Math.imul(Se,de)|0,c=c+Math.imul(ke,he)|0,b=b+Math.imul(ke,de)|0,m=m+Math.imul(G,fe)|0,c=c+Math.imul(G,ge)|0,c=c+Math.imul(K,fe)|0,b=b+Math.imul(K,ge)|0,m=m+Math.imul(C,pe)|0,c=c+Math.imul(C,me)|0,c=c+Math.imul(N,pe)|0,b=b+Math.imul(N,me)|0;var jt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(jt>>>26)|0,jt&=67108863,m=Math.imul(Te,ne),c=Math.imul(Te,se),c=c+Math.imul($e,ne)|0,b=Math.imul($e,se),m=m+Math.imul(Ne,ie)|0,c=c+Math.imul(Ne,oe)|0,c=c+Math.imul(Le,ie)|0,b=b+Math.imul(Le,oe)|0,m=m+Math.imul(xe,ae)|0,c=c+Math.imul(xe,ce)|0,c=c+Math.imul(Ae,ae)|0,b=b+Math.imul(Ae,ce)|0,m=m+Math.imul(Ie,le)|0,c=c+Math.imul(Ie,ue)|0,c=c+Math.imul(Ce,le)|0,b=b+Math.imul(Ce,ue)|0,m=m+Math.imul(Me,he)|0,c=c+Math.imul(Me,de)|0,c=c+Math.imul(Re,he)|0,b=b+Math.imul(Re,de)|0,m=m+Math.imul(Se,fe)|0,c=c+Math.imul(Se,ge)|0,c=c+Math.imul(ke,fe)|0,b=b+Math.imul(ke,ge)|0,m=m+Math.imul(G,pe)|0,c=c+Math.imul(G,me)|0,c=c+Math.imul(K,pe)|0,b=b+Math.imul(K,me)|0,m=m+Math.imul(C,ve)|0,c=c+Math.imul(C,be)|0,c=c+Math.imul(N,ve)|0,b=b+Math.imul(N,be)|0;var Ht=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,m=Math.imul(Y,ne),c=Math.imul(Y,se),c=c+Math.imul(ee,ne)|0,b=Math.imul(ee,se),m=m+Math.imul(Te,ie)|0,c=c+Math.imul(Te,oe)|0,c=c+Math.imul($e,ie)|0,b=b+Math.imul($e,oe)|0,m=m+Math.imul(Ne,ae)|0,c=c+Math.imul(Ne,ce)|0,c=c+Math.imul(Le,ae)|0,b=b+Math.imul(Le,ce)|0,m=m+Math.imul(xe,le)|0,c=c+Math.imul(xe,ue)|0,c=c+Math.imul(Ae,le)|0,b=b+Math.imul(Ae,ue)|0,m=m+Math.imul(Ie,he)|0,c=c+Math.imul(Ie,de)|0,c=c+Math.imul(Ce,he)|0,b=b+Math.imul(Ce,de)|0,m=m+Math.imul(Me,fe)|0,c=c+Math.imul(Me,ge)|0,c=c+Math.imul(Re,fe)|0,b=b+Math.imul(Re,ge)|0,m=m+Math.imul(Se,pe)|0,c=c+Math.imul(Se,me)|0,c=c+Math.imul(ke,pe)|0,b=b+Math.imul(ke,me)|0,m=m+Math.imul(G,ve)|0,c=c+Math.imul(G,be)|0,c=c+Math.imul(K,ve)|0,b=b+Math.imul(K,be)|0,m=m+Math.imul(C,we)|0,c=c+Math.imul(C,ye)|0,c=c+Math.imul(N,we)|0,b=b+Math.imul(N,ye)|0;var Ut=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,m=Math.imul(te,ne),c=Math.imul(te,se),c=c+Math.imul(re,ne)|0,b=Math.imul(re,se),m=m+Math.imul(Y,ie)|0,c=c+Math.imul(Y,oe)|0,c=c+Math.imul(ee,ie)|0,b=b+Math.imul(ee,oe)|0,m=m+Math.imul(Te,ae)|0,c=c+Math.imul(Te,ce)|0,c=c+Math.imul($e,ae)|0,b=b+Math.imul($e,ce)|0,m=m+Math.imul(Ne,le)|0,c=c+Math.imul(Ne,ue)|0,c=c+Math.imul(Le,le)|0,b=b+Math.imul(Le,ue)|0,m=m+Math.imul(xe,he)|0,c=c+Math.imul(xe,de)|0,c=c+Math.imul(Ae,he)|0,b=b+Math.imul(Ae,de)|0,m=m+Math.imul(Ie,fe)|0,c=c+Math.imul(Ie,ge)|0,c=c+Math.imul(Ce,fe)|0,b=b+Math.imul(Ce,ge)|0,m=m+Math.imul(Me,pe)|0,c=c+Math.imul(Me,me)|0,c=c+Math.imul(Re,pe)|0,b=b+Math.imul(Re,me)|0,m=m+Math.imul(Se,ve)|0,c=c+Math.imul(Se,be)|0,c=c+Math.imul(ke,ve)|0,b=b+Math.imul(ke,be)|0,m=m+Math.imul(G,we)|0,c=c+Math.imul(G,ye)|0,c=c+Math.imul(K,we)|0,b=b+Math.imul(K,ye)|0,m=m+Math.imul(C,_e)|0,c=c+Math.imul(C,Ee)|0,c=c+Math.imul(N,_e)|0,b=b+Math.imul(N,Ee)|0;var Vt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,m=Math.imul(te,ie),c=Math.imul(te,oe),c=c+Math.imul(re,ie)|0,b=Math.imul(re,oe),m=m+Math.imul(Y,ae)|0,c=c+Math.imul(Y,ce)|0,c=c+Math.imul(ee,ae)|0,b=b+Math.imul(ee,ce)|0,m=m+Math.imul(Te,le)|0,c=c+Math.imul(Te,ue)|0,c=c+Math.imul($e,le)|0,b=b+Math.imul($e,ue)|0,m=m+Math.imul(Ne,he)|0,c=c+Math.imul(Ne,de)|0,c=c+Math.imul(Le,he)|0,b=b+Math.imul(Le,de)|0,m=m+Math.imul(xe,fe)|0,c=c+Math.imul(xe,ge)|0,c=c+Math.imul(Ae,fe)|0,b=b+Math.imul(Ae,ge)|0,m=m+Math.imul(Ie,pe)|0,c=c+Math.imul(Ie,me)|0,c=c+Math.imul(Ce,pe)|0,b=b+Math.imul(Ce,me)|0,m=m+Math.imul(Me,ve)|0,c=c+Math.imul(Me,be)|0,c=c+Math.imul(Re,ve)|0,b=b+Math.imul(Re,be)|0,m=m+Math.imul(Se,we)|0,c=c+Math.imul(Se,ye)|0,c=c+Math.imul(ke,we)|0,b=b+Math.imul(ke,ye)|0,m=m+Math.imul(G,_e)|0,c=c+Math.imul(G,Ee)|0,c=c+Math.imul(K,_e)|0,b=b+Math.imul(K,Ee)|0;var zt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(zt>>>26)|0,zt&=67108863,m=Math.imul(te,ae),c=Math.imul(te,ce),c=c+Math.imul(re,ae)|0,b=Math.imul(re,ce),m=m+Math.imul(Y,le)|0,c=c+Math.imul(Y,ue)|0,c=c+Math.imul(ee,le)|0,b=b+Math.imul(ee,ue)|0,m=m+Math.imul(Te,he)|0,c=c+Math.imul(Te,de)|0,c=c+Math.imul($e,he)|0,b=b+Math.imul($e,de)|0,m=m+Math.imul(Ne,fe)|0,c=c+Math.imul(Ne,ge)|0,c=c+Math.imul(Le,fe)|0,b=b+Math.imul(Le,ge)|0,m=m+Math.imul(xe,pe)|0,c=c+Math.imul(xe,me)|0,c=c+Math.imul(Ae,pe)|0,b=b+Math.imul(Ae,me)|0,m=m+Math.imul(Ie,ve)|0,c=c+Math.imul(Ie,be)|0,c=c+Math.imul(Ce,ve)|0,b=b+Math.imul(Ce,be)|0,m=m+Math.imul(Me,we)|0,c=c+Math.imul(Me,ye)|0,c=c+Math.imul(Re,we)|0,b=b+Math.imul(Re,ye)|0,m=m+Math.imul(Se,_e)|0,c=c+Math.imul(Se,Ee)|0,c=c+Math.imul(ke,_e)|0,b=b+Math.imul(ke,Ee)|0;var Wt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,m=Math.imul(te,le),c=Math.imul(te,ue),c=c+Math.imul(re,le)|0,b=Math.imul(re,ue),m=m+Math.imul(Y,he)|0,c=c+Math.imul(Y,de)|0,c=c+Math.imul(ee,he)|0,b=b+Math.imul(ee,de)|0,m=m+Math.imul(Te,fe)|0,c=c+Math.imul(Te,ge)|0,c=c+Math.imul($e,fe)|0,b=b+Math.imul($e,ge)|0,m=m+Math.imul(Ne,pe)|0,c=c+Math.imul(Ne,me)|0,c=c+Math.imul(Le,pe)|0,b=b+Math.imul(Le,me)|0,m=m+Math.imul(xe,ve)|0,c=c+Math.imul(xe,be)|0,c=c+Math.imul(Ae,ve)|0,b=b+Math.imul(Ae,be)|0,m=m+Math.imul(Ie,we)|0,c=c+Math.imul(Ie,ye)|0,c=c+Math.imul(Ce,we)|0,b=b+Math.imul(Ce,ye)|0,m=m+Math.imul(Me,_e)|0,c=c+Math.imul(Me,Ee)|0,c=c+Math.imul(Re,_e)|0,b=b+Math.imul(Re,Ee)|0;var qt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(qt>>>26)|0,qt&=67108863,m=Math.imul(te,he),c=Math.imul(te,de),c=c+Math.imul(re,he)|0,b=Math.imul(re,de),m=m+Math.imul(Y,fe)|0,c=c+Math.imul(Y,ge)|0,c=c+Math.imul(ee,fe)|0,b=b+Math.imul(ee,ge)|0,m=m+Math.imul(Te,pe)|0,c=c+Math.imul(Te,me)|0,c=c+Math.imul($e,pe)|0,b=b+Math.imul($e,me)|0,m=m+Math.imul(Ne,ve)|0,c=c+Math.imul(Ne,be)|0,c=c+Math.imul(Le,ve)|0,b=b+Math.imul(Le,be)|0,m=m+Math.imul(xe,we)|0,c=c+Math.imul(xe,ye)|0,c=c+Math.imul(Ae,we)|0,b=b+Math.imul(Ae,ye)|0,m=m+Math.imul(Ie,_e)|0,c=c+Math.imul(Ie,Ee)|0,c=c+Math.imul(Ce,_e)|0,b=b+Math.imul(Ce,Ee)|0;var Jt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,m=Math.imul(te,fe),c=Math.imul(te,ge),c=c+Math.imul(re,fe)|0,b=Math.imul(re,ge),m=m+Math.imul(Y,pe)|0,c=c+Math.imul(Y,me)|0,c=c+Math.imul(ee,pe)|0,b=b+Math.imul(ee,me)|0,m=m+Math.imul(Te,ve)|0,c=c+Math.imul(Te,be)|0,c=c+Math.imul($e,ve)|0,b=b+Math.imul($e,be)|0,m=m+Math.imul(Ne,we)|0,c=c+Math.imul(Ne,ye)|0,c=c+Math.imul(Le,we)|0,b=b+Math.imul(Le,ye)|0,m=m+Math.imul(xe,_e)|0,c=c+Math.imul(xe,Ee)|0,c=c+Math.imul(Ae,_e)|0,b=b+Math.imul(Ae,Ee)|0;var qs=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(qs>>>26)|0,qs&=67108863,m=Math.imul(te,pe),c=Math.imul(te,me),c=c+Math.imul(re,pe)|0,b=Math.imul(re,me),m=m+Math.imul(Y,ve)|0,c=c+Math.imul(Y,be)|0,c=c+Math.imul(ee,ve)|0,b=b+Math.imul(ee,be)|0,m=m+Math.imul(Te,we)|0,c=c+Math.imul(Te,ye)|0,c=c+Math.imul($e,we)|0,b=b+Math.imul($e,ye)|0,m=m+Math.imul(Ne,_e)|0,c=c+Math.imul(Ne,Ee)|0,c=c+Math.imul(Le,_e)|0,b=b+Math.imul(Le,Ee)|0;var Js=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Js>>>26)|0,Js&=67108863,m=Math.imul(te,ve),c=Math.imul(te,be),c=c+Math.imul(re,ve)|0,b=Math.imul(re,be),m=m+Math.imul(Y,we)|0,c=c+Math.imul(Y,ye)|0,c=c+Math.imul(ee,we)|0,b=b+Math.imul(ee,ye)|0,m=m+Math.imul(Te,_e)|0,c=c+Math.imul(Te,Ee)|0,c=c+Math.imul($e,_e)|0,b=b+Math.imul($e,Ee)|0;var Gs=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Gs>>>26)|0,Gs&=67108863,m=Math.imul(te,we),c=Math.imul(te,ye),c=c+Math.imul(re,we)|0,b=Math.imul(re,ye),m=m+Math.imul(Y,_e)|0,c=c+Math.imul(Y,Ee)|0,c=c+Math.imul(ee,_e)|0,b=b+Math.imul(ee,Ee)|0;var Zs=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Zs>>>26)|0,Zs&=67108863,m=Math.imul(te,_e),c=Math.imul(te,Ee),c=c+Math.imul(re,_e)|0,b=Math.imul(re,Ee);var Qs=(E+m|0)+((c&8191)<<13)|0;return E=(b+(c>>>13)|0)+(Qs>>>26)|0,Qs&=67108863,w[0]=$t,w[1]=Pt,w[2]=Ot,w[3]=Bt,w[4]=Dt,w[5]=Ft,w[6]=jt,w[7]=Ht,w[8]=Ut,w[9]=Vt,w[10]=zt,w[11]=Wt,w[12]=qt,w[13]=Jt,w[14]=qs,w[15]=Js,w[16]=Gs,w[17]=Zs,w[18]=Qs,E!==0&&(w[19]=E,d.length++),d};Math.imul||(I=$);function R(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var d=0,p=0,v=0;v<l.length-1;v++){var w=p;p=0;for(var E=d&67108863,m=Math.min(v,o.length-1),c=Math.max(0,v-y.length+1);c<=m;c++){var b=v-c,L=y.words[b]|0,C=o.words[c]|0,N=L*C,Q=N&67108863;w=w+(N/67108864|0)|0,Q=Q+E|0,E=Q&67108863,w=w+(Q>>>26)|0,p+=w>>>26,w&=67108863}l.words[v]=E,d=w,w=p}return d!==0?l.words[v]=d:l.length--,l._strip()}function D(y,o,l){return R(y,o,l)}i.prototype.mulTo=function(o,l){var d,p=this.length+o.length;return this.length===10&&o.length===10?d=I(this,o,l):p<63?d=$(this,o,l):p<1024?d=R(this,o,l):d=D(this,o,l),d},i.prototype.mul=function(o){var l=new i(null);return l.words=new Array(this.length+o.length),this.mulTo(o,l)},i.prototype.mulf=function(o){var l=new i(null);return l.words=new Array(this.length+o.length),D(this,o,l)},i.prototype.imul=function(o){return this.clone().mulTo(o,this)},i.prototype.imuln=function(o){var l=o<0;l&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var d=0,p=0;p<this.length;p++){var v=(this.words[p]|0)*o,w=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=w>>>26,this.words[p]=w&67108863}return d!==0&&(this.words[p]=d,this.length++),this.length=o===0?1:this.length,l?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 l=O(o);if(l.length===0)return new i(1);for(var d=this,p=0;p<l.length&&l[p]===0;p++,d=d.sqr());if(++p<l.length)for(var v=d.sqr();p<l.length;p++,v=v.sqr())l[p]!==0&&(d=d.mul(v));return d},i.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var l=o%26,d=(o-l)/26,p=67108863>>>26-l<<26-l,v;if(l!==0){var w=0;for(v=0;v<this.length;v++){var E=this.words[v]&p,m=(this.words[v]|0)-E<<l;this.words[v]=m|w,w=E>>>26-l}w&&(this.words[v]=w,this.length++)}if(d!==0){for(v=this.length-1;v>=0;v--)this.words[v+d]=this.words[v];for(v=0;v<d;v++)this.words[v]=0;this.length+=d}return this._strip()},i.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},i.prototype.iushrn=function(o,l,d){n(typeof o=="number"&&o>=0);var p;l?p=(l-l%26)/26:p=0;var v=o%26,w=Math.min((o-v)/26,this.length),E=67108863^67108863>>>v<<v,m=d;if(p-=w,p=Math.max(0,p),m){for(var c=0;c<w;c++)m.words[c]=this.words[c];m.length=w}if(w!==0)if(this.length>w)for(this.length-=w,c=0;c<this.length;c++)this.words[c]=this.words[c+w];else this.words[0]=0,this.length=1;var b=0;for(c=this.length-1;c>=0&&(b!==0||c>=p);c--){var L=this.words[c]|0;this.words[c]=b<<26-v|L>>>v,b=L&E}return m&&b!==0&&(m.words[m.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(o,l,d){return n(this.negative===0),this.iushrn(o,l,d)},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 l=o%26,d=(o-l)/26,p=1<<l;if(this.length<=d)return!1;var v=this.words[d];return!!(v&p)},i.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var l=o%26,d=(o-l)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var p=67108863^67108863>>>l<<l;this.words[this.length-1]&=p}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 l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+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 l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+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,l,d){var p=o.length+d,v;this._expand(p);var w,E=0;for(v=0;v<o.length;v++){w=(this.words[v+d]|0)+E;var m=(o.words[v]|0)*l;w-=m&67108863,E=(w>>26)-(m/67108864|0),this.words[v+d]=w&67108863}for(;v<this.length-d;v++)w=(this.words[v+d]|0)+E,E=w>>26,this.words[v+d]=w&67108863;if(E===0)return this._strip();for(n(E===-1),E=0,v=0;v<this.length;v++)w=-(this.words[v]|0)+E,E=w>>26,this.words[v]=w&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(o,l){var d=this.length-o.length,p=this.clone(),v=o,w=v.words[v.length-1]|0,E=this._countBits(w);d=26-E,d!==0&&(v=v.ushln(d),p.iushln(d),w=v.words[v.length-1]|0);var m=p.length-v.length,c;if(l!=="mod"){c=new i(null),c.length=m+1,c.words=new Array(c.length);for(var b=0;b<c.length;b++)c.words[b]=0}var L=p.clone()._ishlnsubmul(v,1,m);L.negative===0&&(p=L,c&&(c.words[m]=1));for(var C=m-1;C>=0;C--){var N=(p.words[v.length+C]|0)*67108864+(p.words[v.length+C-1]|0);for(N=Math.min(N/w|0,67108863),p._ishlnsubmul(v,N,C);p.negative!==0;)N--,p.negative=0,p._ishlnsubmul(v,1,C),p.isZero()||(p.negative^=1);c&&(c.words[C]=N)}return c&&c._strip(),p._strip(),l!=="div"&&d!==0&&p.iushrn(d),{div:c||null,mod:p}},i.prototype.divmod=function(o,l,d){if(n(!o.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var p,v,w;return this.negative!==0&&o.negative===0?(w=this.neg().divmod(o,l),l!=="mod"&&(p=w.div.neg()),l!=="div"&&(v=w.mod.neg(),d&&v.negative!==0&&v.iadd(o)),{div:p,mod:v}):this.negative===0&&o.negative!==0?(w=this.divmod(o.neg(),l),l!=="mod"&&(p=w.div.neg()),{div:p,mod:w.mod}):this.negative&o.negative?(w=this.neg().divmod(o.neg(),l),l!=="div"&&(v=w.mod.neg(),d&&v.negative!==0&&v.isub(o)),{div:w.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new i(0),mod:this}:o.length===1?l==="div"?{div:this.divn(o.words[0]),mod:null}:l==="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,l)},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 l=this.divmod(o);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(o):l.mod,p=o.ushrn(1),v=o.andln(1),w=d.cmp(p);return w<0||v===1&&w===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modrn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var d=(1<<26)%o,p=0,v=this.length-1;v>=0;v--)p=(d*p+(this.words[v]|0))%o;return l?-p:p},i.prototype.modn=function(o){return this.modrn(o)},i.prototype.idivn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var d=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+d*67108864;this.words[p]=v/o|0,d=v%o}return this._strip(),l?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 l=this,d=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new i(1),v=new i(0),w=new i(0),E=new i(1),m=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++m;for(var c=d.clone(),b=l.clone();!l.isZero();){for(var L=0,C=1;!(l.words[0]&C)&&L<26;++L,C<<=1);if(L>0)for(l.iushrn(L);L-- >0;)(p.isOdd()||v.isOdd())&&(p.iadd(c),v.isub(b)),p.iushrn(1),v.iushrn(1);for(var N=0,Q=1;!(d.words[0]&Q)&&N<26;++N,Q<<=1);if(N>0)for(d.iushrn(N);N-- >0;)(w.isOdd()||E.isOdd())&&(w.iadd(c),E.isub(b)),w.iushrn(1),E.iushrn(1);l.cmp(d)>=0?(l.isub(d),p.isub(w),v.isub(E)):(d.isub(l),w.isub(p),E.isub(v))}return{a:w,b:E,gcd:d.iushln(m)}},i.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var l=this,d=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new i(1),v=new i(0),w=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var E=0,m=1;!(l.words[0]&m)&&E<26;++E,m<<=1);if(E>0)for(l.iushrn(E);E-- >0;)p.isOdd()&&p.iadd(w),p.iushrn(1);for(var c=0,b=1;!(d.words[0]&b)&&c<26;++c,b<<=1);if(c>0)for(d.iushrn(c);c-- >0;)v.isOdd()&&v.iadd(w),v.iushrn(1);l.cmp(d)>=0?(l.isub(d),p.isub(v)):(d.isub(l),v.isub(p))}var L;return l.cmpn(1)===0?L=p:L=v,L.cmpn(0)<0&&L.iadd(o),L},i.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),d=o.clone();l.negative=0,d.negative=0;for(var p=0;l.isEven()&&d.isEven();p++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var v=l.cmp(d);if(v<0){var w=l;l=d,d=w}else if(v===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(p)},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 l=o%26,d=(o-l)/26,p=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=p,this;for(var v=p,w=d;v!==0&&w<this.length;w++){var E=this.words[w]|0;E+=v,v=E>>>26,E&=67108863,this.words[w]=E}return v!==0&&(this.words[w]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(o){var l=o<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this._strip();var d;if(this.length>1)d=1;else{l&&(o=-o),n(o<=67108863,"Number is too big");var p=this.words[0]|0;d=p===o?0:p<o?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var l=this.ucmp(o);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var p=this.words[d]|0,v=o.words[d]|0;if(p!==v){p<v?l=-1:p>v&&(l=1);break}}return l},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 H(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 A={k256:null,p224:null,p192:null,p25519:null};function P(y,o){this.name=y,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 l=o,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var p=d<this.n?-1:l.ucmp(this.p);return p===0?(l.words[0]=0,l.length=1):p>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},P.prototype.split=function(o,l){o.iushrn(this.n,0,l)},P.prototype.imulK=function(o){return o.imul(this.k)};function Z(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(Z,P),Z.prototype.split=function(o,l){for(var d=4194303,p=Math.min(o.length,9),v=0;v<p;v++)l.words[v]=o.words[v];if(l.length=p,o.length<=9){o.words[0]=0,o.length=1;return}var w=o.words[9];for(l.words[l.length++]=w&d,v=10;v<o.length;v++){var E=o.words[v]|0;o.words[v-10]=(E&d)<<4|w>>>22,w=E}w>>>=22,o.words[v-10]=w,w===0&&o.length>10?o.length-=10:o.length-=9},Z.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,d=0;d<o.length;d++){var p=o.words[d]|0;l+=p*977,o.words[d]=l&67108863,l=p*64+(l/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function De(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(De,P);function He(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(He,P);function X(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(X,P),X.prototype.imulK=function(o){for(var l=0,d=0;d<o.length;d++){var p=(o.words[d]|0)*19+l,v=p&67108863;p>>>=26,o.words[d]=v,l=p}return l!==0&&(o.words[o.length++]=l),o},i._prime=function(o){if(A[o])return A[o];var l;if(o==="k256")l=new Z;else if(o==="p224")l=new De;else if(o==="p192")l=new He;else if(o==="p25519")l=new X;else throw new Error("Unknown prime "+o);return A[o]=l,l};function H(y){if(typeof y=="string"){var o=i._prime(y);this.m=o.p,this.prime=o}else n(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}H.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},H.prototype._verify2=function(o,l){n((o.negative|l.negative)===0,"red works only with positives"),n(o.red&&o.red===l.red,"red works only with red numbers")},H.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(f(o,o.umod(this.m)._forceRed(this)),o)},H.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},H.prototype.add=function(o,l){this._verify2(o,l);var d=o.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},H.prototype.iadd=function(o,l){this._verify2(o,l);var d=o.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},H.prototype.sub=function(o,l){this._verify2(o,l);var d=o.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},H.prototype.isub=function(o,l){this._verify2(o,l);var d=o.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},H.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},H.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},H.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},H.prototype.isqr=function(o){return this.imul(o,o.clone())},H.prototype.sqr=function(o){return this.mul(o,o)},H.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(n(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(o,d)}for(var p=this.m.subn(1),v=0;!p.isZero()&&p.andln(1)===0;)v++,p.iushrn(1);n(!p.isZero());var w=new i(1).toRed(this),E=w.redNeg(),m=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);this.pow(c,m).cmp(E)!==0;)c.redIAdd(E);for(var b=this.pow(c,p),L=this.pow(o,p.addn(1).iushrn(1)),C=this.pow(o,p),N=v;C.cmp(w)!==0;){for(var Q=C,G=0;Q.cmp(w)!==0;G++)Q=Q.redSqr();n(G<N);var K=this.pow(b,new i(1).iushln(N-G-1));L=L.redMul(K),b=K.redSqr(),C=C.redMul(b),N=G}return L},H.prototype.invm=function(o){var l=o._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},H.prototype.pow=function(o,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return o.clone();var d=4,p=new Array(1<<d);p[0]=new i(1).toRed(this),p[1]=o;for(var v=2;v<p.length;v++)p[v]=this.mul(p[v-1],o);var w=p[0],E=0,m=0,c=l.bitLength()%26;for(c===0&&(c=26),v=l.length-1;v>=0;v--){for(var b=l.words[v],L=c-1;L>=0;L--){var C=b>>L&1;if(w!==p[0]&&(w=this.sqr(w)),C===0&&E===0){m=0;continue}E<<=1,E|=C,m++,!(m!==d&&(v!==0||L!==0))&&(w=this.mul(w,p[E]),m=0,E=0)}c=26}return w},H.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},H.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},i.mont=function(o){return new J(o)};function J(y){H.call(this,y),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(J,H),J.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},J.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var d=o.imul(l),p=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(p).iushrn(this.shift),w=v;return v.cmp(this.m)>=0?w=v.isub(this.m):v.cmpn(0)<0&&(w=v.iadd(this.m)),w._forceRed(this)},J.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new i(0)._forceRed(this);var d=o.mul(l),p=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(p).iushrn(this.shift),w=v;return v.cmp(this.m)>=0?w=v.isub(this.m):v.cmpn(0)<0&&(w=v.iadd(this.m)),w._forceRed(this)},J.prototype.invm=function(o){var l=this.imod(o._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(e,B)})(ki);var es=ki.exports,ln={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.errorValues=Rt.standardErrorCodes=void 0;Rt.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}};Rt.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 ts={},rs={};(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=Rt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,k=r){if(_&&Number.isInteger(_)){const x=_.toString();if(f(t.errorValues,x))return t.errorValues[x].message;if(h(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=n;function s(_){if(!Number.isInteger(_))return!1;const k=_.toString();return!!(t.errorValues[k]||h(_))}e.isValidCode=s;function i(_){var k;if(typeof _=="number")return _;if(a(_))return(k=_.code)!==null&&k!==void 0?k:_.errorCode}e.getErrorCode=i;function a(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function u(_,{shouldIncludeStack:k=!1}={}){const x={};if(_&&typeof _=="object"&&!Array.isArray(_)&&f(_,"code")&&s(_.code)){const M=_;x.code=M.code,M.message&&typeof M.message=="string"?(x.message=M.message,f(M,"data")&&(x.data=M.data)):(x.message=n(x.code),x.data={originalError:g(_)})}else x.code=t.standardErrorCodes.rpc.internal,x.message=S(_,"message")?_.message:r,x.data={originalError:g(_)};return k&&(x.stack=S(_,"stack")?_.stack:void 0),x}e.serialize=u;function h(_){return _>=-32099&&_<=-32e3}function g(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function f(_,k){return Object.prototype.hasOwnProperty.call(_,k)}function S(_,k){return typeof _=="object"&&_!==null&&k in _&&typeof _[k]=="string"}})(rs);Object.defineProperty(ts,"__esModule",{value:!0});ts.standardErrors=void 0;const qe=Rt,Sa=rs;ts.standardErrors={rpc:{parse:e=>st(qe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>st(qe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>st(qe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>st(qe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>st(qe.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 st(t,e)},invalidInput:e=>st(qe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>st(qe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>st(qe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>st(qe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>st(qe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>st(qe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>yr(qe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>yr(qe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>yr(qe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>yr(qe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>yr(qe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>yr(qe.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 Ra(t,r,n)}}};function st(e,t){const[r,n]=ka(t);return new Ma(e,r||(0,Sa.getMessageFromCode)(e),n)}function yr(e,t){const[r,n]=ka(t);return new Ra(e,r||(0,Sa.getMessageFromCode)(e),n)}function ka(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 Ma=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)}},Ra=class extends Ma{constructor(t,r,n){if(!_l(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function _l(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ns={},Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.isErrorResponse=void 0;function El(e){return e.errorMessage!==void 0}Dr.isErrorResponse=El;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.LIB_VERSION=void 0;Fr.LIB_VERSION="3.9.3";Object.defineProperty(ns,"__esModule",{value:!0});ns.serializeError=void 0;const Sl=Dr,kl=Fr,Ml=Rt,Rl=rs;function Il(e,t){const r=(0,Rl.serialize)(Cl(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",kl.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=xl(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ns.serializeError=Il;function Cl(e){return typeof e=="string"?{message:e,code:Ml.standardErrorCodes.rpc.internal}:(0,Sl.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function xl(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=Rt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=ts;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ns;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=rs;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(ln);var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.ProviderType=Ue.RegExpString=Ue.IntNumber=Ue.BigIntString=Ue.AddressString=Ue.HexString=Ue.OpaqueType=void 0;function un(){return e=>e}Ue.OpaqueType=un;Ue.HexString=un();Ue.AddressString=un();Ue.BigIntString=un();function Al(e){return Math.floor(e)}Ue.IntNumber=Al;Ue.RegExpString=un();var oo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(oo||(Ue.ProviderType=oo={}));var Nl=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(T,"__esModule",{value:!0});T.isMobileWeb=T.getLocation=T.isInIFrame=T.createQrUrl=T.getFavicon=T.range=T.isBigNumber=T.ensureParsedJSONObject=T.ensureBN=T.ensureRegExpString=T.ensureIntNumber=T.ensureBuffer=T.ensureAddressString=T.ensureEvenLengthHexString=T.ensureHexString=T.isHexString=T.prepend0x=T.strip0x=T.has0xPrefix=T.hexStringFromIntNumber=T.intNumberFromHexString=T.bigIntStringFromBN=T.hexStringFromBuffer=T.hexStringToUint8Array=T.uint8ArrayToHex=T.randomBytesHex=void 0;const xt=Nl(es),ir=ln,ct=Ue,Ia=/^[0-9]*$/,Ca=/^[a-f0-9]*$/;function Ll(e){return xa(crypto.getRandomValues(new Uint8Array(e)))}T.randomBytesHex=Ll;function xa(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}T.uint8ArrayToHex=xa;function Tl(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}T.hexStringToUint8Array=Tl;function $l(e,t=!1){const r=e.toString("hex");return(0,ct.HexString)(t?`0x${r}`:r)}T.hexStringFromBuffer=$l;function Pl(e){return(0,ct.BigIntString)(e.toString(10))}T.bigIntStringFromBN=Pl;function Ol(e){return(0,ct.IntNumber)(new xt.default(dn(e,!1),16).toNumber())}T.intNumberFromHexString=Ol;function Bl(e){return(0,ct.HexString)(`0x${new xt.default(e).toString(16)}`)}T.hexStringFromIntNumber=Bl;function Mi(e){return e.startsWith("0x")||e.startsWith("0X")}T.has0xPrefix=Mi;function ss(e){return Mi(e)?e.slice(2):e}T.strip0x=ss;function Aa(e){return Mi(e)?`0x${e.slice(2)}`:`0x${e}`}T.prepend0x=Aa;function hn(e){if(typeof e!="string")return!1;const t=ss(e).toLowerCase();return Ca.test(t)}T.isHexString=hn;function Na(e,t=!1){if(typeof e=="string"){const r=ss(e).toLowerCase();if(Ca.test(r))return(0,ct.HexString)(t?`0x${r}`:r)}throw ir.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}T.ensureHexString=Na;function dn(e,t=!1){let r=Na(e,!1);return r.length%2===1&&(r=(0,ct.HexString)(`0${r}`)),t?(0,ct.HexString)(`0x${r}`):r}T.ensureEvenLengthHexString=dn;function Dl(e){if(typeof e=="string"){const t=ss(e).toLowerCase();if(hn(t)&&t.length===40)return(0,ct.AddressString)(Aa(t))}throw ir.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}T.ensureAddressString=Dl;function Fl(e){if(U.isBuffer(e))return e;if(typeof e=="string"){if(hn(e)){const t=dn(e,!1);return U.from(t,"hex")}return U.from(e,"utf8")}throw ir.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}T.ensureBuffer=Fl;function La(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ct.IntNumber)(e);if(typeof e=="string"){if(Ia.test(e))return(0,ct.IntNumber)(Number(e));if(hn(e))return(0,ct.IntNumber)(new xt.default(dn(e,!1),16).toNumber())}throw ir.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}T.ensureIntNumber=La;function jl(e){if(e instanceof RegExp)return(0,ct.RegExpString)(e.toString());throw ir.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}T.ensureRegExpString=jl;function Hl(e){if(e!==null&&(xt.default.isBN(e)||Ta(e)))return new xt.default(e.toString(10),10);if(typeof e=="number")return new xt.default(La(e));if(typeof e=="string"){if(Ia.test(e))return new xt.default(e,10);if(hn(e))return new xt.default(dn(e,!1),16)}throw ir.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}T.ensureBN=Hl;function Ul(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw ir.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}T.ensureParsedJSONObject=Ul;function Ta(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}T.isBigNumber=Ta;function Vl(e,t){return Array.from({length:t-e},(r,n)=>e+n)}T.range=Vl;function zl(){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}`}T.getFavicon=zl;function Wl(e,t,r,n,s,i){const a=n?"parent-id":"id",u=new URLSearchParams({[a]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${u}`}T.createQrUrl=Wl;function $a(){try{return window.frameElement!==null}catch{return!1}}T.isInIFrame=$a;function ql(){try{return $a()&&window.top?window.top.location:window.location}catch{return window.location}}T.getLocation=ql;function Jl(){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)}T.isMobileWeb=Jl;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.ScopedLocalStorage=void 0;class Gl{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}`}}is.ScopedLocalStorage=Gl;var Nr={},fn={},gn={},jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.EVENTS=void 0;jr.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 at={};Object.defineProperty(at,"__esModule",{value:!0});at.RelayAbstract=at.APP_VERSION_KEY=at.LOCAL_STORAGE_ADDRESSES_KEY=at.WALLET_USER_NAME_KEY=void 0;const ao=ln;at.WALLET_USER_NAME_KEY="walletUsername";at.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";at.APP_VERSION_KEY="AppVersion";class Zl{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 ao.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,ao.serializeError)(i,t.method);return s})}}at.RelayAbstract=Zl;var Hr={},Pa={exports:{}},Ql=ll,Kl=ul,Xl=Kl("TypedArray.prototype.buffer",!0),Yl=ml(),eu=Xl||function(t){if(!Yl(t))throw new Ql("Not a Typed Array");return t.buffer},dt=Tt().Buffer,tu=bl,ru=eu,nu=ArrayBuffer.isView||function(t){try{return ru(t),!0}catch{return!1}},su=typeof Uint8Array<"u",Oa=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",iu=Oa&&(dt.prototype instanceof Uint8Array||dt.TYPED_ARRAY_SUPPORT),ou=function(t,r){if(dt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?dt.from(t):t;if(typeof t=="string")return dt.from(t,r);if(Oa&&nu(t)){if(t.byteLength===0)return dt.alloc(0);if(iu){var n=dt.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=dt.from(s);if(i.length===t.byteLength)return i}if(su&&t instanceof Uint8Array)return dt.from(t);var a=tu(t);if(a)for(var u=0;u<t.length;u+=1){var h=t[u];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||dt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return dt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},au=Tt().Buffer,cu=ou;function os(e,t){this._block=au.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}os.prototype.update=function(e,t){e=cu(e,t||"utf8");for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,a=0;a<s;){for(var u=i%n,h=Math.min(s-a,n-u),g=0;g<h;g++)r[u+g]=e[a+g];i+=h,a+=h,i%n===0&&this._update(r)}return this._len+=s,this};os.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};os.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Ur=os,lu=Br,Ba=Ur,uu=Tt().Buffer,hu=[1518500249,1859775393,-1894007588,-899497514],du=new Array(80);function pn(){this.init(),this._w=du,Ba.call(this,64,56)}lu(pn,Ba);pn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function fu(e){return e<<5|e>>>27}function gu(e){return e<<30|e>>>2}function pu(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}pn.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,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var h=0;h<80;++h){var g=~~(h/20),f=fu(r)+pu(g,n,s,i)+a+t[h]+hu[g]|0;a=i,i=s,s=gu(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};pn.prototype._hash=function(){var e=uu.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 mu=pn,vu=Br,Da=Ur,bu=Tt().Buffer,wu=[1518500249,1859775393,-1894007588,-899497514],yu=new Array(80);function mn(){this.init(),this._w=yu,Da.call(this,64,56)}vu(mn,Da);mn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function _u(e){return e<<1|e>>>31}function Eu(e){return e<<5|e>>>27}function Su(e){return e<<30|e>>>2}function ku(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}mn.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,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=_u(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var h=0;h<80;++h){var g=~~(h/20),f=Eu(r)+ku(g,n,s,i)+a+t[h]+wu[g]|0;a=i,i=s,s=Su(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};mn.prototype._hash=function(){var e=bu.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 Mu=mn,Ru=Br,Fa=Ur,Iu=Tt().Buffer,Cu=[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],xu=new Array(64);function vn(){this.init(),this._w=xu,Fa.call(this,64,56)}Ru(vn,Fa);vn.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 Au(e,t,r){return r^e&(t^r)}function Nu(e,t,r){return e&t|r&(e|t)}function Lu(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Tu(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function $u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Pu(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}vn.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,u=this._f|0,h=this._g|0,g=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=Pu(t[f-2])+t[f-7]+$u(t[f-15])+t[f-16]|0;for(var S=0;S<64;++S){var _=g+Tu(a)+Au(a,u,h)+Cu[S]+t[S]|0,k=Lu(r)+Nu(r,n,s)|0;g=h,h=u,u=a,a=i+_|0,i=s,s=n,n=r,r=_+k|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=u+this._f|0,this._g=h+this._g|0,this._h=g+this._h|0};vn.prototype._hash=function(){var e=Iu.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 ja=vn,Ou=Br,Bu=ja,Du=Ur,Fu=Tt().Buffer,ju=new Array(64);function as(){this.init(),this._w=ju,Du.call(this,64,56)}Ou(as,Bu);as.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};as.prototype._hash=function(){var e=Fu.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 Hu=as,Uu=Br,Ha=Ur,Vu=Tt().Buffer,co=[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],zu=new Array(160);function bn(){this.init(),this._w=zu,Ha.call(this,128,112)}Uu(bn,Ha);bn.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 lo(e,t,r){return r^e&(t^r)}function uo(e,t,r){return e&t|r&(e|t)}function ho(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function fo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Wu(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function qu(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Ju(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gu(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ze(e,t){return e>>>0<t>>>0?1:0}bn.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,u=this._fh|0,h=this._gh|0,g=this._hh|0,f=this._al|0,S=this._bl|0,_=this._cl|0,k=this._dl|0,x=this._el|0,M=this._fl|0,O=this._gl|0,$=this._hl|0,I=0;I<32;I+=2)t[I]=e.readInt32BE(I*4),t[I+1]=e.readInt32BE(I*4+4);for(;I<160;I+=2){var R=t[I-30],D=t[I-15*2+1],A=Wu(R,D),P=qu(D,R);R=t[I-2*2],D=t[I-2*2+1];var Z=Ju(R,D),De=Gu(D,R),He=t[I-7*2],X=t[I-7*2+1],H=t[I-16*2],J=t[I-16*2+1],y=P+X|0,o=A+He+ze(y,P)|0;y=y+De|0,o=o+Z+ze(y,De)|0,y=y+J|0,o=o+H+ze(y,J)|0,t[I]=o,t[I+1]=y}for(var l=0;l<160;l+=2){o=t[l],y=t[l+1];var d=uo(r,n,s),p=uo(f,S,_),v=ho(r,f),w=ho(f,r),E=fo(a,x),m=fo(x,a),c=co[l],b=co[l+1],L=lo(a,u,h),C=lo(x,M,O),N=$+m|0,Q=g+E+ze(N,$)|0;N=N+C|0,Q=Q+L+ze(N,C)|0,N=N+b|0,Q=Q+c+ze(N,b)|0,N=N+y|0,Q=Q+o+ze(N,y)|0;var G=w+p|0,K=v+d+ze(G,w)|0;g=h,$=O,h=u,O=M,u=a,M=x,x=k+N|0,a=i+Q+ze(x,k)|0,i=s,k=_,s=n,_=S,n=r,S=f,f=N+G|0,r=Q+K+ze(f,N)|0}this._al=this._al+f|0,this._bl=this._bl+S|0,this._cl=this._cl+_|0,this._dl=this._dl+k|0,this._el=this._el+x|0,this._fl=this._fl+M|0,this._gl=this._gl+O|0,this._hl=this._hl+$|0,this._ah=this._ah+r+ze(this._al,f)|0,this._bh=this._bh+n+ze(this._bl,S)|0,this._ch=this._ch+s+ze(this._cl,_)|0,this._dh=this._dh+i+ze(this._dl,k)|0,this._eh=this._eh+a+ze(this._el,x)|0,this._fh=this._fh+u+ze(this._fl,M)|0,this._gh=this._gh+h+ze(this._gl,O)|0,this._hh=this._hh+g+ze(this._hl,$)|0};bn.prototype._hash=function(){var e=Vu.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 Ua=bn,Zu=Br,Qu=Ua,Ku=Ur,Xu=Tt().Buffer,Yu=new Array(160);function cs(){this.init(),this._w=Yu,Ku.call(this,128,112)}Zu(cs,Qu);cs.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};cs.prototype._hash=function(){var e=Xu.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 eh=cs;(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=mu,e.exports.sha1=Mu,e.exports.sha224=Hu,e.exports.sha256=ja,e.exports.sha384=eh,e.exports.sha512=Ua})(Pa);var th=Pa.exports;Object.defineProperty(Hr,"__esModule",{value:!0});Hr.Session=void 0;const go=th,po=T,mo="session:id",vo="session:secret",bo="session:linked";class Ri{constructor(t,r,n,s){this._storage=t,this._id=r||(0,po.randomBytesHex)(16),this._secret=n||(0,po.randomBytesHex)(32),this._key=new go.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(mo),n=t.getItem(bo),s=t.getItem(vo);return r&&s?new Ri(t,r,s,n==="1"):null}static hash(t){return new go.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(mo,this._id),this._storage.setItem(vo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(bo,this._linked?"1":"0")}}Hr.Session=Ri;var ls={},us={};Object.defineProperty(us,"__esModule",{value:!0});us.Cipher=void 0;const Tn=T;class rh{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,Tn.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)),u=16,h=a.slice(a.byteLength-u),g=a.slice(0,a.byteLength-u),f=new Uint8Array(h),S=new Uint8Array(g),_=new Uint8Array([...n,...f,...S]);return(0,Tn.uint8ArrayToHex)(_)}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,Tn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,Tn.hexStringToUint8Array)(t),u=a.slice(0,12),h=a.slice(12,28),g=a.slice(28),f=new Uint8Array([...g,...h]),S={name:"AES-GCM",iv:new Uint8Array(u)};try{const _=await window.crypto.subtle.decrypt(S,i,f),k=new TextDecoder;n(k.decode(_))}catch(_){s(_)}})()})}}us.Cipher=rh;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.WalletLinkHTTP=void 0;class nh{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}`)}}hs.WalletLinkHTTP=nh;var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.WalletLinkWebSocket=Lr.ConnectionState=void 0;var Rr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Rr||(Lr.ConnectionState=Rr={}));class sh{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,Rr.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,Rr.DISCONNECTED)},s.onopen=i=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Rr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},s.onmessage=i=>{var a,u;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(i.data);(u=this.incomingDataListener)===null||u===void 0||u.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,Rr.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)}}Lr.WalletLinkWebSocket=sh;Object.defineProperty(ls,"__esModule",{value:!0});ls.WalletLinkConnection=void 0;const _r=Ue,ih=us,pt=jr,wo=at,Er=Hr,oh=hs,$n=Lr,yo=1e4,ah=6e4;class ch{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,_r.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=u=>{if(!u)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",g=>u.JsonRpcUrl&&this.handleChainUpdated(g,u.JsonRpcUrl)]]).forEach((g,f)=>{const S=u[f];S!==void 0&&g(S)})},this.handleDestroyed=u=>{var h,g;u==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(g=this.diagnostic)===null||g===void 0||g.log(pt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Er.Session.hash(this.session.id)}))},this.handleAccountUpdated=async u=>{var h,g;try{const f=await this.cipher.decrypt(u);(h=this.listener)===null||h===void 0||h.accountUpdated(f)}catch{(g=this.diagnostic)===null||g===void 0||g.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(u,h)=>{var g,f;try{const S=await this.cipher.decrypt(h);(g=this.listener)===null||g===void 0||g.metadataUpdated(u,S)}catch{(f=this.diagnostic)===null||f===void 0||f.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:u})}},this.handleWalletUsernameUpdated=async u=>{this.handleMetadataUpdated(wo.WALLET_USER_NAME_KEY,u)},this.handleAppVersionUpdated=async u=>{this.handleMetadataUpdated(wo.APP_VERSION_KEY,u)},this.handleChainUpdated=async(u,h)=>{var g,f;try{const S=await this.cipher.decrypt(u),_=await this.cipher.decrypt(h);(g=this.listener)===null||g===void 0||g.chainUpdated(S,_)}catch{(f=this.diagnostic)===null||f===void 0||f.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new ih.Cipher(t.secret),this.diagnostic=s,this.listener=n;const a=new $n.WalletLinkWebSocket(`${r}/rpc`,i);a.setConnectionStateListener(async u=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(pt.EVENTS.CONNECTED_STATE_CHANGE,{state:u,sessionIdHash:Er.Session.hash(t.id)});let g=!1;switch(u){case $n.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(S=>setTimeout(S,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case $n.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),g=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},yo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case $n.ConnectionState.CONNECTING:break}this.connected!==g&&(this.connected=g)}),a.setIncomingDataListener(u=>{var h,g,f;switch(u.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const S=u.type==="IsLinkedOK"?u.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(pt.EVENTS.LINKED,{sessionIdHash:Er.Session.hash(t.id),linked:S,type:u.type,onlineGuests:u.onlineGuests}),this.linked=S||u.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(g=this.diagnostic)===null||g===void 0||g.log(pt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Er.Session.hash(t.id),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.handleSessionMetadataUpdated(u.metadata);break}case"Event":{this.handleIncomingEvent(u);break}}u.id!==void 0&&((f=this.requestResolutions.get(u.id))===null||f===void 0||f(u))}),this.ws=a,this.http=new oh.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(pt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Er.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(pt.EVENTS.DISCONNECTED,{sessionIdHash:Er.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(pt.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,_r.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,_r.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>yo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=ah){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,_r.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,_r.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,_r.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}ls.WalletLinkConnection=ch;var wn={},yn={},Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.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 lh=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yn,"__esModule",{value:!0});yn.injectCssReset=void 0;const uh=lh(Ii);function hh(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(uh.default)),document.documentElement.appendChild(e)}yn.injectCssReset=hh;var ds={};const Ye=_i(hl);var fs={};const gs=_i(dl);var Tr={},ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.CloseIcon=void 0;const _o=Ye;function dh(e){return(0,_o.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,_o.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"}))}ps.CloseIcon=dh;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.CoinbaseWalletRound=void 0;const Pn=Ye;function fh(e){return(0,Pn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Pn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Pn.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,Pn.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"}))}ms.CoinbaseWalletRound=fh;var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.QRCodeIcon=void 0;const Yr=Ye;function gh(e){return(0,Yr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Yr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Yr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Yr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Yr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}vs.QRCodeIcon=gh;var bs={};function Va(e){this.mode=rt.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))}Va.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 _t(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}_t.prototype={addData:function(e){var t=new Va(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=_t.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=Oe.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,u=0;u<this.modules[i].length;u++){var h=u*s,g=this.modules[i][u];g&&(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=Oe.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=Oe.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=Oe.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 u=0;u<2;u++)if(this.modules[n][a-u]==null){var h=!1;i<e.length&&(h=(e[i]>>>s&1)==1);var g=Oe.getMask(t,n,a-u);g&&(h=!h),this.modules[n][a-u]=h,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};_t.PAD0=236;_t.PAD1=17;_t.createData=function(e,t,r){for(var n=yt.getRSBlocks(e,t),s=new za,i=0;i<r.length;i++){var a=r[i];s.put(a.mode,4),s.put(a.getLength(),Oe.getLengthInBits(a.mode,e)),a.write(s)}for(var u=0,i=0;i<n.length;i++)u+=n[i].dataCount;if(s.getLengthInBits()>u*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+u*8+")");for(s.getLengthInBits()+4<=u*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=u*8||(s.put(_t.PAD0,8),s.getLengthInBits()>=u*8));)s.put(_t.PAD1,8);return _t.createBytes(s,n)};_t.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),a=new Array(t.length),u=0;u<t.length;u++){var h=t[u].dataCount,g=t[u].totalCount-h;n=Math.max(n,h),s=Math.max(s,g),i[u]=new Array(h);for(var f=0;f<i[u].length;f++)i[u][f]=255&e.buffer[f+r];r+=h;var S=Oe.getErrorCorrectPolynomial(g),_=new Ir(i[u],S.getLength()-1),k=_.mod(S);a[u]=new Array(S.getLength()-1);for(var f=0;f<a[u].length;f++){var x=f+k.getLength()-a[u].length;a[u][f]=x>=0?k.get(x):0}}for(var M=0,f=0;f<t.length;f++)M+=t[f].totalCount;for(var O=new Array(M),$=0,f=0;f<n;f++)for(var u=0;u<t.length;u++)f<i[u].length&&(O[$++]=i[u][f]);for(var f=0;f<s;f++)for(var u=0;u<t.length;u++)f<a[u].length&&(O[$++]=a[u][f]);return O};var rt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},At={L:1,M:0,Q:3,H:2},It={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Oe={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;Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G15)>=0;)t^=Oe.G15<<Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G15);return(e<<10|t)^Oe.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G18)>=0;)t^=Oe.G18<<Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Oe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case It.PATTERN000:return(t+r)%2==0;case It.PATTERN001:return t%2==0;case It.PATTERN010:return r%3==0;case It.PATTERN011:return(t+r)%3==0;case It.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case It.PATTERN101:return t*r%2+t*r%3==0;case It.PATTERN110:return(t*r%2+t*r%3)%2==0;case It.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Ir([1],0),r=0;r<e;r++)t=t.multiply(new Ir([1,We.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case rt.MODE_NUMBER:return 10;case rt.MODE_ALPHA_NUM:return 9;case rt.MODE_8BIT_BYTE:return 8;case rt.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case rt.MODE_NUMBER:return 12;case rt.MODE_ALPHA_NUM:return 11;case rt.MODE_8BIT_BYTE:return 16;case rt.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case rt.MODE_NUMBER:return 14;case rt.MODE_ALPHA_NUM:return 13;case rt.MODE_8BIT_BYTE:return 16;case rt.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),u=-1;u<=1;u++)if(!(n+u<0||t<=n+u))for(var h=-1;h<=1;h++)s+h<0||t<=s+h||u==0&&h==0||a==e.isDark(n+u,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 g=0;e.isDark(n,s)&&g++,e.isDark(n+1,s)&&g++,e.isDark(n,s+1)&&g++,e.isDark(n+1,s+1)&&g++,(g==0||g==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 S=Math.abs(100*f/t/t-50)/5;return r+=S*10,r}},We={glog:function(e){if(e<1)throw new Error("glog("+e+")");return We.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return We.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Je=0;Je<8;Je++)We.EXP_TABLE[Je]=1<<Je;for(var Je=8;Je<256;Je++)We.EXP_TABLE[Je]=We.EXP_TABLE[Je-4]^We.EXP_TABLE[Je-5]^We.EXP_TABLE[Je-6]^We.EXP_TABLE[Je-8];for(var Je=0;Je<255;Je++)We.LOG_TABLE[We.EXP_TABLE[Je]]=Je;function Ir(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]}Ir.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]^=We.gexp(We.glog(this.get(r))+We.glog(e.get(n)));return new Ir(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=We.glog(this.get(0))-We.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]^=We.gexp(We.glog(e.get(n))+t);return new Ir(r,0).mod(e)}};function yt(e,t){this.totalCount=e,this.dataCount=t}yt.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]];yt.getRSBlocks=function(e,t){var r=yt.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],u=r[i*3+1],h=r[i*3+2],g=0;g<a;g++)s.push(new yt(u,h));return s};yt.getRsBlockTable=function(e,t){switch(t){case At.L:return yt.RS_BLOCK_TABLE[(e-1)*4+0];case At.M:return yt.RS_BLOCK_TABLE[(e-1)*4+1];case At.Q:return yt.RS_BLOCK_TABLE[(e-1)*4+2];case At.H:return yt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function za(){this.buffer=[],this.length=0}za.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 Ks=[[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 Wa(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 At.L;case"M":return At.M;case"Q":return At.Q;case"H":return At.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,g){for(var f=s(h),S=1,_=0,k=0,x=Ks.length;k<=x;k++){var M=Ks[k];if(!M)throw new Error("Content too long: expected "+_+" but got "+f);switch(g){case"L":_=M[0];break;case"M":_=M[1];break;case"Q":_=M[2];break;case"H":_=M[3];break;default:throw new Error("Unknwon error correction level: "+g)}if(f<=_)break;S++}if(S>Ks.length)throw new Error("Content too long");return S}function s(h){var g=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return g.length+(g.length!=h?3:0)}var i=this.options.content,a=n(i,this.options.ecl),u=r(this.options.ecl);this.qrcode=new _t(a,u),this.qrcode.addData(i),this.qrcode.make()}Wa.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{a2 as cl,_ as B,ax as U,t as ll,c as ul,a3 as Br,a9 as _i,a_ as hl,a$ as dl,b0 as cn,a1 as _a,b as fl,b1 as Ei,b2 as gl,g as pl}from"./index-7b68384a.js";import{r as ml,a as Tt,b as Ea,c as vl}from"./browser-38882dd1.js";import{i as bl}from"./index-980812a4.js";function wl(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 Si={},sn={},Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.walletLogo=void 0;const yl=(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 `}};Xn.walletLogo=yl;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.LINK_API_URL=void 0;Yn.LINK_API_URL="https://www.walletlink.org";var T={},ki={exports:{}};ki.exports;(function(e){(function(t,r){function n(y,o){if(!y)throw new Error(o||"Assertion failed")}function s(y,o){y.super_=o;var l=function(){};l.prototype=o.prototype,y.prototype=new l,y.prototype.constructor=y}function i(y,o,l){if(i.isBN(y))return y;this.negative=0,this.words=null,this.length=0,this.red=null,y!==null&&((o==="le"||o==="be")&&(l=o,o=10),this._init(y||0,o||10,l||"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=cl.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,l){return o.cmp(l)>0?o:l},i.min=function(o,l){return o.cmp(l)<0?o:l},i.prototype._init=function(o,l,d){if(typeof o=="number")return this._initNumber(o,l,d);if(typeof o=="object")return this._initArray(o,l,d);l==="hex"&&(l=16),n(l===(l|0)&&l>=2&&l<=36),o=o.toString().replace(/\s+/g,"");var p=0;o[0]==="-"&&(p++,this.negative=1),p<o.length&&(l===16?this._parseHex(o,p,d):(this._parseBase(o,l,p),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(o,l,d){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),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(o,l,d){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 p=0;p<this.length;p++)this.words[p]=0;var v,w,E=0;if(d==="be")for(p=o.length-1,v=0;p>=0;p-=3)w=o[p]|o[p-1]<<8|o[p-2]<<16,this.words[v]|=w<<E&67108863,this.words[v+1]=w>>>26-E&67108863,E+=24,E>=26&&(E-=26,v++);else if(d==="le")for(p=0,v=0;p<o.length;p+=3)w=o[p]|o[p+1]<<8|o[p+2]<<16,this.words[v]|=w<<E&67108863,this.words[v+1]=w>>>26-E&67108863,E+=24,E>=26&&(E-=26,v++);return this._strip()};function u(y,o){var l=y.charCodeAt(o);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;n(!1,"Invalid character in "+y)}function h(y,o,l){var d=u(y,l);return l-1>=o&&(d|=u(y,l-1)<<4),d}i.prototype._parseHex=function(o,l,d){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var v=0,w=0,E;if(d==="be")for(p=o.length-1;p>=l;p-=2)E=h(o,l,p)<<v,this.words[w]|=E&67108863,v>=18?(v-=18,w+=1,this.words[w]|=E>>>26):v+=8;else{var m=o.length-l;for(p=m%2===0?l+1:l;p<o.length;p+=2)E=h(o,l,p)<<v,this.words[w]|=E&67108863,v>=18?(v-=18,w+=1,this.words[w]|=E>>>26):v+=8}this._strip()};function g(y,o,l,d){for(var p=0,v=0,w=Math.min(y.length,l),E=o;E<w;E++){var m=y.charCodeAt(E)-48;p*=d,m>=49?v=m-49+10:m>=17?v=m-17+10:v=m,n(m>=0&&v<d,"Invalid character"),p+=v}return p}i.prototype._parseBase=function(o,l,d){this.words=[0],this.length=1;for(var p=0,v=1;v<=67108863;v*=l)p++;p--,v=v/l|0;for(var w=o.length-d,E=w%p,m=Math.min(w,w-E)+d,c=0,b=d;b<m;b+=p)c=g(o,b,b+p,l),this.imuln(v),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(E!==0){var L=1;for(c=g(o,b,o.length,l),b=0;b<E;b++)L*=l;this.imuln(L),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(o){o.words=new Array(this.length);for(var l=0;l<this.length;l++)o.words[l]=this.words[l];o.length=this.length,o.negative=this.negative,o.red=this.red};function f(y,o){y.words=o.words,y.length=o.length,y.negative=o.negative,y.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")]=S}catch{i.prototype.inspect=S}else i.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var _=["","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"],k=[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],x=[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,l){o=o||10,l=l|0||1;var d;if(o===16||o==="hex"){d="";for(var p=0,v=0,w=0;w<this.length;w++){var E=this.words[w],m=((E<<p|v)&16777215).toString(16);v=E>>>24-p&16777215,p+=2,p>=26&&(p-=26,w--),v!==0||w!==this.length-1?d=_[6-m.length]+m+d:d=m+d}for(v!==0&&(d=v.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(o===(o|0)&&o>=2&&o<=36){var c=k[o],b=x[o];d="";var L=this.clone();for(L.negative=0;!L.isZero();){var C=L.modrn(b).toString(o);L=L.idivn(b),L.isZero()?d=C+d:d=_[c-C.length]+C+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}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,l){return this.toArrayLike(a,o,l)}),i.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)};var M=function(o,l){return o.allocUnsafe?o.allocUnsafe(l):new o(l)};i.prototype.toArrayLike=function(o,l,d){this._strip();var p=this.byteLength(),v=d||Math.max(1,p);n(p<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var w=M(o,v),E=l==="le"?"LE":"BE";return this["_toArrayLike"+E](w,p),w},i.prototype._toArrayLikeLE=function(o,l){for(var d=0,p=0,v=0,w=0;v<this.length;v++){var E=this.words[v]<<w|p;o[d++]=E&255,d<o.length&&(o[d++]=E>>8&255),d<o.length&&(o[d++]=E>>16&255),w===6?(d<o.length&&(o[d++]=E>>24&255),p=0,w=0):(p=E>>>24,w+=2)}if(d<o.length)for(o[d++]=p;d<o.length;)o[d++]=0},i.prototype._toArrayLikeBE=function(o,l){for(var d=o.length-1,p=0,v=0,w=0;v<this.length;v++){var E=this.words[v]<<w|p;o[d--]=E&255,d>=0&&(o[d--]=E>>8&255),d>=0&&(o[d--]=E>>16&255),w===6?(d>=0&&(o[d--]=E>>24&255),p=0,w=0):(p=E>>>24,w+=2)}if(d>=0)for(o[d--]=p;d>=0;)o[d--]=0},Math.clz32?i.prototype._countBits=function(o){return 32-Math.clz32(o)}:i.prototype._countBits=function(o){var l=o,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(o){if(o===0)return 26;var l=o,d=0;return l&8191||(d+=13,l>>>=13),l&127||(d+=7,l>>>=7),l&15||(d+=4,l>>>=4),l&3||(d+=2,l>>>=2),l&1||d++,d},i.prototype.bitLength=function(){var o=this.words[this.length-1],l=this._countBits(o);return(this.length-1)*26+l};function O(y){for(var o=new Array(y.bitLength()),l=0;l<o.length;l++){var d=l/26|0,p=l%26;o[l]=y.words[d]>>>p&1}return o}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(o+=d,d!==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 l=0;l<o.length;l++)this.words[l]=this.words[l]|o.words[l];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 l;this.length>o.length?l=o:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&o.words[d];return this.length=l.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 l,d;this.length>o.length?(l=this,d=o):(l=o,d=this);for(var p=0;p<d.length;p++)this.words[p]=l.words[p]^d.words[p];if(this!==l)for(;p<l.length;p++)this.words[p]=l.words[p];return this.length=l.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 l=Math.ceil(o/26)|0,d=o%26;this._expand(l),d>0&&l--;for(var p=0;p<l;p++)this.words[p]=~this.words[p]&67108863;return d>0&&(this.words[p]=~this.words[p]&67108863>>26-d),this._strip()},i.prototype.notn=function(o){return this.clone().inotn(o)},i.prototype.setn=function(o,l){n(typeof o=="number"&&o>=0);var d=o/26|0,p=o%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<p:this.words[d]=this.words[d]&~(1<<p),this._strip()},i.prototype.iadd=function(o){var l;if(this.negative!==0&&o.negative===0)return this.negative=0,l=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,l=this.isub(o),o.negative=1,l._normSign();var d,p;this.length>o.length?(d=this,p=o):(d=o,p=this);for(var v=0,w=0;w<p.length;w++)l=(d.words[w]|0)+(p.words[w]|0)+v,this.words[w]=l&67108863,v=l>>>26;for(;v!==0&&w<d.length;w++)l=(d.words[w]|0)+v,this.words[w]=l&67108863,v=l>>>26;if(this.length=d.length,v!==0)this.words[this.length]=v,this.length++;else if(d!==this)for(;w<d.length;w++)this.words[w]=d.words[w];return this},i.prototype.add=function(o){var l;return o.negative!==0&&this.negative===0?(o.negative=0,l=this.sub(o),o.negative^=1,l):o.negative===0&&this.negative!==0?(this.negative=0,l=o.sub(this),this.negative=1,l):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 l=this.iadd(o);return o.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var d=this.cmp(o);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,v;d>0?(p=this,v=o):(p=o,v=this);for(var w=0,E=0;E<v.length;E++)l=(p.words[E]|0)-(v.words[E]|0)+w,w=l>>26,this.words[E]=l&67108863;for(;w!==0&&E<p.length;E++)l=(p.words[E]|0)+w,w=l>>26,this.words[E]=l&67108863;if(w===0&&E<p.length&&p!==this)for(;E<p.length;E++)this.words[E]=p.words[E];return this.length=Math.max(this.length,E),p!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(o){return this.clone().isub(o)};function $(y,o,l){l.negative=o.negative^y.negative;var d=y.length+o.length|0;l.length=d,d=d-1|0;var p=y.words[0]|0,v=o.words[0]|0,w=p*v,E=w&67108863,m=w/67108864|0;l.words[0]=E;for(var c=1;c<d;c++){for(var b=m>>>26,L=m&67108863,C=Math.min(c,o.length-1),N=Math.max(0,c-y.length+1);N<=C;N++){var Q=c-N|0;p=y.words[Q]|0,v=o.words[N]|0,w=p*v+L,b+=w/67108864|0,L=w&67108863}l.words[c]=L|0,m=b|0}return m!==0?l.words[c]=m|0:l.length--,l._strip()}var I=function(o,l,d){var p=o.words,v=l.words,w=d.words,E=0,m,c,b,L=p[0]|0,C=L&8191,N=L>>>13,Q=p[1]|0,G=Q&8191,K=Q>>>13,Jr=p[2]|0,Se=Jr&8191,ke=Jr>>>13,Gr=p[3]|0,Me=Gr&8191,Re=Gr>>>13,Zr=p[4]|0,Ie=Zr&8191,Ce=Zr>>>13,Qr=p[5]|0,xe=Qr&8191,Ae=Qr>>>13,Kr=p[6]|0,Ne=Kr&8191,Le=Kr>>>13,Xr=p[7]|0,Te=Xr&8191,$e=Xr>>>13,cr=p[8]|0,Y=cr&8191,ee=cr>>>13,lr=p[9]|0,te=lr&8191,re=lr>>>13,ur=v[0]|0,ne=ur&8191,se=ur>>>13,hr=v[1]|0,ie=hr&8191,oe=hr>>>13,dr=v[2]|0,ae=dr&8191,ce=dr>>>13,fr=v[3]|0,le=fr&8191,ue=fr>>>13,gr=v[4]|0,he=gr&8191,de=gr>>>13,pr=v[5]|0,fe=pr&8191,ge=pr>>>13,mr=v[6]|0,pe=mr&8191,me=mr>>>13,vr=v[7]|0,ve=vr&8191,be=vr>>>13,br=v[8]|0,we=br&8191,ye=br>>>13,wr=v[9]|0,_e=wr&8191,Ee=wr>>>13;d.negative=o.negative^l.negative,d.length=19,m=Math.imul(C,ne),c=Math.imul(C,se),c=c+Math.imul(N,ne)|0,b=Math.imul(N,se);var $t=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+($t>>>26)|0,$t&=67108863,m=Math.imul(G,ne),c=Math.imul(G,se),c=c+Math.imul(K,ne)|0,b=Math.imul(K,se),m=m+Math.imul(C,ie)|0,c=c+Math.imul(C,oe)|0,c=c+Math.imul(N,ie)|0,b=b+Math.imul(N,oe)|0;var Pt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,m=Math.imul(Se,ne),c=Math.imul(Se,se),c=c+Math.imul(ke,ne)|0,b=Math.imul(ke,se),m=m+Math.imul(G,ie)|0,c=c+Math.imul(G,oe)|0,c=c+Math.imul(K,ie)|0,b=b+Math.imul(K,oe)|0,m=m+Math.imul(C,ae)|0,c=c+Math.imul(C,ce)|0,c=c+Math.imul(N,ae)|0,b=b+Math.imul(N,ce)|0;var Ot=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,m=Math.imul(Me,ne),c=Math.imul(Me,se),c=c+Math.imul(Re,ne)|0,b=Math.imul(Re,se),m=m+Math.imul(Se,ie)|0,c=c+Math.imul(Se,oe)|0,c=c+Math.imul(ke,ie)|0,b=b+Math.imul(ke,oe)|0,m=m+Math.imul(G,ae)|0,c=c+Math.imul(G,ce)|0,c=c+Math.imul(K,ae)|0,b=b+Math.imul(K,ce)|0,m=m+Math.imul(C,le)|0,c=c+Math.imul(C,ue)|0,c=c+Math.imul(N,le)|0,b=b+Math.imul(N,ue)|0;var Bt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,m=Math.imul(Ie,ne),c=Math.imul(Ie,se),c=c+Math.imul(Ce,ne)|0,b=Math.imul(Ce,se),m=m+Math.imul(Me,ie)|0,c=c+Math.imul(Me,oe)|0,c=c+Math.imul(Re,ie)|0,b=b+Math.imul(Re,oe)|0,m=m+Math.imul(Se,ae)|0,c=c+Math.imul(Se,ce)|0,c=c+Math.imul(ke,ae)|0,b=b+Math.imul(ke,ce)|0,m=m+Math.imul(G,le)|0,c=c+Math.imul(G,ue)|0,c=c+Math.imul(K,le)|0,b=b+Math.imul(K,ue)|0,m=m+Math.imul(C,he)|0,c=c+Math.imul(C,de)|0,c=c+Math.imul(N,he)|0,b=b+Math.imul(N,de)|0;var Dt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,m=Math.imul(xe,ne),c=Math.imul(xe,se),c=c+Math.imul(Ae,ne)|0,b=Math.imul(Ae,se),m=m+Math.imul(Ie,ie)|0,c=c+Math.imul(Ie,oe)|0,c=c+Math.imul(Ce,ie)|0,b=b+Math.imul(Ce,oe)|0,m=m+Math.imul(Me,ae)|0,c=c+Math.imul(Me,ce)|0,c=c+Math.imul(Re,ae)|0,b=b+Math.imul(Re,ce)|0,m=m+Math.imul(Se,le)|0,c=c+Math.imul(Se,ue)|0,c=c+Math.imul(ke,le)|0,b=b+Math.imul(ke,ue)|0,m=m+Math.imul(G,he)|0,c=c+Math.imul(G,de)|0,c=c+Math.imul(K,he)|0,b=b+Math.imul(K,de)|0,m=m+Math.imul(C,fe)|0,c=c+Math.imul(C,ge)|0,c=c+Math.imul(N,fe)|0,b=b+Math.imul(N,ge)|0;var Ft=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,m=Math.imul(Ne,ne),c=Math.imul(Ne,se),c=c+Math.imul(Le,ne)|0,b=Math.imul(Le,se),m=m+Math.imul(xe,ie)|0,c=c+Math.imul(xe,oe)|0,c=c+Math.imul(Ae,ie)|0,b=b+Math.imul(Ae,oe)|0,m=m+Math.imul(Ie,ae)|0,c=c+Math.imul(Ie,ce)|0,c=c+Math.imul(Ce,ae)|0,b=b+Math.imul(Ce,ce)|0,m=m+Math.imul(Me,le)|0,c=c+Math.imul(Me,ue)|0,c=c+Math.imul(Re,le)|0,b=b+Math.imul(Re,ue)|0,m=m+Math.imul(Se,he)|0,c=c+Math.imul(Se,de)|0,c=c+Math.imul(ke,he)|0,b=b+Math.imul(ke,de)|0,m=m+Math.imul(G,fe)|0,c=c+Math.imul(G,ge)|0,c=c+Math.imul(K,fe)|0,b=b+Math.imul(K,ge)|0,m=m+Math.imul(C,pe)|0,c=c+Math.imul(C,me)|0,c=c+Math.imul(N,pe)|0,b=b+Math.imul(N,me)|0;var jt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(jt>>>26)|0,jt&=67108863,m=Math.imul(Te,ne),c=Math.imul(Te,se),c=c+Math.imul($e,ne)|0,b=Math.imul($e,se),m=m+Math.imul(Ne,ie)|0,c=c+Math.imul(Ne,oe)|0,c=c+Math.imul(Le,ie)|0,b=b+Math.imul(Le,oe)|0,m=m+Math.imul(xe,ae)|0,c=c+Math.imul(xe,ce)|0,c=c+Math.imul(Ae,ae)|0,b=b+Math.imul(Ae,ce)|0,m=m+Math.imul(Ie,le)|0,c=c+Math.imul(Ie,ue)|0,c=c+Math.imul(Ce,le)|0,b=b+Math.imul(Ce,ue)|0,m=m+Math.imul(Me,he)|0,c=c+Math.imul(Me,de)|0,c=c+Math.imul(Re,he)|0,b=b+Math.imul(Re,de)|0,m=m+Math.imul(Se,fe)|0,c=c+Math.imul(Se,ge)|0,c=c+Math.imul(ke,fe)|0,b=b+Math.imul(ke,ge)|0,m=m+Math.imul(G,pe)|0,c=c+Math.imul(G,me)|0,c=c+Math.imul(K,pe)|0,b=b+Math.imul(K,me)|0,m=m+Math.imul(C,ve)|0,c=c+Math.imul(C,be)|0,c=c+Math.imul(N,ve)|0,b=b+Math.imul(N,be)|0;var Ht=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,m=Math.imul(Y,ne),c=Math.imul(Y,se),c=c+Math.imul(ee,ne)|0,b=Math.imul(ee,se),m=m+Math.imul(Te,ie)|0,c=c+Math.imul(Te,oe)|0,c=c+Math.imul($e,ie)|0,b=b+Math.imul($e,oe)|0,m=m+Math.imul(Ne,ae)|0,c=c+Math.imul(Ne,ce)|0,c=c+Math.imul(Le,ae)|0,b=b+Math.imul(Le,ce)|0,m=m+Math.imul(xe,le)|0,c=c+Math.imul(xe,ue)|0,c=c+Math.imul(Ae,le)|0,b=b+Math.imul(Ae,ue)|0,m=m+Math.imul(Ie,he)|0,c=c+Math.imul(Ie,de)|0,c=c+Math.imul(Ce,he)|0,b=b+Math.imul(Ce,de)|0,m=m+Math.imul(Me,fe)|0,c=c+Math.imul(Me,ge)|0,c=c+Math.imul(Re,fe)|0,b=b+Math.imul(Re,ge)|0,m=m+Math.imul(Se,pe)|0,c=c+Math.imul(Se,me)|0,c=c+Math.imul(ke,pe)|0,b=b+Math.imul(ke,me)|0,m=m+Math.imul(G,ve)|0,c=c+Math.imul(G,be)|0,c=c+Math.imul(K,ve)|0,b=b+Math.imul(K,be)|0,m=m+Math.imul(C,we)|0,c=c+Math.imul(C,ye)|0,c=c+Math.imul(N,we)|0,b=b+Math.imul(N,ye)|0;var Ut=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,m=Math.imul(te,ne),c=Math.imul(te,se),c=c+Math.imul(re,ne)|0,b=Math.imul(re,se),m=m+Math.imul(Y,ie)|0,c=c+Math.imul(Y,oe)|0,c=c+Math.imul(ee,ie)|0,b=b+Math.imul(ee,oe)|0,m=m+Math.imul(Te,ae)|0,c=c+Math.imul(Te,ce)|0,c=c+Math.imul($e,ae)|0,b=b+Math.imul($e,ce)|0,m=m+Math.imul(Ne,le)|0,c=c+Math.imul(Ne,ue)|0,c=c+Math.imul(Le,le)|0,b=b+Math.imul(Le,ue)|0,m=m+Math.imul(xe,he)|0,c=c+Math.imul(xe,de)|0,c=c+Math.imul(Ae,he)|0,b=b+Math.imul(Ae,de)|0,m=m+Math.imul(Ie,fe)|0,c=c+Math.imul(Ie,ge)|0,c=c+Math.imul(Ce,fe)|0,b=b+Math.imul(Ce,ge)|0,m=m+Math.imul(Me,pe)|0,c=c+Math.imul(Me,me)|0,c=c+Math.imul(Re,pe)|0,b=b+Math.imul(Re,me)|0,m=m+Math.imul(Se,ve)|0,c=c+Math.imul(Se,be)|0,c=c+Math.imul(ke,ve)|0,b=b+Math.imul(ke,be)|0,m=m+Math.imul(G,we)|0,c=c+Math.imul(G,ye)|0,c=c+Math.imul(K,we)|0,b=b+Math.imul(K,ye)|0,m=m+Math.imul(C,_e)|0,c=c+Math.imul(C,Ee)|0,c=c+Math.imul(N,_e)|0,b=b+Math.imul(N,Ee)|0;var Vt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,m=Math.imul(te,ie),c=Math.imul(te,oe),c=c+Math.imul(re,ie)|0,b=Math.imul(re,oe),m=m+Math.imul(Y,ae)|0,c=c+Math.imul(Y,ce)|0,c=c+Math.imul(ee,ae)|0,b=b+Math.imul(ee,ce)|0,m=m+Math.imul(Te,le)|0,c=c+Math.imul(Te,ue)|0,c=c+Math.imul($e,le)|0,b=b+Math.imul($e,ue)|0,m=m+Math.imul(Ne,he)|0,c=c+Math.imul(Ne,de)|0,c=c+Math.imul(Le,he)|0,b=b+Math.imul(Le,de)|0,m=m+Math.imul(xe,fe)|0,c=c+Math.imul(xe,ge)|0,c=c+Math.imul(Ae,fe)|0,b=b+Math.imul(Ae,ge)|0,m=m+Math.imul(Ie,pe)|0,c=c+Math.imul(Ie,me)|0,c=c+Math.imul(Ce,pe)|0,b=b+Math.imul(Ce,me)|0,m=m+Math.imul(Me,ve)|0,c=c+Math.imul(Me,be)|0,c=c+Math.imul(Re,ve)|0,b=b+Math.imul(Re,be)|0,m=m+Math.imul(Se,we)|0,c=c+Math.imul(Se,ye)|0,c=c+Math.imul(ke,we)|0,b=b+Math.imul(ke,ye)|0,m=m+Math.imul(G,_e)|0,c=c+Math.imul(G,Ee)|0,c=c+Math.imul(K,_e)|0,b=b+Math.imul(K,Ee)|0;var zt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(zt>>>26)|0,zt&=67108863,m=Math.imul(te,ae),c=Math.imul(te,ce),c=c+Math.imul(re,ae)|0,b=Math.imul(re,ce),m=m+Math.imul(Y,le)|0,c=c+Math.imul(Y,ue)|0,c=c+Math.imul(ee,le)|0,b=b+Math.imul(ee,ue)|0,m=m+Math.imul(Te,he)|0,c=c+Math.imul(Te,de)|0,c=c+Math.imul($e,he)|0,b=b+Math.imul($e,de)|0,m=m+Math.imul(Ne,fe)|0,c=c+Math.imul(Ne,ge)|0,c=c+Math.imul(Le,fe)|0,b=b+Math.imul(Le,ge)|0,m=m+Math.imul(xe,pe)|0,c=c+Math.imul(xe,me)|0,c=c+Math.imul(Ae,pe)|0,b=b+Math.imul(Ae,me)|0,m=m+Math.imul(Ie,ve)|0,c=c+Math.imul(Ie,be)|0,c=c+Math.imul(Ce,ve)|0,b=b+Math.imul(Ce,be)|0,m=m+Math.imul(Me,we)|0,c=c+Math.imul(Me,ye)|0,c=c+Math.imul(Re,we)|0,b=b+Math.imul(Re,ye)|0,m=m+Math.imul(Se,_e)|0,c=c+Math.imul(Se,Ee)|0,c=c+Math.imul(ke,_e)|0,b=b+Math.imul(ke,Ee)|0;var Wt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,m=Math.imul(te,le),c=Math.imul(te,ue),c=c+Math.imul(re,le)|0,b=Math.imul(re,ue),m=m+Math.imul(Y,he)|0,c=c+Math.imul(Y,de)|0,c=c+Math.imul(ee,he)|0,b=b+Math.imul(ee,de)|0,m=m+Math.imul(Te,fe)|0,c=c+Math.imul(Te,ge)|0,c=c+Math.imul($e,fe)|0,b=b+Math.imul($e,ge)|0,m=m+Math.imul(Ne,pe)|0,c=c+Math.imul(Ne,me)|0,c=c+Math.imul(Le,pe)|0,b=b+Math.imul(Le,me)|0,m=m+Math.imul(xe,ve)|0,c=c+Math.imul(xe,be)|0,c=c+Math.imul(Ae,ve)|0,b=b+Math.imul(Ae,be)|0,m=m+Math.imul(Ie,we)|0,c=c+Math.imul(Ie,ye)|0,c=c+Math.imul(Ce,we)|0,b=b+Math.imul(Ce,ye)|0,m=m+Math.imul(Me,_e)|0,c=c+Math.imul(Me,Ee)|0,c=c+Math.imul(Re,_e)|0,b=b+Math.imul(Re,Ee)|0;var qt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(qt>>>26)|0,qt&=67108863,m=Math.imul(te,he),c=Math.imul(te,de),c=c+Math.imul(re,he)|0,b=Math.imul(re,de),m=m+Math.imul(Y,fe)|0,c=c+Math.imul(Y,ge)|0,c=c+Math.imul(ee,fe)|0,b=b+Math.imul(ee,ge)|0,m=m+Math.imul(Te,pe)|0,c=c+Math.imul(Te,me)|0,c=c+Math.imul($e,pe)|0,b=b+Math.imul($e,me)|0,m=m+Math.imul(Ne,ve)|0,c=c+Math.imul(Ne,be)|0,c=c+Math.imul(Le,ve)|0,b=b+Math.imul(Le,be)|0,m=m+Math.imul(xe,we)|0,c=c+Math.imul(xe,ye)|0,c=c+Math.imul(Ae,we)|0,b=b+Math.imul(Ae,ye)|0,m=m+Math.imul(Ie,_e)|0,c=c+Math.imul(Ie,Ee)|0,c=c+Math.imul(Ce,_e)|0,b=b+Math.imul(Ce,Ee)|0;var Jt=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,m=Math.imul(te,fe),c=Math.imul(te,ge),c=c+Math.imul(re,fe)|0,b=Math.imul(re,ge),m=m+Math.imul(Y,pe)|0,c=c+Math.imul(Y,me)|0,c=c+Math.imul(ee,pe)|0,b=b+Math.imul(ee,me)|0,m=m+Math.imul(Te,ve)|0,c=c+Math.imul(Te,be)|0,c=c+Math.imul($e,ve)|0,b=b+Math.imul($e,be)|0,m=m+Math.imul(Ne,we)|0,c=c+Math.imul(Ne,ye)|0,c=c+Math.imul(Le,we)|0,b=b+Math.imul(Le,ye)|0,m=m+Math.imul(xe,_e)|0,c=c+Math.imul(xe,Ee)|0,c=c+Math.imul(Ae,_e)|0,b=b+Math.imul(Ae,Ee)|0;var qs=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(qs>>>26)|0,qs&=67108863,m=Math.imul(te,pe),c=Math.imul(te,me),c=c+Math.imul(re,pe)|0,b=Math.imul(re,me),m=m+Math.imul(Y,ve)|0,c=c+Math.imul(Y,be)|0,c=c+Math.imul(ee,ve)|0,b=b+Math.imul(ee,be)|0,m=m+Math.imul(Te,we)|0,c=c+Math.imul(Te,ye)|0,c=c+Math.imul($e,we)|0,b=b+Math.imul($e,ye)|0,m=m+Math.imul(Ne,_e)|0,c=c+Math.imul(Ne,Ee)|0,c=c+Math.imul(Le,_e)|0,b=b+Math.imul(Le,Ee)|0;var Js=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Js>>>26)|0,Js&=67108863,m=Math.imul(te,ve),c=Math.imul(te,be),c=c+Math.imul(re,ve)|0,b=Math.imul(re,be),m=m+Math.imul(Y,we)|0,c=c+Math.imul(Y,ye)|0,c=c+Math.imul(ee,we)|0,b=b+Math.imul(ee,ye)|0,m=m+Math.imul(Te,_e)|0,c=c+Math.imul(Te,Ee)|0,c=c+Math.imul($e,_e)|0,b=b+Math.imul($e,Ee)|0;var Gs=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Gs>>>26)|0,Gs&=67108863,m=Math.imul(te,we),c=Math.imul(te,ye),c=c+Math.imul(re,we)|0,b=Math.imul(re,ye),m=m+Math.imul(Y,_e)|0,c=c+Math.imul(Y,Ee)|0,c=c+Math.imul(ee,_e)|0,b=b+Math.imul(ee,Ee)|0;var Zs=(E+m|0)+((c&8191)<<13)|0;E=(b+(c>>>13)|0)+(Zs>>>26)|0,Zs&=67108863,m=Math.imul(te,_e),c=Math.imul(te,Ee),c=c+Math.imul(re,_e)|0,b=Math.imul(re,Ee);var Qs=(E+m|0)+((c&8191)<<13)|0;return E=(b+(c>>>13)|0)+(Qs>>>26)|0,Qs&=67108863,w[0]=$t,w[1]=Pt,w[2]=Ot,w[3]=Bt,w[4]=Dt,w[5]=Ft,w[6]=jt,w[7]=Ht,w[8]=Ut,w[9]=Vt,w[10]=zt,w[11]=Wt,w[12]=qt,w[13]=Jt,w[14]=qs,w[15]=Js,w[16]=Gs,w[17]=Zs,w[18]=Qs,E!==0&&(w[19]=E,d.length++),d};Math.imul||(I=$);function R(y,o,l){l.negative=o.negative^y.negative,l.length=y.length+o.length;for(var d=0,p=0,v=0;v<l.length-1;v++){var w=p;p=0;for(var E=d&67108863,m=Math.min(v,o.length-1),c=Math.max(0,v-y.length+1);c<=m;c++){var b=v-c,L=y.words[b]|0,C=o.words[c]|0,N=L*C,Q=N&67108863;w=w+(N/67108864|0)|0,Q=Q+E|0,E=Q&67108863,w=w+(Q>>>26)|0,p+=w>>>26,w&=67108863}l.words[v]=E,d=w,w=p}return d!==0?l.words[v]=d:l.length--,l._strip()}function D(y,o,l){return R(y,o,l)}i.prototype.mulTo=function(o,l){var d,p=this.length+o.length;return this.length===10&&o.length===10?d=I(this,o,l):p<63?d=$(this,o,l):p<1024?d=R(this,o,l):d=D(this,o,l),d},i.prototype.mul=function(o){var l=new i(null);return l.words=new Array(this.length+o.length),this.mulTo(o,l)},i.prototype.mulf=function(o){var l=new i(null);return l.words=new Array(this.length+o.length),D(this,o,l)},i.prototype.imul=function(o){return this.clone().mulTo(o,this)},i.prototype.imuln=function(o){var l=o<0;l&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var d=0,p=0;p<this.length;p++){var v=(this.words[p]|0)*o,w=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=w>>>26,this.words[p]=w&67108863}return d!==0&&(this.words[p]=d,this.length++),this.length=o===0?1:this.length,l?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 l=O(o);if(l.length===0)return new i(1);for(var d=this,p=0;p<l.length&&l[p]===0;p++,d=d.sqr());if(++p<l.length)for(var v=d.sqr();p<l.length;p++,v=v.sqr())l[p]!==0&&(d=d.mul(v));return d},i.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var l=o%26,d=(o-l)/26,p=67108863>>>26-l<<26-l,v;if(l!==0){var w=0;for(v=0;v<this.length;v++){var E=this.words[v]&p,m=(this.words[v]|0)-E<<l;this.words[v]=m|w,w=E>>>26-l}w&&(this.words[v]=w,this.length++)}if(d!==0){for(v=this.length-1;v>=0;v--)this.words[v+d]=this.words[v];for(v=0;v<d;v++)this.words[v]=0;this.length+=d}return this._strip()},i.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},i.prototype.iushrn=function(o,l,d){n(typeof o=="number"&&o>=0);var p;l?p=(l-l%26)/26:p=0;var v=o%26,w=Math.min((o-v)/26,this.length),E=67108863^67108863>>>v<<v,m=d;if(p-=w,p=Math.max(0,p),m){for(var c=0;c<w;c++)m.words[c]=this.words[c];m.length=w}if(w!==0)if(this.length>w)for(this.length-=w,c=0;c<this.length;c++)this.words[c]=this.words[c+w];else this.words[0]=0,this.length=1;var b=0;for(c=this.length-1;c>=0&&(b!==0||c>=p);c--){var L=this.words[c]|0;this.words[c]=b<<26-v|L>>>v,b=L&E}return m&&b!==0&&(m.words[m.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(o,l,d){return n(this.negative===0),this.iushrn(o,l,d)},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 l=o%26,d=(o-l)/26,p=1<<l;if(this.length<=d)return!1;var v=this.words[d];return!!(v&p)},i.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var l=o%26,d=(o-l)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var p=67108863^67108863>>>l<<l;this.words[this.length-1]&=p}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 l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+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 l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+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,l,d){var p=o.length+d,v;this._expand(p);var w,E=0;for(v=0;v<o.length;v++){w=(this.words[v+d]|0)+E;var m=(o.words[v]|0)*l;w-=m&67108863,E=(w>>26)-(m/67108864|0),this.words[v+d]=w&67108863}for(;v<this.length-d;v++)w=(this.words[v+d]|0)+E,E=w>>26,this.words[v+d]=w&67108863;if(E===0)return this._strip();for(n(E===-1),E=0,v=0;v<this.length;v++)w=-(this.words[v]|0)+E,E=w>>26,this.words[v]=w&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(o,l){var d=this.length-o.length,p=this.clone(),v=o,w=v.words[v.length-1]|0,E=this._countBits(w);d=26-E,d!==0&&(v=v.ushln(d),p.iushln(d),w=v.words[v.length-1]|0);var m=p.length-v.length,c;if(l!=="mod"){c=new i(null),c.length=m+1,c.words=new Array(c.length);for(var b=0;b<c.length;b++)c.words[b]=0}var L=p.clone()._ishlnsubmul(v,1,m);L.negative===0&&(p=L,c&&(c.words[m]=1));for(var C=m-1;C>=0;C--){var N=(p.words[v.length+C]|0)*67108864+(p.words[v.length+C-1]|0);for(N=Math.min(N/w|0,67108863),p._ishlnsubmul(v,N,C);p.negative!==0;)N--,p.negative=0,p._ishlnsubmul(v,1,C),p.isZero()||(p.negative^=1);c&&(c.words[C]=N)}return c&&c._strip(),p._strip(),l!=="div"&&d!==0&&p.iushrn(d),{div:c||null,mod:p}},i.prototype.divmod=function(o,l,d){if(n(!o.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var p,v,w;return this.negative!==0&&o.negative===0?(w=this.neg().divmod(o,l),l!=="mod"&&(p=w.div.neg()),l!=="div"&&(v=w.mod.neg(),d&&v.negative!==0&&v.iadd(o)),{div:p,mod:v}):this.negative===0&&o.negative!==0?(w=this.divmod(o.neg(),l),l!=="mod"&&(p=w.div.neg()),{div:p,mod:w.mod}):this.negative&o.negative?(w=this.neg().divmod(o.neg(),l),l!=="div"&&(v=w.mod.neg(),d&&v.negative!==0&&v.isub(o)),{div:w.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new i(0),mod:this}:o.length===1?l==="div"?{div:this.divn(o.words[0]),mod:null}:l==="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,l)},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 l=this.divmod(o);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(o):l.mod,p=o.ushrn(1),v=o.andln(1),w=d.cmp(p);return w<0||v===1&&w===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modrn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var d=(1<<26)%o,p=0,v=this.length-1;v>=0;v--)p=(d*p+(this.words[v]|0))%o;return l?-p:p},i.prototype.modn=function(o){return this.modrn(o)},i.prototype.idivn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var d=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+d*67108864;this.words[p]=v/o|0,d=v%o}return this._strip(),l?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 l=this,d=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new i(1),v=new i(0),w=new i(0),E=new i(1),m=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++m;for(var c=d.clone(),b=l.clone();!l.isZero();){for(var L=0,C=1;!(l.words[0]&C)&&L<26;++L,C<<=1);if(L>0)for(l.iushrn(L);L-- >0;)(p.isOdd()||v.isOdd())&&(p.iadd(c),v.isub(b)),p.iushrn(1),v.iushrn(1);for(var N=0,Q=1;!(d.words[0]&Q)&&N<26;++N,Q<<=1);if(N>0)for(d.iushrn(N);N-- >0;)(w.isOdd()||E.isOdd())&&(w.iadd(c),E.isub(b)),w.iushrn(1),E.iushrn(1);l.cmp(d)>=0?(l.isub(d),p.isub(w),v.isub(E)):(d.isub(l),w.isub(p),E.isub(v))}return{a:w,b:E,gcd:d.iushln(m)}},i.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var l=this,d=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var p=new i(1),v=new i(0),w=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var E=0,m=1;!(l.words[0]&m)&&E<26;++E,m<<=1);if(E>0)for(l.iushrn(E);E-- >0;)p.isOdd()&&p.iadd(w),p.iushrn(1);for(var c=0,b=1;!(d.words[0]&b)&&c<26;++c,b<<=1);if(c>0)for(d.iushrn(c);c-- >0;)v.isOdd()&&v.iadd(w),v.iushrn(1);l.cmp(d)>=0?(l.isub(d),p.isub(v)):(d.isub(l),v.isub(p))}var L;return l.cmpn(1)===0?L=p:L=v,L.cmpn(0)<0&&L.iadd(o),L},i.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),d=o.clone();l.negative=0,d.negative=0;for(var p=0;l.isEven()&&d.isEven();p++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var v=l.cmp(d);if(v<0){var w=l;l=d,d=w}else if(v===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(p)},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 l=o%26,d=(o-l)/26,p=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=p,this;for(var v=p,w=d;v!==0&&w<this.length;w++){var E=this.words[w]|0;E+=v,v=E>>>26,E&=67108863,this.words[w]=E}return v!==0&&(this.words[w]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(o){var l=o<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this._strip();var d;if(this.length>1)d=1;else{l&&(o=-o),n(o<=67108863,"Number is too big");var p=this.words[0]|0;d=p===o?0:p<o?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var l=this.ucmp(o);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var p=this.words[d]|0,v=o.words[d]|0;if(p!==v){p<v?l=-1:p>v&&(l=1);break}}return l},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 H(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 A={k256:null,p224:null,p192:null,p25519:null};function P(y,o){this.name=y,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 l=o,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var p=d<this.n?-1:l.ucmp(this.p);return p===0?(l.words[0]=0,l.length=1):p>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},P.prototype.split=function(o,l){o.iushrn(this.n,0,l)},P.prototype.imulK=function(o){return o.imul(this.k)};function Z(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(Z,P),Z.prototype.split=function(o,l){for(var d=4194303,p=Math.min(o.length,9),v=0;v<p;v++)l.words[v]=o.words[v];if(l.length=p,o.length<=9){o.words[0]=0,o.length=1;return}var w=o.words[9];for(l.words[l.length++]=w&d,v=10;v<o.length;v++){var E=o.words[v]|0;o.words[v-10]=(E&d)<<4|w>>>22,w=E}w>>>=22,o.words[v-10]=w,w===0&&o.length>10?o.length-=10:o.length-=9},Z.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,d=0;d<o.length;d++){var p=o.words[d]|0;l+=p*977,o.words[d]=l&67108863,l=p*64+(l/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function De(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(De,P);function He(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(He,P);function X(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(X,P),X.prototype.imulK=function(o){for(var l=0,d=0;d<o.length;d++){var p=(o.words[d]|0)*19+l,v=p&67108863;p>>>=26,o.words[d]=v,l=p}return l!==0&&(o.words[o.length++]=l),o},i._prime=function(o){if(A[o])return A[o];var l;if(o==="k256")l=new Z;else if(o==="p224")l=new De;else if(o==="p192")l=new He;else if(o==="p25519")l=new X;else throw new Error("Unknown prime "+o);return A[o]=l,l};function H(y){if(typeof y=="string"){var o=i._prime(y);this.m=o.p,this.prime=o}else n(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}H.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},H.prototype._verify2=function(o,l){n((o.negative|l.negative)===0,"red works only with positives"),n(o.red&&o.red===l.red,"red works only with red numbers")},H.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(f(o,o.umod(this.m)._forceRed(this)),o)},H.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},H.prototype.add=function(o,l){this._verify2(o,l);var d=o.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},H.prototype.iadd=function(o,l){this._verify2(o,l);var d=o.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},H.prototype.sub=function(o,l){this._verify2(o,l);var d=o.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},H.prototype.isub=function(o,l){this._verify2(o,l);var d=o.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},H.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},H.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},H.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},H.prototype.isqr=function(o){return this.imul(o,o.clone())},H.prototype.sqr=function(o){return this.mul(o,o)},H.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(n(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(o,d)}for(var p=this.m.subn(1),v=0;!p.isZero()&&p.andln(1)===0;)v++,p.iushrn(1);n(!p.isZero());var w=new i(1).toRed(this),E=w.redNeg(),m=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);this.pow(c,m).cmp(E)!==0;)c.redIAdd(E);for(var b=this.pow(c,p),L=this.pow(o,p.addn(1).iushrn(1)),C=this.pow(o,p),N=v;C.cmp(w)!==0;){for(var Q=C,G=0;Q.cmp(w)!==0;G++)Q=Q.redSqr();n(G<N);var K=this.pow(b,new i(1).iushln(N-G-1));L=L.redMul(K),b=K.redSqr(),C=C.redMul(b),N=G}return L},H.prototype.invm=function(o){var l=o._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},H.prototype.pow=function(o,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return o.clone();var d=4,p=new Array(1<<d);p[0]=new i(1).toRed(this),p[1]=o;for(var v=2;v<p.length;v++)p[v]=this.mul(p[v-1],o);var w=p[0],E=0,m=0,c=l.bitLength()%26;for(c===0&&(c=26),v=l.length-1;v>=0;v--){for(var b=l.words[v],L=c-1;L>=0;L--){var C=b>>L&1;if(w!==p[0]&&(w=this.sqr(w)),C===0&&E===0){m=0;continue}E<<=1,E|=C,m++,!(m!==d&&(v!==0||L!==0))&&(w=this.mul(w,p[E]),m=0,E=0)}c=26}return w},H.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},H.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},i.mont=function(o){return new J(o)};function J(y){H.call(this,y),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(J,H),J.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},J.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},J.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var d=o.imul(l),p=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(p).iushrn(this.shift),w=v;return v.cmp(this.m)>=0?w=v.isub(this.m):v.cmpn(0)<0&&(w=v.iadd(this.m)),w._forceRed(this)},J.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new i(0)._forceRed(this);var d=o.mul(l),p=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(p).iushrn(this.shift),w=v;return v.cmp(this.m)>=0?w=v.isub(this.m):v.cmpn(0)<0&&(w=v.iadd(this.m)),w._forceRed(this)},J.prototype.invm=function(o){var l=this.imod(o._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(e,B)})(ki);var es=ki.exports,ln={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.errorValues=Rt.standardErrorCodes=void 0;Rt.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}};Rt.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 ts={},rs={};(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=Rt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,k=r){if(_&&Number.isInteger(_)){const x=_.toString();if(f(t.errorValues,x))return t.errorValues[x].message;if(h(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=n;function s(_){if(!Number.isInteger(_))return!1;const k=_.toString();return!!(t.errorValues[k]||h(_))}e.isValidCode=s;function i(_){var k;if(typeof _=="number")return _;if(a(_))return(k=_.code)!==null&&k!==void 0?k:_.errorCode}e.getErrorCode=i;function a(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function u(_,{shouldIncludeStack:k=!1}={}){const x={};if(_&&typeof _=="object"&&!Array.isArray(_)&&f(_,"code")&&s(_.code)){const M=_;x.code=M.code,M.message&&typeof M.message=="string"?(x.message=M.message,f(M,"data")&&(x.data=M.data)):(x.message=n(x.code),x.data={originalError:g(_)})}else x.code=t.standardErrorCodes.rpc.internal,x.message=S(_,"message")?_.message:r,x.data={originalError:g(_)};return k&&(x.stack=S(_,"stack")?_.stack:void 0),x}e.serialize=u;function h(_){return _>=-32099&&_<=-32e3}function g(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function f(_,k){return Object.prototype.hasOwnProperty.call(_,k)}function S(_,k){return typeof _=="object"&&_!==null&&k in _&&typeof _[k]=="string"}})(rs);Object.defineProperty(ts,"__esModule",{value:!0});ts.standardErrors=void 0;const qe=Rt,Sa=rs;ts.standardErrors={rpc:{parse:e=>st(qe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>st(qe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>st(qe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>st(qe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>st(qe.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 st(t,e)},invalidInput:e=>st(qe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>st(qe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>st(qe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>st(qe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>st(qe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>st(qe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>yr(qe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>yr(qe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>yr(qe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>yr(qe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>yr(qe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>yr(qe.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 Ra(t,r,n)}}};function st(e,t){const[r,n]=ka(t);return new Ma(e,r||(0,Sa.getMessageFromCode)(e),n)}function yr(e,t){const[r,n]=ka(t);return new Ra(e,r||(0,Sa.getMessageFromCode)(e),n)}function ka(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 Ma=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)}},Ra=class extends Ma{constructor(t,r,n){if(!_l(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function _l(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ns={},Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.isErrorResponse=void 0;function El(e){return e.errorMessage!==void 0}Dr.isErrorResponse=El;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.LIB_VERSION=void 0;Fr.LIB_VERSION="3.9.3";Object.defineProperty(ns,"__esModule",{value:!0});ns.serializeError=void 0;const Sl=Dr,kl=Fr,Ml=Rt,Rl=rs;function Il(e,t){const r=(0,Rl.serialize)(Cl(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",kl.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=xl(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ns.serializeError=Il;function Cl(e){return typeof e=="string"?{message:e,code:Ml.standardErrorCodes.rpc.internal}:(0,Sl.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function xl(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=Rt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=ts;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ns;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=rs;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(ln);var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.ProviderType=Ue.RegExpString=Ue.IntNumber=Ue.BigIntString=Ue.AddressString=Ue.HexString=Ue.OpaqueType=void 0;function un(){return e=>e}Ue.OpaqueType=un;Ue.HexString=un();Ue.AddressString=un();Ue.BigIntString=un();function Al(e){return Math.floor(e)}Ue.IntNumber=Al;Ue.RegExpString=un();var oo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(oo||(Ue.ProviderType=oo={}));var Nl=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(T,"__esModule",{value:!0});T.isMobileWeb=T.getLocation=T.isInIFrame=T.createQrUrl=T.getFavicon=T.range=T.isBigNumber=T.ensureParsedJSONObject=T.ensureBN=T.ensureRegExpString=T.ensureIntNumber=T.ensureBuffer=T.ensureAddressString=T.ensureEvenLengthHexString=T.ensureHexString=T.isHexString=T.prepend0x=T.strip0x=T.has0xPrefix=T.hexStringFromIntNumber=T.intNumberFromHexString=T.bigIntStringFromBN=T.hexStringFromBuffer=T.hexStringToUint8Array=T.uint8ArrayToHex=T.randomBytesHex=void 0;const xt=Nl(es),ir=ln,ct=Ue,Ia=/^[0-9]*$/,Ca=/^[a-f0-9]*$/;function Ll(e){return xa(crypto.getRandomValues(new Uint8Array(e)))}T.randomBytesHex=Ll;function xa(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}T.uint8ArrayToHex=xa;function Tl(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}T.hexStringToUint8Array=Tl;function $l(e,t=!1){const r=e.toString("hex");return(0,ct.HexString)(t?`0x${r}`:r)}T.hexStringFromBuffer=$l;function Pl(e){return(0,ct.BigIntString)(e.toString(10))}T.bigIntStringFromBN=Pl;function Ol(e){return(0,ct.IntNumber)(new xt.default(dn(e,!1),16).toNumber())}T.intNumberFromHexString=Ol;function Bl(e){return(0,ct.HexString)(`0x${new xt.default(e).toString(16)}`)}T.hexStringFromIntNumber=Bl;function Mi(e){return e.startsWith("0x")||e.startsWith("0X")}T.has0xPrefix=Mi;function ss(e){return Mi(e)?e.slice(2):e}T.strip0x=ss;function Aa(e){return Mi(e)?`0x${e.slice(2)}`:`0x${e}`}T.prepend0x=Aa;function hn(e){if(typeof e!="string")return!1;const t=ss(e).toLowerCase();return Ca.test(t)}T.isHexString=hn;function Na(e,t=!1){if(typeof e=="string"){const r=ss(e).toLowerCase();if(Ca.test(r))return(0,ct.HexString)(t?`0x${r}`:r)}throw ir.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}T.ensureHexString=Na;function dn(e,t=!1){let r=Na(e,!1);return r.length%2===1&&(r=(0,ct.HexString)(`0${r}`)),t?(0,ct.HexString)(`0x${r}`):r}T.ensureEvenLengthHexString=dn;function Dl(e){if(typeof e=="string"){const t=ss(e).toLowerCase();if(hn(t)&&t.length===40)return(0,ct.AddressString)(Aa(t))}throw ir.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}T.ensureAddressString=Dl;function Fl(e){if(U.isBuffer(e))return e;if(typeof e=="string"){if(hn(e)){const t=dn(e,!1);return U.from(t,"hex")}return U.from(e,"utf8")}throw ir.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}T.ensureBuffer=Fl;function La(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ct.IntNumber)(e);if(typeof e=="string"){if(Ia.test(e))return(0,ct.IntNumber)(Number(e));if(hn(e))return(0,ct.IntNumber)(new xt.default(dn(e,!1),16).toNumber())}throw ir.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}T.ensureIntNumber=La;function jl(e){if(e instanceof RegExp)return(0,ct.RegExpString)(e.toString());throw ir.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}T.ensureRegExpString=jl;function Hl(e){if(e!==null&&(xt.default.isBN(e)||Ta(e)))return new xt.default(e.toString(10),10);if(typeof e=="number")return new xt.default(La(e));if(typeof e=="string"){if(Ia.test(e))return new xt.default(e,10);if(hn(e))return new xt.default(dn(e,!1),16)}throw ir.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}T.ensureBN=Hl;function Ul(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw ir.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}T.ensureParsedJSONObject=Ul;function Ta(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}T.isBigNumber=Ta;function Vl(e,t){return Array.from({length:t-e},(r,n)=>e+n)}T.range=Vl;function zl(){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}`}T.getFavicon=zl;function Wl(e,t,r,n,s,i){const a=n?"parent-id":"id",u=new URLSearchParams({[a]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${u}`}T.createQrUrl=Wl;function $a(){try{return window.frameElement!==null}catch{return!1}}T.isInIFrame=$a;function ql(){try{return $a()&&window.top?window.top.location:window.location}catch{return window.location}}T.getLocation=ql;function Jl(){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)}T.isMobileWeb=Jl;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.ScopedLocalStorage=void 0;class Gl{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}`}}is.ScopedLocalStorage=Gl;var Nr={},fn={},gn={},jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.EVENTS=void 0;jr.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 at={};Object.defineProperty(at,"__esModule",{value:!0});at.RelayAbstract=at.APP_VERSION_KEY=at.LOCAL_STORAGE_ADDRESSES_KEY=at.WALLET_USER_NAME_KEY=void 0;const ao=ln;at.WALLET_USER_NAME_KEY="walletUsername";at.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";at.APP_VERSION_KEY="AppVersion";class Zl{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 ao.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,ao.serializeError)(i,t.method);return s})}}at.RelayAbstract=Zl;var Hr={},Pa={exports:{}},Ql=ll,Kl=ul,Xl=Kl("TypedArray.prototype.buffer",!0),Yl=ml(),eu=Xl||function(t){if(!Yl(t))throw new Ql("Not a Typed Array");return t.buffer},dt=Tt().Buffer,tu=bl,ru=eu,nu=ArrayBuffer.isView||function(t){try{return ru(t),!0}catch{return!1}},su=typeof Uint8Array<"u",Oa=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",iu=Oa&&(dt.prototype instanceof Uint8Array||dt.TYPED_ARRAY_SUPPORT),ou=function(t,r){if(dt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?dt.from(t):t;if(typeof t=="string")return dt.from(t,r);if(Oa&&nu(t)){if(t.byteLength===0)return dt.alloc(0);if(iu){var n=dt.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=dt.from(s);if(i.length===t.byteLength)return i}if(su&&t instanceof Uint8Array)return dt.from(t);var a=tu(t);if(a)for(var u=0;u<t.length;u+=1){var h=t[u];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||dt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return dt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},au=Tt().Buffer,cu=ou;function os(e,t){this._block=au.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}os.prototype.update=function(e,t){e=cu(e,t||"utf8");for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,a=0;a<s;){for(var u=i%n,h=Math.min(s-a,n-u),g=0;g<h;g++)r[u+g]=e[a+g];i+=h,a+=h,i%n===0&&this._update(r)}return this._len+=s,this};os.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};os.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Ur=os,lu=Br,Ba=Ur,uu=Tt().Buffer,hu=[1518500249,1859775393,-1894007588,-899497514],du=new Array(80);function pn(){this.init(),this._w=du,Ba.call(this,64,56)}lu(pn,Ba);pn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function fu(e){return e<<5|e>>>27}function gu(e){return e<<30|e>>>2}function pu(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}pn.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,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var h=0;h<80;++h){var g=~~(h/20),f=fu(r)+pu(g,n,s,i)+a+t[h]+hu[g]|0;a=i,i=s,s=gu(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};pn.prototype._hash=function(){var e=uu.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 mu=pn,vu=Br,Da=Ur,bu=Tt().Buffer,wu=[1518500249,1859775393,-1894007588,-899497514],yu=new Array(80);function mn(){this.init(),this._w=yu,Da.call(this,64,56)}vu(mn,Da);mn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function _u(e){return e<<1|e>>>31}function Eu(e){return e<<5|e>>>27}function Su(e){return e<<30|e>>>2}function ku(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}mn.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,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=_u(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var h=0;h<80;++h){var g=~~(h/20),f=Eu(r)+ku(g,n,s,i)+a+t[h]+wu[g]|0;a=i,i=s,s=Su(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};mn.prototype._hash=function(){var e=bu.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 Mu=mn,Ru=Br,Fa=Ur,Iu=Tt().Buffer,Cu=[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],xu=new Array(64);function vn(){this.init(),this._w=xu,Fa.call(this,64,56)}Ru(vn,Fa);vn.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 Au(e,t,r){return r^e&(t^r)}function Nu(e,t,r){return e&t|r&(e|t)}function Lu(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Tu(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function $u(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Pu(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}vn.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,u=this._f|0,h=this._g|0,g=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=Pu(t[f-2])+t[f-7]+$u(t[f-15])+t[f-16]|0;for(var S=0;S<64;++S){var _=g+Tu(a)+Au(a,u,h)+Cu[S]+t[S]|0,k=Lu(r)+Nu(r,n,s)|0;g=h,h=u,u=a,a=i+_|0,i=s,s=n,n=r,r=_+k|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=u+this._f|0,this._g=h+this._g|0,this._h=g+this._h|0};vn.prototype._hash=function(){var e=Iu.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 ja=vn,Ou=Br,Bu=ja,Du=Ur,Fu=Tt().Buffer,ju=new Array(64);function as(){this.init(),this._w=ju,Du.call(this,64,56)}Ou(as,Bu);as.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};as.prototype._hash=function(){var e=Fu.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 Hu=as,Uu=Br,Ha=Ur,Vu=Tt().Buffer,co=[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],zu=new Array(160);function bn(){this.init(),this._w=zu,Ha.call(this,128,112)}Uu(bn,Ha);bn.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 lo(e,t,r){return r^e&(t^r)}function uo(e,t,r){return e&t|r&(e|t)}function ho(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function fo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Wu(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function qu(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Ju(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gu(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ze(e,t){return e>>>0<t>>>0?1:0}bn.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,u=this._fh|0,h=this._gh|0,g=this._hh|0,f=this._al|0,S=this._bl|0,_=this._cl|0,k=this._dl|0,x=this._el|0,M=this._fl|0,O=this._gl|0,$=this._hl|0,I=0;I<32;I+=2)t[I]=e.readInt32BE(I*4),t[I+1]=e.readInt32BE(I*4+4);for(;I<160;I+=2){var R=t[I-30],D=t[I-15*2+1],A=Wu(R,D),P=qu(D,R);R=t[I-2*2],D=t[I-2*2+1];var Z=Ju(R,D),De=Gu(D,R),He=t[I-7*2],X=t[I-7*2+1],H=t[I-16*2],J=t[I-16*2+1],y=P+X|0,o=A+He+ze(y,P)|0;y=y+De|0,o=o+Z+ze(y,De)|0,y=y+J|0,o=o+H+ze(y,J)|0,t[I]=o,t[I+1]=y}for(var l=0;l<160;l+=2){o=t[l],y=t[l+1];var d=uo(r,n,s),p=uo(f,S,_),v=ho(r,f),w=ho(f,r),E=fo(a,x),m=fo(x,a),c=co[l],b=co[l+1],L=lo(a,u,h),C=lo(x,M,O),N=$+m|0,Q=g+E+ze(N,$)|0;N=N+C|0,Q=Q+L+ze(N,C)|0,N=N+b|0,Q=Q+c+ze(N,b)|0,N=N+y|0,Q=Q+o+ze(N,y)|0;var G=w+p|0,K=v+d+ze(G,w)|0;g=h,$=O,h=u,O=M,u=a,M=x,x=k+N|0,a=i+Q+ze(x,k)|0,i=s,k=_,s=n,_=S,n=r,S=f,f=N+G|0,r=Q+K+ze(f,N)|0}this._al=this._al+f|0,this._bl=this._bl+S|0,this._cl=this._cl+_|0,this._dl=this._dl+k|0,this._el=this._el+x|0,this._fl=this._fl+M|0,this._gl=this._gl+O|0,this._hl=this._hl+$|0,this._ah=this._ah+r+ze(this._al,f)|0,this._bh=this._bh+n+ze(this._bl,S)|0,this._ch=this._ch+s+ze(this._cl,_)|0,this._dh=this._dh+i+ze(this._dl,k)|0,this._eh=this._eh+a+ze(this._el,x)|0,this._fh=this._fh+u+ze(this._fl,M)|0,this._gh=this._gh+h+ze(this._gl,O)|0,this._hh=this._hh+g+ze(this._hl,$)|0};bn.prototype._hash=function(){var e=Vu.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 Ua=bn,Zu=Br,Qu=Ua,Ku=Ur,Xu=Tt().Buffer,Yu=new Array(160);function cs(){this.init(),this._w=Yu,Ku.call(this,128,112)}Zu(cs,Qu);cs.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};cs.prototype._hash=function(){var e=Xu.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 eh=cs;(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=mu,e.exports.sha1=Mu,e.exports.sha224=Hu,e.exports.sha256=ja,e.exports.sha384=eh,e.exports.sha512=Ua})(Pa);var th=Pa.exports;Object.defineProperty(Hr,"__esModule",{value:!0});Hr.Session=void 0;const go=th,po=T,mo="session:id",vo="session:secret",bo="session:linked";class Ri{constructor(t,r,n,s){this._storage=t,this._id=r||(0,po.randomBytesHex)(16),this._secret=n||(0,po.randomBytesHex)(32),this._key=new go.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(mo),n=t.getItem(bo),s=t.getItem(vo);return r&&s?new Ri(t,r,s,n==="1"):null}static hash(t){return new go.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(mo,this._id),this._storage.setItem(vo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(bo,this._linked?"1":"0")}}Hr.Session=Ri;var ls={},us={};Object.defineProperty(us,"__esModule",{value:!0});us.Cipher=void 0;const Tn=T;class rh{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,Tn.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)),u=16,h=a.slice(a.byteLength-u),g=a.slice(0,a.byteLength-u),f=new Uint8Array(h),S=new Uint8Array(g),_=new Uint8Array([...n,...f,...S]);return(0,Tn.uint8ArrayToHex)(_)}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,Tn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,Tn.hexStringToUint8Array)(t),u=a.slice(0,12),h=a.slice(12,28),g=a.slice(28),f=new Uint8Array([...g,...h]),S={name:"AES-GCM",iv:new Uint8Array(u)};try{const _=await window.crypto.subtle.decrypt(S,i,f),k=new TextDecoder;n(k.decode(_))}catch(_){s(_)}})()})}}us.Cipher=rh;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.WalletLinkHTTP=void 0;class nh{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}`)}}hs.WalletLinkHTTP=nh;var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.WalletLinkWebSocket=Lr.ConnectionState=void 0;var Rr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Rr||(Lr.ConnectionState=Rr={}));class sh{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,Rr.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,Rr.DISCONNECTED)},s.onopen=i=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Rr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},s.onmessage=i=>{var a,u;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(i.data);(u=this.incomingDataListener)===null||u===void 0||u.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,Rr.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)}}Lr.WalletLinkWebSocket=sh;Object.defineProperty(ls,"__esModule",{value:!0});ls.WalletLinkConnection=void 0;const _r=Ue,ih=us,pt=jr,wo=at,Er=Hr,oh=hs,$n=Lr,yo=1e4,ah=6e4;class ch{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,_r.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=u=>{if(!u)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",g=>u.JsonRpcUrl&&this.handleChainUpdated(g,u.JsonRpcUrl)]]).forEach((g,f)=>{const S=u[f];S!==void 0&&g(S)})},this.handleDestroyed=u=>{var h,g;u==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(g=this.diagnostic)===null||g===void 0||g.log(pt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Er.Session.hash(this.session.id)}))},this.handleAccountUpdated=async u=>{var h,g;try{const f=await this.cipher.decrypt(u);(h=this.listener)===null||h===void 0||h.accountUpdated(f)}catch{(g=this.diagnostic)===null||g===void 0||g.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(u,h)=>{var g,f;try{const S=await this.cipher.decrypt(h);(g=this.listener)===null||g===void 0||g.metadataUpdated(u,S)}catch{(f=this.diagnostic)===null||f===void 0||f.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:u})}},this.handleWalletUsernameUpdated=async u=>{this.handleMetadataUpdated(wo.WALLET_USER_NAME_KEY,u)},this.handleAppVersionUpdated=async u=>{this.handleMetadataUpdated(wo.APP_VERSION_KEY,u)},this.handleChainUpdated=async(u,h)=>{var g,f;try{const S=await this.cipher.decrypt(u),_=await this.cipher.decrypt(h);(g=this.listener)===null||g===void 0||g.chainUpdated(S,_)}catch{(f=this.diagnostic)===null||f===void 0||f.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new ih.Cipher(t.secret),this.diagnostic=s,this.listener=n;const a=new $n.WalletLinkWebSocket(`${r}/rpc`,i);a.setConnectionStateListener(async u=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(pt.EVENTS.CONNECTED_STATE_CHANGE,{state:u,sessionIdHash:Er.Session.hash(t.id)});let g=!1;switch(u){case $n.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(S=>setTimeout(S,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case $n.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),g=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},yo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case $n.ConnectionState.CONNECTING:break}this.connected!==g&&(this.connected=g)}),a.setIncomingDataListener(u=>{var h,g,f;switch(u.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const S=u.type==="IsLinkedOK"?u.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(pt.EVENTS.LINKED,{sessionIdHash:Er.Session.hash(t.id),linked:S,type:u.type,onlineGuests:u.onlineGuests}),this.linked=S||u.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(g=this.diagnostic)===null||g===void 0||g.log(pt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Er.Session.hash(t.id),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.handleSessionMetadataUpdated(u.metadata);break}case"Event":{this.handleIncomingEvent(u);break}}u.id!==void 0&&((f=this.requestResolutions.get(u.id))===null||f===void 0||f(u))}),this.ws=a,this.http=new oh.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(pt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Er.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(pt.EVENTS.DISCONNECTED,{sessionIdHash:Er.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(pt.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,_r.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,_r.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>yo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=ah){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,_r.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,_r.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,_r.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}ls.WalletLinkConnection=ch;var wn={},yn={},Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.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 lh=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yn,"__esModule",{value:!0});yn.injectCssReset=void 0;const uh=lh(Ii);function hh(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(uh.default)),document.documentElement.appendChild(e)}yn.injectCssReset=hh;var ds={};const Ye=_i(hl);var fs={};const gs=_i(dl);var Tr={},ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.CloseIcon=void 0;const _o=Ye;function dh(e){return(0,_o.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,_o.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"}))}ps.CloseIcon=dh;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.CoinbaseWalletRound=void 0;const Pn=Ye;function fh(e){return(0,Pn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Pn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Pn.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,Pn.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"}))}ms.CoinbaseWalletRound=fh;var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.QRCodeIcon=void 0;const Yr=Ye;function gh(e){return(0,Yr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Yr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Yr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Yr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Yr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}vs.QRCodeIcon=gh;var bs={};function Va(e){this.mode=rt.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))}Va.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 _t(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}_t.prototype={addData:function(e){var t=new Va(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=_t.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=Oe.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,u=0;u<this.modules[i].length;u++){var h=u*s,g=this.modules[i][u];g&&(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=Oe.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=Oe.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=Oe.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 u=0;u<2;u++)if(this.modules[n][a-u]==null){var h=!1;i<e.length&&(h=(e[i]>>>s&1)==1);var g=Oe.getMask(t,n,a-u);g&&(h=!h),this.modules[n][a-u]=h,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};_t.PAD0=236;_t.PAD1=17;_t.createData=function(e,t,r){for(var n=yt.getRSBlocks(e,t),s=new za,i=0;i<r.length;i++){var a=r[i];s.put(a.mode,4),s.put(a.getLength(),Oe.getLengthInBits(a.mode,e)),a.write(s)}for(var u=0,i=0;i<n.length;i++)u+=n[i].dataCount;if(s.getLengthInBits()>u*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+u*8+")");for(s.getLengthInBits()+4<=u*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=u*8||(s.put(_t.PAD0,8),s.getLengthInBits()>=u*8));)s.put(_t.PAD1,8);return _t.createBytes(s,n)};_t.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),a=new Array(t.length),u=0;u<t.length;u++){var h=t[u].dataCount,g=t[u].totalCount-h;n=Math.max(n,h),s=Math.max(s,g),i[u]=new Array(h);for(var f=0;f<i[u].length;f++)i[u][f]=255&e.buffer[f+r];r+=h;var S=Oe.getErrorCorrectPolynomial(g),_=new Ir(i[u],S.getLength()-1),k=_.mod(S);a[u]=new Array(S.getLength()-1);for(var f=0;f<a[u].length;f++){var x=f+k.getLength()-a[u].length;a[u][f]=x>=0?k.get(x):0}}for(var M=0,f=0;f<t.length;f++)M+=t[f].totalCount;for(var O=new Array(M),$=0,f=0;f<n;f++)for(var u=0;u<t.length;u++)f<i[u].length&&(O[$++]=i[u][f]);for(var f=0;f<s;f++)for(var u=0;u<t.length;u++)f<a[u].length&&(O[$++]=a[u][f]);return O};var rt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},At={L:1,M:0,Q:3,H:2},It={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Oe={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;Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G15)>=0;)t^=Oe.G15<<Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G15);return(e<<10|t)^Oe.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G18)>=0;)t^=Oe.G18<<Oe.getBCHDigit(t)-Oe.getBCHDigit(Oe.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Oe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case It.PATTERN000:return(t+r)%2==0;case It.PATTERN001:return t%2==0;case It.PATTERN010:return r%3==0;case It.PATTERN011:return(t+r)%3==0;case It.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case It.PATTERN101:return t*r%2+t*r%3==0;case It.PATTERN110:return(t*r%2+t*r%3)%2==0;case It.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Ir([1],0),r=0;r<e;r++)t=t.multiply(new Ir([1,We.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case rt.MODE_NUMBER:return 10;case rt.MODE_ALPHA_NUM:return 9;case rt.MODE_8BIT_BYTE:return 8;case rt.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case rt.MODE_NUMBER:return 12;case rt.MODE_ALPHA_NUM:return 11;case rt.MODE_8BIT_BYTE:return 16;case rt.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case rt.MODE_NUMBER:return 14;case rt.MODE_ALPHA_NUM:return 13;case rt.MODE_8BIT_BYTE:return 16;case rt.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),u=-1;u<=1;u++)if(!(n+u<0||t<=n+u))for(var h=-1;h<=1;h++)s+h<0||t<=s+h||u==0&&h==0||a==e.isDark(n+u,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 g=0;e.isDark(n,s)&&g++,e.isDark(n+1,s)&&g++,e.isDark(n,s+1)&&g++,e.isDark(n+1,s+1)&&g++,(g==0||g==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 S=Math.abs(100*f/t/t-50)/5;return r+=S*10,r}},We={glog:function(e){if(e<1)throw new Error("glog("+e+")");return We.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return We.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Je=0;Je<8;Je++)We.EXP_TABLE[Je]=1<<Je;for(var Je=8;Je<256;Je++)We.EXP_TABLE[Je]=We.EXP_TABLE[Je-4]^We.EXP_TABLE[Je-5]^We.EXP_TABLE[Je-6]^We.EXP_TABLE[Je-8];for(var Je=0;Je<255;Je++)We.LOG_TABLE[We.EXP_TABLE[Je]]=Je;function Ir(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]}Ir.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]^=We.gexp(We.glog(this.get(r))+We.glog(e.get(n)));return new Ir(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=We.glog(this.get(0))-We.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]^=We.gexp(We.glog(e.get(n))+t);return new Ir(r,0).mod(e)}};function yt(e,t){this.totalCount=e,this.dataCount=t}yt.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]];yt.getRSBlocks=function(e,t){var r=yt.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],u=r[i*3+1],h=r[i*3+2],g=0;g<a;g++)s.push(new yt(u,h));return s};yt.getRsBlockTable=function(e,t){switch(t){case At.L:return yt.RS_BLOCK_TABLE[(e-1)*4+0];case At.M:return yt.RS_BLOCK_TABLE[(e-1)*4+1];case At.Q:return yt.RS_BLOCK_TABLE[(e-1)*4+2];case At.H:return yt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function za(){this.buffer=[],this.length=0}za.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 Ks=[[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 Wa(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 At.L;case"M":return At.M;case"Q":return At.Q;case"H":return At.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,g){for(var f=s(h),S=1,_=0,k=0,x=Ks.length;k<=x;k++){var M=Ks[k];if(!M)throw new Error("Content too long: expected "+_+" but got "+f);switch(g){case"L":_=M[0];break;case"M":_=M[1];break;case"Q":_=M[2];break;case"H":_=M[3];break;default:throw new Error("Unknwon error correction level: "+g)}if(f<=_)break;S++}if(S>Ks.length)throw new Error("Content too long");return S}function s(h){var g=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return g.length+(g.length!=h?3:0)}var i=this.options.content,a=n(i,this.options.ecl),u=r(this.options.ecl);this.qrcode=new _t(a,u),this.qrcode.addData(i),this.qrcode.make()}Wa.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,u=t.height,h=r.length,g=a/(h+2*t.padding),f=u/(h+2*t.padding),S=typeof t.join<"u"?!!t.join:!1,_=typeof t.swap<"u"?!!t.swap:!1,k=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,x=typeof t.predefined<"u"?!!t.predefined:!1,M=x?s+'<defs><path id="qrmodule" d="M0 0 h'+f+" v"+g+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",O=s+'<rect x="0" y="0" width="'+a+'" height="'+u+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,$="",I="",R=0;R<h;R++)for(var D=0;D<h;D++){var A=r[D][R];if(A){var P=D*g+t.padding*g,Z=R*f+t.padding*f;if(_){var De=P;P=Z,Z=De}if(S){var He=g+P,X=f+Z;P=Number.isInteger(P)?Number(P):P.toFixed(2),Z=Number.isInteger(Z)?Number(Z):Z.toFixed(2),He=Number.isInteger(He)?Number(He):He.toFixed(2),X=Number.isInteger(X)?Number(X):X.toFixed(2),I+="M"+P+","+Z+" V"+X+" H"+He+" V"+Z+" H"+P+" Z "}else x?$+=s+'<use x="'+P.toString()+'" y="'+Z.toString()+'" href="#qrmodule" />'+i:$+=s+'<rect x="'+P.toString()+'" y="'+Z.toString()+'" width="'+g+'" height="'+f+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}S&&($=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+I+'" />');let H="";if(this.options.image!==void 0&&this.options.image.svg){const y=a*this.options.image.width/100,o=u*this.options.image.height/100,l=a/2-y/2,d=u/2-o/2;H+=`<svg x="${l}" y="${d}" width="${y}" height="${o}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,H+=this.options.image.svg+i,H+="</svg>"}var J="";switch(e.container){case"svg":k&&(J+='<?xml version="1.0" standalone="yes"?>'+i),J+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+u+'">'+i,J+=M+O+$,J+=H,J+="</svg>";break;case"svg-viewbox":k&&(J+='<?xml version="1.0" standalone="yes"?>'+i),J+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+u+'">'+i,J+=M+O+$,J+=H,J+="</svg>";break;case"g":J+='<g width="'+a+'" height="'+u+'">'+i,J+=M+O+$,J+=H,J+="</g>";break;default:J+=(M+O+$+H).replace(/^\s+/,"");break}return J};var ph=Wa,mh=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bs,"__esModule",{value:!0});bs.QRCode=void 0;const vh=Ye,Eo=gs,bh=mh(ph),wh=e=>{const[t,r]=(0,Eo.useState)("");return(0,Eo.useEffect)(()=>{var n,s;const i=new bh.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,vh.h)("img",{src:t,alt:"QR Code"}):null};bs.QRCode=wh;var ws={},Ci={};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.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 yh=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ws,"__esModule",{value:!0});ws.Spinner=void 0;const On=Ye,_h=yh(Ci),Eh=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,On.h)("div",{class:"-cbwsdk-spinner"},(0,On.h)("style",null,_h.default),(0,On.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,On.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ws.Spinner=Eh;var xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.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 qa=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.CoinbaseWalletSteps=Tr.ConnectContent=void 0;const rr=qa(cn),W=Ye,Sh=T,kh=Fr,Mh=ps,Rh=ms,Ih=vs,Ch=bs,xh=ws,Ah=qa(xi),Xs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Ja},Nh=e=>e==="light"?"#FFFFFF":"#0A0B0D";function Lh(e){const{theme:t}=e,r=(0,Sh.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Xs.steps;return(0,W.h)("div",{"data-testid":"connect-content",className:(0,rr.default)("-cbwsdk-connect-content",t)},(0,W.h)("style",null,Ah.default),(0,W.h)("div",{className:"-cbwsdk-connect-content-header"},(0,W.h)("h2",{className:(0,rr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,W.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,W.h)(Mh.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,W.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,W.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,W.h)(Th,{title:Xs.title,description:Xs.description,theme:t})),(0,W.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,W.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,W.h)(Ch.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,W.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:kh.LIB_VERSION}),(0,W.h)("input",{type:"hidden",value:r})),(0,W.h)(n,{theme:t}),!e.isConnected&&(0,W.h)("div",{"data-testid":"connecting-spinner",className:(0,rr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,W.h)(xh.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,W.h)("p",null,"Connecting...")))))}Tr.ConnectContent=Lh;function Th({title:e,description:t,theme:r}){return(0,W.h)("div",{className:(0,rr.default)("-cbwsdk-connect-item",r)},(0,W.h)("div",null,(0,W.h)(Rh.CoinbaseWalletRound,null)),(0,W.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,W.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,W.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Ja({theme:e}){return(0,W.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,W.h)("li",{className:(0,rr.default)("-cbwsdk-wallet-steps-item",e)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,W.h)("li",{className:(0,rr.default)("-cbwsdk-wallet-steps-item",e)},(0,W.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,W.h)("span",null,"Tap ",(0,W.h)("strong",null,"Scan")," "),(0,W.h)("span",{className:(0,rr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,W.h)(Ih.QRCodeIcon,{fill:Nh(e)})))))}Tr.CoinbaseWalletSteps=Ja;var ys={},_s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.ArrowLeftIcon=void 0;const So=Ye;function $h(e){return(0,So.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,So.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"}))}_s.ArrowLeftIcon=$h;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.LaptopIcon=void 0;const Ys=Ye;function Ph(e){return(0,Ys.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ys.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ys.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"}))}Es.LaptopIcon=Ph;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.SafeIcon=void 0;const ko=Ye;function Oh(e){return(0,ko.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,ko.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"}))}Ss.SafeIcon=Oh;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.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 Ga=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ys,"__esModule",{value:!0});ys.TryExtensionContent=void 0;const Gt=Ga(cn),je=Ye,ei=gs,Bh=_s,Dh=Es,Fh=Ss,jh=Ga(Ai);function Hh({theme:e}){const[t,r]=(0,ei.useState)(!1),n=(0,ei.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,ei.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,je.h)("div",{class:(0,Gt.default)("-cbwsdk-try-extension",e)},(0,je.h)("style",null,jh.default),(0,je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,je.h)("h3",{class:(0,Gt.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,je.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,je.h)("button",{class:(0,Gt.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,je.h)("div",null,!t&&(0,je.h)(Bh.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,je.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,je.h)("span",{class:(0,Gt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,je.h)(Dh.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,je.h)("div",{class:(0,Gt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,je.h)("span",{class:(0,Gt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,je.h)(Fh.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,je.h)("div",{class:(0,Gt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ys.TryExtensionContent=Hh;var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.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 Za=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fs,"__esModule",{value:!0});fs.ConnectDialog=void 0;const ti=Za(cn),Zt=Ye,ri=gs,Uh=Tr,Vh=ys,zh=Za(Ni),Wh=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,ri.useState)(!t),[i,a]=(0,ri.useState)(!t);(0,ri.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 u=r?"dark":"light";return(0,Zt.h)("div",{class:(0,ti.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Zt.h)("style",null,zh.default),(0,Zt.h)("div",{class:(0,ti.default)("-cbwsdk-connect-dialog-backdrop",u,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Zt.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Zt.h)("div",{class:(0,ti.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,Zt.h)(Uh.ConnectContent,{theme:u,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,Zt.h)(Vh.TryExtensionContent,{theme:u}))))};fs.ConnectDialog=Wh;Object.defineProperty(ds,"__esModule",{value:!0});ds.LinkFlow=void 0;const ni=Ye,qh=fs;class Jh{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,ni.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,ni.render)((0,ni.h)(qh.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)}}ds.LinkFlow=Jh;var Li={},Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.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=B&&B.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(cn),n=Ye,s=gs,i=t(Ti),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",u="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(_){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=_.darkMode}attach(_){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",_.appendChild(this.root),this.render()}presentItem(_){const k=this.nextItemKey++;return this.items.set(k,_),this.render(),()=>{this.items.delete(k),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(([_,k])=>(0,n.h)(e.SnackbarInstance,Object.assign({},k,{key:_}))))),this.root)}}e.Snackbar=h;const g=S=>(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"},S.children));e.SnackbarContainer=g;const f=({autoExpand:S,message:_,menuItems:k})=>{const[x,M]=(0,s.useState)(!0),[O,$]=(0,s.useState)(S??!1);(0,s.useEffect)(()=>{const R=[window.setTimeout(()=>{M(!1)},1),window.setTimeout(()=>{$(!0)},1e4)];return()=>{R.forEach(window.clearTimeout)}});const I=()=>{$(!O)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",x&&"-cbwsdk-snackbar-instance-hidden",O&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:I},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},_),(0,n.h)("div",{class:"-gear-container"},!O&&(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:u,class:"-gear-icon",title:"Expand"}))),k&&k.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},k.map((R,D)=>(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:D},(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})(Li);Object.defineProperty(wn,"__esModule",{value:!0});wn.WalletLinkRelayUI=void 0;const Gh=yn,Zh=ds,Qh=Li;class Kh{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new Qh.Snackbar({darkMode:t.darkMode}),this.linkFlow=new Zh.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,Gh.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}}wn.WalletLinkRelayUI=Kh;Object.defineProperty(gn,"__esModule",{value:!0});gn.WalletLinkRelay=void 0;const Sr=ln,Xh=Ue,Pe=T,Qt=jr,Mo=at,Ct=Hr,Yh=ls,Kt=Dr,ed=wn;class Mt extends Mo.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 u;this.isLinked=a;const h=this.storage.getItem(Mo.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const g=h.split(" "),f=this.storage.getItem("IsStandaloneSigning")==="true";if(g[0]!==""&&!a&&this.session.linked&&!f){this.isUnlinkedErrorState=!0;const S=this.getSessionIdHash();(u=this.diagnostic)===null||u===void 0||u.log(Qt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:S})}}},this.metadataUpdated=(a,u)=>{this.storage.setItem(a,u)},this.chainUpdated=(a,u)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===u||(this.chainCallbackParams={chainId:a,jsonRpcUrl:u},this.chainCallback&&this.chainCallback(a,u))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Mt.accountRequestCallbackIds.size>0&&(Array.from(Mt.accountRequestCallbackIds.values()).forEach(u=>{const h={type:"WEB3_RESPONSE",id:u,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:u}))}),Mt.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=Ct.Session.load(this.storage)||new Ct.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new Yh.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:a}=this.options,u=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:a,session:t});return s.connect(),{session:t,ui:u,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(Qt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=Ct.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(Qt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ct.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:a,connection:u}=this.subscribe();this._session=i,this.connection=u,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(Qt.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,Pe.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Pe.hexStringFromBuffer)(t,!0),signature:(0,Pe.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Pe.bigIntStringFromBN)(t.weiValue),data:(0,Pe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Pe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Pe.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Pe.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Pe.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,Pe.bigIntStringFromBN)(t.weiValue),data:(0,Pe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Pe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Pe.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Pe.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Pe.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Pe.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Pe.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,Pe.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r==null||r()};return{promise:new Promise((a,u)=>{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,Kt.isErrorResponse)(h))return u(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 ed.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=Ct.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Qt.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Ct.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(a=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(Qt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Ct.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(Qt.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Mt.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),Mt.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,Sr.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,Pe.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,u=>{if(this.ui.hideRequestEthereumAccounts(),(0,Kt.isErrorResponse)(u))return a(new Error(u.errorMessage));i(u)}),this.ui.inlineAccountsResponse()){const u=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Sr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}Mt.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,Pe.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},i=new Promise((a,u)=>{this.relayEventManager.callbacks.set(n,f=>{if((0,Kt.isErrorResponse)(f))return u(new Error(f.errorMessage));a(f)});const h=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Xh.ProviderType.Unselected}})},g=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:f}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:g,onCancel:h,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,a){const u={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:a}};let h=null;const g=(0,Pe.randomBytesHex)(8),f=_=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,u.method,_),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload}));const S=new Promise((_,k)=>{this.relayEventManager.callbacks.set(g,O=>{if(h==null||h(),(0,Kt.isErrorResponse)(O))return k(new Error(O.errorMessage));_(O)});const x=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!1}})},M=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:M,onCancel:x,type:t,address:r,symbol:n,decimals:s,image:i,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,u)});return{cancel:f,promise:S}}addEthereumChain(t,r,n,s,i,a){const u={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:a}};let h=null;const g=(0,Pe.randomBytesHex)(8),f=_=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,u.method,_),h==null||h()};return this.ui.inlineAddEthereumChain(t)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload})),{promise:new Promise((_,k)=>{this.relayEventManager.callbacks.set(g,O=>{if(h==null||h(),(0,Kt.isErrorResponse)(O))return k(new Error(O.errorMessage));_(O)});const x=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},M=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:O}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:x,onApprove:M,chainId:u.params.chainId,rpcUrls:u.params.rpcUrls,blockExplorerUrls:u.params.blockExplorerUrls,chainName:u.params.chainName,iconUrls:u.params.iconUrls,nativeCurrency:u.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,u)}),cancel:f}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,Pe.randomBytesHex)(8),i=u=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,u)};return{promise:new Promise((u,h)=>{this.relayEventManager.callbacks.set(s,S=>{if((0,Kt.isErrorResponse)(S)&&S.errorCode)return h(Sr.standardErrors.provider.custom({code:S.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Kt.isErrorResponse)(S))return h(new Error(S.errorMessage));u(S)});const g=S=>{var _;if(S){const k=(_=(0,Sr.getErrorCode)(S))!==null&&_!==void 0?_:Sr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",S instanceof Error?S:Sr.standardErrors.provider.unsupportedChain(t),k)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},f=S=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:S}}})};this.ui.switchEthereumChain({onCancel:g,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 Ct.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}}}gn.WalletLinkRelay=Mt;Mt.accountRequestCallbackIds=new Set;var _n={},ks={},Qa={};(function(e){var t=B&&B.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var u=Object.getOwnPropertyDescriptor(s,i);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,u)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=B&&B.__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(Li,e)})(Qa);var $i={};Object.defineProperty($i,"__esModule",{value:!0});$i.default=(()=>".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}")();var Ka=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0});ks.RedirectDialog=void 0;const td=Ka(cn),wt=Ye,rd=yn,nd=Qa,sd=Ka($i);class id{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,rd.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,wt.render)(null,this.root),t&&(0,wt.render)((0,wt.h)(od,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}ks.RedirectDialog=id;const od=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,wt.h)(nd.SnackbarContainer,{darkMode:r},(0,wt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,wt.h)("style",null,sd.default),(0,wt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,wt.h)("div",{class:(0,td.default)("-cbwsdk-redirect-dialog-box",i)},(0,wt.h)("p",null,e),(0,wt.h)("button",{onClick:n},t))))};Object.defineProperty(_n,"__esModule",{value:!0});_n.MobileRelayUI=void 0;const ad=ks;class cd{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new ad.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}}_n.MobileRelayUI=cd;Object.defineProperty(fn,"__esModule",{value:!0});fn.MobileRelay=void 0;const ld=T,ud=gn,hd=_n;class dd extends ud.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,ld.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 hd.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}})}}fn.MobileRelay=dd;const{Transform:fd}=Ea();var gd=e=>class Xa extends fd{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 Xa(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:pd}=Ea();var md=e=>class Ya extends pd{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 Ya(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const vd=gd,bd=md;var wd=function(e){const t=vd(e),r=bd(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)}}},ec={};const Ro=[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];ec.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],u=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],g=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],S=e[9]^e[19]^e[29]^e[39]^e[49];let _=f^(s<<1|i>>>31),k=S^(i<<1|s>>>31);const x=e[0]^_,M=e[1]^k,O=e[10]^_,$=e[11]^k,I=e[20]^_,R=e[21]^k,D=e[30]^_,A=e[31]^k,P=e[40]^_,Z=e[41]^k;_=r^(a<<1|u>>>31),k=n^(u<<1|a>>>31);const De=e[2]^_,He=e[3]^k,X=e[12]^_,H=e[13]^k,J=e[22]^_,y=e[23]^k,o=e[32]^_,l=e[33]^k,d=e[42]^_,p=e[43]^k;_=s^(h<<1|g>>>31),k=i^(g<<1|h>>>31);const v=e[4]^_,w=e[5]^k,E=e[14]^_,m=e[15]^k,c=e[24]^_,b=e[25]^k,L=e[34]^_,C=e[35]^k,N=e[44]^_,Q=e[45]^k;_=a^(f<<1|S>>>31),k=u^(S<<1|f>>>31);const G=e[6]^_,K=e[7]^k,Jr=e[16]^_,Se=e[17]^k,ke=e[26]^_,Gr=e[27]^k,Me=e[36]^_,Re=e[37]^k,Zr=e[46]^_,Ie=e[47]^k;_=h^(r<<1|n>>>31),k=g^(n<<1|r>>>31);const Ce=e[8]^_,Qr=e[9]^k,xe=e[18]^_,Ae=e[19]^k,Kr=e[28]^_,Ne=e[29]^k,Le=e[38]^_,Xr=e[39]^k,Te=e[48]^_,$e=e[49]^k,cr=x,Y=M,ee=$<<4|O>>>28,lr=O<<4|$>>>28,te=I<<3|R>>>29,re=R<<3|I>>>29,ur=A<<9|D>>>23,ne=D<<9|A>>>23,se=P<<18|Z>>>14,hr=Z<<18|P>>>14,ie=De<<1|He>>>31,oe=He<<1|De>>>31,dr=H<<12|X>>>20,ae=X<<12|H>>>20,ce=J<<10|y>>>22,fr=y<<10|J>>>22,le=l<<13|o>>>19,ue=o<<13|l>>>19,gr=d<<2|p>>>30,he=p<<2|d>>>30,de=w<<30|v>>>2,pr=v<<30|w>>>2,fe=E<<6|m>>>26,ge=m<<6|E>>>26,mr=b<<11|c>>>21,pe=c<<11|b>>>21,me=L<<15|C>>>17,vr=C<<15|L>>>17,ve=Q<<29|N>>>3,be=N<<29|Q>>>3,br=G<<28|K>>>4,we=K<<28|G>>>4,ye=Se<<23|Jr>>>9,wr=Jr<<23|Se>>>9,_e=ke<<25|Gr>>>7,Ee=Gr<<25|ke>>>7,$t=Me<<21|Re>>>11,Pt=Re<<21|Me>>>11,Ot=Ie<<24|Zr>>>8,Bt=Zr<<24|Ie>>>8,Dt=Ce<<27|Qr>>>5,Ft=Qr<<27|Ce>>>5,jt=xe<<20|Ae>>>12,Ht=Ae<<20|xe>>>12,Ut=Ne<<7|Kr>>>25,Vt=Kr<<7|Ne>>>25,zt=Le<<8|Xr>>>24,Wt=Xr<<8|Le>>>24,qt=Te<<14|$e>>>18,Jt=$e<<14|Te>>>18;e[0]=cr^~dr&mr,e[1]=Y^~ae&pe,e[10]=br^~jt&te,e[11]=we^~Ht&re,e[20]=ie^~fe&_e,e[21]=oe^~ge&Ee,e[30]=Dt^~ee&ce,e[31]=Ft^~lr&fr,e[40]=de^~ye&Ut,e[41]=pr^~wr&Vt,e[2]=dr^~mr&$t,e[3]=ae^~pe&Pt,e[12]=jt^~te&le,e[13]=Ht^~re&ue,e[22]=fe^~_e&zt,e[23]=ge^~Ee&Wt,e[32]=ee^~ce&me,e[33]=lr^~fr&vr,e[42]=ye^~Ut&ur,e[43]=wr^~Vt&ne,e[4]=mr^~$t&qt,e[5]=pe^~Pt&Jt,e[14]=te^~le&ve,e[15]=re^~ue&be,e[24]=_e^~zt&se,e[25]=Ee^~Wt&hr,e[34]=ce^~me&Ot,e[35]=fr^~vr&Bt,e[44]=Ut^~ur&gr,e[45]=Vt^~ne&he,e[6]=$t^~qt&cr,e[7]=Pt^~Jt&Y,e[16]=le^~ve&br,e[17]=ue^~be&we,e[26]=zt^~se&ie,e[27]=Wt^~hr&oe,e[36]=me^~Ot&Dt,e[37]=vr^~Bt&Ft,e[46]=ur^~gr&de,e[47]=ne^~he&pr,e[8]=qt^~cr&dr,e[9]=Jt^~Y&ae,e[18]=ve^~br&jt,e[19]=be^~we&Ht,e[28]=se^~ie&fe,e[29]=hr^~oe&ge,e[38]=Ot^~Dt&ee,e[39]=Bt^~Ft&lr,e[48]=gr^~de&ye,e[49]=he^~pr&wr,e[0]^=Ro[t*2],e[1]^=Ro[t*2+1]}};const Zn=ec;function Vr(){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}Vr.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};Vr.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&&(Zn.p1600(this.state),this.count=0)};Vr.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&Zn.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Zn.p1600(this.state),this.count=0,this.squeezing=!0};Vr.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&&(Zn.p1600(this.state),this.count=0);return t};Vr.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 yd=Vr,_d=wd(yd);const Ed=_d,Sd=es;function tc(e){return U.allocUnsafe(e).fill(0)}function rc(e,t,r){const n=tc(t);return e=Ms(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 kd(e,t){return rc(e,t,!0)}function Ms(e){if(!U.isBuffer(e))if(Array.isArray(e))e=U.from(e);else if(typeof e=="string")nc(e)?e=U.from(Id(sc(e)),"hex"):e=U.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=U.allocUnsafe(0);else if(Sd.isBN(e))e=e.toArrayLike(U);else if(e.toArray)e=U.from(e.toArray());else throw new Error("invalid type");return e}function Md(e){return e=Ms(e),"0x"+e.toString("hex")}function Rd(e,t){return e=Ms(e),t||(t=256),Ed("keccak"+t).update(e).digest()}function Id(e){return e.length%2?"0"+e:e}function nc(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function sc(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var ic={zeros:tc,setLength:rc,setLengthRight:kd,isHexString:nc,stripHexPrefix:sc,toBuffer:Ms,bufferToHex:Md,keccak:Rd};const nr=ic,er=es;function oc(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 Cr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Io(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function ac(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function Xt(e){var t=typeof e;if(t==="string")return nr.isHexString(e)?new er(nr.stripHexPrefix(e),16):new er(e,10);if(t==="number")return new er(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function bt(e,t){var r,n,s,i;if(e==="address")return bt("uint160",Xt(t));if(e==="bool")return bt("uint8",t?1:0);if(e==="string")return bt("bytes",new U(t,"utf8"));if(xd(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=ac(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(bt(e,t[i]));if(r==="dynamic"){var a=bt("uint256",t.length);s.unshift(a)}return U.concat(s)}else{if(e==="bytes")return t=new U(t),s=U.concat([bt("uint256",t.length),t]),t.length%32!==0&&(s=U.concat([s,nr.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=Cr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return nr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Cr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Xt(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=Cr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Xt(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=Io(e),n=Xt(t),n<0)throw new Error("Supplied ufixed is negative");return bt("uint256",n.mul(new er(2).pow(new er(r[1]))))}else if(e.startsWith("fixed"))return r=Io(e),bt("int256",Xt(t).mul(new er(2).pow(new er(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Cd(e){return e==="string"||e==="bytes"||ac(e)==="dynamic"}function xd(e){return e.lastIndexOf("]")===e.length-1}function Ad(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var a=oc(e[i]),u=t[i],h=bt(a,u);Cd(a)?(r.push(bt("uint256",s)),n.push(h),s+=h.length):r.push(h)}return U.concat(r.concat(n))}function cc(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=oc(e[i]),u=t[i];if(a==="bytes")s.push(u);else if(a==="string")s.push(new U(u,"utf8"));else if(a==="bool")s.push(new U(u?"01":"00","hex"));else if(a==="address")s.push(nr.setLength(u,20));else if(a.startsWith("bytes")){if(r=Cr(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(nr.setLengthRight(u,r))}else if(a.startsWith("uint")){if(r=Cr(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Xt(u),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=Cr(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Xt(u),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 Nd(e,t){return nr.keccak(cc(e,t))}var Ld={rawEncode:Ad,solidityPack:cc,soliditySHA3:Nd};const ht=ic,nn=Ld,lc={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=(u,h,g)=>{if(r[h]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ht.keccak(this.encodeData(h,g,r,n))];if(g===void 0)throw new Error(`missing value for field ${u} of type ${h}`);if(h==="bytes")return["bytes32",ht.keccak(g)];if(h==="string")return typeof g=="string"&&(g=U.from(g,"utf8")),["bytes32",ht.keccak(g)];if(h.lastIndexOf("]")===h.length-1){const f=h.slice(0,h.lastIndexOf("[")),S=g.map(_=>a(u,f,_));return["bytes32",ht.keccak(nn.rawEncode(S.map(([_])=>_),S.map(([,_])=>_)))]}return[h,g]};for(const u of r[e]){const[h,g]=a(u.name,u.type,t[u.name]);s.push(h),i.push(g)}}else for(const a of r[e]){let u=t[a.name];if(u!==void 0)if(a.type==="bytes")s.push("bytes32"),u=ht.keccak(u),i.push(u);else if(a.type==="string")s.push("bytes32"),typeof u=="string"&&(u=U.from(u,"utf8")),u=ht.keccak(u),i.push(u);else if(r[a.type]!==void 0)s.push("bytes32"),u=ht.keccak(this.encodeData(a.type,u,r,n)),i.push(u);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(u)}}return nn.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:u})=>u+" "+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 ht.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return ht.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in lc.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)),ht.keccak(U.concat(n))}};var Td={TYPED_MESSAGE_SCHEMA:lc,TypedDataUtils:si,hashForSignTypedDataLegacy:function(e){return $d(e.data)},hashForSignTypedData_v3:function(e){return si.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return si.hash(e.data)}};function $d(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"?ht.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 nn.soliditySHA3(["bytes32","bytes32"],[nn.soliditySHA3(new Array(e.length).fill("string"),s),nn.soliditySHA3(n,r)])}var $r={};Object.defineProperty($r,"__esModule",{value:!0});$r.filterFromParam=$r.FilterPolyfill=void 0;const Mr=Ue,Qe=T,Pd=5*60*1e3,Yt={jsonrpc:"2.0",id:0};class Od{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,Mr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=uc(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,Qe.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,Qe.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,Qe.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,Qe.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,Qe.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(Bn())}async getFilterLogs(t){const r=(0,Qe.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Yt),{method:"eth_getLogs",params:[Co(n)]})):Bn()}makeFilterId(){return(0,Mr.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 Bn();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return Dn();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},Yt),{method:"eth_getLogs",params:[Co(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(a.result)){const u=a.result.map(g=>(0,Qe.intNumberFromHexString)(g.blockNumber||"0x0")),h=Math.max(...u);if(h&&h>n){const g=(0,Mr.IntNumber)(h+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${g}`),this.cursors.set(t,g)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Bn();const n=await this.getCurrentBlockHeight();if(r>n)return Dn();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,Qe.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Mr.IntNumber)(a))))).filter(a=>!!a),i=(0,Mr.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({},Yt),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Dn())}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)},Pd);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({},Yt),{method:"eth_blockNumber",params:[]}));return(0,Qe.intNumberFromHexString)((0,Qe.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Yt),{method:"eth_getBlockByNumber",params:[(0,Qe.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Qe.ensureHexString)(r.result.hash):null}}$r.FilterPolyfill=Od;function uc(e){return{fromBlock:xo(e.fromBlock),toBlock:xo(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}$r.filterFromParam=uc;function Co(e){const t={fromBlock:Ao(e.fromBlock),toBlock:Ao(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function xo(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Mr.IntNumber)(0);if((0,Qe.isHexString)(e))return(0,Qe.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Ao(e){return e==="latest"?e:(0,Qe.hexStringFromIntNumber)(e)}function Bn(){return Object.assign(Object.assign({},Yt),{error:{code:-32e3,message:"filter not found"}})}function Dn(){return Object.assign(Object.assign({},Yt),{result:[]})}var Rs={},hc={},Is={},Pi=Bd;function Bd(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 No=(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,u){if(t.multiArgs){const h=new Array(arguments.length-1);for(let g=1;g<arguments.length;g++)h[g-1]=arguments[g];a?(h.unshift(a),i(h)):s(h)}else a?i(a):s(u)}):n.push(function(a){if(t.multiArgs){const u=new Array(arguments.length-1);for(let h=0;h<arguments.length;h++)u[h]=arguments[h];s(u)}else s(a)}),e.apply(this,n)})};var Dd=(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):No(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)?No(i,t):i}return n},En={},Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});const Fd=_a;function Lo(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function jd(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Hd=class extends Fd.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 u=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw u.context=a,u}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")Lo(i,this,r);else{const a=i.length,u=jd(i);for(let h=0;h<a;h+=1)Lo(u[h],this,r)}return!0}};Sn.default=Hd;var Ud=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(En,"__esModule",{value:!0});En.BaseBlockTracker=void 0;const Vd=Ud(Sn),zd=1e3,Wd=(e,t)=>e+t,To=["sync","latest"];class qd extends Vd.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*zd,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){To.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 To.map(t=>this.listenerCount(t)).reduce(Wd)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=$o(t),s=$o(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}}En.BaseBlockTracker=qd;function $o(e){return Number.parseInt(e,16)}var dc={},fc={},Ge={};class gc extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...a}=t,{path:u}=t,h=u.length===0?s:`At path: ${u.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 Jd(e){return lt(e)&&typeof e[Symbol.iterator]=="function"}function lt(e){return typeof e=="object"&&e!=null}function Po(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ve(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Gd(e){const{done:t,value:r}=e.next();return t?void 0:r}function Zd(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:u,message:h=`Expected a value of type \`${a}\`${u?` with refinement \`${u}\``:""}, but received: \`${Ve(n)}\``}=e;return{value:n,type:a,refinement:u,key:s[s.length-1],path:s,branch:i,...e,message:h}}function*mi(e,t,r,n){Jd(e)||(e=[e]);for(const s of e){const i=Zd(s,t,r,n);i&&(yield i)}}function*Oi(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:a=!1}=r,u={path:n,branch:s};if(i&&(e=t.coercer(e,u),a&&t.type!=="type"&<(t.schema)&<(e)&&!Array.isArray(e)))for(const g in e)t.schema[g]===void 0&&delete e[g];let h="valid";for(const g of t.validator(e,u))g.explanation=r.message,h="not_valid",yield[g,void 0];for(let[g,f,S]of t.entries(e,u)){const _=Oi(f,S,{path:g===void 0?n:[...n,g],branch:g===void 0?s:[...s,f],coerce:i,mask:a,message:r.message});for(const k of _)k[0]?(h=k[0].refinement!=null?"not_refined":"not_valid",yield[k[0],void 0]):i&&(f=k[1],g===void 0?e=f:e instanceof Map?e.set(g,f):e instanceof Set?e.add(f):lt(e)&&(f!==void 0||g in e)&&(e[g]=f))}if(h!=="not_valid")for(const g of t.refiner(e,u))g.explanation=r.message,h="not_refined",yield[g,void 0];h==="valid"&&(yield[void 0,e])}class Fe{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:a=h=>h,entries:u=function*(){}}=t;this.type=r,this.schema=n,this.entries=u,this.coercer=a,s?this.validator=(h,g)=>{const f=s(h,g);return mi(f,g,this,h)}:this.validator=()=>[],i?this.refiner=(h,g)=>{const f=i(h,g);return mi(f,g,this,h)}:this.refiner=()=>[]}assert(t,r){return pc(t,this,r)}create(t,r){return mc(t,this,r)}is(t){return Bi(t,this)}mask(t,r){return vc(t,this,r)}validate(t,r={}){return zr(t,this,r)}}function pc(e,t,r){const n=zr(e,t,{message:r});if(n[0])throw n[0]}function mc(e,t,r){const n=zr(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function vc(e,t,r){const n=zr(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Bi(e,t){return!zr(e,t)[0]}function zr(e,t,r={}){const n=Oi(e,t,r),s=Gd(n);return s[0]?[new gc(s[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,s[1]]}function Qd(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?Mn(n):kn(n)}function et(e,t){return new Fe({type:e,schema:null,validator:t})}function Kd(e,t){return new Fe({...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 Xd(e){return new Fe({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 Yd(e){let t;return new Fe({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 e0(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return Mn(n);default:return kn(n)}}function t0(e){const t=e instanceof Fe,r=t?{...e.schema}:{...e};for(const n in r)r[n]=bc(r[n]);return t&&e.type==="type"?Mn(r):kn(r)}function r0(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];switch(e.type){case"type":return Mn(n);default:return kn(n)}}function n0(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),et(e,t)}function s0(){return et("any",()=>!0)}function i0(e){return new Fe({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: ${Ve(t)}`}})}function o0(){return et("bigint",e=>typeof e=="bigint")}function a0(){return et("boolean",e=>typeof e=="boolean")}function c0(){return et("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ve(e)}`)}function l0(e){const t={},r=e.map(n=>Ve(n)).join();for(const n of e)t[n]=n;return new Fe({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ve(n)}`}})}function u0(){return et("func",e=>typeof e=="function"||`Expected a function, but received: ${Ve(e)}`)}function h0(e){return et("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ve(t)}`)}function d0(){return et("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ve(e)}`)}function f0(e){return new Fe({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 g0(e){const t=Ve(e),r=typeof e;return new Fe({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ve(n)}`}})}function p0(e,t){return new Fe({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: ${Ve(r)}`}})}function Di(){return et("never",()=>!1)}function m0(e){return new Fe({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function v0(){return et("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ve(e)}`)}function kn(e){const t=e?Object.keys(e):[],r=Di();return new Fe({type:"object",schema:e||null,*entries(n){if(e&<(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 lt(n)||`Expected an object, but received: ${Ve(n)}`},coercer(n){return lt(n)?{...n}:n}})}function bc(e){return new Fe({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function b0(e,t){return new Fe({type:"record",schema:null,*entries(r){if(lt(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return lt(r)||`Expected an object, but received: ${Ve(r)}`}})}function w0(){return et("regexp",e=>e instanceof RegExp)}function y0(e){return new Fe({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: ${Ve(t)}`}})}function wc(){return et("string",e=>typeof e=="string"||`Expected a string, but received: ${Ve(e)}`)}function _0(e){const t=Di();return new Fe({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: ${Ve(r)}`}})}function Mn(e){const t=Object.keys(e);return new Fe({type:"type",schema:e,*entries(r){if(lt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return lt(r)||`Expected an object, but received: ${Ve(r)}`},coercer(r){return lt(r)?{...r}:r}})}function E0(e){const t=e.map(r=>r.type).join(" | ");return new Fe({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]=Oi(r,i,n),[u]=a;if(u[0])for(const[h]of a)h&&s.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ve(r)}`,...s]}})}function yc(){return et("unknown",()=>!0)}function Fi(e,t,r){return new Fe({...e,coercer:(n,s)=>Bi(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function S0(e,t,r={}){return Fi(e,yc(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&Po(n)&&Po(s)){const i={...n};let a=!1;for(const u in s)i[u]===void 0&&(i[u]=s[u],a=!0);if(a)return i}return n})}function k0(e){return Fi(e,wc(),t=>t.trim())}function M0(e){return or(e,"empty",t=>{const r=_c(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function _c(e){return e instanceof Map||e instanceof Set?e.size:e.length}function R0(e,t,r={}){const{exclusive:n}=r;return or(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function I0(e,t,r={}){const{exclusive:n}=r;return or(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function C0(e){return or(e,"nonempty",t=>_c(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function x0(e,t){return or(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function A0(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return or(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 or(e,t,r){return new Fe({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),a=mi(i,s,e,n);for(const u of a)yield{...u,refinement:t}}})}const N0=Object.freeze(Object.defineProperty({__proto__:null,Struct:Fe,StructError:gc,any:s0,array:i0,assert:pc,assign:Qd,bigint:o0,boolean:a0,coerce:Fi,create:mc,date:c0,defaulted:S0,define:et,deprecated:Kd,dynamic:Xd,empty:M0,enums:l0,func:u0,instance:h0,integer:d0,intersection:f0,is:Bi,lazy:Yd,literal:g0,map:p0,mask:vc,max:R0,min:I0,never:Di,nonempty:C0,nullable:m0,number:v0,object:kn,omit:e0,optional:bc,partial:t0,pattern:x0,pick:r0,record:b0,refine:or,regexp:w0,set:y0,size:A0,string:wc,struct:n0,trimmed:k0,tuple:_0,type:Mn,union:E0,unknown:yc,validate:zr},Symbol.toStringTag,{value:"Module"})),ar=_i(N0);Object.defineProperty(Ge,"__esModule",{value:!0});Ge.assertExhaustive=Ge.assertStruct=Ge.assert=Ge.AssertionError=void 0;const L0=ar;function T0(e){return typeof e=="object"&&e!==null&&"message"in e}function $0(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 P0(e){const t=T0(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Ec(e,t){return $0(e)?new e({message:t}):e({message:t})}class ji extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Ge.AssertionError=ji;function O0(e,t="Assertion failed.",r=ji){if(!e)throw t instanceof Error?t:Ec(r,t)}Ge.assert=O0;function B0(e,t,r="Assertion failed",n=ji){try{(0,L0.assert)(e,t)}catch(s){throw Ec(n,`${r}: ${P0(s)}.`)}}Ge.assertStruct=B0;function D0(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ge.assertExhaustive=D0;var Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.base64=void 0;const F0=ar,j0=Ge,H0=(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,j0.assert)(i==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let u;return s?u=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):u=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,F0.pattern)(e,u)};Rn.base64=H0;var q={},In={};(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=ar,r=Ge;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(g){return(0,t.is)(g,e.HexStruct)}e.isHexString=n;function s(g){return(0,t.is)(g,e.StrictHexStruct)}e.isStrictHexString=s;function i(g){(0,r.assert)(n(g),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function a(g){(0,r.assert)(s(g),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function u(g){return g.startsWith("0x")?g:g.startsWith("0X")?`0x${g.substring(2)}`:`0x${g}`}e.add0x=u;function h(g){return g.startsWith("0x")||g.startsWith("0X")?g.substring(2):g}e.remove0x=h})(In);Object.defineProperty(q,"__esModule",{value:!0});q.createDataView=q.concatBytes=q.valueToBytes=q.stringToBytes=q.numberToBytes=q.signedBigIntToBytes=q.bigIntToBytes=q.hexToBytes=q.bytesToString=q.bytesToNumber=q.bytesToSignedBigInt=q.bytesToBigInt=q.bytesToHex=q.assertIsBytes=q.isBytes=void 0;const nt=Ge,vi=In,Oo=48,Bo=58,Do=87;function U0(){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 V0=U0();function Hi(e){return e instanceof Uint8Array}q.isBytes=Hi;function Wr(e){(0,nt.assert)(Hi(e),"Value must be a Uint8Array.")}q.assertIsBytes=Wr;function Sc(e){if(Wr(e),e.length===0)return"0x";const t=V0(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,vi.add0x)(r.join(""))}q.bytesToHex=Sc;function kc(e){Wr(e);const t=Sc(e);return BigInt(t)}q.bytesToBigInt=kc;function z0(e){Wr(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}q.bytesToSignedBigInt=z0;function W0(e){Wr(e);const t=kc(e);return(0,nt.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}q.bytesToNumber=W0;function q0(e){return Wr(e),new TextDecoder().decode(e)}q.bytesToString=q0;function Cs(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,vi.assertIsHexString)(e);const r=(0,vi.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),u=n.charCodeAt(i*2+1),h=a-(a<Bo?Oo:Do),g=u-(u<Bo?Oo:Do);s[i]=h*16+g}return s}q.hexToBytes=Cs;function Mc(e){(0,nt.assert)(typeof e=="bigint","Value must be a bigint."),(0,nt.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Cs(t)}q.bigIntToBytes=Mc;function J0(e,t){(0,nt.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function G0(e,t){(0,nt.assert)(typeof e=="bigint","Value must be a bigint."),(0,nt.assert)(typeof t=="number","Byte length must be a number."),(0,nt.assert)(t>0,"Byte length must be greater than 0."),(0,nt.assert)(J0(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()}q.signedBigIntToBytes=G0;function Rc(e){(0,nt.assert)(typeof e=="number","Value must be a number."),(0,nt.assert)(e>=0,"Value must be a non-negative number."),(0,nt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Cs(t)}q.numberToBytes=Rc;function Ic(e){return(0,nt.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}q.stringToBytes=Ic;function Cc(e){if(typeof e=="bigint")return Mc(e);if(typeof e=="number")return Rc(e);if(typeof e=="string")return e.startsWith("0x")?Cs(e):Ic(e);if(Hi(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}q.valueToBytes=Cc;function Z0(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=Cc(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}q.concatBytes=Z0;function Q0(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)}q.createDataView=Q0;var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.ChecksumStruct=void 0;const Fo=ar,K0=Rn;xs.ChecksumStruct=(0,Fo.size)((0,K0.base64)((0,Fo.string)(),{paddingRequired:!0}),44,44);var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.createHex=Et.createBytes=Et.createBigInt=Et.createNumber=void 0;const Be=ar,X0=Ge,xc=q,As=In,Ac=(0,Be.union)([(0,Be.number)(),(0,Be.bigint)(),(0,Be.string)(),As.StrictHexStruct]),Y0=(0,Be.coerce)((0,Be.number)(),Ac,Number),ef=(0,Be.coerce)((0,Be.bigint)(),Ac,BigInt);(0,Be.union)([As.StrictHexStruct,(0,Be.instance)(Uint8Array)]);const tf=(0,Be.coerce)((0,Be.instance)(Uint8Array),(0,Be.union)([As.StrictHexStruct]),xc.hexToBytes),rf=(0,Be.coerce)(As.StrictHexStruct,(0,Be.instance)(Uint8Array),xc.bytesToHex);function nf(e){try{const t=(0,Be.create)(e,Y0);return(0,X0.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Be.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Et.createNumber=nf;function sf(e){try{return(0,Be.create)(e,ef)}catch(t){throw t instanceof Be.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Et.createBigInt=sf;function of(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Be.create)(e,tf)}catch(t){throw t instanceof Be.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Et.createBytes=of;function af(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Be.create)(e,rf)}catch(t){throw t instanceof Be.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Et.createHex=af;var Pr={},Nc=B&&B.__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},Ke=B&&B.__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)},ut,mt;Object.defineProperty(Pr,"__esModule",{value:!0});Pr.FrozenSet=Pr.FrozenMap=void 0;class Ui{constructor(t){ut.set(this,void 0),Nc(this,ut,new Map(t),"f"),Object.freeze(this)}get size(){return Ke(this,ut,"f").size}[(ut=new WeakMap,Symbol.iterator)](){return Ke(this,ut,"f")[Symbol.iterator]()}entries(){return Ke(this,ut,"f").entries()}forEach(t,r){return Ke(this,ut,"f").forEach((n,s,i)=>t.call(r,n,s,this))}get(t){return Ke(this,ut,"f").get(t)}has(t){return Ke(this,ut,"f").has(t)}keys(){return Ke(this,ut,"f").keys()}values(){return Ke(this,ut,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Pr.FrozenMap=Ui;class Vi{constructor(t){mt.set(this,void 0),Nc(this,mt,new Set(t),"f"),Object.freeze(this)}get size(){return Ke(this,mt,"f").size}[(mt=new WeakMap,Symbol.iterator)](){return Ke(this,mt,"f")[Symbol.iterator]()}entries(){return Ke(this,mt,"f").entries()}forEach(t,r){return Ke(this,mt,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return Ke(this,mt,"f").has(t)}keys(){return Ke(this,mt,"f").keys()}values(){return Ke(this,mt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Pr.FrozenSet=Vi;Object.freeze(Ui);Object.freeze(Ui.prototype);Object.freeze(Vi);Object.freeze(Vi.prototype);var Lc={};Object.defineProperty(Lc,"__esModule",{value:!0});var Tc={};(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=ar,r=Ge,n=()=>(0,t.define)("finite number",A=>(0,t.is)(A,(0,t.number)())&&Number.isFinite(A));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",(A,P)=>{function Z(De,He){const H=[...He.validator(De,P)];return H.length>0?H:!0}try{const De=Z(A,e.UnsafeJsonStruct);return De!==!0?De:Z(JSON.parse(JSON.stringify(A)),e.UnsafeJsonStruct)}catch(De){return De instanceof RangeError?"Circular reference detected":!1}});function s(A){return(0,t.is)(A,e.JsonStruct)}e.isValidJson=s;function i(A){(0,r.assertStruct)(A,e.JsonStruct,"Invalid JSON value");const P=JSON.stringify(A);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(A){return(0,t.is)(A,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function u(A,P){(0,r.assertStruct)(A,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",P)}e.assertIsJsonRpcNotification=u;function h(A){return(0,t.is)(A,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function g(A,P){(0,r.assertStruct)(A,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",P)}e.assertIsJsonRpcRequest=g,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(A){return(0,t.is)(A,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=f;function S(A,P){(0,r.assertStruct)(A,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",P)}e.assertIsPendingJsonRpcResponse=S;function _(A){return(0,t.is)(A,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=_;function k(A,P){(0,r.assertStruct)(A,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",P)}e.assertIsJsonRpcResponse=k;function x(A){return(0,t.is)(A,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=x;function M(A,P){(0,r.assertStruct)(A,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",P)}e.assertIsJsonRpcSuccess=M;function O(A){return(0,t.is)(A,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=O;function $(A,P){(0,r.assertStruct)(A,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",P)}e.assertIsJsonRpcFailure=$;function I(A){return(0,t.is)(A,e.JsonRpcErrorStruct)}e.isJsonRpcError=I;function R(A,P){(0,r.assertStruct)(A,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",P)}e.assertIsJsonRpcError=R;function D(A){const{permitEmptyString:P,permitFractions:Z,permitNull:De}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},A);return X=>!!(typeof X=="number"&&(Z||Number.isInteger(X))||typeof X=="string"&&(P||X.length>0)||De&&X===null)}e.getJsonRpcIdValidator=D})(Tc);var $c={};Object.defineProperty($c,"__esModule",{value:!0});var Or={},cf=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Or,"__esModule",{value:!0});Or.createModuleLogger=Or.createProjectLogger=void 0;const lf=cf(vl()),uf=(0,lf.default)("metamask");function hf(e){return uf.extend(e)}Or.createProjectLogger=hf;function df(e,t){return e.extend(t)}Or.createModuleLogger=df;var Pc={};(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(g){return Array.isArray(g)&&g.length>0}e.isNonEmptyArray=t;function r(g){return g==null}e.isNullOrUndefined=r;function n(g){return!!g&&typeof g=="object"&&!Array.isArray(g)}e.isObject=n;const s=(g,f)=>Object.hasOwnProperty.call(g,f);e.hasProperty=s,function(g){g[g.Null=4]="Null",g[g.Comma=1]="Comma",g[g.Wrapper=1]="Wrapper",g[g.True=4]="True",g[g.False=5]="False",g[g.Quote=1]="Quote",g[g.Colon=1]="Colon",g[g.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(g){if(typeof g!="object"||g===null)return!1;try{let f=g;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(g)===f}catch{return!1}}e.isPlainObject=i;function a(g){return g.charCodeAt(0)<=127}e.isASCII=a;function u(g){var f;return g.split("").reduce((_,k)=>a(k)?_+1:_+2,0)+((f=g.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&f!==void 0?f:[]).length}e.calculateStringSize=u;function h(g){return g.toString().length}e.calculateNumberSize=h})(Pc);var St={};Object.defineProperty(St,"__esModule",{value:!0});St.hexToBigInt=St.hexToNumber=St.bigIntToHex=St.numberToHex=void 0;const xr=Ge,on=In,ff=e=>((0,xr.assert)(typeof e=="number","Value must be a number."),(0,xr.assert)(e>=0,"Value must be a non-negative number."),(0,xr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,on.add0x)(e.toString(16)));St.numberToHex=ff;const gf=e=>((0,xr.assert)(typeof e=="bigint","Value must be a bigint."),(0,xr.assert)(e>=0,"Value must be a non-negative bigint."),(0,on.add0x)(e.toString(16)));St.bigIntToHex=gf;const pf=e=>{(0,on.assertIsHexString)(e);const t=parseInt(e,16);return(0,xr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};St.hexToNumber=pf;const mf=e=>((0,on.assertIsHexString)(e),BigInt((0,on.add0x)(e)));St.hexToBigInt=mf;var Oc={};Object.defineProperty(Oc,"__esModule",{value:!0});var Bc={};(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})(Bc);var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0});var Fc={},bi={exports:{}};const vf="2.0.0",jc=256,bf=Number.MAX_SAFE_INTEGER||9007199254740991,wf=16,yf=jc-6,_f=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ns={MAX_LENGTH:jc,MAX_SAFE_COMPONENT_LENGTH:wf,MAX_SAFE_BUILD_LENGTH:yf,MAX_SAFE_INTEGER:bf,RELEASE_TYPES:_f,SEMVER_SPEC_VERSION:vf,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Ef=typeof fl=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Ls=Ef;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Ns,i=Ls;t=e.exports={};const a=t.re=[],u=t.safeRe=[],h=t.src=[],g=t.safeSrc=[],f=t.t={};let S=0;const _="[a-zA-Z0-9-]",k=[["\\s",1],["\\d",s],[_,n]],x=O=>{for(const[$,I]of k)O=O.split(`${$}*`).join(`${$}{0,${I}}`).split(`${$}+`).join(`${$}{1,${I}}`);return O},M=(O,$,I)=>{const R=x($),D=S++;i(O,D,$),f[O]=D,h[D]=$,g[D]=R,a[D]=new RegExp($,I?"g":void 0),u[D]=new RegExp(R,I?"g":void 0)};M("NUMERICIDENTIFIER","0|[1-9]\\d*"),M("NUMERICIDENTIFIERLOOSE","\\d+"),M("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_}*`),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",`${_}+`),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*$")})(bi,bi.exports);var Cn=bi.exports;const Sf=Object.freeze({loose:!0}),kf=Object.freeze({}),Mf=e=>e?typeof e!="object"?Sf:e:kf;var zi=Mf;const jo=/^[0-9]+$/,Hc=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=jo.test(e),n=jo.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Rf=(e,t)=>Hc(t,e);var Uc={compareIdentifiers:Hc,rcompareIdentifiers:Rf};const Fn=Ls,{MAX_LENGTH:Ho,MAX_SAFE_INTEGER:jn}=Ns,{safeRe:Hn,t:Un}=Cn,If=zi,{compareIdentifiers:ii}=Uc;let Cf=class vt{constructor(t,r){if(r=If(r),t instanceof vt){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>Ho)throw new TypeError(`version is longer than ${Ho} characters`);Fn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Hn[Un.LOOSE]:Hn[Un.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>jn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>jn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>jn||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<jn)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(Fn("SemVer.compare",this.version,this.options,t),!(t instanceof vt)){if(typeof t=="string"&&t===this.version)return 0;t=new vt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof vt||(t=new vt(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 vt||(t=new vt(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(Fn("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 ii(n,s)}while(++r)}compareBuild(t){t instanceof vt||(t=new vt(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(Fn("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 ii(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?Hn[Un.PRERELEASELOOSE]:Hn[Un.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]),ii(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 Xe=Cf;const Uo=Xe,xf=(e,t,r=!1)=>{if(e instanceof Uo)return e;try{return new Uo(e,t)}catch(n){if(!r)return null;throw n}};var qr=xf;const Af=qr,Nf=(e,t)=>{const r=Af(e,t);return r?r.version:null};var Lf=Nf;const Tf=qr,$f=(e,t)=>{const r=Tf(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Pf=$f;const Vo=Xe,Of=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Vo(e instanceof Vo?e.version:e,r).inc(t,n,s).version}catch{return null}};var Bf=Of;const zo=qr,Df=(e,t)=>{const r=zo(e,null,!0),n=zo(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,a=i?r:n,u=i?n:r,h=!!a.prerelease.length;if(!!u.prerelease.length&&!h){if(!u.patch&&!u.minor)return"major";if(u.compareMain(a)===0)return u.minor&&!u.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 Ff=Df;const jf=Xe,Hf=(e,t)=>new jf(e,t).major;var Uf=Hf;const Vf=Xe,zf=(e,t)=>new Vf(e,t).minor;var Wf=zf;const qf=Xe,Jf=(e,t)=>new qf(e,t).patch;var Gf=Jf;const Zf=qr,Qf=(e,t)=>{const r=Zf(e,t);return r&&r.prerelease.length?r.prerelease:null};var Kf=Qf;const Wo=Xe,Xf=(e,t,r)=>new Wo(e,r).compare(new Wo(t,r));var ft=Xf;const Yf=ft,e1=(e,t,r)=>Yf(t,e,r);var t1=e1;const r1=ft,n1=(e,t)=>r1(e,t,!0);var s1=n1;const qo=Xe,i1=(e,t,r)=>{const n=new qo(e,r),s=new qo(t,r);return n.compare(s)||n.compareBuild(s)};var Wi=i1;const o1=Wi,a1=(e,t)=>e.sort((r,n)=>o1(r,n,t));var c1=a1;const l1=Wi,u1=(e,t)=>e.sort((r,n)=>l1(n,r,t));var h1=u1;const d1=ft,f1=(e,t,r)=>d1(e,t,r)>0;var Ts=f1;const g1=ft,p1=(e,t,r)=>g1(e,t,r)<0;var qi=p1;const m1=ft,v1=(e,t,r)=>m1(e,t,r)===0;var Vc=v1;const b1=ft,w1=(e,t,r)=>b1(e,t,r)!==0;var zc=w1;const y1=ft,_1=(e,t,r)=>y1(e,t,r)>=0;var Ji=_1;const E1=ft,S1=(e,t,r)=>E1(e,t,r)<=0;var Gi=S1;const k1=Vc,M1=zc,R1=Ts,I1=Ji,C1=qi,x1=Gi,A1=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return k1(e,r,n);case"!=":return M1(e,r,n);case">":return R1(e,r,n);case">=":return I1(e,r,n);case"<":return C1(e,r,n);case"<=":return x1(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Wc=A1;const N1=Xe,L1=qr,{safeRe:Vn,t:zn}=Cn,T1=(e,t)=>{if(e instanceof N1)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?Vn[zn.COERCEFULL]:Vn[zn.COERCE]);else{const h=t.includePrerelease?Vn[zn.COERCERTLFULL]:Vn[zn.COERCERTL];let g;for(;(g=h.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||g.index+g[0].length!==r.index+r[0].length)&&(r=g),h.lastIndex=g.index+g[1].length+g[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]}`:"",u=t.includePrerelease&&r[6]?`+${r[6]}`:"";return L1(`${n}.${s}.${i}${a}${u}`,t)};var $1=T1;class P1{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 O1=P1,oi,Jo;function gt(){if(Jo)return oi;Jo=1;const e=/\s+/g;class t{constructor(l,d){if(d=s(d),l instanceof t)return l.loose===!!d.loose&&l.includePrerelease===!!d.includePrerelease?l:new t(l.raw,d);if(l instanceof i)return this.raw=l.value,this.set=[[l]],this.formatted=void 0,this;if(this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease,this.raw=l.trim().replace(e," "),this.set=this.raw.split("||").map(p=>this.parseRange(p.trim())).filter(p=>p.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const p=this.set[0];if(this.set=this.set.filter(v=>!M(v[0])),this.set.length===0)this.set=[p];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&O(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let l=0;l<this.set.length;l++){l>0&&(this.formatted+="||");const d=this.set[l];for(let p=0;p<d.length;p++)p>0&&(this.formatted+=" "),this.formatted+=d[p].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(l){const p=((this.options.includePrerelease&&k)|(this.options.loose&&x))+":"+l,v=n.get(p);if(v)return v;const w=this.options.loose,E=w?h[g.HYPHENRANGELOOSE]:h[g.HYPHENRANGE];l=l.replace(E,J(this.options.includePrerelease)),a("hyphen replace",l),l=l.replace(h[g.COMPARATORTRIM],f),a("comparator trim",l),l=l.replace(h[g.TILDETRIM],S),a("tilde trim",l),l=l.replace(h[g.CARETTRIM],_),a("caret trim",l);let m=l.split(" ").map(C=>I(C,this.options)).join(" ").split(/\s+/).map(C=>H(C,this.options));w&&(m=m.filter(C=>(a("loose invalid filter",C,this.options),!!C.match(h[g.COMPARATORLOOSE])))),a("range list",m);const c=new Map,b=m.map(C=>new i(C,this.options));for(const C of b){if(M(C))return[C];c.set(C.value,C)}c.size>1&&c.has("")&&c.delete("");const L=[...c.values()];return n.set(p,L),L}intersects(l,d){if(!(l instanceof t))throw new TypeError("a Range is required");return this.set.some(p=>$(p,d)&&l.set.some(v=>$(v,d)&&p.every(w=>v.every(E=>w.intersects(E,d)))))}test(l){if(!l)return!1;if(typeof l=="string")try{l=new u(l,this.options)}catch{return!1}for(let d=0;d<this.set.length;d++)if(y(this.set[d],l,this.options))return!0;return!1}}oi=t;const r=O1,n=new r,s=zi,i=$s(),a=Ls,u=Xe,{safeRe:h,t:g,comparatorTrimReplace:f,tildeTrimReplace:S,caretTrimReplace:_}=Cn,{FLAG_INCLUDE_PRERELEASE:k,FLAG_LOOSE:x}=Ns,M=o=>o.value==="<0.0.0-0",O=o=>o.value==="",$=(o,l)=>{let d=!0;const p=o.slice();let v=p.pop();for(;d&&p.length;)d=p.every(w=>v.intersects(w,l)),v=p.pop();return d},I=(o,l)=>(o=o.replace(h[g.BUILD],""),a("comp",o,l),o=P(o,l),a("caret",o),o=D(o,l),a("tildes",o),o=De(o,l),a("xrange",o),o=X(o,l),a("stars",o),o),R=o=>!o||o.toLowerCase()==="x"||o==="*",D=(o,l)=>o.trim().split(/\s+/).map(d=>A(d,l)).join(" "),A=(o,l)=>{const d=l.loose?h[g.TILDELOOSE]:h[g.TILDE];return o.replace(d,(p,v,w,E,m)=>{a("tilde",o,p,v,w,E,m);let c;return R(v)?c="":R(w)?c=`>=${v}.0.0 <${+v+1}.0.0-0`:R(E)?c=`>=${v}.${w}.0 <${v}.${+w+1}.0-0`:m?(a("replaceTilde pr",m),c=`>=${v}.${w}.${E}-${m} <${v}.${+w+1}.0-0`):c=`>=${v}.${w}.${E} <${v}.${+w+1}.0-0`,a("tilde return",c),c})},P=(o,l)=>o.trim().split(/\s+/).map(d=>Z(d,l)).join(" "),Z=(o,l)=>{a("caret",o,l);const d=l.loose?h[g.CARETLOOSE]:h[g.CARET],p=l.includePrerelease?"-0":"";return o.replace(d,(v,w,E,m,c)=>{a("caret",o,v,w,E,m,c);let b;return R(w)?b="":R(E)?b=`>=${w}.0.0${p} <${+w+1}.0.0-0`:R(m)?w==="0"?b=`>=${w}.${E}.0${p} <${w}.${+E+1}.0-0`:b=`>=${w}.${E}.0${p} <${+w+1}.0.0-0`:c?(a("replaceCaret pr",c),w==="0"?E==="0"?b=`>=${w}.${E}.${m}-${c} <${w}.${E}.${+m+1}-0`:b=`>=${w}.${E}.${m}-${c} <${w}.${+E+1}.0-0`:b=`>=${w}.${E}.${m}-${c} <${+w+1}.0.0-0`):(a("no pr"),w==="0"?E==="0"?b=`>=${w}.${E}.${m}${p} <${w}.${E}.${+m+1}-0`:b=`>=${w}.${E}.${m}${p} <${w}.${+E+1}.0-0`:b=`>=${w}.${E}.${m} <${+w+1}.0.0-0`),a("caret return",b),b})},De=(o,l)=>(a("replaceXRanges",o,l),o.split(/\s+/).map(d=>He(d,l)).join(" ")),He=(o,l)=>{o=o.trim();const d=l.loose?h[g.XRANGELOOSE]:h[g.XRANGE];return o.replace(d,(p,v,w,E,m,c)=>{a("xRange",o,p,v,w,E,m,c);const b=R(w),L=b||R(E),C=L||R(m),N=C;return v==="="&&N&&(v=""),c=l.includePrerelease?"-0":"",b?v===">"||v==="<"?p="<0.0.0-0":p="*":v&&N?(L&&(E=0),m=0,v===">"?(v=">=",L?(w=+w+1,E=0,m=0):(E=+E+1,m=0)):v==="<="&&(v="<",L?w=+w+1:E=+E+1),v==="<"&&(c="-0"),p=`${v+w}.${E}.${m}${c}`):L?p=`>=${w}.0.0${c} <${+w+1}.0.0-0`:C&&(p=`>=${w}.${E}.0${c} <${w}.${+E+1}.0-0`),a("xRange return",p),p})},X=(o,l)=>(a("replaceStars",o,l),o.trim().replace(h[g.STAR],"")),H=(o,l)=>(a("replaceGTE0",o,l),o.trim().replace(h[l.includePrerelease?g.GTE0PRE:g.GTE0],"")),J=o=>(l,d,p,v,w,E,m,c,b,L,C,N)=>(R(p)?d="":R(v)?d=`>=${p}.0.0${o?"-0":""}`:R(w)?d=`>=${p}.${v}.0${o?"-0":""}`:E?d=`>=${d}`:d=`>=${d}${o?"-0":""}`,R(b)?c="":R(L)?c=`<${+b+1}.0.0-0`:R(C)?c=`<${b}.${+L+1}.0-0`:N?c=`<=${b}.${L}.${C}-${N}`:o?c=`<${b}.${L}.${+C+1}-0`:c=`<=${c}`,`${d} ${c}`.trim()),y=(o,l,d)=>{for(let p=0;p<o.length;p++)if(!o[p].test(l))return!1;if(l.prerelease.length&&!d.includePrerelease){for(let p=0;p<o.length;p++)if(a(o[p].semver),o[p].semver!==i.ANY&&o[p].semver.prerelease.length>0){const v=o[p].semver;if(v.major===l.major&&v.minor===l.minor&&v.patch===l.patch)return!0}return!1}return!0};return oi}var ai,Go;function $s(){if(Go)return ai;Go=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,S){if(S=r(S),f instanceof t){if(f.loose===!!S.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),a("comparator",f,S),this.options=S,this.loose=!!S.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(f){const S=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],_=f.match(S);if(!_)throw new TypeError(`Invalid comparator: ${f}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new u(_[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 u(f,this.options)}catch{return!1}return i(f,this.operator,this.semver,this.options)}intersects(f,S){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(f.value,S).test(this.value):f.operator===""?f.value===""?!0:new h(this.value,S).test(f.semver):(S=r(S),S.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!S.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,S)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||i(this.semver,">",f.semver,S)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}ai=t;const r=zi,{safeRe:n,t:s}=Cn,i=Wc,a=Ls,u=Xe,h=gt();return ai}const B1=gt(),D1=(e,t,r)=>{try{t=new B1(t,r)}catch{return!1}return t.test(e)};var Ps=D1;const F1=gt(),j1=(e,t)=>new F1(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var H1=j1;const U1=Xe,V1=gt(),z1=(e,t,r)=>{let n=null,s=null,i=null;try{i=new V1(t,r)}catch{return null}return e.forEach(a=>{i.test(a)&&(!n||s.compare(a)===-1)&&(n=a,s=new U1(n,r))}),n};var W1=z1;const q1=Xe,J1=gt(),G1=(e,t,r)=>{let n=null,s=null,i=null;try{i=new J1(t,r)}catch{return null}return e.forEach(a=>{i.test(a)&&(!n||s.compare(a)===1)&&(n=a,s=new q1(n,r))}),n};var Z1=G1;const ci=Xe,Q1=gt(),Zo=Ts,K1=(e,t)=>{e=new Q1(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 u=new ci(a.semver.version);switch(a.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!i||Zo(u,i))&&(i=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),i&&(!r||Zo(r,i))&&(r=i)}return r&&e.test(r)?r:null};var X1=K1;const Y1=gt(),eg=(e,t)=>{try{return new Y1(e,t).range||"*"}catch{return null}};var tg=eg;const rg=Xe,qc=$s(),{ANY:ng}=qc,sg=gt(),ig=Ps,Qo=Ts,Ko=qi,og=Gi,ag=Ji,cg=(e,t,r,n)=>{e=new rg(e,n),t=new sg(t,n);let s,i,a,u,h;switch(r){case">":s=Qo,i=og,a=Ko,u=">",h=">=";break;case"<":s=Ko,i=ag,a=Qo,u="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ig(e,t,n))return!1;for(let g=0;g<t.set.length;++g){const f=t.set[g];let S=null,_=null;if(f.forEach(k=>{k.semver===ng&&(k=new qc(">=0.0.0")),S=S||k,_=_||k,s(k.semver,S.semver,n)?S=k:a(k.semver,_.semver,n)&&(_=k)}),S.operator===u||S.operator===h||(!_.operator||_.operator===u)&&i(e,_.semver))return!1;if(_.operator===h&&a(e,_.semver))return!1}return!0};var Zi=cg;const lg=Zi,ug=(e,t,r)=>lg(e,t,">",r);var hg=ug;const dg=Zi,fg=(e,t,r)=>dg(e,t,"<",r);var gg=fg;const Xo=gt(),pg=(e,t,r)=>(e=new Xo(e,r),t=new Xo(t,r),e.intersects(t,r));var mg=pg;const vg=Ps,bg=ft;var wg=(e,t,r)=>{const n=[];let s=null,i=null;const a=e.sort((f,S)=>bg(f,S,r));for(const f of a)vg(f,t,r)?(i=f,s||(s=f)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const u=[];for(const[f,S]of n)f===S?u.push(f):!S&&f===a[0]?u.push("*"):S?f===a[0]?u.push(`<=${S}`):u.push(`${f} - ${S}`):u.push(`>=${f}`);const h=u.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return h.length<g.length?h:t};const Yo=gt(),Qi=$s(),{ANY:li}=Qi,en=Ps,Ki=ft,yg=(e,t,r={})=>{if(e===t)return!0;e=new Yo(e,r),t=new Yo(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const a=Eg(s,i,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},_g=[new Qi(">=0.0.0-0")],ea=[new Qi(">=0.0.0")],Eg=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===li){if(t.length===1&&t[0].semver===li)return!0;r.includePrerelease?e=_g:e=ea}if(t.length===1&&t[0].semver===li){if(r.includePrerelease)return!0;t=ea}const n=new Set;let s,i;for(const k of e)k.operator===">"||k.operator===">="?s=ta(s,k,r):k.operator==="<"||k.operator==="<="?i=ra(i,k,r):n.add(k.semver);if(n.size>1)return null;let a;if(s&&i){if(a=Ki(s.semver,i.semver,r),a>0)return null;if(a===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const k of n){if(s&&!en(k,String(s),r)||i&&!en(k,String(i),r))return null;for(const x of t)if(!en(k,String(x),r))return!1;return!0}let u,h,g,f,S=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,_=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;S&&S.prerelease.length===1&&i.operator==="<"&&S.prerelease[0]===0&&(S=!1);for(const k of t){if(f=f||k.operator===">"||k.operator===">=",g=g||k.operator==="<"||k.operator==="<=",s){if(_&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===_.major&&k.semver.minor===_.minor&&k.semver.patch===_.patch&&(_=!1),k.operator===">"||k.operator===">="){if(u=ta(s,k,r),u===k&&u!==s)return!1}else if(s.operator===">="&&!en(s.semver,String(k),r))return!1}if(i){if(S&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===S.major&&k.semver.minor===S.minor&&k.semver.patch===S.patch&&(S=!1),k.operator==="<"||k.operator==="<="){if(h=ra(i,k,r),h===k&&h!==i)return!1}else if(i.operator==="<="&&!en(i.semver,String(k),r))return!1}if(!k.operator&&(i||s)&&a!==0)return!1}return!(s&&g&&!i&&a!==0||i&&f&&!s&&a!==0||_||S)},ta=(e,t,r)=>{if(!e)return t;const n=Ki(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},ra=(e,t,r)=>{if(!e)return t;const n=Ki(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Sg=yg;const ui=Cn,na=Ns,kg=Xe,sa=Uc,Mg=qr,Rg=Lf,Ig=Pf,Cg=Bf,xg=Ff,Ag=Uf,Ng=Wf,Lg=Gf,Tg=Kf,$g=ft,Pg=t1,Og=s1,Bg=Wi,Dg=c1,Fg=h1,jg=Ts,Hg=qi,Ug=Vc,Vg=zc,zg=Ji,Wg=Gi,qg=Wc,Jg=$1,Gg=$s(),Zg=gt(),Qg=Ps,Kg=H1,Xg=W1,Yg=Z1,ep=X1,tp=tg,rp=Zi,np=hg,sp=gg,ip=mg,op=wg,ap=Sg;var cp={parse:Mg,valid:Rg,clean:Ig,inc:Cg,diff:xg,major:Ag,minor:Ng,patch:Lg,prerelease:Tg,compare:$g,rcompare:Pg,compareLoose:Og,compareBuild:Bg,sort:Dg,rsort:Fg,gt:jg,lt:Hg,eq:Ug,neq:Vg,gte:zg,lte:Wg,cmp:qg,coerce:Jg,Comparator:Gg,Range:Zg,satisfies:Qg,toComparators:Kg,maxSatisfying:Xg,minSatisfying:Yg,minVersion:ep,validRange:tp,outside:rp,gtr:np,ltr:sp,intersects:ip,simplifyRange:op,subset:ap,SemVer:kg,re:ui.re,src:ui.src,tokens:ui.t,SEMVER_SPEC_VERSION:na.SEMVER_SPEC_VERSION,RELEASE_TYPES:na.RELEASE_TYPES,compareIdentifiers:sa.compareIdentifiers,rcompareIdentifiers:sa.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=cp,r=ar,n=Ge;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",S=>(0,t.valid)(S)===null?`Expected SemVer version, got "${S}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",S=>(0,t.validRange)(S)===null?`Expected SemVer range, got "${S}"`:!0);function s(S){return(0,r.is)(S,e.VersionStruct)}e.isValidSemVerVersion=s;function i(S){return(0,r.is)(S,e.VersionRangeStruct)}e.isValidSemVerRange=i;function a(S){(0,n.assertStruct)(S,e.VersionStruct)}e.assertIsSemVerVersion=a;function u(S){(0,n.assertStruct)(S,e.VersionRangeStruct)}e.assertIsSemVerRange=u;function h(S,_){return(0,t.gt)(S,_)}e.gtVersion=h;function g(S,_){return(0,t.gtr)(S,_)}e.gtRange=g;function f(S,_){return(0,t.satisfies)(S,_,{includePrerelease:!0})}e.satisfiesVersionRange=f})(Fc);(function(e){var t=B&&B.__createBinding||(Object.create?function(n,s,i,a){a===void 0&&(a=i);var u=Object.getOwnPropertyDescriptor(s,i);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,a,u)}:function(n,s,i,a){a===void 0&&(a=i),n[a]=s[i]}),r=B&&B.__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(Ge,e),r(Rn,e),r(q,e),r(xs,e),r(Et,e),r(Pr,e),r(Lc,e),r(In,e),r(Tc,e),r($c,e),r(Or,e),r(Pc,e),r(St,e),r(Oc,e),r(Bc,e),r(Dc,e),r(Fc,e)})(fc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=fc;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(dc);var Jc=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Is,"__esModule",{value:!0});Is.PollingBlockTracker=void 0;const lp=Jc(Pi),up=Jc(Dd),hp=En,ia=dc,oa=(0,ia.createModuleLogger)(ia.projectLogger,"polling-block-tracker"),dp=(0,lp.default)(),fp=1e3;class gp extends hp.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*fp,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=aa(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=aa(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:dp(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),oa("Making request",t);const r=await(0,up.default)(n=>this._provider.sendAsync(t,n))();if(oa("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
4
|
${r.error.message}`);return r.result}}Is.PollingBlockTracker=gp;function aa(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Os={},pp=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Os,"__esModule",{value:!0});Os.SubscribeBlockTracker=void 0;const mp=pp(Pi),vp=En,bp=(0,mp.default)();class wp extends vp.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:bp(),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)}}Os.SubscribeBlockTracker=wp;(function(e){var t=B&&B.__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=B&&B.__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(Is,e),r(Os,e)})(hc);var Xi={},Bs={},xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.getUniqueId=void 0;const Gc=4294967295;let hi=Math.floor(Math.random()*Gc);function yp(){return hi=(hi+1)%Gc,hi}xn.getUniqueId=yp;Object.defineProperty(Bs,"__esModule",{value:!0});Bs.createIdRemapMiddleware=void 0;const _p=xn;function Ep(){return(e,t,r,n)=>{const s=e.id,i=_p.getUniqueId();e.id=i,t.id=i,r(a=>{e.id=s,t.id=s,a()})}}Bs.createIdRemapMiddleware=Ep;var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.createAsyncMiddleware=void 0;function Sp(e){return async(t,r,n,s)=>{let i;const a=new Promise(f=>{i=f});let u=null,h=!1;const g=async()=>{h=!0,n(f=>{u=f,i()}),await a};try{await e(t,r,g),h?(await a,u(null)):s(null)}catch(f){u?u(f):s(f)}}}Ds.createAsyncMiddleware=Sp;var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.createScaffoldMiddleware=void 0;function kp(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())}}Fs.createScaffoldMiddleware=kp;var An={},Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});const Mp=_a;function ca(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Rp(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Ip=class extends Mp.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 u=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw u.context=a,u}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")ca(i,this,r);else{const a=i.length,u=Rp(i);for(let h=0;h<a;h+=1)ca(u[h],this,r)}return!0}};Yi.default=Ip;var Zc={},Nt={},Cp=an;an.default=an;an.stable=Xc;an.stableStringify=Xc;var Qn="[...]",Qc="[Circular]",sr=[],tr=[];function Kc(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function an(e,t,r,n){typeof n>"u"&&(n=Kc()),wi(e,"",0,[],void 0,0,n);var s;try{tr.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,Yc(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;sr.length!==0;){var i=sr.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function Ar(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),sr.push([n,r,t,s])):tr.push([t,r,e]):(n[r]=e,sr.push([n,r,t]))}function wi(e,t,r,n,s,i,a){i+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){Ar(Qc,e,t,s);return}if(typeof a.depthLimit<"u"&&i>a.depthLimit){Ar(Qn,e,t,s);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Ar(Qn,e,t,s);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)wi(e[u],u,u,n,e,i,a);else{var h=Object.keys(e);for(u=0;u<h.length;u++){var g=h[u];wi(e[g],g,u,n,e,i,a)}}n.pop()}}function xp(e,t){return e<t?-1:e>t?1:0}function Xc(e,t,r,n){typeof n>"u"&&(n=Kc());var s=yi(e,"",0,[],void 0,0,n)||e,i;try{tr.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,Yc(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;sr.length!==0;){var a=sr.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return i}function yi(e,t,r,n,s,i,a){i+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){Ar(Qc,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&i>a.depthLimit){Ar(Qn,e,t,s);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Ar(Qn,e,t,s);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)yi(e[u],u,u,n,e,i,a);else{var h={},g=Object.keys(e).sort(xp);for(u=0;u<g.length;u++){var f=g[u];yi(e[f],f,u,n,e,i,a),h[f]=e[f]}if(typeof s<"u")sr.push([s,t,e]),s[t]=h;else return h}n.pop()}}function Yc(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(tr.length>0)for(var n=0;n<tr.length;n++){var s=tr[n];if(s[1]===t&&s[0]===r){r=s[2],tr.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Nt,"__esModule",{value:!0});Nt.EthereumProviderError=Nt.EthereumRpcError=void 0;const Ap=Cp;class el 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 Ap.default(this.serialize(),Tp,2)}}Nt.EthereumRpcError=el;class Np extends el{constructor(t,r,n){if(!Lp(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Nt.EthereumProviderError=Np;function Lp(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Tp(e,t){if(t!=="[Circular]")return t}var eo={},Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.errorValues=Lt.errorCodes=void 0;Lt.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}};Lt.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=Lt,r=Nt,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(_,k=s){if(Number.isInteger(_)){const x=_.toString();if(S(t.errorValues,x))return t.errorValues[x].message;if(g(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=a;function u(_){if(!Number.isInteger(_))return!1;const k=_.toString();return!!(t.errorValues[k]||g(_))}e.isValidCode=u;function h(_,{fallbackError:k=i,shouldIncludeStack:x=!1}={}){var M,O;if(!k||!Number.isInteger(k.code)||typeof k.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(_ instanceof r.EthereumRpcError)return _.serialize();const $={};if(_&&typeof _=="object"&&!Array.isArray(_)&&S(_,"code")&&u(_.code)){const R=_;$.code=R.code,R.message&&typeof R.message=="string"?($.message=R.message,S(R,"data")&&($.data=R.data)):($.message=a($.code),$.data={originalError:f(_)})}else{$.code=k.code;const R=(M=_)===null||M===void 0?void 0:M.message;$.message=R&&typeof R=="string"?R:k.message,$.data={originalError:f(_)}}const I=(O=_)===null||O===void 0?void 0:O.stack;return x&&_&&I&&typeof I=="string"&&($.stack=I),$}e.serializeError=h;function g(_){return _>=-32099&&_<=-32e3}function f(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function S(_,k){return Object.prototype.hasOwnProperty.call(_,k)}})(eo);var js={};Object.defineProperty(js,"__esModule",{value:!0});js.ethErrors=void 0;const to=Nt,tl=eo,Ze=Lt;js.ethErrors={rpc:{parse:e=>it(Ze.errorCodes.rpc.parse,e),invalidRequest:e=>it(Ze.errorCodes.rpc.invalidRequest,e),invalidParams:e=>it(Ze.errorCodes.rpc.invalidParams,e),methodNotFound:e=>it(Ze.errorCodes.rpc.methodNotFound,e),internal:e=>it(Ze.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 it(t,e)},invalidInput:e=>it(Ze.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>it(Ze.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>it(Ze.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>it(Ze.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>it(Ze.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>it(Ze.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>tn(Ze.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>tn(Ze.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>tn(Ze.errorCodes.provider.unsupportedMethod,e),disconnected:e=>tn(Ze.errorCodes.provider.disconnected,e),chainDisconnected:e=>tn(Ze.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new to.EthereumProviderError(t,r,n)}}};function it(e,t){const[r,n]=rl(t);return new to.EthereumRpcError(e,r||tl.getMessageFromCode(e),n)}function tn(e,t){const[r,n]=rl(t);return new to.EthereumProviderError(e,r||tl.getMessageFromCode(e),n)}function rl(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=Nt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=eo;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=js;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=Lt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(Zc);var $p=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(An,"__esModule",{value:!0});An.JsonRpcEngine=void 0;const Pp=$p(Yi),ot=Zc;class kt extends Pp.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,u]=await kt._runAllMiddleware(t,r,this._middleware);return a?(await kt._runReturnHandlers(u),s(i)):n(async h=>{try{await kt._runReturnHandlers(u)}catch(g){return h(g)}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 ot.EthereumRpcError(ot.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 ot.EthereumRpcError(ot.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=ot.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await kt._runAllMiddleware(t,r,this._middleware);if(kt._checkForCompletion(t,r,s),await kt._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,a=!1;for(const u of n)if([i,a]=await kt._runMiddleware(t,r,u,s),a)break;return[i,a,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const a=h=>{const g=h||r.error;g&&(r.error=ot.serializeError(g)),i([g,!0])},u=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new ot.EthereumRpcError(ot.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request:
|