@dcl/governance-site 1.13.2-19714639134.commit-47eb9e8 → 1.14.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.
@@ -1,4 +1,4 @@
1
- import{bu as vu,c as D,B as V,bB as bu,bC as wu,bD as yu,by as qr,g as qi,bE as wn,k as lc,e as Eu,h as Su}from"./index-ba55f353.js";import{b as ku,c as Dt,e as uc,d as Mu,r as Ji}from"./tslib.es6-5ee5eafe.js";function Ru(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Gi={},mn={},ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.walletLogo=void 0;const Cu=(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 `}};ms.walletLogo=Cu;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.LINK_API_URL=void 0;_s.LINK_API_URL="https://www.walletlink.org";var O={},Zi={exports:{}};Zi.exports;(function(e){(function(t,r){function n(E,o){if(!E)throw new Error(o||"Assertion failed")}function i(E,o){E.super_=o;var u=function(){};u.prototype=o.prototype,E.prototype=new u,E.prototype.constructor=E}function s(E,o,u){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(E||0,o||10,u||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=vu.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,u){return o.cmp(u)>0?o:u},s.min=function(o,u){return o.cmp(u)<0?o:u},s.prototype._init=function(o,u,p){if(typeof o=="number")return this._initNumber(o,u,p);if(typeof o=="object")return this._initArray(o,u,p);u==="hex"&&(u=16),n(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var m=0;o[0]==="-"&&(m++,this.negative=1),m<o.length&&(u===16?this._parseHex(o,m,p):(this._parseBase(o,u,m),p==="le"&&this._initArray(this.toArray(),u,p)))},s.prototype._initNumber=function(o,u,p){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},s.prototype._initArray=function(o,u,p){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v,y,k=0;if(p==="be")for(m=o.length-1,v=0;m>=0;m-=3)y=o[m]|o[m-1]<<8|o[m-2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);else if(p==="le")for(m=0,v=0;m<o.length;m+=3)y=o[m]|o[m+1]<<8|o[m+2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);return this._strip()};function c(E,o){var u=E.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;n(!1,"Invalid character in "+E)}function h(E,o,u){var p=c(E,u);return u-1>=o&&(p|=c(E,u-1)<<4),p}s.prototype._parseHex=function(o,u,p){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v=0,y=0,k;if(p==="be")for(m=o.length-1;m>=u;m-=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8;else{var _=o.length-u;for(m=_%2===0?u+1:u;m<o.length;m+=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8}this._strip()};function d(E,o,u,p){for(var m=0,v=0,y=Math.min(E.length,u),k=o;k<y;k++){var _=E.charCodeAt(k)-48;m*=p,_>=49?v=_-49+10:_>=17?v=_-17+10:v=_,n(_>=0&&v<p,"Invalid character"),m+=v}return m}s.prototype._parseBase=function(o,u,p){this.words=[0],this.length=1;for(var m=0,v=1;v<=67108863;v*=u)m++;m--,v=v/u|0;for(var y=o.length-p,k=y%m,_=Math.min(y,y-k)+p,l=0,w=p;w<_;w+=m)l=d(o,w,w+m,u),this.imuln(v),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(k!==0){var T=1;for(l=d(o,w,o.length,u),w=0;w<k;w++)T*=u;this.imuln(T),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},s.prototype.copy=function(o){o.words=new Array(this.length);for(var u=0;u<this.length;u++)o.words[u]=this.words[u];o.length=this.length,o.negative=this.negative,o.red=this.red};function f(E,o){E.words=o.words,E.length=o.length,E.negative=o.negative,E.red=o.red}if(s.prototype._move=function(o){f(o,this)},s.prototype.clone=function(){var o=new s(null);return this.copy(o),o},s.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[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];s.prototype.toString=function(o,u){o=o||10,u=u|0||1;var p;if(o===16||o==="hex"){p="";for(var m=0,v=0,y=0;y<this.length;y++){var k=this.words[y],_=((k<<m|v)&16777215).toString(16);v=k>>>24-m&16777215,m+=2,m>=26&&(m-=26,y--),v!==0||y!==this.length-1?p=b[6-_.length]+_+p:p=_+p}for(v!==0&&(p=v.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(o===(o|0)&&o>=2&&o<=36){var l=S[o],w=I[o];p="";var T=this.clone();for(T.negative=0;!T.isZero();){var L=T.modrn(w).toString(o);T=T.idivn(w),T.isZero()?p=L+p:p=b[l-L.length]+L+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.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},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,u){return this.toArrayLike(a,o,u)}),s.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var R=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};s.prototype.toArrayLike=function(o,u,p){this._strip();var m=this.byteLength(),v=p||Math.max(1,m);n(m<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var y=R(o,v),k=u==="le"?"LE":"BE";return this["_toArrayLike"+k](y,m),y},s.prototype._toArrayLikeLE=function(o,u){for(var p=0,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p++]=k&255,p<o.length&&(o[p++]=k>>8&255),p<o.length&&(o[p++]=k>>16&255),y===6?(p<o.length&&(o[p++]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p<o.length)for(o[p++]=m;p<o.length;)o[p++]=0},s.prototype._toArrayLikeBE=function(o,u){for(var p=o.length-1,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p--]=k&255,p>=0&&(o[p--]=k>>8&255),p>=0&&(o[p--]=k>>16&255),y===6?(p>=0&&(o[p--]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p>=0)for(o[p--]=m;p>=0;)o[p--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var u=o,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},s.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,p=0;return u&8191||(p+=13,u>>>=13),u&127||(p+=7,u>>>=7),u&15||(p+=4,u>>>=4),u&3||(p+=2,u>>>=2),u&1||p++,p},s.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function x(E){for(var o=new Array(E.bitLength()),u=0;u<o.length;u++){var p=u/26|0,m=u%26;o[u]=E.words[p]>>>m&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(o+=p,p!==26)break}return o},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},s.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var u=0;u<o.length;u++)this.words[u]=this.words[u]|o.words[u];return this._strip()},s.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},s.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&o.words[p];return this.length=u.length,this._strip()},s.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},s.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var u,p;this.length>o.length?(u=this,p=o):(u=o,p=this);for(var m=0;m<p.length;m++)this.words[m]=u.words[m]^p.words[m];if(this!==u)for(;m<u.length;m++)this.words[m]=u.words[m];return this.length=u.length,this._strip()},s.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},s.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,p=o%26;this._expand(u),p>0&&u--;for(var m=0;m<u;m++)this.words[m]=~this.words[m]&67108863;return p>0&&(this.words[m]=~this.words[m]&67108863>>26-p),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,u){n(typeof o=="number"&&o>=0);var p=o/26|0,m=o%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<m:this.words[p]=this.words[p]&~(1<<m),this._strip()},s.prototype.iadd=function(o){var u;if(this.negative!==0&&o.negative===0)return this.negative=0,u=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,u=this.isub(o),o.negative=1,u._normSign();var p,m;this.length>o.length?(p=this,m=o):(p=o,m=this);for(var v=0,y=0;y<m.length;y++)u=(p.words[y]|0)+(m.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;for(;v!==0&&y<p.length;y++)u=(p.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;if(this.length=p.length,v!==0)this.words[this.length]=v,this.length++;else if(p!==this)for(;y<p.length;y++)this.words[y]=p.words[y];return this},s.prototype.add=function(o){var u;return o.negative!==0&&this.negative===0?(o.negative=0,u=this.sub(o),o.negative^=1,u):o.negative===0&&this.negative!==0?(this.negative=0,u=o.sub(this),this.negative=1,u):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var p=this.cmp(o);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,v;p>0?(m=this,v=o):(m=o,v=this);for(var y=0,k=0;k<v.length;k++)u=(m.words[k]|0)-(v.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;for(;y!==0&&k<m.length;k++)u=(m.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;if(y===0&&k<m.length&&m!==this)for(;k<m.length;k++)this.words[k]=m.words[k];return this.length=Math.max(this.length,k),m!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(o){return this.clone().isub(o)};function A(E,o,u){u.negative=o.negative^E.negative;var p=E.length+o.length|0;u.length=p,p=p-1|0;var m=E.words[0]|0,v=o.words[0]|0,y=m*v,k=y&67108863,_=y/67108864|0;u.words[0]=k;for(var l=1;l<p;l++){for(var w=_>>>26,T=_&67108863,L=Math.min(l,o.length-1),$=Math.max(0,l-E.length+1);$<=L;$++){var K=l-$|0;m=E.words[K]|0,v=o.words[$]|0,y=m*v+T,w+=y/67108864|0,T=y&67108863}u.words[l]=T|0,_=w|0}return _!==0?u.words[l]=_|0:u.length--,u._strip()}var C=function(o,u,p){var m=o.words,v=u.words,y=p.words,k=0,_,l,w,T=m[0]|0,L=T&8191,$=T>>>13,K=m[1]|0,Q=K&8191,X=K>>>13,rn=m[2]|0,Ce=rn&8191,Ie=rn>>>13,nn=m[3]|0,xe=nn&8191,Ae=nn>>>13,sn=m[4]|0,Ne=sn&8191,Le=sn>>>13,on=m[5]|0,$e=on&8191,Te=on>>>13,an=m[6]|0,Pe=an&8191,Oe=an>>>13,cn=m[7]|0,Be=cn&8191,De=cn>>>13,gr=m[8]|0,ne=gr&8191,se=gr>>>13,mr=m[9]|0,ie=mr&8191,oe=mr>>>13,_r=v[0]|0,ae=_r&8191,ce=_r>>>13,vr=v[1]|0,le=vr&8191,ue=vr>>>13,br=v[2]|0,he=br&8191,de=br>>>13,wr=v[3]|0,fe=wr&8191,pe=wr>>>13,yr=v[4]|0,ge=yr&8191,me=yr>>>13,Er=v[5]|0,_e=Er&8191,ve=Er>>>13,Sr=v[6]|0,be=Sr&8191,we=Sr>>>13,kr=v[7]|0,ye=kr&8191,Ee=kr>>>13,Mr=v[8]|0,Se=Mr&8191,ke=Mr>>>13,Rr=v[9]|0,Me=Rr&8191,Re=Rr>>>13;p.negative=o.negative^u.negative,p.length=19,_=Math.imul(L,ae),l=Math.imul(L,ce),l=l+Math.imul($,ae)|0,w=Math.imul($,ce);var Ft=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,_=Math.imul(Q,ae),l=Math.imul(Q,ce),l=l+Math.imul(X,ae)|0,w=Math.imul(X,ce),_=_+Math.imul(L,le)|0,l=l+Math.imul(L,ue)|0,l=l+Math.imul($,le)|0,w=w+Math.imul($,ue)|0;var jt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(jt>>>26)|0,jt&=67108863,_=Math.imul(Ce,ae),l=Math.imul(Ce,ce),l=l+Math.imul(Ie,ae)|0,w=Math.imul(Ie,ce),_=_+Math.imul(Q,le)|0,l=l+Math.imul(Q,ue)|0,l=l+Math.imul(X,le)|0,w=w+Math.imul(X,ue)|0,_=_+Math.imul(L,he)|0,l=l+Math.imul(L,de)|0,l=l+Math.imul($,he)|0,w=w+Math.imul($,de)|0;var Ht=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,_=Math.imul(xe,ae),l=Math.imul(xe,ce),l=l+Math.imul(Ae,ae)|0,w=Math.imul(Ae,ce),_=_+Math.imul(Ce,le)|0,l=l+Math.imul(Ce,ue)|0,l=l+Math.imul(Ie,le)|0,w=w+Math.imul(Ie,ue)|0,_=_+Math.imul(Q,he)|0,l=l+Math.imul(Q,de)|0,l=l+Math.imul(X,he)|0,w=w+Math.imul(X,de)|0,_=_+Math.imul(L,fe)|0,l=l+Math.imul(L,pe)|0,l=l+Math.imul($,fe)|0,w=w+Math.imul($,pe)|0;var Ut=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,_=Math.imul(Ne,ae),l=Math.imul(Ne,ce),l=l+Math.imul(Le,ae)|0,w=Math.imul(Le,ce),_=_+Math.imul(xe,le)|0,l=l+Math.imul(xe,ue)|0,l=l+Math.imul(Ae,le)|0,w=w+Math.imul(Ae,ue)|0,_=_+Math.imul(Ce,he)|0,l=l+Math.imul(Ce,de)|0,l=l+Math.imul(Ie,he)|0,w=w+Math.imul(Ie,de)|0,_=_+Math.imul(Q,fe)|0,l=l+Math.imul(Q,pe)|0,l=l+Math.imul(X,fe)|0,w=w+Math.imul(X,pe)|0,_=_+Math.imul(L,ge)|0,l=l+Math.imul(L,me)|0,l=l+Math.imul($,ge)|0,w=w+Math.imul($,me)|0;var Vt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,_=Math.imul($e,ae),l=Math.imul($e,ce),l=l+Math.imul(Te,ae)|0,w=Math.imul(Te,ce),_=_+Math.imul(Ne,le)|0,l=l+Math.imul(Ne,ue)|0,l=l+Math.imul(Le,le)|0,w=w+Math.imul(Le,ue)|0,_=_+Math.imul(xe,he)|0,l=l+Math.imul(xe,de)|0,l=l+Math.imul(Ae,he)|0,w=w+Math.imul(Ae,de)|0,_=_+Math.imul(Ce,fe)|0,l=l+Math.imul(Ce,pe)|0,l=l+Math.imul(Ie,fe)|0,w=w+Math.imul(Ie,pe)|0,_=_+Math.imul(Q,ge)|0,l=l+Math.imul(Q,me)|0,l=l+Math.imul(X,ge)|0,w=w+Math.imul(X,me)|0,_=_+Math.imul(L,_e)|0,l=l+Math.imul(L,ve)|0,l=l+Math.imul($,_e)|0,w=w+Math.imul($,ve)|0;var zt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(zt>>>26)|0,zt&=67108863,_=Math.imul(Pe,ae),l=Math.imul(Pe,ce),l=l+Math.imul(Oe,ae)|0,w=Math.imul(Oe,ce),_=_+Math.imul($e,le)|0,l=l+Math.imul($e,ue)|0,l=l+Math.imul(Te,le)|0,w=w+Math.imul(Te,ue)|0,_=_+Math.imul(Ne,he)|0,l=l+Math.imul(Ne,de)|0,l=l+Math.imul(Le,he)|0,w=w+Math.imul(Le,de)|0,_=_+Math.imul(xe,fe)|0,l=l+Math.imul(xe,pe)|0,l=l+Math.imul(Ae,fe)|0,w=w+Math.imul(Ae,pe)|0,_=_+Math.imul(Ce,ge)|0,l=l+Math.imul(Ce,me)|0,l=l+Math.imul(Ie,ge)|0,w=w+Math.imul(Ie,me)|0,_=_+Math.imul(Q,_e)|0,l=l+Math.imul(Q,ve)|0,l=l+Math.imul(X,_e)|0,w=w+Math.imul(X,ve)|0,_=_+Math.imul(L,be)|0,l=l+Math.imul(L,we)|0,l=l+Math.imul($,be)|0,w=w+Math.imul($,we)|0;var Wt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,_=Math.imul(Be,ae),l=Math.imul(Be,ce),l=l+Math.imul(De,ae)|0,w=Math.imul(De,ce),_=_+Math.imul(Pe,le)|0,l=l+Math.imul(Pe,ue)|0,l=l+Math.imul(Oe,le)|0,w=w+Math.imul(Oe,ue)|0,_=_+Math.imul($e,he)|0,l=l+Math.imul($e,de)|0,l=l+Math.imul(Te,he)|0,w=w+Math.imul(Te,de)|0,_=_+Math.imul(Ne,fe)|0,l=l+Math.imul(Ne,pe)|0,l=l+Math.imul(Le,fe)|0,w=w+Math.imul(Le,pe)|0,_=_+Math.imul(xe,ge)|0,l=l+Math.imul(xe,me)|0,l=l+Math.imul(Ae,ge)|0,w=w+Math.imul(Ae,me)|0,_=_+Math.imul(Ce,_e)|0,l=l+Math.imul(Ce,ve)|0,l=l+Math.imul(Ie,_e)|0,w=w+Math.imul(Ie,ve)|0,_=_+Math.imul(Q,be)|0,l=l+Math.imul(Q,we)|0,l=l+Math.imul(X,be)|0,w=w+Math.imul(X,we)|0,_=_+Math.imul(L,ye)|0,l=l+Math.imul(L,Ee)|0,l=l+Math.imul($,ye)|0,w=w+Math.imul($,Ee)|0;var qt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(qt>>>26)|0,qt&=67108863,_=Math.imul(ne,ae),l=Math.imul(ne,ce),l=l+Math.imul(se,ae)|0,w=Math.imul(se,ce),_=_+Math.imul(Be,le)|0,l=l+Math.imul(Be,ue)|0,l=l+Math.imul(De,le)|0,w=w+Math.imul(De,ue)|0,_=_+Math.imul(Pe,he)|0,l=l+Math.imul(Pe,de)|0,l=l+Math.imul(Oe,he)|0,w=w+Math.imul(Oe,de)|0,_=_+Math.imul($e,fe)|0,l=l+Math.imul($e,pe)|0,l=l+Math.imul(Te,fe)|0,w=w+Math.imul(Te,pe)|0,_=_+Math.imul(Ne,ge)|0,l=l+Math.imul(Ne,me)|0,l=l+Math.imul(Le,ge)|0,w=w+Math.imul(Le,me)|0,_=_+Math.imul(xe,_e)|0,l=l+Math.imul(xe,ve)|0,l=l+Math.imul(Ae,_e)|0,w=w+Math.imul(Ae,ve)|0,_=_+Math.imul(Ce,be)|0,l=l+Math.imul(Ce,we)|0,l=l+Math.imul(Ie,be)|0,w=w+Math.imul(Ie,we)|0,_=_+Math.imul(Q,ye)|0,l=l+Math.imul(Q,Ee)|0,l=l+Math.imul(X,ye)|0,w=w+Math.imul(X,Ee)|0,_=_+Math.imul(L,Se)|0,l=l+Math.imul(L,ke)|0,l=l+Math.imul($,Se)|0,w=w+Math.imul($,ke)|0;var Jt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,_=Math.imul(ie,ae),l=Math.imul(ie,ce),l=l+Math.imul(oe,ae)|0,w=Math.imul(oe,ce),_=_+Math.imul(ne,le)|0,l=l+Math.imul(ne,ue)|0,l=l+Math.imul(se,le)|0,w=w+Math.imul(se,ue)|0,_=_+Math.imul(Be,he)|0,l=l+Math.imul(Be,de)|0,l=l+Math.imul(De,he)|0,w=w+Math.imul(De,de)|0,_=_+Math.imul(Pe,fe)|0,l=l+Math.imul(Pe,pe)|0,l=l+Math.imul(Oe,fe)|0,w=w+Math.imul(Oe,pe)|0,_=_+Math.imul($e,ge)|0,l=l+Math.imul($e,me)|0,l=l+Math.imul(Te,ge)|0,w=w+Math.imul(Te,me)|0,_=_+Math.imul(Ne,_e)|0,l=l+Math.imul(Ne,ve)|0,l=l+Math.imul(Le,_e)|0,w=w+Math.imul(Le,ve)|0,_=_+Math.imul(xe,be)|0,l=l+Math.imul(xe,we)|0,l=l+Math.imul(Ae,be)|0,w=w+Math.imul(Ae,we)|0,_=_+Math.imul(Ce,ye)|0,l=l+Math.imul(Ce,Ee)|0,l=l+Math.imul(Ie,ye)|0,w=w+Math.imul(Ie,Ee)|0,_=_+Math.imul(Q,Se)|0,l=l+Math.imul(Q,ke)|0,l=l+Math.imul(X,Se)|0,w=w+Math.imul(X,ke)|0,_=_+Math.imul(L,Me)|0,l=l+Math.imul(L,Re)|0,l=l+Math.imul($,Me)|0,w=w+Math.imul($,Re)|0;var Gt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,_=Math.imul(ie,le),l=Math.imul(ie,ue),l=l+Math.imul(oe,le)|0,w=Math.imul(oe,ue),_=_+Math.imul(ne,he)|0,l=l+Math.imul(ne,de)|0,l=l+Math.imul(se,he)|0,w=w+Math.imul(se,de)|0,_=_+Math.imul(Be,fe)|0,l=l+Math.imul(Be,pe)|0,l=l+Math.imul(De,fe)|0,w=w+Math.imul(De,pe)|0,_=_+Math.imul(Pe,ge)|0,l=l+Math.imul(Pe,me)|0,l=l+Math.imul(Oe,ge)|0,w=w+Math.imul(Oe,me)|0,_=_+Math.imul($e,_e)|0,l=l+Math.imul($e,ve)|0,l=l+Math.imul(Te,_e)|0,w=w+Math.imul(Te,ve)|0,_=_+Math.imul(Ne,be)|0,l=l+Math.imul(Ne,we)|0,l=l+Math.imul(Le,be)|0,w=w+Math.imul(Le,we)|0,_=_+Math.imul(xe,ye)|0,l=l+Math.imul(xe,Ee)|0,l=l+Math.imul(Ae,ye)|0,w=w+Math.imul(Ae,Ee)|0,_=_+Math.imul(Ce,Se)|0,l=l+Math.imul(Ce,ke)|0,l=l+Math.imul(Ie,Se)|0,w=w+Math.imul(Ie,ke)|0,_=_+Math.imul(Q,Me)|0,l=l+Math.imul(Q,Re)|0,l=l+Math.imul(X,Me)|0,w=w+Math.imul(X,Re)|0;var Zt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,_=Math.imul(ie,he),l=Math.imul(ie,de),l=l+Math.imul(oe,he)|0,w=Math.imul(oe,de),_=_+Math.imul(ne,fe)|0,l=l+Math.imul(ne,pe)|0,l=l+Math.imul(se,fe)|0,w=w+Math.imul(se,pe)|0,_=_+Math.imul(Be,ge)|0,l=l+Math.imul(Be,me)|0,l=l+Math.imul(De,ge)|0,w=w+Math.imul(De,me)|0,_=_+Math.imul(Pe,_e)|0,l=l+Math.imul(Pe,ve)|0,l=l+Math.imul(Oe,_e)|0,w=w+Math.imul(Oe,ve)|0,_=_+Math.imul($e,be)|0,l=l+Math.imul($e,we)|0,l=l+Math.imul(Te,be)|0,w=w+Math.imul(Te,we)|0,_=_+Math.imul(Ne,ye)|0,l=l+Math.imul(Ne,Ee)|0,l=l+Math.imul(Le,ye)|0,w=w+Math.imul(Le,Ee)|0,_=_+Math.imul(xe,Se)|0,l=l+Math.imul(xe,ke)|0,l=l+Math.imul(Ae,Se)|0,w=w+Math.imul(Ae,ke)|0,_=_+Math.imul(Ce,Me)|0,l=l+Math.imul(Ce,Re)|0,l=l+Math.imul(Ie,Me)|0,w=w+Math.imul(Ie,Re)|0;var Qt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,_=Math.imul(ie,fe),l=Math.imul(ie,pe),l=l+Math.imul(oe,fe)|0,w=Math.imul(oe,pe),_=_+Math.imul(ne,ge)|0,l=l+Math.imul(ne,me)|0,l=l+Math.imul(se,ge)|0,w=w+Math.imul(se,me)|0,_=_+Math.imul(Be,_e)|0,l=l+Math.imul(Be,ve)|0,l=l+Math.imul(De,_e)|0,w=w+Math.imul(De,ve)|0,_=_+Math.imul(Pe,be)|0,l=l+Math.imul(Pe,we)|0,l=l+Math.imul(Oe,be)|0,w=w+Math.imul(Oe,we)|0,_=_+Math.imul($e,ye)|0,l=l+Math.imul($e,Ee)|0,l=l+Math.imul(Te,ye)|0,w=w+Math.imul(Te,Ee)|0,_=_+Math.imul(Ne,Se)|0,l=l+Math.imul(Ne,ke)|0,l=l+Math.imul(Le,Se)|0,w=w+Math.imul(Le,ke)|0,_=_+Math.imul(xe,Me)|0,l=l+Math.imul(xe,Re)|0,l=l+Math.imul(Ae,Me)|0,w=w+Math.imul(Ae,Re)|0;var Kt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,_=Math.imul(ie,ge),l=Math.imul(ie,me),l=l+Math.imul(oe,ge)|0,w=Math.imul(oe,me),_=_+Math.imul(ne,_e)|0,l=l+Math.imul(ne,ve)|0,l=l+Math.imul(se,_e)|0,w=w+Math.imul(se,ve)|0,_=_+Math.imul(Be,be)|0,l=l+Math.imul(Be,we)|0,l=l+Math.imul(De,be)|0,w=w+Math.imul(De,we)|0,_=_+Math.imul(Pe,ye)|0,l=l+Math.imul(Pe,Ee)|0,l=l+Math.imul(Oe,ye)|0,w=w+Math.imul(Oe,Ee)|0,_=_+Math.imul($e,Se)|0,l=l+Math.imul($e,ke)|0,l=l+Math.imul(Te,Se)|0,w=w+Math.imul(Te,ke)|0,_=_+Math.imul(Ne,Me)|0,l=l+Math.imul(Ne,Re)|0,l=l+Math.imul(Le,Me)|0,w=w+Math.imul(Le,Re)|0;var Xt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,_=Math.imul(ie,_e),l=Math.imul(ie,ve),l=l+Math.imul(oe,_e)|0,w=Math.imul(oe,ve),_=_+Math.imul(ne,be)|0,l=l+Math.imul(ne,we)|0,l=l+Math.imul(se,be)|0,w=w+Math.imul(se,we)|0,_=_+Math.imul(Be,ye)|0,l=l+Math.imul(Be,Ee)|0,l=l+Math.imul(De,ye)|0,w=w+Math.imul(De,Ee)|0,_=_+Math.imul(Pe,Se)|0,l=l+Math.imul(Pe,ke)|0,l=l+Math.imul(Oe,Se)|0,w=w+Math.imul(Oe,ke)|0,_=_+Math.imul($e,Me)|0,l=l+Math.imul($e,Re)|0,l=l+Math.imul(Te,Me)|0,w=w+Math.imul(Te,Re)|0;var ui=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(ui>>>26)|0,ui&=67108863,_=Math.imul(ie,be),l=Math.imul(ie,we),l=l+Math.imul(oe,be)|0,w=Math.imul(oe,we),_=_+Math.imul(ne,ye)|0,l=l+Math.imul(ne,Ee)|0,l=l+Math.imul(se,ye)|0,w=w+Math.imul(se,Ee)|0,_=_+Math.imul(Be,Se)|0,l=l+Math.imul(Be,ke)|0,l=l+Math.imul(De,Se)|0,w=w+Math.imul(De,ke)|0,_=_+Math.imul(Pe,Me)|0,l=l+Math.imul(Pe,Re)|0,l=l+Math.imul(Oe,Me)|0,w=w+Math.imul(Oe,Re)|0;var hi=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(hi>>>26)|0,hi&=67108863,_=Math.imul(ie,ye),l=Math.imul(ie,Ee),l=l+Math.imul(oe,ye)|0,w=Math.imul(oe,Ee),_=_+Math.imul(ne,Se)|0,l=l+Math.imul(ne,ke)|0,l=l+Math.imul(se,Se)|0,w=w+Math.imul(se,ke)|0,_=_+Math.imul(Be,Me)|0,l=l+Math.imul(Be,Re)|0,l=l+Math.imul(De,Me)|0,w=w+Math.imul(De,Re)|0;var di=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(di>>>26)|0,di&=67108863,_=Math.imul(ie,Se),l=Math.imul(ie,ke),l=l+Math.imul(oe,Se)|0,w=Math.imul(oe,ke),_=_+Math.imul(ne,Me)|0,l=l+Math.imul(ne,Re)|0,l=l+Math.imul(se,Me)|0,w=w+Math.imul(se,Re)|0;var fi=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(fi>>>26)|0,fi&=67108863,_=Math.imul(ie,Me),l=Math.imul(ie,Re),l=l+Math.imul(oe,Me)|0,w=Math.imul(oe,Re);var pi=(k+_|0)+((l&8191)<<13)|0;return k=(w+(l>>>13)|0)+(pi>>>26)|0,pi&=67108863,y[0]=Ft,y[1]=jt,y[2]=Ht,y[3]=Ut,y[4]=Vt,y[5]=zt,y[6]=Wt,y[7]=qt,y[8]=Jt,y[9]=Gt,y[10]=Zt,y[11]=Qt,y[12]=Kt,y[13]=Xt,y[14]=ui,y[15]=hi,y[16]=di,y[17]=fi,y[18]=pi,k!==0&&(y[19]=k,p.length++),p};Math.imul||(C=A);function M(E,o,u){u.negative=o.negative^E.negative,u.length=E.length+o.length;for(var p=0,m=0,v=0;v<u.length-1;v++){var y=m;m=0;for(var k=p&67108863,_=Math.min(v,o.length-1),l=Math.max(0,v-E.length+1);l<=_;l++){var w=v-l,T=E.words[w]|0,L=o.words[l]|0,$=T*L,K=$&67108863;y=y+($/67108864|0)|0,K=K+k|0,k=K&67108863,y=y+(K>>>26)|0,m+=y>>>26,y&=67108863}u.words[v]=k,p=y,y=m}return p!==0?u.words[v]=p:u.length--,u._strip()}function B(E,o,u){return M(E,o,u)}s.prototype.mulTo=function(o,u){var p,m=this.length+o.length;return this.length===10&&o.length===10?p=C(this,o,u):m<63?p=A(this,o,u):m<1024?p=M(this,o,u):p=B(this,o,u),p},s.prototype.mul=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},s.prototype.mulf=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),B(this,o,u)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var u=o<0;u&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var p=0,m=0;m<this.length;m++){var v=(this.words[m]|0)*o,y=(v&67108863)+(p&67108863);p>>=26,p+=v/67108864|0,p+=y>>>26,this.words[m]=y&67108863}return p!==0&&(this.words[m]=p,this.length++),this.length=o===0?1:this.length,u?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var u=x(o);if(u.length===0)return new s(1);for(var p=this,m=0;m<u.length&&u[m]===0;m++,p=p.sqr());if(++m<u.length)for(var v=p.sqr();m<u.length;m++,v=v.sqr())u[m]!==0&&(p=p.mul(v));return p},s.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=67108863>>>26-u<<26-u,v;if(u!==0){var y=0;for(v=0;v<this.length;v++){var k=this.words[v]&m,_=(this.words[v]|0)-k<<u;this.words[v]=_|y,y=k>>>26-u}y&&(this.words[v]=y,this.length++)}if(p!==0){for(v=this.length-1;v>=0;v--)this.words[v+p]=this.words[v];for(v=0;v<p;v++)this.words[v]=0;this.length+=p}return this._strip()},s.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},s.prototype.iushrn=function(o,u,p){n(typeof o=="number"&&o>=0);var m;u?m=(u-u%26)/26:m=0;var v=o%26,y=Math.min((o-v)/26,this.length),k=67108863^67108863>>>v<<v,_=p;if(m-=y,m=Math.max(0,m),_){for(var l=0;l<y;l++)_.words[l]=this.words[l];_.length=y}if(y!==0)if(this.length>y)for(this.length-=y,l=0;l<this.length;l++)this.words[l]=this.words[l+y];else this.words[0]=0,this.length=1;var w=0;for(l=this.length-1;l>=0&&(w!==0||l>=m);l--){var T=this.words[l]|0;this.words[l]=w<<26-v|T>>>v,w=T&k}return _&&w!==0&&(_.words[_.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,u,p){return n(this.negative===0),this.iushrn(o,u,p)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return!1;var v=this.words[p];return!!(v&m)},s.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var m=67108863^67108863>>>u<<u;this.words[this.length-1]&=m}return this._strip()},s.prototype.maskn=function(o){return this.clone().imaskn(o)},s.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)},s.prototype._iaddn=function(o){this.words[0]+=o;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},s.prototype.addn=function(o){return this.clone().iaddn(o)},s.prototype.subn=function(o){return this.clone().isubn(o)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(o,u,p){var m=o.length+p,v;this._expand(m);var y,k=0;for(v=0;v<o.length;v++){y=(this.words[v+p]|0)+k;var _=(o.words[v]|0)*u;y-=_&67108863,k=(y>>26)-(_/67108864|0),this.words[v+p]=y&67108863}for(;v<this.length-p;v++)y=(this.words[v+p]|0)+k,k=y>>26,this.words[v+p]=y&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,v=0;v<this.length;v++)y=-(this.words[v]|0)+k,k=y>>26,this.words[v]=y&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,u){var p=this.length-o.length,m=this.clone(),v=o,y=v.words[v.length-1]|0,k=this._countBits(y);p=26-k,p!==0&&(v=v.ushln(p),m.iushln(p),y=v.words[v.length-1]|0);var _=m.length-v.length,l;if(u!=="mod"){l=new s(null),l.length=_+1,l.words=new Array(l.length);for(var w=0;w<l.length;w++)l.words[w]=0}var T=m.clone()._ishlnsubmul(v,1,_);T.negative===0&&(m=T,l&&(l.words[_]=1));for(var L=_-1;L>=0;L--){var $=(m.words[v.length+L]|0)*67108864+(m.words[v.length+L-1]|0);for($=Math.min($/y|0,67108863),m._ishlnsubmul(v,$,L);m.negative!==0;)$--,m.negative=0,m._ishlnsubmul(v,1,L),m.isZero()||(m.negative^=1);l&&(l.words[L]=$)}return l&&l._strip(),m._strip(),u!=="div"&&p!==0&&m.iushrn(p),{div:l||null,mod:m}},s.prototype.divmod=function(o,u,p){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,v,y;return this.negative!==0&&o.negative===0?(y=this.neg().divmod(o,u),u!=="mod"&&(m=y.div.neg()),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.iadd(o)),{div:m,mod:v}):this.negative===0&&o.negative!==0?(y=this.divmod(o.neg(),u),u!=="mod"&&(m=y.div.neg()),{div:m,mod:y.mod}):this.negative&o.negative?(y=this.neg().divmod(o.neg(),u),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.isub(o)),{div:y.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,u)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(o):u.mod,m=o.ushrn(1),v=o.andln(1),y=p.cmp(m);return y<0||v===1&&y===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},s.prototype.modrn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=(1<<26)%o,m=0,v=this.length-1;v>=0;v--)m=(p*m+(this.words[v]|0))%o;return u?-m:m},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var v=(this.words[m]|0)+p*67108864;this.words[m]=v/o|0,p=v%o}return this._strip(),u?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new s(1),v=new s(0),y=new s(0),k=new s(1),_=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++_;for(var l=p.clone(),w=u.clone();!u.isZero();){for(var T=0,L=1;!(u.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(u.iushrn(T);T-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(l),v.isub(w)),m.iushrn(1),v.iushrn(1);for(var $=0,K=1;!(p.words[0]&K)&&$<26;++$,K<<=1);if($>0)for(p.iushrn($);$-- >0;)(y.isOdd()||k.isOdd())&&(y.iadd(l),k.isub(w)),y.iushrn(1),k.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(y),v.isub(k)):(p.isub(u),y.isub(m),k.isub(v))}return{a:y,b:k,gcd:p.iushln(_)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new s(1),v=new s(0),y=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var k=0,_=1;!(u.words[0]&_)&&k<26;++k,_<<=1);if(k>0)for(u.iushrn(k);k-- >0;)m.isOdd()&&m.iadd(y),m.iushrn(1);for(var l=0,w=1;!(p.words[0]&w)&&l<26;++l,w<<=1);if(l>0)for(p.iushrn(l);l-- >0;)v.isOdd()&&v.iadd(y),v.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(v)):(p.isub(u),v.isub(m))}var T;return u.cmpn(1)===0?T=m:T=v,T.cmpn(0)<0&&T.iadd(o),T},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),p=o.clone();u.negative=0,p.negative=0;for(var m=0;u.isEven()&&p.isEven();m++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var v=u.cmp(p);if(v<0){var y=u;u=p,p=y}else if(v===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(m)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=m,this;for(var v=m,y=p;v!==0&&y<this.length;y++){var k=this.words[y]|0;k+=v,v=k>>>26,k&=67108863,this.words[y]=k}return v!==0&&(this.words[y]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(o=-o),n(o<=67108863,"Number is too big");var m=this.words[0]|0;p=m===o?0:m<o?-1:1}return this.negative!==0?-p|0:p},s.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var u=this.ucmp(o);return this.negative!==0?-u|0:u},s.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var m=this.words[p]|0,v=o.words[p]|0;if(m!==v){m<v?u=-1:m>v&&(u=1);break}}return u},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new F(o)},s.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)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var N={k256:null,p224:null,p192:null,p25519:null};function P(E,o){this.name=E,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},P.prototype.ireduce=function(o){var u=o,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var m=p<this.n?-1:u.ucmp(this.p);return m===0?(u.words[0]=0,u.length=1):m>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},P.prototype.split=function(o,u){o.iushrn(this.n,0,u)},P.prototype.imulK=function(o){return o.imul(this.k)};function W(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(W,P),W.prototype.split=function(o,u){for(var p=4194303,m=Math.min(o.length,9),v=0;v<m;v++)u.words[v]=o.words[v];if(u.length=m,o.length<=9){o.words[0]=0,o.length=1;return}var y=o.words[9];for(u.words[u.length++]=y&p,v=10;v<o.length;v++){var k=o.words[v]|0;o.words[v-10]=(k&p)<<4|y>>>22,y=k}y>>>=22,o.words[v-10]=y,y===0&&o.length>10?o.length-=10:o.length-=9},W.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,p=0;p<o.length;p++){var m=o.words[p]|0;u+=m*977,o.words[p]=u&67108863,u=m*64+(u/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function Y(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Y,P);function re(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(re,P);function Z(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Z,P),Z.prototype.imulK=function(o){for(var u=0,p=0;p<o.length;p++){var m=(o.words[p]|0)*19+u,v=m&67108863;m>>>=26,o.words[p]=v,u=m}return u!==0&&(o.words[o.length++]=u),o},s._prime=function(o){if(N[o])return N[o];var u;if(o==="k256")u=new W;else if(o==="p224")u=new Y;else if(o==="p192")u=new re;else if(o==="p25519")u=new Z;else throw new Error("Unknown prime "+o);return N[o]=u,u};function F(E){if(typeof E=="string"){var o=s._prime(E);this.m=o.p,this.prime=o}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}F.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},F.prototype._verify2=function(o,u){n((o.negative|u.negative)===0,"red works only with positives"),n(o.red&&o.red===u.red,"red works only with red numbers")},F.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(f(o,o.umod(this.m)._forceRed(this)),o)},F.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},F.prototype.add=function(o,u){this._verify2(o,u);var p=o.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},F.prototype.iadd=function(o,u){this._verify2(o,u);var p=o.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},F.prototype.sub=function(o,u){this._verify2(o,u);var p=o.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},F.prototype.isub=function(o,u){this._verify2(o,u);var p=o.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},F.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},F.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},F.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},F.prototype.isqr=function(o){return this.imul(o,o.clone())},F.prototype.sqr=function(o){return this.mul(o,o)},F.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(n(u%2===1),u===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(o,p)}for(var m=this.m.subn(1),v=0;!m.isZero()&&m.andln(1)===0;)v++,m.iushrn(1);n(!m.isZero());var y=new s(1).toRed(this),k=y.redNeg(),_=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);this.pow(l,_).cmp(k)!==0;)l.redIAdd(k);for(var w=this.pow(l,m),T=this.pow(o,m.addn(1).iushrn(1)),L=this.pow(o,m),$=v;L.cmp(y)!==0;){for(var K=L,Q=0;K.cmp(y)!==0;Q++)K=K.redSqr();n(Q<$);var X=this.pow(w,new s(1).iushln($-Q-1));T=T.redMul(X),w=X.redSqr(),L=L.redMul(w),$=Q}return T},F.prototype.invm=function(o){var u=o._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},F.prototype.pow=function(o,u){if(u.isZero())return new s(1).toRed(this);if(u.cmpn(1)===0)return o.clone();var p=4,m=new Array(1<<p);m[0]=new s(1).toRed(this),m[1]=o;for(var v=2;v<m.length;v++)m[v]=this.mul(m[v-1],o);var y=m[0],k=0,_=0,l=u.bitLength()%26;for(l===0&&(l=26),v=u.length-1;v>=0;v--){for(var w=u.words[v],T=l-1;T>=0;T--){var L=w>>T&1;if(y!==m[0]&&(y=this.sqr(y)),L===0&&k===0){_=0;continue}k<<=1,k|=L,_++,!(_!==p&&(v!==0||T!==0))&&(y=this.mul(y,m[k]),_=0,k=0)}l=26}return y},F.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},F.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},s.mont=function(o){return new U(o)};function U(E){F.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}i(U,F),U.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},U.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},U.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var p=o.imul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},U.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new s(0)._forceRed(this);var p=o.mul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},U.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,D)})(Zi);var vs=Zi.exports,yn={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.errorValues=At.standardErrorCodes=void 0;At.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};At.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var bs={},ws={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=At,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(b,S=r){if(b&&Number.isInteger(b)){const I=b.toString();if(f(t.errorValues,I))return t.errorValues[I].message;if(h(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return S}e.getMessageFromCode=n;function i(b){if(!Number.isInteger(b))return!1;const S=b.toString();return!!(t.errorValues[S]||h(b))}e.isValidCode=i;function s(b){var S;if(typeof b=="number")return b;if(a(b))return(S=b.code)!==null&&S!==void 0?S:b.errorCode}e.getErrorCode=s;function a(b){return typeof b=="object"&&b!==null&&(typeof b.code=="number"||typeof b.errorCode=="number")}function c(b,{shouldIncludeStack:S=!1}={}){const I={};if(b&&typeof b=="object"&&!Array.isArray(b)&&f(b,"code")&&i(b.code)){const R=b;I.code=R.code,R.message&&typeof R.message=="string"?(I.message=R.message,f(R,"data")&&(I.data=R.data)):(I.message=n(I.code),I.data={originalError:d(b)})}else I.code=t.standardErrorCodes.rpc.internal,I.message=g(b,"message")?b.message:r,I.data={originalError:d(b)};return S&&(I.stack=g(b,"stack")?b.stack:void 0),I}e.serialize=c;function h(b){return b>=-32099&&b<=-32e3}function d(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function f(b,S){return Object.prototype.hasOwnProperty.call(b,S)}function g(b,S){return typeof b=="object"&&b!==null&&S in b&&typeof b[S]=="string"}})(ws);Object.defineProperty(bs,"__esModule",{value:!0});bs.standardErrors=void 0;const Ze=At,hc=ws;bs.standardErrors={rpc:{parse:e=>at(Ze.standardErrorCodes.rpc.parse,e),invalidRequest:e=>at(Ze.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>at(Ze.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>at(Ze.standardErrorCodes.rpc.methodNotFound,e),internal:e=>at(Ze.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return at(t,e)},invalidInput:e=>at(Ze.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>at(Ze.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>at(Ze.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>at(Ze.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>at(Ze.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>at(Ze.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Cr(Ze.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Cr(Ze.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Cr(Ze.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Cr(Ze.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Cr(Ze.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Cr(Ze.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new pc(t,r,n)}}};function at(e,t){const[r,n]=dc(t);return new fc(e,r||(0,hc.getMessageFromCode)(e),n)}function Cr(e,t){const[r,n]=dc(t);return new pc(e,r||(0,hc.getMessageFromCode)(e),n)}function dc(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 fc=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)}},pc=class extends fc{constructor(t,r,n){if(!Iu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Iu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ys={},Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isErrorResponse=void 0;function xu(e){return e.errorMessage!==void 0}Jr.isErrorResponse=xu;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.LIB_VERSION=void 0;Gr.LIB_VERSION="3.9.3";Object.defineProperty(ys,"__esModule",{value:!0});ys.serializeError=void 0;const Au=Jr,Nu=Gr,Lu=At,$u=ws;function Tu(e,t){const r=(0,$u.serialize)(Pu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Nu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Ou(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ys.serializeError=Tu;function Pu(e){return typeof e=="string"?{message:e,code:Lu.standardErrorCodes.rpc.internal}:(0,Au.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Ou(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=At;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=bs;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ys;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=ws;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(yn);var We={};Object.defineProperty(We,"__esModule",{value:!0});We.ProviderType=We.RegExpString=We.IntNumber=We.BigIntString=We.AddressString=We.HexString=We.OpaqueType=void 0;function En(){return e=>e}We.OpaqueType=En;We.HexString=En();We.AddressString=En();We.BigIntString=En();function Bu(e){return Math.floor(e)}We.IntNumber=Bu;We.RegExpString=En();var Do;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Do||(We.ProviderType=Do={}));var Du=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(O,"__esModule",{value:!0});O.isMobileWeb=O.getLocation=O.isInIFrame=O.createQrUrl=O.getFavicon=O.range=O.isBigNumber=O.ensureParsedJSONObject=O.ensureBN=O.ensureRegExpString=O.ensureIntNumber=O.ensureBuffer=O.ensureAddressString=O.ensureEvenLengthHexString=O.ensureHexString=O.isHexString=O.prepend0x=O.strip0x=O.has0xPrefix=O.hexStringFromIntNumber=O.intNumberFromHexString=O.bigIntStringFromBN=O.hexStringFromBuffer=O.hexStringToUint8Array=O.uint8ArrayToHex=O.randomBytesHex=void 0;const Tt=Du(vs),hr=yn,ht=We,gc=/^[0-9]*$/,mc=/^[a-f0-9]*$/;function Fu(e){return _c(crypto.getRandomValues(new Uint8Array(e)))}O.randomBytesHex=Fu;function _c(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=_c;function ju(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}O.hexStringToUint8Array=ju;function Hu(e,t=!1){const r=e.toString("hex");return(0,ht.HexString)(t?`0x${r}`:r)}O.hexStringFromBuffer=Hu;function Uu(e){return(0,ht.BigIntString)(e.toString(10))}O.bigIntStringFromBN=Uu;function Vu(e){return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}O.intNumberFromHexString=Vu;function zu(e){return(0,ht.HexString)(`0x${new Tt.default(e).toString(16)}`)}O.hexStringFromIntNumber=zu;function Qi(e){return e.startsWith("0x")||e.startsWith("0X")}O.has0xPrefix=Qi;function Es(e){return Qi(e)?e.slice(2):e}O.strip0x=Es;function vc(e){return Qi(e)?`0x${e.slice(2)}`:`0x${e}`}O.prepend0x=vc;function Sn(e){if(typeof e!="string")return!1;const t=Es(e).toLowerCase();return mc.test(t)}O.isHexString=Sn;function bc(e,t=!1){if(typeof e=="string"){const r=Es(e).toLowerCase();if(mc.test(r))return(0,ht.HexString)(t?`0x${r}`:r)}throw hr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}O.ensureHexString=bc;function kn(e,t=!1){let r=bc(e,!1);return r.length%2===1&&(r=(0,ht.HexString)(`0${r}`)),t?(0,ht.HexString)(`0x${r}`):r}O.ensureEvenLengthHexString=kn;function Wu(e){if(typeof e=="string"){const t=Es(e).toLowerCase();if(Sn(t)&&t.length===40)return(0,ht.AddressString)(vc(t))}throw hr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}O.ensureAddressString=Wu;function qu(e){if(V.isBuffer(e))return e;if(typeof e=="string"){if(Sn(e)){const t=kn(e,!1);return V.from(t,"hex")}return V.from(e,"utf8")}throw hr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}O.ensureBuffer=qu;function wc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ht.IntNumber)(e);if(typeof e=="string"){if(gc.test(e))return(0,ht.IntNumber)(Number(e));if(Sn(e))return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureIntNumber=wc;function Ju(e){if(e instanceof RegExp)return(0,ht.RegExpString)(e.toString());throw hr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}O.ensureRegExpString=Ju;function Gu(e){if(e!==null&&(Tt.default.isBN(e)||yc(e)))return new Tt.default(e.toString(10),10);if(typeof e=="number")return new Tt.default(wc(e));if(typeof e=="string"){if(gc.test(e))return new Tt.default(e,10);if(Sn(e))return new Tt.default(kn(e,!1),16)}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureBN=Gu;function Zu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw hr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}O.ensureParsedJSONObject=Zu;function yc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}O.isBigNumber=yc;function Qu(e,t){return Array.from({length:t-e},(r,n)=>e+n)}O.range=Qu;function Ku(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}O.getFavicon=Ku;function Xu(e,t,r,n,i,s){const a=n?"parent-id":"id",c=new URLSearchParams({[a]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}O.createQrUrl=Xu;function Ec(){try{return window.frameElement!==null}catch{return!1}}O.isInIFrame=Ec;function Yu(){try{return Ec()&&window.top?window.top.location:window.location}catch{return window.location}}O.getLocation=Yu;function eh(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}O.isMobileWeb=eh;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.ScopedLocalStorage=void 0;class th{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 i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Ss.ScopedLocalStorage=th;var Dr={},Sc={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(h,d,f){this.fn=h,this.context=d,this.once=f||!1}function s(h,d,f,g,b){if(typeof f!="function")throw new TypeError("The listener must be a function");var S=new i(f,g||h,b),I=r?r+d:d;return h._events[I]?h._events[I].fn?h._events[I]=[h._events[I],S]:h._events[I].push(S):(h._events[I]=S,h._eventsCount++),h}function a(h,d){--h._eventsCount===0?h._events=new n:delete h._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],f,g;if(this._eventsCount===0)return d;for(g in f=this._events)t.call(f,g)&&d.push(r?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},c.prototype.listeners=function(d){var f=r?r+d:d,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var b=0,S=g.length,I=new Array(S);b<S;b++)I[b]=g[b].fn;return I},c.prototype.listenerCount=function(d){var f=r?r+d:d,g=this._events[f];return g?g.fn?1:g.length:0},c.prototype.emit=function(d,f,g,b,S,I){var R=r?r+d:d;if(!this._events[R])return!1;var x=this._events[R],A=arguments.length,C,M;if(x.fn){switch(x.once&&this.removeListener(d,x.fn,void 0,!0),A){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,f),!0;case 3:return x.fn.call(x.context,f,g),!0;case 4:return x.fn.call(x.context,f,g,b),!0;case 5:return x.fn.call(x.context,f,g,b,S),!0;case 6:return x.fn.call(x.context,f,g,b,S,I),!0}for(M=1,C=new Array(A-1);M<A;M++)C[M-1]=arguments[M];x.fn.apply(x.context,C)}else{var B=x.length,N;for(M=0;M<B;M++)switch(x[M].once&&this.removeListener(d,x[M].fn,void 0,!0),A){case 1:x[M].fn.call(x[M].context);break;case 2:x[M].fn.call(x[M].context,f);break;case 3:x[M].fn.call(x[M].context,f,g);break;case 4:x[M].fn.call(x[M].context,f,g,b);break;default:if(!C)for(N=1,C=new Array(A-1);N<A;N++)C[N-1]=arguments[N];x[M].fn.apply(x[M].context,C)}}return!0},c.prototype.on=function(d,f,g){return s(this,d,f,g,!1)},c.prototype.once=function(d,f,g){return s(this,d,f,g,!0)},c.prototype.removeListener=function(d,f,g,b){var S=r?r+d:d;if(!this._events[S])return this;if(!f)return a(this,S),this;var I=this._events[S];if(I.fn)I.fn===f&&(!b||I.once)&&(!g||I.context===g)&&a(this,S);else{for(var R=0,x=[],A=I.length;R<A;R++)(I[R].fn!==f||b&&!I[R].once||g&&I[R].context!==g)&&x.push(I[R]);x.length?this._events[S]=x.length===1?x[0]:x:a(this,S)}return this},c.prototype.removeAllListeners=function(d){var f;return d?(f=r?r+d:d,this._events[f]&&a(this,f)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,e.exports=c})(Sc);var rh=Sc.exports,Mn={},Rn={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.EVENTS=void 0;Zr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.RelayAbstract=ut.APP_VERSION_KEY=ut.LOCAL_STORAGE_ADDRESSES_KEY=ut.WALLET_USER_NAME_KEY=void 0;const Fo=yn;ut.WALLET_USER_NAME_KEY="walletUsername";ut.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ut.APP_VERSION_KEY="AppVersion";class nh{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 Fo.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Fo.serializeError)(s,t.method);return i})}}ut.RelayAbstract=nh;var Qr={},kc={exports:{}},sh=bu,ih=wu,oh=ih("TypedArray.prototype.buffer",!0),ah=ku(),ch=oh||function(t){if(!ah(t))throw new sh("Not a Typed Array");return t.buffer},gt=Dt().Buffer,lh=yu,uh=ch,hh=ArrayBuffer.isView||function(t){try{return uh(t),!0}catch{return!1}},dh=typeof Uint8Array<"u",Mc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",fh=Mc&&(gt.prototype instanceof Uint8Array||gt.TYPED_ARRAY_SUPPORT),ph=function(t,r){if(gt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?gt.from(t):t;if(typeof t=="string")return gt.from(t,r);if(Mc&&hh(t)){if(t.byteLength===0)return gt.alloc(0);if(fh){var n=gt.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=gt.from(i);if(s.length===t.byteLength)return s}if(dh&&t instanceof Uint8Array)return gt.from(t);var a=lh(t);if(a)for(var c=0;c<t.length;c+=1){var h=t[c];if(typeof h!="number"||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||gt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return gt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},gh=Dt().Buffer,mh=ph;function ks(e,t){this._block=gh.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}ks.prototype.update=function(e,t){e=mh(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,a=0;a<i;){for(var c=s%n,h=Math.min(i-a,n-c),d=0;d<h;d++)r[c+d]=e[a+d];s+=h,a+=h,s%n===0&&this._update(r)}return this._len+=i,this};ks.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,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};ks.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Kr=ks,_h=qr,Rc=Kr,vh=Dt().Buffer,bh=[1518500249,1859775393,-1894007588,-899497514],wh=new Array(80);function Cn(){this.init(),this._w=wh,Rc.call(this,64,56)}_h(Cn,Rc);Cn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function yh(e){return e<<5|e>>>27}function Eh(e){return e<<30|e>>>2}function Sh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Cn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var h=0;h<80;++h){var d=~~(h/20),f=yh(r)+Sh(d,n,i,s)+a+t[h]+bh[d]|0;a=s,s=i,i=Eh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Cn.prototype._hash=function(){var e=vh.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 kh=Cn,Mh=qr,Cc=Kr,Rh=Dt().Buffer,Ch=[1518500249,1859775393,-1894007588,-899497514],Ih=new Array(80);function In(){this.init(),this._w=Ih,Cc.call(this,64,56)}Mh(In,Cc);In.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function xh(e){return e<<1|e>>>31}function Ah(e){return e<<5|e>>>27}function Nh(e){return e<<30|e>>>2}function Lh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}In.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=xh(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var h=0;h<80;++h){var d=~~(h/20),f=Ah(r)+Lh(d,n,i,s)+a+t[h]+Ch[d]|0;a=s,s=i,i=Nh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};In.prototype._hash=function(){var e=Rh.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 $h=In,Th=qr,Ic=Kr,Ph=Dt().Buffer,Oh=[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],Bh=new Array(64);function xn(){this.init(),this._w=Bh,Ic.call(this,64,56)}Th(xn,Ic);xn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Dh(e,t,r){return r^e&(t^r)}function Fh(e,t,r){return e&t|r&(e|t)}function jh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Hh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Uh(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Vh(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}xn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=this._f|0,h=this._g|0,d=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=Vh(t[f-2])+t[f-7]+Uh(t[f-15])+t[f-16]|0;for(var g=0;g<64;++g){var b=d+Hh(a)+Dh(a,c,h)+Oh[g]+t[g]|0,S=jh(r)+Fh(r,n,i)|0;d=h,h=c,c=a,a=s+b|0,s=i,i=n,n=r,r=b+S|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=h+this._g|0,this._h=d+this._h|0};xn.prototype._hash=function(){var e=Ph.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 xc=xn,zh=qr,Wh=xc,qh=Kr,Jh=Dt().Buffer,Gh=new Array(64);function Ms(){this.init(),this._w=Gh,qh.call(this,64,56)}zh(Ms,Wh);Ms.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};Ms.prototype._hash=function(){var e=Jh.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 Zh=Ms,Qh=qr,Ac=Kr,Kh=Dt().Buffer,jo=[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],Xh=new Array(160);function An(){this.init(),this._w=Xh,Ac.call(this,128,112)}Qh(An,Ac);An.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ho(e,t,r){return r^e&(t^r)}function Uo(e,t,r){return e&t|r&(e|t)}function Vo(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function zo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Yh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function ed(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function td(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function rd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Je(e,t){return e>>>0<t>>>0?1:0}An.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,a=this._eh|0,c=this._fh|0,h=this._gh|0,d=this._hh|0,f=this._al|0,g=this._bl|0,b=this._cl|0,S=this._dl|0,I=this._el|0,R=this._fl|0,x=this._gl|0,A=this._hl|0,C=0;C<32;C+=2)t[C]=e.readInt32BE(C*4),t[C+1]=e.readInt32BE(C*4+4);for(;C<160;C+=2){var M=t[C-30],B=t[C-15*2+1],N=Yh(M,B),P=ed(B,M);M=t[C-2*2],B=t[C-2*2+1];var W=td(M,B),Y=rd(B,M),re=t[C-7*2],Z=t[C-7*2+1],F=t[C-16*2],U=t[C-16*2+1],E=P+Z|0,o=N+re+Je(E,P)|0;E=E+Y|0,o=o+W+Je(E,Y)|0,E=E+U|0,o=o+F+Je(E,U)|0,t[C]=o,t[C+1]=E}for(var u=0;u<160;u+=2){o=t[u],E=t[u+1];var p=Uo(r,n,i),m=Uo(f,g,b),v=Vo(r,f),y=Vo(f,r),k=zo(a,I),_=zo(I,a),l=jo[u],w=jo[u+1],T=Ho(a,c,h),L=Ho(I,R,x),$=A+_|0,K=d+k+Je($,A)|0;$=$+L|0,K=K+T+Je($,L)|0,$=$+w|0,K=K+l+Je($,w)|0,$=$+E|0,K=K+o+Je($,E)|0;var Q=y+m|0,X=v+p+Je(Q,y)|0;d=h,A=x,h=c,x=R,c=a,R=I,I=S+$|0,a=s+K+Je(I,S)|0,s=i,S=b,i=n,b=g,n=r,g=f,f=$+Q|0,r=K+X+Je(f,$)|0}this._al=this._al+f|0,this._bl=this._bl+g|0,this._cl=this._cl+b|0,this._dl=this._dl+S|0,this._el=this._el+I|0,this._fl=this._fl+R|0,this._gl=this._gl+x|0,this._hl=this._hl+A|0,this._ah=this._ah+r+Je(this._al,f)|0,this._bh=this._bh+n+Je(this._bl,g)|0,this._ch=this._ch+i+Je(this._cl,b)|0,this._dh=this._dh+s+Je(this._dl,S)|0,this._eh=this._eh+a+Je(this._el,I)|0,this._fh=this._fh+c+Je(this._fl,R)|0,this._gh=this._gh+h+Je(this._gl,x)|0,this._hh=this._hh+d+Je(this._hl,A)|0};An.prototype._hash=function(){var e=Kh.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+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 Nc=An,nd=qr,sd=Nc,id=Kr,od=Dt().Buffer,ad=new Array(160);function Rs(){this.init(),this._w=ad,id.call(this,128,112)}nd(Rs,sd);Rs.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};Rs.prototype._hash=function(){var e=od.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+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 cd=Rs;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=kh,e.exports.sha1=$h,e.exports.sha224=Zh,e.exports.sha256=xc,e.exports.sha384=cd,e.exports.sha512=Nc})(kc);var ld=kc.exports;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Session=void 0;const Wo=ld,qo=O,Jo="session:id",Go="session:secret",Zo="session:linked";class Ki{constructor(t,r,n,i){this._storage=t,this._id=r||(0,qo.randomBytesHex)(16),this._secret=n||(0,qo.randomBytesHex)(32),this._key=new Wo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Jo),n=t.getItem(Zo),i=t.getItem(Go);return r&&i?new Ki(t,r,i,n==="1"):null}static hash(t){return new Wo.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(Jo,this._id),this._storage.setItem(Go,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Zo,this._linked?"1":"0")}}Qr.Session=Ki;var Cs={},Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.Cipher=void 0;const Gn=O;class ud{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)),i=await crypto.subtle.importKey("raw",(0,Gn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),c=16,h=a.slice(a.byteLength-c),d=a.slice(0,a.byteLength-c),f=new Uint8Array(h),g=new Uint8Array(d),b=new Uint8Array([...n,...f,...g]);return(0,Gn.uint8ArrayToHex)(b)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,Gn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,Gn.hexStringToUint8Array)(t),c=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),f=new Uint8Array([...d,...h]),g={name:"AES-GCM",iv:new Uint8Array(c)};try{const b=await window.crypto.subtle.decrypt(g,s,f),S=new TextDecoder;n(S.decode(b))}catch(b){i(b)}})()})}}Is.Cipher=ud;var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.WalletLinkHTTP=void 0;class hd{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}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:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(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(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}xs.WalletLinkHTTP=hd;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.WalletLinkWebSocket=Fr.ConnectionState=void 0;var $r;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})($r||(Fr.ConnectionState=$r={}));class dd{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 i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,$r.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.DISCONNECTED)},i.onopen=s=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,c;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,$r.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Fr.WalletLinkWebSocket=dd;Object.defineProperty(Cs,"__esModule",{value:!0});Cs.WalletLinkConnection=void 0;const Ir=We,fd=Is,vt=Zr,Qo=ut,xr=Qr,pd=xs,Zn=Fr,Ko=1e4,gd=6e4;class md{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Ir.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>c.JsonRpcUrl&&this.handleChainUpdated(d,c.JsonRpcUrl)]]).forEach((d,f)=>{const g=c[f];g!==void 0&&d(g)})},this.handleDestroyed=c=>{var h,d;c==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:xr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var h,d;try{const f=await this.cipher.decrypt(c);(h=this.listener)===null||h===void 0||h.accountUpdated(f)}catch{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(c,g)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(Qo.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(Qo.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(c),b=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(g,b)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new fd.Cipher(t.secret),this.diagnostic=i,this.listener=n;const a=new Zn.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async c=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:xr.Session.hash(t.id)});let d=!1;switch(c){case Zn.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(g=>setTimeout(g,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case Zn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ko),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Zn.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(c=>{var h,d,f;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const g=c.type==="IsLinkedOK"?c.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.LINKED,{sessionIdHash:xr.Session.hash(t.id),linked:g,type:c.type,onlineGuests:c.onlineGuests}),this.linked=g||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:xr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((f=this.requestResolutions.get(c.id))===null||f===void 0||f(c))}),this.ws=a,this.http=new pd.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.STARTED_CONNECTING,{sessionIdHash:xr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.DISCONNECTED,{sessionIdHash:xr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);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>Ko*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=gd){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Cs.WalletLinkConnection=md;var Nn={},Ln={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.default=(()=>'@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')();var _d=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.injectCssReset=void 0;const vd=_d(Xi);function bd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(vd.default)),document.documentElement.appendChild(e)}Ln.injectCssReset=bd;var As={},$n,te,Lc,$c,nr,Xo,Tc,Pc,Oc,Yi,Pi,Oi,Bc,_n={},Dc=[],wd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Tn=Array.isArray;function kt(e,t){for(var r in t)e[r]=t[r];return e}function eo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Bi(e,t,r){var n,i,s,a={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?$n.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)a[s]===void 0&&(a[s]=e.defaultProps[s]);return fn(e,a,n,i,null)}function fn(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Lc,__i:-1,__u:0};return i==null&&te.vnode!=null&&te.vnode(s),s}function yd(){return{current:null}}function Pn(e){return e.children}function pn(e,t){this.props=e,this.context=t}function jr(e,t){if(t==null)return e.__?jr(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?jr(e):null}function Fc(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Fc(e)}}function Di(e){(!e.__d&&(e.__d=!0)&&nr.push(e)&&!ds.__r++||Xo!=te.debounceRendering)&&((Xo=te.debounceRendering)||Tc)(ds)}function ds(){for(var e,t,r,n,i,s,a,c=1;nr.length;)nr.length>c&&nr.sort(Pc),e=nr.shift(),c=nr.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,s=[],a=[],t.__P&&((r=kt({},n)).__v=n.__v+1,te.vnode&&te.vnode(r),to(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,s,i??jr(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Vc(s,r,a),n.__e=n.__=null,r.__e!=i&&Fc(r)));ds.__r=0}function jc(e,t,r,n,i,s,a,c,h,d,f){var g,b,S,I,R,x,A,C=n&&n.__k||Dc,M=t.length;for(h=Ed(r,t,C,h,M),g=0;g<M;g++)(S=r.__k[g])!=null&&(b=S.__i==-1?_n:C[S.__i]||_n,S.__i=g,x=to(e,S,b,i,s,a,c,h,d,f),I=S.__e,S.ref&&b.ref!=S.ref&&(b.ref&&ro(b.ref,null,S),f.push(S.ref,S.__c||I,S)),R==null&&I!=null&&(R=I),(A=!!(4&S.__u))||b.__k===S.__k?h=Hc(S,h,e,A):typeof S.type=="function"&&x!==void 0?h=x:I&&(h=I.nextSibling),S.__u&=-7);return r.__e=R,h}function Ed(e,t,r,n,i){var s,a,c,h,d,f=r.length,g=f,b=0;for(e.__k=new Array(i),s=0;s<i;s++)(a=t[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(h=s+b,(a=e.__k[s]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?fn(null,a,null,null,null):Tn(a)?fn(Pn,{children:a},null,null,null):a.constructor==null&&a.__b>0?fn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,c=null,(d=a.__i=Sd(a,r,h,g))!=-1&&(g--,(c=r[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(i>f?b--:i<f&&b++),typeof a.type!="function"&&(a.__u|=4)):d!=h&&(d==h-1?b--:d==h+1?b++:(d>h?b--:b++,a.__u|=4))):e.__k[s]=null;if(g)for(s=0;s<f;s++)(c=r[s])!=null&&!(2&c.__u)&&(c.__e==n&&(n=jr(c)),Wc(c,c));return n}function Hc(e,t,r,n){var i,s;if(typeof e.type=="function"){for(i=e.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=e,t=Hc(i[s],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=jr(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Uc(e,t){return t=t||[],e==null||typeof e=="boolean"||(Tn(e)?e.some(function(r){Uc(r,t)}):t.push(e)),t}function Sd(e,t,r,n){var i,s,a,c=e.key,h=e.type,d=t[r],f=d!=null&&(2&d.__u)==0;if(d===null&&e.key==null||f&&c==d.key&&h==d.type)return r;if(n>(f?1:0)){for(i=r-1,s=r+1;i>=0||s<t.length;)if((d=t[a=i>=0?i--:s++])!=null&&!(2&d.__u)&&c==d.key&&h==d.type)return a}return-1}function Yo(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||wd.test(t)?r:r+"px"}function Qn(e,t,r,n,i){var s,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Yo(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Yo(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(Oc,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.u=n.u:(r.u=Yi,e.addEventListener(t,s?Oi:Pi,s)):e.removeEventListener(t,s?Oi:Pi,s);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ea(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Yi++;else if(t.t<r.u)return;return r(te.event?te.event(t):t)}}}function to(e,t,r,n,i,s,a,c,h,d){var f,g,b,S,I,R,x,A,C,M,B,N,P,W,Y,re,Z,F=t.type;if(t.constructor!=null)return null;128&r.__u&&(h=!!(32&r.__u),s=[c=t.__e=r.__e]),(f=te.__b)&&f(t);e:if(typeof F=="function")try{if(A=t.props,C="prototype"in F&&F.prototype.render,M=(f=F.contextType)&&n[f.__c],B=f?M?M.props.value:f.__:n,r.__c?x=(g=t.__c=r.__c).__=g.__E:(C?t.__c=g=new F(A,B):(t.__c=g=new pn(A,B),g.constructor=F,g.render=Md),M&&M.sub(g),g.props=A,g.state||(g.state={}),g.context=B,g.__n=n,b=g.__d=!0,g.__h=[],g._sb=[]),C&&g.__s==null&&(g.__s=g.state),C&&F.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=kt({},g.__s)),kt(g.__s,F.getDerivedStateFromProps(A,g.__s))),S=g.props,I=g.state,g.__v=t,b)C&&F.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),C&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(C&&F.getDerivedStateFromProps==null&&A!==S&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(A,B),!g.__e&&g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(A,g.__s,B)===!1||t.__v==r.__v){for(t.__v!=r.__v&&(g.props=A,g.state=g.__s,g.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(U){U&&(U.__=t)}),N=0;N<g._sb.length;N++)g.__h.push(g._sb[N]);g._sb=[],g.__h.length&&a.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(A,g.__s,B),C&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(S,I,R)})}if(g.context=B,g.props=A,g.__P=e,g.__e=!1,P=te.__r,W=0,C){for(g.state=g.__s,g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),Y=0;Y<g._sb.length;Y++)g.__h.push(g._sb[Y]);g._sb=[]}else do g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++W<25);g.state=g.__s,g.getChildContext!=null&&(n=kt(kt({},n),g.getChildContext())),C&&!b&&g.getSnapshotBeforeUpdate!=null&&(R=g.getSnapshotBeforeUpdate(S,I)),re=f,f!=null&&f.type===Pn&&f.key==null&&(re=zc(f.props.children)),c=jc(e,Tn(re)?re:[re],t,r,n,i,s,a,c,h,d),g.base=t.__e,t.__u&=-161,g.__h.length&&a.push(g),x&&(g.__E=g.__=null)}catch(U){if(t.__v=null,h||s!=null)if(U.then){for(t.__u|=h?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,t.__e=c}else{for(Z=s.length;Z--;)eo(s[Z]);Fi(t)}else t.__e=r.__e,t.__k=r.__k,U.then||Fi(t);te.__e(U,t,r)}else s==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):c=t.__e=kd(r.__e,t,r,n,i,s,a,h,d);return(f=te.diffed)&&f(t),128&t.__u?void 0:c}function Fi(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Fi)}function Vc(e,t,r){for(var n=0;n<r.length;n++)ro(r[n],r[++n],r[++n]);te.__c&&te.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(s){s.call(i)})}catch(s){te.__e(s,i.__v)}})}function zc(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Tn(e)?e.map(zc):kt({},e)}function kd(e,t,r,n,i,s,a,c,h){var d,f,g,b,S,I,R,x=r.props,A=t.props,C=t.type;if(C=="svg"?i="http://www.w3.org/2000/svg":C=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(d=0;d<s.length;d++)if((S=s[d])&&"setAttribute"in S==!!C&&(C?S.localName==C:S.nodeType==3)){e=S,s[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(A);e=document.createElementNS(i,C,A.is&&A),c&&(te.__m&&te.__m(t,s),c=!1),s=null}if(C==null)x===A||c&&e.data==A||(e.data=A);else{if(s=s&&$n.call(e.childNodes),x=r.props||_n,!c&&s!=null)for(x={},d=0;d<e.attributes.length;d++)x[(S=e.attributes[d]).name]=S.value;for(d in x)if(S=x[d],d!="children"){if(d=="dangerouslySetInnerHTML")g=S;else if(!(d in A)){if(d=="value"&&"defaultValue"in A||d=="checked"&&"defaultChecked"in A)continue;Qn(e,d,null,S,i)}}for(d in A)S=A[d],d=="children"?b=S:d=="dangerouslySetInnerHTML"?f=S:d=="value"?I=S:d=="checked"?R=S:c&&typeof S!="function"||x[d]===S||Qn(e,d,S,x[d],i);if(f)c||g&&(f.__html==g.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(g&&(e.innerHTML=""),jc(t.type=="template"?e.content:e,Tn(b)?b:[b],t,r,n,C=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:r.__k&&jr(r,0),c,h),s!=null)for(d=s.length;d--;)eo(s[d]);c||(d="value",C=="progress"&&I==null?e.removeAttribute("value"):I!=null&&(I!==e[d]||C=="progress"&&!I||C=="option"&&I!=x[d])&&Qn(e,d,I,x[d],i),d="checked",R!=null&&R!=e[d]&&Qn(e,d,R,x[d],i))}return e}function ro(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){te.__e(i,r)}}function Wc(e,t,r){var n,i;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ro(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){te.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Wc(n[i],t,r||typeof e.type!="function");r||eo(e.__e),e.__c=e.__=e.__e=void 0}function Md(e,t,r){return this.constructor(e,r)}function qc(e,t,r){var n,i,s,a;t==document&&(t=document.documentElement),te.__&&te.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,s=[],a=[],to(t,e=(!n&&r||t).__k=Bi(Pn,null,[e]),i||_n,_n,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?$n.call(t.childNodes):null,s,!n&&r?r:i?i.__e:t.firstChild,n,a),Vc(s,e,a)}function Jc(e,t){qc(e,t,Jc)}function Rd(e,t,r){var n,i,s,a,c=kt({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)s=="key"?n=t[s]:s=="ref"?i=t[s]:c[s]=t[s]===void 0&&a!=null?a[s]:t[s];return arguments.length>2&&(c.children=arguments.length>3?$n.call(arguments,2):r),fn(e.type,c,n||e.key,i||e.ref,null)}function Cd(e){function t(r){var n,i;return this.getChildContext||(n=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&n.forEach(function(a){a.__e=!0,Di(a)})},this.sub=function(s){n.add(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){n&&n.delete(s),a&&a.call(s)}}),r.children}return t.__c="__cC"+Bc++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t}$n=Dc.slice,te={__e:function(e,t,r,n){for(var i,s,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(c){e=c}throw e}},Lc=0,$c=function(e){return e!=null&&e.constructor==null},pn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=kt({},this.state),typeof e=="function"&&(e=e(kt({},r),this.props)),e&&kt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Di(this))},pn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Di(this))},pn.prototype.render=Pn,nr=[],Tc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pc=function(e,t){return e.__v.__b-t.__v.__b},ds.__r=0,Oc=/(PointerCapture)$|Capture$/i,Yi=0,Pi=ea(!1),Oi=ea(!0),Bc=0;const Id=Object.freeze(Object.defineProperty({__proto__:null,Component:pn,Fragment:Pn,cloneElement:Rd,createContext:Cd,createElement:Bi,createRef:yd,h:Bi,hydrate:Jc,get isValidElement(){return $c},get options(){return te},render:qc,toChildArray:Uc},Symbol.toStringTag,{value:"Module"})),rt=qi(Id);var Ns={},Nt,ee,gi,ta,Hr=0,Gc=[],He=te,ra=He.__b,na=He.__r,sa=He.diffed,ia=He.__c,oa=He.unmount,aa=He.__;function dr(e,t){He.__h&&He.__h(ee,e,Hr||t),Hr=0;var r=ee.__H||(ee.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Zc(e){return Hr=1,Qc(Xc,e)}function Qc(e,t,r){var n=dr(Nt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Xc(void 0,t),function(c){var h=n.__N?n.__N[0]:n.__[0],d=n.t(h,c);h!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ee,!ee.__f)){var i=function(c,h,d){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(b){return!!b.__c});if(f.every(function(b){return!b.__N}))return!s||s.call(this,c,h,d);var g=n.__c.props!==c;return f.forEach(function(b){if(b.__N){var S=b.__[0];b.__=b.__N,b.__N=void 0,S!==b.__[0]&&(g=!0)}}),s&&s.call(this,c,h,d)||g};ee.__f=!0;var s=ee.shouldComponentUpdate,a=ee.componentWillUpdate;ee.componentWillUpdate=function(c,h,d){if(this.__e){var f=s;s=void 0,i(c,h,d),s=f}a&&a.call(this,c,h,d)},ee.shouldComponentUpdate=i}return n.__N||n.__}function xd(e,t){var r=dr(Nt++,3);!He.__s&&so(r.__H,t)&&(r.__=e,r.u=t,ee.__H.__h.push(r))}function Kc(e,t){var r=dr(Nt++,4);!He.__s&&so(r.__H,t)&&(r.__=e,r.u=t,ee.__h.push(r))}function Ad(e){return Hr=5,no(function(){return{current:e}},[])}function Nd(e,t,r){Hr=6,Kc(function(){if(typeof e=="function"){var n=e(t());return function(){e(null),n&&typeof n=="function"&&n()}}if(e)return e.current=t(),function(){return e.current=null}},r==null?r:r.concat(e))}function no(e,t){var r=dr(Nt++,7);return so(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ld(e,t){return Hr=8,no(function(){return e},t)}function $d(e){var t=ee.context[e.__c],r=dr(Nt++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(ee)),t.props.value):e.__}function Td(e,t){He.useDebugValue&&He.useDebugValue(t?t(e):e)}function Pd(e){var t=dr(Nt++,10),r=Zc();return t.__=e,ee.componentDidCatch||(ee.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Od(){var e=dr(Nt++,11);if(!e.__){for(var t=ee.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Bd(){for(var e;e=Gc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(us),e.__H.__h.forEach(ji),e.__H.__h=[]}catch(t){e.__H.__h=[],He.__e(t,e.__v)}}He.__b=function(e){ee=null,ra&&ra(e)},He.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),aa&&aa(e,t)},He.__r=function(e){na&&na(e),Nt=0;var t=(ee=e.__c).__H;t&&(gi===ee?(t.__h=[],ee.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(us),t.__h.forEach(ji),t.__h=[],Nt=0)),gi=ee},He.diffed=function(e){sa&&sa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gc.push(t)!==1&&ta===He.requestAnimationFrame||((ta=He.requestAnimationFrame)||Dd)(Bd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),gi=ee=null},He.__c=function(e,t){t.some(function(r){try{r.__h.forEach(us),r.__h=r.__h.filter(function(n){return!n.__||ji(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],He.__e(n,r.__v)}}),ia&&ia(e,t)},He.unmount=function(e){oa&&oa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{us(n)}catch(i){t=i}}),r.__H=void 0,t&&He.__e(t,r.__v))};var ca=typeof requestAnimationFrame=="function";function Dd(e){var t,r=function(){clearTimeout(n),ca&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);ca&&(t=requestAnimationFrame(r))}function us(e){var t=ee,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ee=t}function ji(e){var t=ee;e.__c=e.__(),ee=t}function so(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Xc(e,t){return typeof t=="function"?t(e):t}const Fd=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Ld,useContext:$d,useDebugValue:Td,useEffect:xd,useErrorBoundary:Pd,useId:Od,useImperativeHandle:Nd,useLayoutEffect:Kc,useMemo:no,useReducer:Qc,useRef:Ad,useState:Zc},Symbol.toStringTag,{value:"Module"})),Ls=qi(Fd);var Ur={},$s={};Object.defineProperty($s,"__esModule",{value:!0});$s.CloseIcon=void 0;const la=rt;function jd(e){return(0,la.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,la.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}$s.CloseIcon=jd;var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.CoinbaseWalletRound=void 0;const Kn=rt;function Hd(e){return(0,Kn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Kn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Kn.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,Kn.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}Ts.CoinbaseWalletRound=Hd;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.QRCodeIcon=void 0;const ln=rt;function Ud(e){return(0,ln.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,ln.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,ln.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,ln.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,ln.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Ps.QRCodeIcon=Ud;var Os={};function Yc(e){this.mode=it.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,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))}Yc.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 Mt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Mt.prototype={addData:function(e){var t=new Yc(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=Mt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=je.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var a=s*i,c=0;c<this.modules[s].length;c++){var h=c*i,d=this.modules[s][c];d&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+i,a),n.lineTo(h+i,a+i),n.lineTo(h,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=je.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var a=-2;a<=2;a++)s==-2||s==2||a==-2||a==2||s==0&&a==0?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}},setupTypeNumber:function(e){for(var t=je.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=je.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var h=!1;s<e.length&&(h=(e[s]>>>i&1)==1);var d=je.getMask(t,n,a-c);d&&(h=!h),this.modules[n][a-c]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Mt.PAD0=236;Mt.PAD1=17;Mt.createData=function(e,t,r){for(var n=St.getRSBlocks(e,t),i=new el,s=0;s<r.length;s++){var a=r[s];i.put(a.mode,4),i.put(a.getLength(),je.getLengthInBits(a.mode,e)),a.write(i)}for(var c=0,s=0;s<n.length;s++)c+=n[s].dataCount;if(i.getLengthInBits()>c*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Mt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Mt.PAD1,8);return Mt.createBytes(i,n)};Mt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c++){var h=t[c].dataCount,d=t[c].totalCount-h;n=Math.max(n,h),i=Math.max(i,d),s[c]=new Array(h);for(var f=0;f<s[c].length;f++)s[c][f]=255&e.buffer[f+r];r+=h;var g=je.getErrorCorrectPolynomial(d),b=new Tr(s[c],g.getLength()-1),S=b.mod(g);a[c]=new Array(g.getLength()-1);for(var f=0;f<a[c].length;f++){var I=f+S.getLength()-a[c].length;a[c][f]=I>=0?S.get(I):0}}for(var R=0,f=0;f<t.length;f++)R+=t[f].totalCount;for(var x=new Array(R),A=0,f=0;f<n;f++)for(var c=0;c<t.length;c++)f<s[c].length&&(x[A++]=s[c][f]);for(var f=0;f<i;f++)for(var c=0;c<t.length;c++)f<a[c].length&&(x[A++]=a[c][f]);return x};var it={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Pt={L:1,M:0,Q:3,H:2},Lt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},je={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;je.getBCHDigit(t)-je.getBCHDigit(je.G15)>=0;)t^=je.G15<<je.getBCHDigit(t)-je.getBCHDigit(je.G15);return(e<<10|t)^je.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;je.getBCHDigit(t)-je.getBCHDigit(je.G18)>=0;)t^=je.G18<<je.getBCHDigit(t)-je.getBCHDigit(je.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return je.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Lt.PATTERN000:return(t+r)%2==0;case Lt.PATTERN001:return t%2==0;case Lt.PATTERN010:return r%3==0;case Lt.PATTERN011:return(t+r)%3==0;case Lt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Lt.PATTERN101:return t*r%2+t*r%3==0;case Lt.PATTERN110:return(t*r%2+t*r%3)%2==0;case Lt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Tr([1],0),r=0;r<e;r++)t=t.multiply(new Tr([1,Ge.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case it.MODE_NUMBER:return 10;case it.MODE_ALPHA_NUM:return 9;case it.MODE_8BIT_BYTE:return 8;case it.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case it.MODE_NUMBER:return 12;case it.MODE_ALPHA_NUM:return 11;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case it.MODE_NUMBER:return 14;case it.MODE_ALPHA_NUM:return 13;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,a=e.isDark(n,i),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var h=-1;h<=1;h++)i+h<0||t<=i+h||c==0&&h==0||a==e.isDark(n+c,i+h)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var d=0;e.isDark(n,i)&&d++,e.isDark(n+1,i)&&d++,e.isDark(n,i+1)&&d++,e.isDark(n+1,i+1)&&d++,(d==0||d==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var f=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&f++;var g=Math.abs(100*f/t/t-50)/5;return r+=g*10,r}},Ge={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Ge.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Ge.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Qe=0;Qe<8;Qe++)Ge.EXP_TABLE[Qe]=1<<Qe;for(var Qe=8;Qe<256;Qe++)Ge.EXP_TABLE[Qe]=Ge.EXP_TABLE[Qe-4]^Ge.EXP_TABLE[Qe-5]^Ge.EXP_TABLE[Qe-6]^Ge.EXP_TABLE[Qe-8];for(var Qe=0;Qe<255;Qe++)Ge.LOG_TABLE[Ge.EXP_TABLE[Qe]]=Qe;function Tr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Tr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Ge.gexp(Ge.glog(this.get(r))+Ge.glog(e.get(n)));return new Tr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Ge.glog(this.get(0))-Ge.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Ge.gexp(Ge.glog(e.get(n))+t);return new Tr(r,0).mod(e)}};function St(e,t){this.totalCount=e,this.dataCount=t}St.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];St.getRSBlocks=function(e,t){var r=St.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var a=r[s*3+0],c=r[s*3+1],h=r[s*3+2],d=0;d<a;d++)i.push(new St(c,h));return i};St.getRsBlockTable=function(e,t){switch(t){case Pt.L:return St.RS_BLOCK_TABLE[(e-1)*4+0];case Pt.M:return St.RS_BLOCK_TABLE[(e-1)*4+1];case Pt.Q:return St.RS_BLOCK_TABLE[(e-1)*4+2];case Pt.H:return St.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function el(){this.buffer=[],this.length=0}el.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mi=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function tl(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Pt.L;case"M":return Pt.M;case"Q":return Pt.Q;case"H":return Pt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var f=i(h),g=1,b=0,S=0,I=mi.length;S<=I;S++){var R=mi[S];if(!R)throw new Error("Content too long: expected "+b+" but got "+f);switch(d){case"L":b=R[0];break;case"M":b=R[1];break;case"Q":b=R[2];break;case"H":b=R[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(f<=b)break;g++}if(g>mi.length)throw new Error("Content too long");return g}function i(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new Mt(a,c),this.qrcode.addData(s),this.qrcode.make()}tl.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,i=n?" ":"",s=n?`\r
1
+ import{bu as vu,c as D,B as V,bB as bu,bC as wu,bD as yu,by as qr,g as qi,bE as wn,k as lc,e as Eu,h as Su}from"./index-aa7d7c43.js";import{b as ku,c as Dt,e as uc,d as Mu,r as Ji}from"./tslib.es6-73cd0029.js";function Ru(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Gi={},mn={},ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.walletLogo=void 0;const Cu=(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 `}};ms.walletLogo=Cu;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.LINK_API_URL=void 0;_s.LINK_API_URL="https://www.walletlink.org";var O={},Zi={exports:{}};Zi.exports;(function(e){(function(t,r){function n(E,o){if(!E)throw new Error(o||"Assertion failed")}function i(E,o){E.super_=o;var u=function(){};u.prototype=o.prototype,E.prototype=new u,E.prototype.constructor=E}function s(E,o,u){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(E||0,o||10,u||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=vu.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,u){return o.cmp(u)>0?o:u},s.min=function(o,u){return o.cmp(u)<0?o:u},s.prototype._init=function(o,u,p){if(typeof o=="number")return this._initNumber(o,u,p);if(typeof o=="object")return this._initArray(o,u,p);u==="hex"&&(u=16),n(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var m=0;o[0]==="-"&&(m++,this.negative=1),m<o.length&&(u===16?this._parseHex(o,m,p):(this._parseBase(o,u,m),p==="le"&&this._initArray(this.toArray(),u,p)))},s.prototype._initNumber=function(o,u,p){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},s.prototype._initArray=function(o,u,p){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v,y,k=0;if(p==="be")for(m=o.length-1,v=0;m>=0;m-=3)y=o[m]|o[m-1]<<8|o[m-2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);else if(p==="le")for(m=0,v=0;m<o.length;m+=3)y=o[m]|o[m+1]<<8|o[m+2]<<16,this.words[v]|=y<<k&67108863,this.words[v+1]=y>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);return this._strip()};function c(E,o){var u=E.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;n(!1,"Invalid character in "+E)}function h(E,o,u){var p=c(E,u);return u-1>=o&&(p|=c(E,u-1)<<4),p}s.prototype._parseHex=function(o,u,p){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var v=0,y=0,k;if(p==="be")for(m=o.length-1;m>=u;m-=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8;else{var _=o.length-u;for(m=_%2===0?u+1:u;m<o.length;m+=2)k=h(o,u,m)<<v,this.words[y]|=k&67108863,v>=18?(v-=18,y+=1,this.words[y]|=k>>>26):v+=8}this._strip()};function d(E,o,u,p){for(var m=0,v=0,y=Math.min(E.length,u),k=o;k<y;k++){var _=E.charCodeAt(k)-48;m*=p,_>=49?v=_-49+10:_>=17?v=_-17+10:v=_,n(_>=0&&v<p,"Invalid character"),m+=v}return m}s.prototype._parseBase=function(o,u,p){this.words=[0],this.length=1;for(var m=0,v=1;v<=67108863;v*=u)m++;m--,v=v/u|0;for(var y=o.length-p,k=y%m,_=Math.min(y,y-k)+p,l=0,w=p;w<_;w+=m)l=d(o,w,w+m,u),this.imuln(v),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(k!==0){var T=1;for(l=d(o,w,o.length,u),w=0;w<k;w++)T*=u;this.imuln(T),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},s.prototype.copy=function(o){o.words=new Array(this.length);for(var u=0;u<this.length;u++)o.words[u]=this.words[u];o.length=this.length,o.negative=this.negative,o.red=this.red};function f(E,o){E.words=o.words,E.length=o.length,E.negative=o.negative,E.red=o.red}if(s.prototype._move=function(o){f(o,this)},s.prototype.clone=function(){var o=new s(null);return this.copy(o),o},s.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[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];s.prototype.toString=function(o,u){o=o||10,u=u|0||1;var p;if(o===16||o==="hex"){p="";for(var m=0,v=0,y=0;y<this.length;y++){var k=this.words[y],_=((k<<m|v)&16777215).toString(16);v=k>>>24-m&16777215,m+=2,m>=26&&(m-=26,y--),v!==0||y!==this.length-1?p=b[6-_.length]+_+p:p=_+p}for(v!==0&&(p=v.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(o===(o|0)&&o>=2&&o<=36){var l=S[o],w=I[o];p="";var T=this.clone();for(T.negative=0;!T.isZero();){var L=T.modrn(w).toString(o);T=T.idivn(w),T.isZero()?p=L+p:p=b[l-L.length]+L+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.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},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,u){return this.toArrayLike(a,o,u)}),s.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var R=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};s.prototype.toArrayLike=function(o,u,p){this._strip();var m=this.byteLength(),v=p||Math.max(1,m);n(m<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var y=R(o,v),k=u==="le"?"LE":"BE";return this["_toArrayLike"+k](y,m),y},s.prototype._toArrayLikeLE=function(o,u){for(var p=0,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p++]=k&255,p<o.length&&(o[p++]=k>>8&255),p<o.length&&(o[p++]=k>>16&255),y===6?(p<o.length&&(o[p++]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p<o.length)for(o[p++]=m;p<o.length;)o[p++]=0},s.prototype._toArrayLikeBE=function(o,u){for(var p=o.length-1,m=0,v=0,y=0;v<this.length;v++){var k=this.words[v]<<y|m;o[p--]=k&255,p>=0&&(o[p--]=k>>8&255),p>=0&&(o[p--]=k>>16&255),y===6?(p>=0&&(o[p--]=k>>24&255),m=0,y=0):(m=k>>>24,y+=2)}if(p>=0)for(o[p--]=m;p>=0;)o[p--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var u=o,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},s.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,p=0;return u&8191||(p+=13,u>>>=13),u&127||(p+=7,u>>>=7),u&15||(p+=4,u>>>=4),u&3||(p+=2,u>>>=2),u&1||p++,p},s.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function x(E){for(var o=new Array(E.bitLength()),u=0;u<o.length;u++){var p=u/26|0,m=u%26;o[u]=E.words[p]>>>m&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(o+=p,p!==26)break}return o},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},s.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var u=0;u<o.length;u++)this.words[u]=this.words[u]|o.words[u];return this._strip()},s.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},s.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&o.words[p];return this.length=u.length,this._strip()},s.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},s.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var u,p;this.length>o.length?(u=this,p=o):(u=o,p=this);for(var m=0;m<p.length;m++)this.words[m]=u.words[m]^p.words[m];if(this!==u)for(;m<u.length;m++)this.words[m]=u.words[m];return this.length=u.length,this._strip()},s.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},s.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,p=o%26;this._expand(u),p>0&&u--;for(var m=0;m<u;m++)this.words[m]=~this.words[m]&67108863;return p>0&&(this.words[m]=~this.words[m]&67108863>>26-p),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,u){n(typeof o=="number"&&o>=0);var p=o/26|0,m=o%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<m:this.words[p]=this.words[p]&~(1<<m),this._strip()},s.prototype.iadd=function(o){var u;if(this.negative!==0&&o.negative===0)return this.negative=0,u=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,u=this.isub(o),o.negative=1,u._normSign();var p,m;this.length>o.length?(p=this,m=o):(p=o,m=this);for(var v=0,y=0;y<m.length;y++)u=(p.words[y]|0)+(m.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;for(;v!==0&&y<p.length;y++)u=(p.words[y]|0)+v,this.words[y]=u&67108863,v=u>>>26;if(this.length=p.length,v!==0)this.words[this.length]=v,this.length++;else if(p!==this)for(;y<p.length;y++)this.words[y]=p.words[y];return this},s.prototype.add=function(o){var u;return o.negative!==0&&this.negative===0?(o.negative=0,u=this.sub(o),o.negative^=1,u):o.negative===0&&this.negative!==0?(this.negative=0,u=o.sub(this),this.negative=1,u):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var p=this.cmp(o);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,v;p>0?(m=this,v=o):(m=o,v=this);for(var y=0,k=0;k<v.length;k++)u=(m.words[k]|0)-(v.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;for(;y!==0&&k<m.length;k++)u=(m.words[k]|0)+y,y=u>>26,this.words[k]=u&67108863;if(y===0&&k<m.length&&m!==this)for(;k<m.length;k++)this.words[k]=m.words[k];return this.length=Math.max(this.length,k),m!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(o){return this.clone().isub(o)};function A(E,o,u){u.negative=o.negative^E.negative;var p=E.length+o.length|0;u.length=p,p=p-1|0;var m=E.words[0]|0,v=o.words[0]|0,y=m*v,k=y&67108863,_=y/67108864|0;u.words[0]=k;for(var l=1;l<p;l++){for(var w=_>>>26,T=_&67108863,L=Math.min(l,o.length-1),$=Math.max(0,l-E.length+1);$<=L;$++){var K=l-$|0;m=E.words[K]|0,v=o.words[$]|0,y=m*v+T,w+=y/67108864|0,T=y&67108863}u.words[l]=T|0,_=w|0}return _!==0?u.words[l]=_|0:u.length--,u._strip()}var C=function(o,u,p){var m=o.words,v=u.words,y=p.words,k=0,_,l,w,T=m[0]|0,L=T&8191,$=T>>>13,K=m[1]|0,Q=K&8191,X=K>>>13,rn=m[2]|0,Ce=rn&8191,Ie=rn>>>13,nn=m[3]|0,xe=nn&8191,Ae=nn>>>13,sn=m[4]|0,Ne=sn&8191,Le=sn>>>13,on=m[5]|0,$e=on&8191,Te=on>>>13,an=m[6]|0,Pe=an&8191,Oe=an>>>13,cn=m[7]|0,Be=cn&8191,De=cn>>>13,gr=m[8]|0,ne=gr&8191,se=gr>>>13,mr=m[9]|0,ie=mr&8191,oe=mr>>>13,_r=v[0]|0,ae=_r&8191,ce=_r>>>13,vr=v[1]|0,le=vr&8191,ue=vr>>>13,br=v[2]|0,he=br&8191,de=br>>>13,wr=v[3]|0,fe=wr&8191,pe=wr>>>13,yr=v[4]|0,ge=yr&8191,me=yr>>>13,Er=v[5]|0,_e=Er&8191,ve=Er>>>13,Sr=v[6]|0,be=Sr&8191,we=Sr>>>13,kr=v[7]|0,ye=kr&8191,Ee=kr>>>13,Mr=v[8]|0,Se=Mr&8191,ke=Mr>>>13,Rr=v[9]|0,Me=Rr&8191,Re=Rr>>>13;p.negative=o.negative^u.negative,p.length=19,_=Math.imul(L,ae),l=Math.imul(L,ce),l=l+Math.imul($,ae)|0,w=Math.imul($,ce);var Ft=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,_=Math.imul(Q,ae),l=Math.imul(Q,ce),l=l+Math.imul(X,ae)|0,w=Math.imul(X,ce),_=_+Math.imul(L,le)|0,l=l+Math.imul(L,ue)|0,l=l+Math.imul($,le)|0,w=w+Math.imul($,ue)|0;var jt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(jt>>>26)|0,jt&=67108863,_=Math.imul(Ce,ae),l=Math.imul(Ce,ce),l=l+Math.imul(Ie,ae)|0,w=Math.imul(Ie,ce),_=_+Math.imul(Q,le)|0,l=l+Math.imul(Q,ue)|0,l=l+Math.imul(X,le)|0,w=w+Math.imul(X,ue)|0,_=_+Math.imul(L,he)|0,l=l+Math.imul(L,de)|0,l=l+Math.imul($,he)|0,w=w+Math.imul($,de)|0;var Ht=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,_=Math.imul(xe,ae),l=Math.imul(xe,ce),l=l+Math.imul(Ae,ae)|0,w=Math.imul(Ae,ce),_=_+Math.imul(Ce,le)|0,l=l+Math.imul(Ce,ue)|0,l=l+Math.imul(Ie,le)|0,w=w+Math.imul(Ie,ue)|0,_=_+Math.imul(Q,he)|0,l=l+Math.imul(Q,de)|0,l=l+Math.imul(X,he)|0,w=w+Math.imul(X,de)|0,_=_+Math.imul(L,fe)|0,l=l+Math.imul(L,pe)|0,l=l+Math.imul($,fe)|0,w=w+Math.imul($,pe)|0;var Ut=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,_=Math.imul(Ne,ae),l=Math.imul(Ne,ce),l=l+Math.imul(Le,ae)|0,w=Math.imul(Le,ce),_=_+Math.imul(xe,le)|0,l=l+Math.imul(xe,ue)|0,l=l+Math.imul(Ae,le)|0,w=w+Math.imul(Ae,ue)|0,_=_+Math.imul(Ce,he)|0,l=l+Math.imul(Ce,de)|0,l=l+Math.imul(Ie,he)|0,w=w+Math.imul(Ie,de)|0,_=_+Math.imul(Q,fe)|0,l=l+Math.imul(Q,pe)|0,l=l+Math.imul(X,fe)|0,w=w+Math.imul(X,pe)|0,_=_+Math.imul(L,ge)|0,l=l+Math.imul(L,me)|0,l=l+Math.imul($,ge)|0,w=w+Math.imul($,me)|0;var Vt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,_=Math.imul($e,ae),l=Math.imul($e,ce),l=l+Math.imul(Te,ae)|0,w=Math.imul(Te,ce),_=_+Math.imul(Ne,le)|0,l=l+Math.imul(Ne,ue)|0,l=l+Math.imul(Le,le)|0,w=w+Math.imul(Le,ue)|0,_=_+Math.imul(xe,he)|0,l=l+Math.imul(xe,de)|0,l=l+Math.imul(Ae,he)|0,w=w+Math.imul(Ae,de)|0,_=_+Math.imul(Ce,fe)|0,l=l+Math.imul(Ce,pe)|0,l=l+Math.imul(Ie,fe)|0,w=w+Math.imul(Ie,pe)|0,_=_+Math.imul(Q,ge)|0,l=l+Math.imul(Q,me)|0,l=l+Math.imul(X,ge)|0,w=w+Math.imul(X,me)|0,_=_+Math.imul(L,_e)|0,l=l+Math.imul(L,ve)|0,l=l+Math.imul($,_e)|0,w=w+Math.imul($,ve)|0;var zt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(zt>>>26)|0,zt&=67108863,_=Math.imul(Pe,ae),l=Math.imul(Pe,ce),l=l+Math.imul(Oe,ae)|0,w=Math.imul(Oe,ce),_=_+Math.imul($e,le)|0,l=l+Math.imul($e,ue)|0,l=l+Math.imul(Te,le)|0,w=w+Math.imul(Te,ue)|0,_=_+Math.imul(Ne,he)|0,l=l+Math.imul(Ne,de)|0,l=l+Math.imul(Le,he)|0,w=w+Math.imul(Le,de)|0,_=_+Math.imul(xe,fe)|0,l=l+Math.imul(xe,pe)|0,l=l+Math.imul(Ae,fe)|0,w=w+Math.imul(Ae,pe)|0,_=_+Math.imul(Ce,ge)|0,l=l+Math.imul(Ce,me)|0,l=l+Math.imul(Ie,ge)|0,w=w+Math.imul(Ie,me)|0,_=_+Math.imul(Q,_e)|0,l=l+Math.imul(Q,ve)|0,l=l+Math.imul(X,_e)|0,w=w+Math.imul(X,ve)|0,_=_+Math.imul(L,be)|0,l=l+Math.imul(L,we)|0,l=l+Math.imul($,be)|0,w=w+Math.imul($,we)|0;var Wt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,_=Math.imul(Be,ae),l=Math.imul(Be,ce),l=l+Math.imul(De,ae)|0,w=Math.imul(De,ce),_=_+Math.imul(Pe,le)|0,l=l+Math.imul(Pe,ue)|0,l=l+Math.imul(Oe,le)|0,w=w+Math.imul(Oe,ue)|0,_=_+Math.imul($e,he)|0,l=l+Math.imul($e,de)|0,l=l+Math.imul(Te,he)|0,w=w+Math.imul(Te,de)|0,_=_+Math.imul(Ne,fe)|0,l=l+Math.imul(Ne,pe)|0,l=l+Math.imul(Le,fe)|0,w=w+Math.imul(Le,pe)|0,_=_+Math.imul(xe,ge)|0,l=l+Math.imul(xe,me)|0,l=l+Math.imul(Ae,ge)|0,w=w+Math.imul(Ae,me)|0,_=_+Math.imul(Ce,_e)|0,l=l+Math.imul(Ce,ve)|0,l=l+Math.imul(Ie,_e)|0,w=w+Math.imul(Ie,ve)|0,_=_+Math.imul(Q,be)|0,l=l+Math.imul(Q,we)|0,l=l+Math.imul(X,be)|0,w=w+Math.imul(X,we)|0,_=_+Math.imul(L,ye)|0,l=l+Math.imul(L,Ee)|0,l=l+Math.imul($,ye)|0,w=w+Math.imul($,Ee)|0;var qt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(qt>>>26)|0,qt&=67108863,_=Math.imul(ne,ae),l=Math.imul(ne,ce),l=l+Math.imul(se,ae)|0,w=Math.imul(se,ce),_=_+Math.imul(Be,le)|0,l=l+Math.imul(Be,ue)|0,l=l+Math.imul(De,le)|0,w=w+Math.imul(De,ue)|0,_=_+Math.imul(Pe,he)|0,l=l+Math.imul(Pe,de)|0,l=l+Math.imul(Oe,he)|0,w=w+Math.imul(Oe,de)|0,_=_+Math.imul($e,fe)|0,l=l+Math.imul($e,pe)|0,l=l+Math.imul(Te,fe)|0,w=w+Math.imul(Te,pe)|0,_=_+Math.imul(Ne,ge)|0,l=l+Math.imul(Ne,me)|0,l=l+Math.imul(Le,ge)|0,w=w+Math.imul(Le,me)|0,_=_+Math.imul(xe,_e)|0,l=l+Math.imul(xe,ve)|0,l=l+Math.imul(Ae,_e)|0,w=w+Math.imul(Ae,ve)|0,_=_+Math.imul(Ce,be)|0,l=l+Math.imul(Ce,we)|0,l=l+Math.imul(Ie,be)|0,w=w+Math.imul(Ie,we)|0,_=_+Math.imul(Q,ye)|0,l=l+Math.imul(Q,Ee)|0,l=l+Math.imul(X,ye)|0,w=w+Math.imul(X,Ee)|0,_=_+Math.imul(L,Se)|0,l=l+Math.imul(L,ke)|0,l=l+Math.imul($,Se)|0,w=w+Math.imul($,ke)|0;var Jt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,_=Math.imul(ie,ae),l=Math.imul(ie,ce),l=l+Math.imul(oe,ae)|0,w=Math.imul(oe,ce),_=_+Math.imul(ne,le)|0,l=l+Math.imul(ne,ue)|0,l=l+Math.imul(se,le)|0,w=w+Math.imul(se,ue)|0,_=_+Math.imul(Be,he)|0,l=l+Math.imul(Be,de)|0,l=l+Math.imul(De,he)|0,w=w+Math.imul(De,de)|0,_=_+Math.imul(Pe,fe)|0,l=l+Math.imul(Pe,pe)|0,l=l+Math.imul(Oe,fe)|0,w=w+Math.imul(Oe,pe)|0,_=_+Math.imul($e,ge)|0,l=l+Math.imul($e,me)|0,l=l+Math.imul(Te,ge)|0,w=w+Math.imul(Te,me)|0,_=_+Math.imul(Ne,_e)|0,l=l+Math.imul(Ne,ve)|0,l=l+Math.imul(Le,_e)|0,w=w+Math.imul(Le,ve)|0,_=_+Math.imul(xe,be)|0,l=l+Math.imul(xe,we)|0,l=l+Math.imul(Ae,be)|0,w=w+Math.imul(Ae,we)|0,_=_+Math.imul(Ce,ye)|0,l=l+Math.imul(Ce,Ee)|0,l=l+Math.imul(Ie,ye)|0,w=w+Math.imul(Ie,Ee)|0,_=_+Math.imul(Q,Se)|0,l=l+Math.imul(Q,ke)|0,l=l+Math.imul(X,Se)|0,w=w+Math.imul(X,ke)|0,_=_+Math.imul(L,Me)|0,l=l+Math.imul(L,Re)|0,l=l+Math.imul($,Me)|0,w=w+Math.imul($,Re)|0;var Gt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,_=Math.imul(ie,le),l=Math.imul(ie,ue),l=l+Math.imul(oe,le)|0,w=Math.imul(oe,ue),_=_+Math.imul(ne,he)|0,l=l+Math.imul(ne,de)|0,l=l+Math.imul(se,he)|0,w=w+Math.imul(se,de)|0,_=_+Math.imul(Be,fe)|0,l=l+Math.imul(Be,pe)|0,l=l+Math.imul(De,fe)|0,w=w+Math.imul(De,pe)|0,_=_+Math.imul(Pe,ge)|0,l=l+Math.imul(Pe,me)|0,l=l+Math.imul(Oe,ge)|0,w=w+Math.imul(Oe,me)|0,_=_+Math.imul($e,_e)|0,l=l+Math.imul($e,ve)|0,l=l+Math.imul(Te,_e)|0,w=w+Math.imul(Te,ve)|0,_=_+Math.imul(Ne,be)|0,l=l+Math.imul(Ne,we)|0,l=l+Math.imul(Le,be)|0,w=w+Math.imul(Le,we)|0,_=_+Math.imul(xe,ye)|0,l=l+Math.imul(xe,Ee)|0,l=l+Math.imul(Ae,ye)|0,w=w+Math.imul(Ae,Ee)|0,_=_+Math.imul(Ce,Se)|0,l=l+Math.imul(Ce,ke)|0,l=l+Math.imul(Ie,Se)|0,w=w+Math.imul(Ie,ke)|0,_=_+Math.imul(Q,Me)|0,l=l+Math.imul(Q,Re)|0,l=l+Math.imul(X,Me)|0,w=w+Math.imul(X,Re)|0;var Zt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,_=Math.imul(ie,he),l=Math.imul(ie,de),l=l+Math.imul(oe,he)|0,w=Math.imul(oe,de),_=_+Math.imul(ne,fe)|0,l=l+Math.imul(ne,pe)|0,l=l+Math.imul(se,fe)|0,w=w+Math.imul(se,pe)|0,_=_+Math.imul(Be,ge)|0,l=l+Math.imul(Be,me)|0,l=l+Math.imul(De,ge)|0,w=w+Math.imul(De,me)|0,_=_+Math.imul(Pe,_e)|0,l=l+Math.imul(Pe,ve)|0,l=l+Math.imul(Oe,_e)|0,w=w+Math.imul(Oe,ve)|0,_=_+Math.imul($e,be)|0,l=l+Math.imul($e,we)|0,l=l+Math.imul(Te,be)|0,w=w+Math.imul(Te,we)|0,_=_+Math.imul(Ne,ye)|0,l=l+Math.imul(Ne,Ee)|0,l=l+Math.imul(Le,ye)|0,w=w+Math.imul(Le,Ee)|0,_=_+Math.imul(xe,Se)|0,l=l+Math.imul(xe,ke)|0,l=l+Math.imul(Ae,Se)|0,w=w+Math.imul(Ae,ke)|0,_=_+Math.imul(Ce,Me)|0,l=l+Math.imul(Ce,Re)|0,l=l+Math.imul(Ie,Me)|0,w=w+Math.imul(Ie,Re)|0;var Qt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,_=Math.imul(ie,fe),l=Math.imul(ie,pe),l=l+Math.imul(oe,fe)|0,w=Math.imul(oe,pe),_=_+Math.imul(ne,ge)|0,l=l+Math.imul(ne,me)|0,l=l+Math.imul(se,ge)|0,w=w+Math.imul(se,me)|0,_=_+Math.imul(Be,_e)|0,l=l+Math.imul(Be,ve)|0,l=l+Math.imul(De,_e)|0,w=w+Math.imul(De,ve)|0,_=_+Math.imul(Pe,be)|0,l=l+Math.imul(Pe,we)|0,l=l+Math.imul(Oe,be)|0,w=w+Math.imul(Oe,we)|0,_=_+Math.imul($e,ye)|0,l=l+Math.imul($e,Ee)|0,l=l+Math.imul(Te,ye)|0,w=w+Math.imul(Te,Ee)|0,_=_+Math.imul(Ne,Se)|0,l=l+Math.imul(Ne,ke)|0,l=l+Math.imul(Le,Se)|0,w=w+Math.imul(Le,ke)|0,_=_+Math.imul(xe,Me)|0,l=l+Math.imul(xe,Re)|0,l=l+Math.imul(Ae,Me)|0,w=w+Math.imul(Ae,Re)|0;var Kt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,_=Math.imul(ie,ge),l=Math.imul(ie,me),l=l+Math.imul(oe,ge)|0,w=Math.imul(oe,me),_=_+Math.imul(ne,_e)|0,l=l+Math.imul(ne,ve)|0,l=l+Math.imul(se,_e)|0,w=w+Math.imul(se,ve)|0,_=_+Math.imul(Be,be)|0,l=l+Math.imul(Be,we)|0,l=l+Math.imul(De,be)|0,w=w+Math.imul(De,we)|0,_=_+Math.imul(Pe,ye)|0,l=l+Math.imul(Pe,Ee)|0,l=l+Math.imul(Oe,ye)|0,w=w+Math.imul(Oe,Ee)|0,_=_+Math.imul($e,Se)|0,l=l+Math.imul($e,ke)|0,l=l+Math.imul(Te,Se)|0,w=w+Math.imul(Te,ke)|0,_=_+Math.imul(Ne,Me)|0,l=l+Math.imul(Ne,Re)|0,l=l+Math.imul(Le,Me)|0,w=w+Math.imul(Le,Re)|0;var Xt=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,_=Math.imul(ie,_e),l=Math.imul(ie,ve),l=l+Math.imul(oe,_e)|0,w=Math.imul(oe,ve),_=_+Math.imul(ne,be)|0,l=l+Math.imul(ne,we)|0,l=l+Math.imul(se,be)|0,w=w+Math.imul(se,we)|0,_=_+Math.imul(Be,ye)|0,l=l+Math.imul(Be,Ee)|0,l=l+Math.imul(De,ye)|0,w=w+Math.imul(De,Ee)|0,_=_+Math.imul(Pe,Se)|0,l=l+Math.imul(Pe,ke)|0,l=l+Math.imul(Oe,Se)|0,w=w+Math.imul(Oe,ke)|0,_=_+Math.imul($e,Me)|0,l=l+Math.imul($e,Re)|0,l=l+Math.imul(Te,Me)|0,w=w+Math.imul(Te,Re)|0;var ui=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(ui>>>26)|0,ui&=67108863,_=Math.imul(ie,be),l=Math.imul(ie,we),l=l+Math.imul(oe,be)|0,w=Math.imul(oe,we),_=_+Math.imul(ne,ye)|0,l=l+Math.imul(ne,Ee)|0,l=l+Math.imul(se,ye)|0,w=w+Math.imul(se,Ee)|0,_=_+Math.imul(Be,Se)|0,l=l+Math.imul(Be,ke)|0,l=l+Math.imul(De,Se)|0,w=w+Math.imul(De,ke)|0,_=_+Math.imul(Pe,Me)|0,l=l+Math.imul(Pe,Re)|0,l=l+Math.imul(Oe,Me)|0,w=w+Math.imul(Oe,Re)|0;var hi=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(hi>>>26)|0,hi&=67108863,_=Math.imul(ie,ye),l=Math.imul(ie,Ee),l=l+Math.imul(oe,ye)|0,w=Math.imul(oe,Ee),_=_+Math.imul(ne,Se)|0,l=l+Math.imul(ne,ke)|0,l=l+Math.imul(se,Se)|0,w=w+Math.imul(se,ke)|0,_=_+Math.imul(Be,Me)|0,l=l+Math.imul(Be,Re)|0,l=l+Math.imul(De,Me)|0,w=w+Math.imul(De,Re)|0;var di=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(di>>>26)|0,di&=67108863,_=Math.imul(ie,Se),l=Math.imul(ie,ke),l=l+Math.imul(oe,Se)|0,w=Math.imul(oe,ke),_=_+Math.imul(ne,Me)|0,l=l+Math.imul(ne,Re)|0,l=l+Math.imul(se,Me)|0,w=w+Math.imul(se,Re)|0;var fi=(k+_|0)+((l&8191)<<13)|0;k=(w+(l>>>13)|0)+(fi>>>26)|0,fi&=67108863,_=Math.imul(ie,Me),l=Math.imul(ie,Re),l=l+Math.imul(oe,Me)|0,w=Math.imul(oe,Re);var pi=(k+_|0)+((l&8191)<<13)|0;return k=(w+(l>>>13)|0)+(pi>>>26)|0,pi&=67108863,y[0]=Ft,y[1]=jt,y[2]=Ht,y[3]=Ut,y[4]=Vt,y[5]=zt,y[6]=Wt,y[7]=qt,y[8]=Jt,y[9]=Gt,y[10]=Zt,y[11]=Qt,y[12]=Kt,y[13]=Xt,y[14]=ui,y[15]=hi,y[16]=di,y[17]=fi,y[18]=pi,k!==0&&(y[19]=k,p.length++),p};Math.imul||(C=A);function M(E,o,u){u.negative=o.negative^E.negative,u.length=E.length+o.length;for(var p=0,m=0,v=0;v<u.length-1;v++){var y=m;m=0;for(var k=p&67108863,_=Math.min(v,o.length-1),l=Math.max(0,v-E.length+1);l<=_;l++){var w=v-l,T=E.words[w]|0,L=o.words[l]|0,$=T*L,K=$&67108863;y=y+($/67108864|0)|0,K=K+k|0,k=K&67108863,y=y+(K>>>26)|0,m+=y>>>26,y&=67108863}u.words[v]=k,p=y,y=m}return p!==0?u.words[v]=p:u.length--,u._strip()}function B(E,o,u){return M(E,o,u)}s.prototype.mulTo=function(o,u){var p,m=this.length+o.length;return this.length===10&&o.length===10?p=C(this,o,u):m<63?p=A(this,o,u):m<1024?p=M(this,o,u):p=B(this,o,u),p},s.prototype.mul=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},s.prototype.mulf=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),B(this,o,u)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var u=o<0;u&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var p=0,m=0;m<this.length;m++){var v=(this.words[m]|0)*o,y=(v&67108863)+(p&67108863);p>>=26,p+=v/67108864|0,p+=y>>>26,this.words[m]=y&67108863}return p!==0&&(this.words[m]=p,this.length++),this.length=o===0?1:this.length,u?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var u=x(o);if(u.length===0)return new s(1);for(var p=this,m=0;m<u.length&&u[m]===0;m++,p=p.sqr());if(++m<u.length)for(var v=p.sqr();m<u.length;m++,v=v.sqr())u[m]!==0&&(p=p.mul(v));return p},s.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=67108863>>>26-u<<26-u,v;if(u!==0){var y=0;for(v=0;v<this.length;v++){var k=this.words[v]&m,_=(this.words[v]|0)-k<<u;this.words[v]=_|y,y=k>>>26-u}y&&(this.words[v]=y,this.length++)}if(p!==0){for(v=this.length-1;v>=0;v--)this.words[v+p]=this.words[v];for(v=0;v<p;v++)this.words[v]=0;this.length+=p}return this._strip()},s.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},s.prototype.iushrn=function(o,u,p){n(typeof o=="number"&&o>=0);var m;u?m=(u-u%26)/26:m=0;var v=o%26,y=Math.min((o-v)/26,this.length),k=67108863^67108863>>>v<<v,_=p;if(m-=y,m=Math.max(0,m),_){for(var l=0;l<y;l++)_.words[l]=this.words[l];_.length=y}if(y!==0)if(this.length>y)for(this.length-=y,l=0;l<this.length;l++)this.words[l]=this.words[l+y];else this.words[0]=0,this.length=1;var w=0;for(l=this.length-1;l>=0&&(w!==0||l>=m);l--){var T=this.words[l]|0;this.words[l]=w<<26-v|T>>>v,w=T&k}return _&&w!==0&&(_.words[_.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,u,p){return n(this.negative===0),this.iushrn(o,u,p)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return!1;var v=this.words[p];return!!(v&m)},s.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var m=67108863^67108863>>>u<<u;this.words[this.length-1]&=m}return this._strip()},s.prototype.maskn=function(o){return this.clone().imaskn(o)},s.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)},s.prototype._iaddn=function(o){this.words[0]+=o;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},s.prototype.addn=function(o){return this.clone().iaddn(o)},s.prototype.subn=function(o){return this.clone().isubn(o)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(o,u,p){var m=o.length+p,v;this._expand(m);var y,k=0;for(v=0;v<o.length;v++){y=(this.words[v+p]|0)+k;var _=(o.words[v]|0)*u;y-=_&67108863,k=(y>>26)-(_/67108864|0),this.words[v+p]=y&67108863}for(;v<this.length-p;v++)y=(this.words[v+p]|0)+k,k=y>>26,this.words[v+p]=y&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,v=0;v<this.length;v++)y=-(this.words[v]|0)+k,k=y>>26,this.words[v]=y&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,u){var p=this.length-o.length,m=this.clone(),v=o,y=v.words[v.length-1]|0,k=this._countBits(y);p=26-k,p!==0&&(v=v.ushln(p),m.iushln(p),y=v.words[v.length-1]|0);var _=m.length-v.length,l;if(u!=="mod"){l=new s(null),l.length=_+1,l.words=new Array(l.length);for(var w=0;w<l.length;w++)l.words[w]=0}var T=m.clone()._ishlnsubmul(v,1,_);T.negative===0&&(m=T,l&&(l.words[_]=1));for(var L=_-1;L>=0;L--){var $=(m.words[v.length+L]|0)*67108864+(m.words[v.length+L-1]|0);for($=Math.min($/y|0,67108863),m._ishlnsubmul(v,$,L);m.negative!==0;)$--,m.negative=0,m._ishlnsubmul(v,1,L),m.isZero()||(m.negative^=1);l&&(l.words[L]=$)}return l&&l._strip(),m._strip(),u!=="div"&&p!==0&&m.iushrn(p),{div:l||null,mod:m}},s.prototype.divmod=function(o,u,p){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,v,y;return this.negative!==0&&o.negative===0?(y=this.neg().divmod(o,u),u!=="mod"&&(m=y.div.neg()),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.iadd(o)),{div:m,mod:v}):this.negative===0&&o.negative!==0?(y=this.divmod(o.neg(),u),u!=="mod"&&(m=y.div.neg()),{div:m,mod:y.mod}):this.negative&o.negative?(y=this.neg().divmod(o.neg(),u),u!=="div"&&(v=y.mod.neg(),p&&v.negative!==0&&v.isub(o)),{div:y.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,u)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(o):u.mod,m=o.ushrn(1),v=o.andln(1),y=p.cmp(m);return y<0||v===1&&y===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},s.prototype.modrn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=(1<<26)%o,m=0,v=this.length-1;v>=0;v--)m=(p*m+(this.words[v]|0))%o;return u?-m:m},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=0,m=this.length-1;m>=0;m--){var v=(this.words[m]|0)+p*67108864;this.words[m]=v/o|0,p=v%o}return this._strip(),u?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new s(1),v=new s(0),y=new s(0),k=new s(1),_=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++_;for(var l=p.clone(),w=u.clone();!u.isZero();){for(var T=0,L=1;!(u.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(u.iushrn(T);T-- >0;)(m.isOdd()||v.isOdd())&&(m.iadd(l),v.isub(w)),m.iushrn(1),v.iushrn(1);for(var $=0,K=1;!(p.words[0]&K)&&$<26;++$,K<<=1);if($>0)for(p.iushrn($);$-- >0;)(y.isOdd()||k.isOdd())&&(y.iadd(l),k.isub(w)),y.iushrn(1),k.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(y),v.isub(k)):(p.isub(u),y.isub(m),k.isub(v))}return{a:y,b:k,gcd:p.iushln(_)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var m=new s(1),v=new s(0),y=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var k=0,_=1;!(u.words[0]&_)&&k<26;++k,_<<=1);if(k>0)for(u.iushrn(k);k-- >0;)m.isOdd()&&m.iadd(y),m.iushrn(1);for(var l=0,w=1;!(p.words[0]&w)&&l<26;++l,w<<=1);if(l>0)for(p.iushrn(l);l-- >0;)v.isOdd()&&v.iadd(y),v.iushrn(1);u.cmp(p)>=0?(u.isub(p),m.isub(v)):(p.isub(u),v.isub(m))}var T;return u.cmpn(1)===0?T=m:T=v,T.cmpn(0)<0&&T.iadd(o),T},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),p=o.clone();u.negative=0,p.negative=0;for(var m=0;u.isEven()&&p.isEven();m++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var v=u.cmp(p);if(v<0){var y=u;u=p,p=y}else if(v===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(m)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var u=o%26,p=(o-u)/26,m=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=m,this;for(var v=m,y=p;v!==0&&y<this.length;y++){var k=this.words[y]|0;k+=v,v=k>>>26,k&=67108863,this.words[y]=k}return v!==0&&(this.words[y]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(o=-o),n(o<=67108863,"Number is too big");var m=this.words[0]|0;p=m===o?0:m<o?-1:1}return this.negative!==0?-p|0:p},s.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var u=this.ucmp(o);return this.negative!==0?-u|0:u},s.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var m=this.words[p]|0,v=o.words[p]|0;if(m!==v){m<v?u=-1:m>v&&(u=1);break}}return u},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new F(o)},s.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)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var N={k256:null,p224:null,p192:null,p25519:null};function P(E,o){this.name=E,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},P.prototype.ireduce=function(o){var u=o,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var m=p<this.n?-1:u.ucmp(this.p);return m===0?(u.words[0]=0,u.length=1):m>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},P.prototype.split=function(o,u){o.iushrn(this.n,0,u)},P.prototype.imulK=function(o){return o.imul(this.k)};function W(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(W,P),W.prototype.split=function(o,u){for(var p=4194303,m=Math.min(o.length,9),v=0;v<m;v++)u.words[v]=o.words[v];if(u.length=m,o.length<=9){o.words[0]=0,o.length=1;return}var y=o.words[9];for(u.words[u.length++]=y&p,v=10;v<o.length;v++){var k=o.words[v]|0;o.words[v-10]=(k&p)<<4|y>>>22,y=k}y>>>=22,o.words[v-10]=y,y===0&&o.length>10?o.length-=10:o.length-=9},W.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,p=0;p<o.length;p++){var m=o.words[p]|0;u+=m*977,o.words[p]=u&67108863,u=m*64+(u/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function Y(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Y,P);function re(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(re,P);function Z(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Z,P),Z.prototype.imulK=function(o){for(var u=0,p=0;p<o.length;p++){var m=(o.words[p]|0)*19+u,v=m&67108863;m>>>=26,o.words[p]=v,u=m}return u!==0&&(o.words[o.length++]=u),o},s._prime=function(o){if(N[o])return N[o];var u;if(o==="k256")u=new W;else if(o==="p224")u=new Y;else if(o==="p192")u=new re;else if(o==="p25519")u=new Z;else throw new Error("Unknown prime "+o);return N[o]=u,u};function F(E){if(typeof E=="string"){var o=s._prime(E);this.m=o.p,this.prime=o}else n(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}F.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},F.prototype._verify2=function(o,u){n((o.negative|u.negative)===0,"red works only with positives"),n(o.red&&o.red===u.red,"red works only with red numbers")},F.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(f(o,o.umod(this.m)._forceRed(this)),o)},F.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},F.prototype.add=function(o,u){this._verify2(o,u);var p=o.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},F.prototype.iadd=function(o,u){this._verify2(o,u);var p=o.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},F.prototype.sub=function(o,u){this._verify2(o,u);var p=o.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},F.prototype.isub=function(o,u){this._verify2(o,u);var p=o.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},F.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},F.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},F.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},F.prototype.isqr=function(o){return this.imul(o,o.clone())},F.prototype.sqr=function(o){return this.mul(o,o)},F.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(n(u%2===1),u===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(o,p)}for(var m=this.m.subn(1),v=0;!m.isZero()&&m.andln(1)===0;)v++,m.iushrn(1);n(!m.isZero());var y=new s(1).toRed(this),k=y.redNeg(),_=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);this.pow(l,_).cmp(k)!==0;)l.redIAdd(k);for(var w=this.pow(l,m),T=this.pow(o,m.addn(1).iushrn(1)),L=this.pow(o,m),$=v;L.cmp(y)!==0;){for(var K=L,Q=0;K.cmp(y)!==0;Q++)K=K.redSqr();n(Q<$);var X=this.pow(w,new s(1).iushln($-Q-1));T=T.redMul(X),w=X.redSqr(),L=L.redMul(w),$=Q}return T},F.prototype.invm=function(o){var u=o._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},F.prototype.pow=function(o,u){if(u.isZero())return new s(1).toRed(this);if(u.cmpn(1)===0)return o.clone();var p=4,m=new Array(1<<p);m[0]=new s(1).toRed(this),m[1]=o;for(var v=2;v<m.length;v++)m[v]=this.mul(m[v-1],o);var y=m[0],k=0,_=0,l=u.bitLength()%26;for(l===0&&(l=26),v=u.length-1;v>=0;v--){for(var w=u.words[v],T=l-1;T>=0;T--){var L=w>>T&1;if(y!==m[0]&&(y=this.sqr(y)),L===0&&k===0){_=0;continue}k<<=1,k|=L,_++,!(_!==p&&(v!==0||T!==0))&&(y=this.mul(y,m[k]),_=0,k=0)}l=26}return y},F.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},F.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},s.mont=function(o){return new U(o)};function U(E){F.call(this,E),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}i(U,F),U.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},U.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},U.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var p=o.imul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},U.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new s(0)._forceRed(this);var p=o.mul(u),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(m).iushrn(this.shift),y=v;return v.cmp(this.m)>=0?y=v.isub(this.m):v.cmpn(0)<0&&(y=v.iadd(this.m)),y._forceRed(this)},U.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,D)})(Zi);var vs=Zi.exports,yn={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.errorValues=At.standardErrorCodes=void 0;At.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};At.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var bs={},ws={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=At,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(b,S=r){if(b&&Number.isInteger(b)){const I=b.toString();if(f(t.errorValues,I))return t.errorValues[I].message;if(h(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return S}e.getMessageFromCode=n;function i(b){if(!Number.isInteger(b))return!1;const S=b.toString();return!!(t.errorValues[S]||h(b))}e.isValidCode=i;function s(b){var S;if(typeof b=="number")return b;if(a(b))return(S=b.code)!==null&&S!==void 0?S:b.errorCode}e.getErrorCode=s;function a(b){return typeof b=="object"&&b!==null&&(typeof b.code=="number"||typeof b.errorCode=="number")}function c(b,{shouldIncludeStack:S=!1}={}){const I={};if(b&&typeof b=="object"&&!Array.isArray(b)&&f(b,"code")&&i(b.code)){const R=b;I.code=R.code,R.message&&typeof R.message=="string"?(I.message=R.message,f(R,"data")&&(I.data=R.data)):(I.message=n(I.code),I.data={originalError:d(b)})}else I.code=t.standardErrorCodes.rpc.internal,I.message=g(b,"message")?b.message:r,I.data={originalError:d(b)};return S&&(I.stack=g(b,"stack")?b.stack:void 0),I}e.serialize=c;function h(b){return b>=-32099&&b<=-32e3}function d(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function f(b,S){return Object.prototype.hasOwnProperty.call(b,S)}function g(b,S){return typeof b=="object"&&b!==null&&S in b&&typeof b[S]=="string"}})(ws);Object.defineProperty(bs,"__esModule",{value:!0});bs.standardErrors=void 0;const Ze=At,hc=ws;bs.standardErrors={rpc:{parse:e=>at(Ze.standardErrorCodes.rpc.parse,e),invalidRequest:e=>at(Ze.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>at(Ze.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>at(Ze.standardErrorCodes.rpc.methodNotFound,e),internal:e=>at(Ze.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return at(t,e)},invalidInput:e=>at(Ze.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>at(Ze.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>at(Ze.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>at(Ze.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>at(Ze.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>at(Ze.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Cr(Ze.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Cr(Ze.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Cr(Ze.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Cr(Ze.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Cr(Ze.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Cr(Ze.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new pc(t,r,n)}}};function at(e,t){const[r,n]=dc(t);return new fc(e,r||(0,hc.getMessageFromCode)(e),n)}function Cr(e,t){const[r,n]=dc(t);return new pc(e,r||(0,hc.getMessageFromCode)(e),n)}function dc(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 fc=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)}},pc=class extends fc{constructor(t,r,n){if(!Iu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Iu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ys={},Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isErrorResponse=void 0;function xu(e){return e.errorMessage!==void 0}Jr.isErrorResponse=xu;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.LIB_VERSION=void 0;Gr.LIB_VERSION="3.9.3";Object.defineProperty(ys,"__esModule",{value:!0});ys.serializeError=void 0;const Au=Jr,Nu=Gr,Lu=At,$u=ws;function Tu(e,t){const r=(0,$u.serialize)(Pu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Nu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Ou(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ys.serializeError=Tu;function Pu(e){return typeof e=="string"?{message:e,code:Lu.standardErrorCodes.rpc.internal}:(0,Au.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Ou(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=At;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=bs;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ys;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=ws;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(yn);var We={};Object.defineProperty(We,"__esModule",{value:!0});We.ProviderType=We.RegExpString=We.IntNumber=We.BigIntString=We.AddressString=We.HexString=We.OpaqueType=void 0;function En(){return e=>e}We.OpaqueType=En;We.HexString=En();We.AddressString=En();We.BigIntString=En();function Bu(e){return Math.floor(e)}We.IntNumber=Bu;We.RegExpString=En();var Do;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Do||(We.ProviderType=Do={}));var Du=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(O,"__esModule",{value:!0});O.isMobileWeb=O.getLocation=O.isInIFrame=O.createQrUrl=O.getFavicon=O.range=O.isBigNumber=O.ensureParsedJSONObject=O.ensureBN=O.ensureRegExpString=O.ensureIntNumber=O.ensureBuffer=O.ensureAddressString=O.ensureEvenLengthHexString=O.ensureHexString=O.isHexString=O.prepend0x=O.strip0x=O.has0xPrefix=O.hexStringFromIntNumber=O.intNumberFromHexString=O.bigIntStringFromBN=O.hexStringFromBuffer=O.hexStringToUint8Array=O.uint8ArrayToHex=O.randomBytesHex=void 0;const Tt=Du(vs),hr=yn,ht=We,gc=/^[0-9]*$/,mc=/^[a-f0-9]*$/;function Fu(e){return _c(crypto.getRandomValues(new Uint8Array(e)))}O.randomBytesHex=Fu;function _c(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=_c;function ju(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}O.hexStringToUint8Array=ju;function Hu(e,t=!1){const r=e.toString("hex");return(0,ht.HexString)(t?`0x${r}`:r)}O.hexStringFromBuffer=Hu;function Uu(e){return(0,ht.BigIntString)(e.toString(10))}O.bigIntStringFromBN=Uu;function Vu(e){return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}O.intNumberFromHexString=Vu;function zu(e){return(0,ht.HexString)(`0x${new Tt.default(e).toString(16)}`)}O.hexStringFromIntNumber=zu;function Qi(e){return e.startsWith("0x")||e.startsWith("0X")}O.has0xPrefix=Qi;function Es(e){return Qi(e)?e.slice(2):e}O.strip0x=Es;function vc(e){return Qi(e)?`0x${e.slice(2)}`:`0x${e}`}O.prepend0x=vc;function Sn(e){if(typeof e!="string")return!1;const t=Es(e).toLowerCase();return mc.test(t)}O.isHexString=Sn;function bc(e,t=!1){if(typeof e=="string"){const r=Es(e).toLowerCase();if(mc.test(r))return(0,ht.HexString)(t?`0x${r}`:r)}throw hr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}O.ensureHexString=bc;function kn(e,t=!1){let r=bc(e,!1);return r.length%2===1&&(r=(0,ht.HexString)(`0${r}`)),t?(0,ht.HexString)(`0x${r}`):r}O.ensureEvenLengthHexString=kn;function Wu(e){if(typeof e=="string"){const t=Es(e).toLowerCase();if(Sn(t)&&t.length===40)return(0,ht.AddressString)(vc(t))}throw hr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}O.ensureAddressString=Wu;function qu(e){if(V.isBuffer(e))return e;if(typeof e=="string"){if(Sn(e)){const t=kn(e,!1);return V.from(t,"hex")}return V.from(e,"utf8")}throw hr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}O.ensureBuffer=qu;function wc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,ht.IntNumber)(e);if(typeof e=="string"){if(gc.test(e))return(0,ht.IntNumber)(Number(e));if(Sn(e))return(0,ht.IntNumber)(new Tt.default(kn(e,!1),16).toNumber())}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureIntNumber=wc;function Ju(e){if(e instanceof RegExp)return(0,ht.RegExpString)(e.toString());throw hr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}O.ensureRegExpString=Ju;function Gu(e){if(e!==null&&(Tt.default.isBN(e)||yc(e)))return new Tt.default(e.toString(10),10);if(typeof e=="number")return new Tt.default(wc(e));if(typeof e=="string"){if(gc.test(e))return new Tt.default(e,10);if(Sn(e))return new Tt.default(kn(e,!1),16)}throw hr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureBN=Gu;function Zu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw hr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}O.ensureParsedJSONObject=Zu;function yc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}O.isBigNumber=yc;function Qu(e,t){return Array.from({length:t-e},(r,n)=>e+n)}O.range=Qu;function Ku(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}O.getFavicon=Ku;function Xu(e,t,r,n,i,s){const a=n?"parent-id":"id",c=new URLSearchParams({[a]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}O.createQrUrl=Xu;function Ec(){try{return window.frameElement!==null}catch{return!1}}O.isInIFrame=Ec;function Yu(){try{return Ec()&&window.top?window.top.location:window.location}catch{return window.location}}O.getLocation=Yu;function eh(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}O.isMobileWeb=eh;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.ScopedLocalStorage=void 0;class th{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 i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Ss.ScopedLocalStorage=th;var Dr={},Sc={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(h,d,f){this.fn=h,this.context=d,this.once=f||!1}function s(h,d,f,g,b){if(typeof f!="function")throw new TypeError("The listener must be a function");var S=new i(f,g||h,b),I=r?r+d:d;return h._events[I]?h._events[I].fn?h._events[I]=[h._events[I],S]:h._events[I].push(S):(h._events[I]=S,h._eventsCount++),h}function a(h,d){--h._eventsCount===0?h._events=new n:delete h._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],f,g;if(this._eventsCount===0)return d;for(g in f=this._events)t.call(f,g)&&d.push(r?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},c.prototype.listeners=function(d){var f=r?r+d:d,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var b=0,S=g.length,I=new Array(S);b<S;b++)I[b]=g[b].fn;return I},c.prototype.listenerCount=function(d){var f=r?r+d:d,g=this._events[f];return g?g.fn?1:g.length:0},c.prototype.emit=function(d,f,g,b,S,I){var R=r?r+d:d;if(!this._events[R])return!1;var x=this._events[R],A=arguments.length,C,M;if(x.fn){switch(x.once&&this.removeListener(d,x.fn,void 0,!0),A){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,f),!0;case 3:return x.fn.call(x.context,f,g),!0;case 4:return x.fn.call(x.context,f,g,b),!0;case 5:return x.fn.call(x.context,f,g,b,S),!0;case 6:return x.fn.call(x.context,f,g,b,S,I),!0}for(M=1,C=new Array(A-1);M<A;M++)C[M-1]=arguments[M];x.fn.apply(x.context,C)}else{var B=x.length,N;for(M=0;M<B;M++)switch(x[M].once&&this.removeListener(d,x[M].fn,void 0,!0),A){case 1:x[M].fn.call(x[M].context);break;case 2:x[M].fn.call(x[M].context,f);break;case 3:x[M].fn.call(x[M].context,f,g);break;case 4:x[M].fn.call(x[M].context,f,g,b);break;default:if(!C)for(N=1,C=new Array(A-1);N<A;N++)C[N-1]=arguments[N];x[M].fn.apply(x[M].context,C)}}return!0},c.prototype.on=function(d,f,g){return s(this,d,f,g,!1)},c.prototype.once=function(d,f,g){return s(this,d,f,g,!0)},c.prototype.removeListener=function(d,f,g,b){var S=r?r+d:d;if(!this._events[S])return this;if(!f)return a(this,S),this;var I=this._events[S];if(I.fn)I.fn===f&&(!b||I.once)&&(!g||I.context===g)&&a(this,S);else{for(var R=0,x=[],A=I.length;R<A;R++)(I[R].fn!==f||b&&!I[R].once||g&&I[R].context!==g)&&x.push(I[R]);x.length?this._events[S]=x.length===1?x[0]:x:a(this,S)}return this},c.prototype.removeAllListeners=function(d){var f;return d?(f=r?r+d:d,this._events[f]&&a(this,f)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,e.exports=c})(Sc);var rh=Sc.exports,Mn={},Rn={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.EVENTS=void 0;Zr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.RelayAbstract=ut.APP_VERSION_KEY=ut.LOCAL_STORAGE_ADDRESSES_KEY=ut.WALLET_USER_NAME_KEY=void 0;const Fo=yn;ut.WALLET_USER_NAME_KEY="walletUsername";ut.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ut.APP_VERSION_KEY="AppVersion";class nh{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 Fo.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Fo.serializeError)(s,t.method);return i})}}ut.RelayAbstract=nh;var Qr={},kc={exports:{}},sh=bu,ih=wu,oh=ih("TypedArray.prototype.buffer",!0),ah=ku(),ch=oh||function(t){if(!ah(t))throw new sh("Not a Typed Array");return t.buffer},gt=Dt().Buffer,lh=yu,uh=ch,hh=ArrayBuffer.isView||function(t){try{return uh(t),!0}catch{return!1}},dh=typeof Uint8Array<"u",Mc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",fh=Mc&&(gt.prototype instanceof Uint8Array||gt.TYPED_ARRAY_SUPPORT),ph=function(t,r){if(gt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?gt.from(t):t;if(typeof t=="string")return gt.from(t,r);if(Mc&&hh(t)){if(t.byteLength===0)return gt.alloc(0);if(fh){var n=gt.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=gt.from(i);if(s.length===t.byteLength)return s}if(dh&&t instanceof Uint8Array)return gt.from(t);var a=lh(t);if(a)for(var c=0;c<t.length;c+=1){var h=t[c];if(typeof h!="number"||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||gt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return gt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},gh=Dt().Buffer,mh=ph;function ks(e,t){this._block=gh.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}ks.prototype.update=function(e,t){e=mh(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,a=0;a<i;){for(var c=s%n,h=Math.min(i-a,n-c),d=0;d<h;d++)r[c+d]=e[a+d];s+=h,a+=h,s%n===0&&this._update(r)}return this._len+=i,this};ks.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,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};ks.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Kr=ks,_h=qr,Rc=Kr,vh=Dt().Buffer,bh=[1518500249,1859775393,-1894007588,-899497514],wh=new Array(80);function Cn(){this.init(),this._w=wh,Rc.call(this,64,56)}_h(Cn,Rc);Cn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function yh(e){return e<<5|e>>>27}function Eh(e){return e<<30|e>>>2}function Sh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Cn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var h=0;h<80;++h){var d=~~(h/20),f=yh(r)+Sh(d,n,i,s)+a+t[h]+bh[d]|0;a=s,s=i,i=Eh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Cn.prototype._hash=function(){var e=vh.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 kh=Cn,Mh=qr,Cc=Kr,Rh=Dt().Buffer,Ch=[1518500249,1859775393,-1894007588,-899497514],Ih=new Array(80);function In(){this.init(),this._w=Ih,Cc.call(this,64,56)}Mh(In,Cc);In.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function xh(e){return e<<1|e>>>31}function Ah(e){return e<<5|e>>>27}function Nh(e){return e<<30|e>>>2}function Lh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}In.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=xh(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var h=0;h<80;++h){var d=~~(h/20),f=Ah(r)+Lh(d,n,i,s)+a+t[h]+Ch[d]|0;a=s,s=i,i=Nh(n),n=r,r=f}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};In.prototype._hash=function(){var e=Rh.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 $h=In,Th=qr,Ic=Kr,Ph=Dt().Buffer,Oh=[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],Bh=new Array(64);function xn(){this.init(),this._w=Bh,Ic.call(this,64,56)}Th(xn,Ic);xn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Dh(e,t,r){return r^e&(t^r)}function Fh(e,t,r){return e&t|r&(e|t)}function jh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Hh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Uh(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Vh(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}xn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=this._f|0,h=this._g|0,d=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=Vh(t[f-2])+t[f-7]+Uh(t[f-15])+t[f-16]|0;for(var g=0;g<64;++g){var b=d+Hh(a)+Dh(a,c,h)+Oh[g]+t[g]|0,S=jh(r)+Fh(r,n,i)|0;d=h,h=c,c=a,a=s+b|0,s=i,i=n,n=r,r=b+S|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=h+this._g|0,this._h=d+this._h|0};xn.prototype._hash=function(){var e=Ph.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 xc=xn,zh=qr,Wh=xc,qh=Kr,Jh=Dt().Buffer,Gh=new Array(64);function Ms(){this.init(),this._w=Gh,qh.call(this,64,56)}zh(Ms,Wh);Ms.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};Ms.prototype._hash=function(){var e=Jh.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 Zh=Ms,Qh=qr,Ac=Kr,Kh=Dt().Buffer,jo=[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],Xh=new Array(160);function An(){this.init(),this._w=Xh,Ac.call(this,128,112)}Qh(An,Ac);An.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ho(e,t,r){return r^e&(t^r)}function Uo(e,t,r){return e&t|r&(e|t)}function Vo(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function zo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Yh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function ed(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function td(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function rd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Je(e,t){return e>>>0<t>>>0?1:0}An.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,a=this._eh|0,c=this._fh|0,h=this._gh|0,d=this._hh|0,f=this._al|0,g=this._bl|0,b=this._cl|0,S=this._dl|0,I=this._el|0,R=this._fl|0,x=this._gl|0,A=this._hl|0,C=0;C<32;C+=2)t[C]=e.readInt32BE(C*4),t[C+1]=e.readInt32BE(C*4+4);for(;C<160;C+=2){var M=t[C-30],B=t[C-15*2+1],N=Yh(M,B),P=ed(B,M);M=t[C-2*2],B=t[C-2*2+1];var W=td(M,B),Y=rd(B,M),re=t[C-7*2],Z=t[C-7*2+1],F=t[C-16*2],U=t[C-16*2+1],E=P+Z|0,o=N+re+Je(E,P)|0;E=E+Y|0,o=o+W+Je(E,Y)|0,E=E+U|0,o=o+F+Je(E,U)|0,t[C]=o,t[C+1]=E}for(var u=0;u<160;u+=2){o=t[u],E=t[u+1];var p=Uo(r,n,i),m=Uo(f,g,b),v=Vo(r,f),y=Vo(f,r),k=zo(a,I),_=zo(I,a),l=jo[u],w=jo[u+1],T=Ho(a,c,h),L=Ho(I,R,x),$=A+_|0,K=d+k+Je($,A)|0;$=$+L|0,K=K+T+Je($,L)|0,$=$+w|0,K=K+l+Je($,w)|0,$=$+E|0,K=K+o+Je($,E)|0;var Q=y+m|0,X=v+p+Je(Q,y)|0;d=h,A=x,h=c,x=R,c=a,R=I,I=S+$|0,a=s+K+Je(I,S)|0,s=i,S=b,i=n,b=g,n=r,g=f,f=$+Q|0,r=K+X+Je(f,$)|0}this._al=this._al+f|0,this._bl=this._bl+g|0,this._cl=this._cl+b|0,this._dl=this._dl+S|0,this._el=this._el+I|0,this._fl=this._fl+R|0,this._gl=this._gl+x|0,this._hl=this._hl+A|0,this._ah=this._ah+r+Je(this._al,f)|0,this._bh=this._bh+n+Je(this._bl,g)|0,this._ch=this._ch+i+Je(this._cl,b)|0,this._dh=this._dh+s+Je(this._dl,S)|0,this._eh=this._eh+a+Je(this._el,I)|0,this._fh=this._fh+c+Je(this._fl,R)|0,this._gh=this._gh+h+Je(this._gl,x)|0,this._hh=this._hh+d+Je(this._hl,A)|0};An.prototype._hash=function(){var e=Kh.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+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 Nc=An,nd=qr,sd=Nc,id=Kr,od=Dt().Buffer,ad=new Array(160);function Rs(){this.init(),this._w=ad,id.call(this,128,112)}nd(Rs,sd);Rs.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};Rs.prototype._hash=function(){var e=od.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+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 cd=Rs;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=kh,e.exports.sha1=$h,e.exports.sha224=Zh,e.exports.sha256=xc,e.exports.sha384=cd,e.exports.sha512=Nc})(kc);var ld=kc.exports;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Session=void 0;const Wo=ld,qo=O,Jo="session:id",Go="session:secret",Zo="session:linked";class Ki{constructor(t,r,n,i){this._storage=t,this._id=r||(0,qo.randomBytesHex)(16),this._secret=n||(0,qo.randomBytesHex)(32),this._key=new Wo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Jo),n=t.getItem(Zo),i=t.getItem(Go);return r&&i?new Ki(t,r,i,n==="1"):null}static hash(t){return new Wo.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(Jo,this._id),this._storage.setItem(Go,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Zo,this._linked?"1":"0")}}Qr.Session=Ki;var Cs={},Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.Cipher=void 0;const Gn=O;class ud{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)),i=await crypto.subtle.importKey("raw",(0,Gn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),c=16,h=a.slice(a.byteLength-c),d=a.slice(0,a.byteLength-c),f=new Uint8Array(h),g=new Uint8Array(d),b=new Uint8Array([...n,...f,...g]);return(0,Gn.uint8ArrayToHex)(b)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,Gn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,Gn.hexStringToUint8Array)(t),c=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),f=new Uint8Array([...d,...h]),g={name:"AES-GCM",iv:new Uint8Array(c)};try{const b=await window.crypto.subtle.decrypt(g,s,f),S=new TextDecoder;n(S.decode(b))}catch(b){i(b)}})()})}}Is.Cipher=ud;var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.WalletLinkHTTP=void 0;class hd{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}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:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(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(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}xs.WalletLinkHTTP=hd;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.WalletLinkWebSocket=Fr.ConnectionState=void 0;var $r;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})($r||(Fr.ConnectionState=$r={}));class dd{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 i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,$r.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.DISCONNECTED)},i.onopen=s=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,$r.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,c;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,$r.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Fr.WalletLinkWebSocket=dd;Object.defineProperty(Cs,"__esModule",{value:!0});Cs.WalletLinkConnection=void 0;const Ir=We,fd=Is,vt=Zr,Qo=ut,xr=Qr,pd=xs,Zn=Fr,Ko=1e4,gd=6e4;class md{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Ir.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>c.JsonRpcUrl&&this.handleChainUpdated(d,c.JsonRpcUrl)]]).forEach((d,f)=>{const g=c[f];g!==void 0&&d(g)})},this.handleDestroyed=c=>{var h,d;c==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:xr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var h,d;try{const f=await this.cipher.decrypt(c);(h=this.listener)===null||h===void 0||h.accountUpdated(f)}catch{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(c,g)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(Qo.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(Qo.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,h)=>{var d,f;try{const g=await this.cipher.decrypt(c),b=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(g,b)}catch{(f=this.diagnostic)===null||f===void 0||f.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new fd.Cipher(t.secret),this.diagnostic=i,this.listener=n;const a=new Zn.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async c=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:xr.Session.hash(t.id)});let d=!1;switch(c){case Zn.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(g=>setTimeout(g,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case Zn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ko),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Zn.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(c=>{var h,d,f;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const g=c.type==="IsLinkedOK"?c.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(vt.EVENTS.LINKED,{sessionIdHash:xr.Session.hash(t.id),linked:g,type:c.type,onlineGuests:c.onlineGuests}),this.linked=g||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(vt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:xr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((f=this.requestResolutions.get(c.id))===null||f===void 0||f(c))}),this.ws=a,this.http=new pd.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.STARTED_CONNECTING,{sessionIdHash:xr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(vt.EVENTS.DISCONNECTED,{sessionIdHash:xr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(vt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);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>Ko*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=gd){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Ir.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Cs.WalletLinkConnection=md;var Nn={},Ln={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.default=(()=>'@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')();var _d=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.injectCssReset=void 0;const vd=_d(Xi);function bd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(vd.default)),document.documentElement.appendChild(e)}Ln.injectCssReset=bd;var As={},$n,te,Lc,$c,nr,Xo,Tc,Pc,Oc,Yi,Pi,Oi,Bc,_n={},Dc=[],wd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Tn=Array.isArray;function kt(e,t){for(var r in t)e[r]=t[r];return e}function eo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Bi(e,t,r){var n,i,s,a={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?$n.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)a[s]===void 0&&(a[s]=e.defaultProps[s]);return fn(e,a,n,i,null)}function fn(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Lc,__i:-1,__u:0};return i==null&&te.vnode!=null&&te.vnode(s),s}function yd(){return{current:null}}function Pn(e){return e.children}function pn(e,t){this.props=e,this.context=t}function jr(e,t){if(t==null)return e.__?jr(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?jr(e):null}function Fc(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Fc(e)}}function Di(e){(!e.__d&&(e.__d=!0)&&nr.push(e)&&!ds.__r++||Xo!=te.debounceRendering)&&((Xo=te.debounceRendering)||Tc)(ds)}function ds(){for(var e,t,r,n,i,s,a,c=1;nr.length;)nr.length>c&&nr.sort(Pc),e=nr.shift(),c=nr.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,s=[],a=[],t.__P&&((r=kt({},n)).__v=n.__v+1,te.vnode&&te.vnode(r),to(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,s,i??jr(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Vc(s,r,a),n.__e=n.__=null,r.__e!=i&&Fc(r)));ds.__r=0}function jc(e,t,r,n,i,s,a,c,h,d,f){var g,b,S,I,R,x,A,C=n&&n.__k||Dc,M=t.length;for(h=Ed(r,t,C,h,M),g=0;g<M;g++)(S=r.__k[g])!=null&&(b=S.__i==-1?_n:C[S.__i]||_n,S.__i=g,x=to(e,S,b,i,s,a,c,h,d,f),I=S.__e,S.ref&&b.ref!=S.ref&&(b.ref&&ro(b.ref,null,S),f.push(S.ref,S.__c||I,S)),R==null&&I!=null&&(R=I),(A=!!(4&S.__u))||b.__k===S.__k?h=Hc(S,h,e,A):typeof S.type=="function"&&x!==void 0?h=x:I&&(h=I.nextSibling),S.__u&=-7);return r.__e=R,h}function Ed(e,t,r,n,i){var s,a,c,h,d,f=r.length,g=f,b=0;for(e.__k=new Array(i),s=0;s<i;s++)(a=t[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(h=s+b,(a=e.__k[s]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?fn(null,a,null,null,null):Tn(a)?fn(Pn,{children:a},null,null,null):a.constructor==null&&a.__b>0?fn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,c=null,(d=a.__i=Sd(a,r,h,g))!=-1&&(g--,(c=r[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(i>f?b--:i<f&&b++),typeof a.type!="function"&&(a.__u|=4)):d!=h&&(d==h-1?b--:d==h+1?b++:(d>h?b--:b++,a.__u|=4))):e.__k[s]=null;if(g)for(s=0;s<f;s++)(c=r[s])!=null&&!(2&c.__u)&&(c.__e==n&&(n=jr(c)),Wc(c,c));return n}function Hc(e,t,r,n){var i,s;if(typeof e.type=="function"){for(i=e.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=e,t=Hc(i[s],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=jr(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Uc(e,t){return t=t||[],e==null||typeof e=="boolean"||(Tn(e)?e.some(function(r){Uc(r,t)}):t.push(e)),t}function Sd(e,t,r,n){var i,s,a,c=e.key,h=e.type,d=t[r],f=d!=null&&(2&d.__u)==0;if(d===null&&e.key==null||f&&c==d.key&&h==d.type)return r;if(n>(f?1:0)){for(i=r-1,s=r+1;i>=0||s<t.length;)if((d=t[a=i>=0?i--:s++])!=null&&!(2&d.__u)&&c==d.key&&h==d.type)return a}return-1}function Yo(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||wd.test(t)?r:r+"px"}function Qn(e,t,r,n,i){var s,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Yo(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Yo(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(Oc,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.u=n.u:(r.u=Yi,e.addEventListener(t,s?Oi:Pi,s)):e.removeEventListener(t,s?Oi:Pi,s);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ea(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Yi++;else if(t.t<r.u)return;return r(te.event?te.event(t):t)}}}function to(e,t,r,n,i,s,a,c,h,d){var f,g,b,S,I,R,x,A,C,M,B,N,P,W,Y,re,Z,F=t.type;if(t.constructor!=null)return null;128&r.__u&&(h=!!(32&r.__u),s=[c=t.__e=r.__e]),(f=te.__b)&&f(t);e:if(typeof F=="function")try{if(A=t.props,C="prototype"in F&&F.prototype.render,M=(f=F.contextType)&&n[f.__c],B=f?M?M.props.value:f.__:n,r.__c?x=(g=t.__c=r.__c).__=g.__E:(C?t.__c=g=new F(A,B):(t.__c=g=new pn(A,B),g.constructor=F,g.render=Md),M&&M.sub(g),g.props=A,g.state||(g.state={}),g.context=B,g.__n=n,b=g.__d=!0,g.__h=[],g._sb=[]),C&&g.__s==null&&(g.__s=g.state),C&&F.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=kt({},g.__s)),kt(g.__s,F.getDerivedStateFromProps(A,g.__s))),S=g.props,I=g.state,g.__v=t,b)C&&F.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),C&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(C&&F.getDerivedStateFromProps==null&&A!==S&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(A,B),!g.__e&&g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(A,g.__s,B)===!1||t.__v==r.__v){for(t.__v!=r.__v&&(g.props=A,g.state=g.__s,g.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(U){U&&(U.__=t)}),N=0;N<g._sb.length;N++)g.__h.push(g._sb[N]);g._sb=[],g.__h.length&&a.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(A,g.__s,B),C&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(S,I,R)})}if(g.context=B,g.props=A,g.__P=e,g.__e=!1,P=te.__r,W=0,C){for(g.state=g.__s,g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),Y=0;Y<g._sb.length;Y++)g.__h.push(g._sb[Y]);g._sb=[]}else do g.__d=!1,P&&P(t),f=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++W<25);g.state=g.__s,g.getChildContext!=null&&(n=kt(kt({},n),g.getChildContext())),C&&!b&&g.getSnapshotBeforeUpdate!=null&&(R=g.getSnapshotBeforeUpdate(S,I)),re=f,f!=null&&f.type===Pn&&f.key==null&&(re=zc(f.props.children)),c=jc(e,Tn(re)?re:[re],t,r,n,i,s,a,c,h,d),g.base=t.__e,t.__u&=-161,g.__h.length&&a.push(g),x&&(g.__E=g.__=null)}catch(U){if(t.__v=null,h||s!=null)if(U.then){for(t.__u|=h?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,t.__e=c}else{for(Z=s.length;Z--;)eo(s[Z]);Fi(t)}else t.__e=r.__e,t.__k=r.__k,U.then||Fi(t);te.__e(U,t,r)}else s==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):c=t.__e=kd(r.__e,t,r,n,i,s,a,h,d);return(f=te.diffed)&&f(t),128&t.__u?void 0:c}function Fi(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Fi)}function Vc(e,t,r){for(var n=0;n<r.length;n++)ro(r[n],r[++n],r[++n]);te.__c&&te.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(s){s.call(i)})}catch(s){te.__e(s,i.__v)}})}function zc(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Tn(e)?e.map(zc):kt({},e)}function kd(e,t,r,n,i,s,a,c,h){var d,f,g,b,S,I,R,x=r.props,A=t.props,C=t.type;if(C=="svg"?i="http://www.w3.org/2000/svg":C=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(d=0;d<s.length;d++)if((S=s[d])&&"setAttribute"in S==!!C&&(C?S.localName==C:S.nodeType==3)){e=S,s[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(A);e=document.createElementNS(i,C,A.is&&A),c&&(te.__m&&te.__m(t,s),c=!1),s=null}if(C==null)x===A||c&&e.data==A||(e.data=A);else{if(s=s&&$n.call(e.childNodes),x=r.props||_n,!c&&s!=null)for(x={},d=0;d<e.attributes.length;d++)x[(S=e.attributes[d]).name]=S.value;for(d in x)if(S=x[d],d!="children"){if(d=="dangerouslySetInnerHTML")g=S;else if(!(d in A)){if(d=="value"&&"defaultValue"in A||d=="checked"&&"defaultChecked"in A)continue;Qn(e,d,null,S,i)}}for(d in A)S=A[d],d=="children"?b=S:d=="dangerouslySetInnerHTML"?f=S:d=="value"?I=S:d=="checked"?R=S:c&&typeof S!="function"||x[d]===S||Qn(e,d,S,x[d],i);if(f)c||g&&(f.__html==g.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(g&&(e.innerHTML=""),jc(t.type=="template"?e.content:e,Tn(b)?b:[b],t,r,n,C=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:r.__k&&jr(r,0),c,h),s!=null)for(d=s.length;d--;)eo(s[d]);c||(d="value",C=="progress"&&I==null?e.removeAttribute("value"):I!=null&&(I!==e[d]||C=="progress"&&!I||C=="option"&&I!=x[d])&&Qn(e,d,I,x[d],i),d="checked",R!=null&&R!=e[d]&&Qn(e,d,R,x[d],i))}return e}function ro(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){te.__e(i,r)}}function Wc(e,t,r){var n,i;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ro(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){te.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Wc(n[i],t,r||typeof e.type!="function");r||eo(e.__e),e.__c=e.__=e.__e=void 0}function Md(e,t,r){return this.constructor(e,r)}function qc(e,t,r){var n,i,s,a;t==document&&(t=document.documentElement),te.__&&te.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,s=[],a=[],to(t,e=(!n&&r||t).__k=Bi(Pn,null,[e]),i||_n,_n,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?$n.call(t.childNodes):null,s,!n&&r?r:i?i.__e:t.firstChild,n,a),Vc(s,e,a)}function Jc(e,t){qc(e,t,Jc)}function Rd(e,t,r){var n,i,s,a,c=kt({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)s=="key"?n=t[s]:s=="ref"?i=t[s]:c[s]=t[s]===void 0&&a!=null?a[s]:t[s];return arguments.length>2&&(c.children=arguments.length>3?$n.call(arguments,2):r),fn(e.type,c,n||e.key,i||e.ref,null)}function Cd(e){function t(r){var n,i;return this.getChildContext||(n=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&n.forEach(function(a){a.__e=!0,Di(a)})},this.sub=function(s){n.add(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){n&&n.delete(s),a&&a.call(s)}}),r.children}return t.__c="__cC"+Bc++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t}$n=Dc.slice,te={__e:function(e,t,r,n){for(var i,s,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(c){e=c}throw e}},Lc=0,$c=function(e){return e!=null&&e.constructor==null},pn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=kt({},this.state),typeof e=="function"&&(e=e(kt({},r),this.props)),e&&kt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Di(this))},pn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Di(this))},pn.prototype.render=Pn,nr=[],Tc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pc=function(e,t){return e.__v.__b-t.__v.__b},ds.__r=0,Oc=/(PointerCapture)$|Capture$/i,Yi=0,Pi=ea(!1),Oi=ea(!0),Bc=0;const Id=Object.freeze(Object.defineProperty({__proto__:null,Component:pn,Fragment:Pn,cloneElement:Rd,createContext:Cd,createElement:Bi,createRef:yd,h:Bi,hydrate:Jc,get isValidElement(){return $c},get options(){return te},render:qc,toChildArray:Uc},Symbol.toStringTag,{value:"Module"})),rt=qi(Id);var Ns={},Nt,ee,gi,ta,Hr=0,Gc=[],He=te,ra=He.__b,na=He.__r,sa=He.diffed,ia=He.__c,oa=He.unmount,aa=He.__;function dr(e,t){He.__h&&He.__h(ee,e,Hr||t),Hr=0;var r=ee.__H||(ee.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Zc(e){return Hr=1,Qc(Xc,e)}function Qc(e,t,r){var n=dr(Nt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Xc(void 0,t),function(c){var h=n.__N?n.__N[0]:n.__[0],d=n.t(h,c);h!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=ee,!ee.__f)){var i=function(c,h,d){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(b){return!!b.__c});if(f.every(function(b){return!b.__N}))return!s||s.call(this,c,h,d);var g=n.__c.props!==c;return f.forEach(function(b){if(b.__N){var S=b.__[0];b.__=b.__N,b.__N=void 0,S!==b.__[0]&&(g=!0)}}),s&&s.call(this,c,h,d)||g};ee.__f=!0;var s=ee.shouldComponentUpdate,a=ee.componentWillUpdate;ee.componentWillUpdate=function(c,h,d){if(this.__e){var f=s;s=void 0,i(c,h,d),s=f}a&&a.call(this,c,h,d)},ee.shouldComponentUpdate=i}return n.__N||n.__}function xd(e,t){var r=dr(Nt++,3);!He.__s&&so(r.__H,t)&&(r.__=e,r.u=t,ee.__H.__h.push(r))}function Kc(e,t){var r=dr(Nt++,4);!He.__s&&so(r.__H,t)&&(r.__=e,r.u=t,ee.__h.push(r))}function Ad(e){return Hr=5,no(function(){return{current:e}},[])}function Nd(e,t,r){Hr=6,Kc(function(){if(typeof e=="function"){var n=e(t());return function(){e(null),n&&typeof n=="function"&&n()}}if(e)return e.current=t(),function(){return e.current=null}},r==null?r:r.concat(e))}function no(e,t){var r=dr(Nt++,7);return so(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ld(e,t){return Hr=8,no(function(){return e},t)}function $d(e){var t=ee.context[e.__c],r=dr(Nt++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(ee)),t.props.value):e.__}function Td(e,t){He.useDebugValue&&He.useDebugValue(t?t(e):e)}function Pd(e){var t=dr(Nt++,10),r=Zc();return t.__=e,ee.componentDidCatch||(ee.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Od(){var e=dr(Nt++,11);if(!e.__){for(var t=ee.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Bd(){for(var e;e=Gc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(us),e.__H.__h.forEach(ji),e.__H.__h=[]}catch(t){e.__H.__h=[],He.__e(t,e.__v)}}He.__b=function(e){ee=null,ra&&ra(e)},He.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),aa&&aa(e,t)},He.__r=function(e){na&&na(e),Nt=0;var t=(ee=e.__c).__H;t&&(gi===ee?(t.__h=[],ee.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(us),t.__h.forEach(ji),t.__h=[],Nt=0)),gi=ee},He.diffed=function(e){sa&&sa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gc.push(t)!==1&&ta===He.requestAnimationFrame||((ta=He.requestAnimationFrame)||Dd)(Bd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),gi=ee=null},He.__c=function(e,t){t.some(function(r){try{r.__h.forEach(us),r.__h=r.__h.filter(function(n){return!n.__||ji(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],He.__e(n,r.__v)}}),ia&&ia(e,t)},He.unmount=function(e){oa&&oa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{us(n)}catch(i){t=i}}),r.__H=void 0,t&&He.__e(t,r.__v))};var ca=typeof requestAnimationFrame=="function";function Dd(e){var t,r=function(){clearTimeout(n),ca&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);ca&&(t=requestAnimationFrame(r))}function us(e){var t=ee,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ee=t}function ji(e){var t=ee;e.__c=e.__(),ee=t}function so(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Xc(e,t){return typeof t=="function"?t(e):t}const Fd=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Ld,useContext:$d,useDebugValue:Td,useEffect:xd,useErrorBoundary:Pd,useId:Od,useImperativeHandle:Nd,useLayoutEffect:Kc,useMemo:no,useReducer:Qc,useRef:Ad,useState:Zc},Symbol.toStringTag,{value:"Module"})),Ls=qi(Fd);var Ur={},$s={};Object.defineProperty($s,"__esModule",{value:!0});$s.CloseIcon=void 0;const la=rt;function jd(e){return(0,la.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,la.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}$s.CloseIcon=jd;var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.CoinbaseWalletRound=void 0;const Kn=rt;function Hd(e){return(0,Kn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Kn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Kn.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,Kn.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}Ts.CoinbaseWalletRound=Hd;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.QRCodeIcon=void 0;const ln=rt;function Ud(e){return(0,ln.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,ln.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,ln.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,ln.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,ln.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Ps.QRCodeIcon=Ud;var Os={};function Yc(e){this.mode=it.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,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))}Yc.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 Mt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Mt.prototype={addData:function(e){var t=new Yc(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=Mt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=je.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var a=s*i,c=0;c<this.modules[s].length;c++){var h=c*i,d=this.modules[s][c];d&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+i,a),n.lineTo(h+i,a+i),n.lineTo(h,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=je.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var a=-2;a<=2;a++)s==-2||s==2||a==-2||a==2||s==0&&a==0?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}},setupTypeNumber:function(e){for(var t=je.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=je.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var h=!1;s<e.length&&(h=(e[s]>>>i&1)==1);var d=je.getMask(t,n,a-c);d&&(h=!h),this.modules[n][a-c]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Mt.PAD0=236;Mt.PAD1=17;Mt.createData=function(e,t,r){for(var n=St.getRSBlocks(e,t),i=new el,s=0;s<r.length;s++){var a=r[s];i.put(a.mode,4),i.put(a.getLength(),je.getLengthInBits(a.mode,e)),a.write(i)}for(var c=0,s=0;s<n.length;s++)c+=n[s].dataCount;if(i.getLengthInBits()>c*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Mt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Mt.PAD1,8);return Mt.createBytes(i,n)};Mt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c++){var h=t[c].dataCount,d=t[c].totalCount-h;n=Math.max(n,h),i=Math.max(i,d),s[c]=new Array(h);for(var f=0;f<s[c].length;f++)s[c][f]=255&e.buffer[f+r];r+=h;var g=je.getErrorCorrectPolynomial(d),b=new Tr(s[c],g.getLength()-1),S=b.mod(g);a[c]=new Array(g.getLength()-1);for(var f=0;f<a[c].length;f++){var I=f+S.getLength()-a[c].length;a[c][f]=I>=0?S.get(I):0}}for(var R=0,f=0;f<t.length;f++)R+=t[f].totalCount;for(var x=new Array(R),A=0,f=0;f<n;f++)for(var c=0;c<t.length;c++)f<s[c].length&&(x[A++]=s[c][f]);for(var f=0;f<i;f++)for(var c=0;c<t.length;c++)f<a[c].length&&(x[A++]=a[c][f]);return x};var it={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Pt={L:1,M:0,Q:3,H:2},Lt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},je={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;je.getBCHDigit(t)-je.getBCHDigit(je.G15)>=0;)t^=je.G15<<je.getBCHDigit(t)-je.getBCHDigit(je.G15);return(e<<10|t)^je.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;je.getBCHDigit(t)-je.getBCHDigit(je.G18)>=0;)t^=je.G18<<je.getBCHDigit(t)-je.getBCHDigit(je.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return je.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Lt.PATTERN000:return(t+r)%2==0;case Lt.PATTERN001:return t%2==0;case Lt.PATTERN010:return r%3==0;case Lt.PATTERN011:return(t+r)%3==0;case Lt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Lt.PATTERN101:return t*r%2+t*r%3==0;case Lt.PATTERN110:return(t*r%2+t*r%3)%2==0;case Lt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Tr([1],0),r=0;r<e;r++)t=t.multiply(new Tr([1,Ge.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case it.MODE_NUMBER:return 10;case it.MODE_ALPHA_NUM:return 9;case it.MODE_8BIT_BYTE:return 8;case it.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case it.MODE_NUMBER:return 12;case it.MODE_ALPHA_NUM:return 11;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case it.MODE_NUMBER:return 14;case it.MODE_ALPHA_NUM:return 13;case it.MODE_8BIT_BYTE:return 16;case it.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,a=e.isDark(n,i),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var h=-1;h<=1;h++)i+h<0||t<=i+h||c==0&&h==0||a==e.isDark(n+c,i+h)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var d=0;e.isDark(n,i)&&d++,e.isDark(n+1,i)&&d++,e.isDark(n,i+1)&&d++,e.isDark(n+1,i+1)&&d++,(d==0||d==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var f=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&f++;var g=Math.abs(100*f/t/t-50)/5;return r+=g*10,r}},Ge={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Ge.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Ge.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Qe=0;Qe<8;Qe++)Ge.EXP_TABLE[Qe]=1<<Qe;for(var Qe=8;Qe<256;Qe++)Ge.EXP_TABLE[Qe]=Ge.EXP_TABLE[Qe-4]^Ge.EXP_TABLE[Qe-5]^Ge.EXP_TABLE[Qe-6]^Ge.EXP_TABLE[Qe-8];for(var Qe=0;Qe<255;Qe++)Ge.LOG_TABLE[Ge.EXP_TABLE[Qe]]=Qe;function Tr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Tr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Ge.gexp(Ge.glog(this.get(r))+Ge.glog(e.get(n)));return new Tr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Ge.glog(this.get(0))-Ge.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Ge.gexp(Ge.glog(e.get(n))+t);return new Tr(r,0).mod(e)}};function St(e,t){this.totalCount=e,this.dataCount=t}St.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];St.getRSBlocks=function(e,t){var r=St.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var a=r[s*3+0],c=r[s*3+1],h=r[s*3+2],d=0;d<a;d++)i.push(new St(c,h));return i};St.getRsBlockTable=function(e,t){switch(t){case Pt.L:return St.RS_BLOCK_TABLE[(e-1)*4+0];case Pt.M:return St.RS_BLOCK_TABLE[(e-1)*4+1];case Pt.Q:return St.RS_BLOCK_TABLE[(e-1)*4+2];case Pt.H:return St.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function el(){this.buffer=[],this.length=0}el.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mi=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function tl(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Pt.L;case"M":return Pt.M;case"Q":return Pt.Q;case"H":return Pt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var f=i(h),g=1,b=0,S=0,I=mi.length;S<=I;S++){var R=mi[S];if(!R)throw new Error("Content too long: expected "+b+" but got "+f);switch(d){case"L":b=R[0];break;case"M":b=R[1];break;case"Q":b=R[2];break;case"H":b=R[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(f<=b)break;g++}if(g>mi.length)throw new Error("Content too long");return g}function i(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new Mt(a,c),this.qrcode.addData(s),this.qrcode.make()}tl.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,i=n?" ":"",s=n?`\r
2
2
  `:"",a=t.width,c=t.height,h=r.length,d=a/(h+2*t.padding),f=c/(h+2*t.padding),g=typeof t.join<"u"?!!t.join:!1,b=typeof t.swap<"u"?!!t.swap:!1,S=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,I=typeof t.predefined<"u"?!!t.predefined:!1,R=I?i+'<defs><path id="qrmodule" d="M0 0 h'+f+" v"+d+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",x=i+'<rect x="0" y="0" width="'+a+'" height="'+c+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,A="",C="",M=0;M<h;M++)for(var B=0;B<h;B++){var N=r[B][M];if(N){var P=B*d+t.padding*d,W=M*f+t.padding*f;if(b){var Y=P;P=W,W=Y}if(g){var re=d+P,Z=f+W;P=Number.isInteger(P)?Number(P):P.toFixed(2),W=Number.isInteger(W)?Number(W):W.toFixed(2),re=Number.isInteger(re)?Number(re):re.toFixed(2),Z=Number.isInteger(Z)?Number(Z):Z.toFixed(2),C+="M"+P+","+W+" V"+Z+" H"+re+" V"+W+" H"+P+" Z "}else I?A+=i+'<use x="'+P.toString()+'" y="'+W.toString()+'" href="#qrmodule" />'+s:A+=i+'<rect x="'+P.toString()+'" y="'+W.toString()+'" width="'+d+'" height="'+f+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}g&&(A=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+C+'" />');let F="";if(this.options.image!==void 0&&this.options.image.svg){const E=a*this.options.image.width/100,o=c*this.options.image.height/100,u=a/2-E/2,p=c/2-o/2;F+=`<svg x="${u}" y="${p}" width="${E}" height="${o}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,F+=this.options.image.svg+s,F+="</svg>"}var U="";switch(e.container){case"svg":S&&(U+='<?xml version="1.0" standalone="yes"?>'+s),U+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+c+'">'+s,U+=R+x+A,U+=F,U+="</svg>";break;case"svg-viewbox":S&&(U+='<?xml version="1.0" standalone="yes"?>'+s),U+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+c+'">'+s,U+=R+x+A,U+=F,U+="</svg>";break;case"g":U+='<g width="'+a+'" height="'+c+'">'+s,U+=R+x+A,U+=F,U+="</g>";break;default:U+=(R+x+A+F).replace(/^\s+/,"");break}return U};var Vd=tl,zd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Os,"__esModule",{value:!0});Os.QRCode=void 0;const Wd=rt,ua=Ls,qd=zd(Vd),Jd=e=>{const[t,r]=(0,ua.useState)("");return(0,ua.useEffect)(()=>{var n,i;const s=new qd.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:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),a=V.from(s.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,Wd.h)("img",{src:t,alt:"QR Code"}):null};Os.QRCode=Jd;var Bs={},io={};Object.defineProperty(io,"__esModule",{value:!0});io.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 Gd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.Spinner=void 0;const Xn=rt,Zd=Gd(io),Qd=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Xn.h)("div",{class:"-cbwsdk-spinner"},(0,Xn.h)("style",null,Zd.default),(0,Xn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Xn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Bs.Spinner=Qd;var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.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 rl=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.CoinbaseWalletSteps=Ur.ConnectContent=void 0;const cr=rl(wn),J=rt,Kd=O,Xd=Gr,Yd=$s,e0=Ts,t0=Ps,r0=Os,n0=Bs,s0=rl(oo),_i={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:nl},i0=e=>e==="light"?"#FFFFFF":"#0A0B0D";function o0(e){const{theme:t}=e,r=(0,Kd.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=_i.steps;return(0,J.h)("div",{"data-testid":"connect-content",className:(0,cr.default)("-cbwsdk-connect-content",t)},(0,J.h)("style",null,s0.default),(0,J.h)("div",{className:"-cbwsdk-connect-content-header"},(0,J.h)("h2",{className:(0,cr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,J.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,J.h)(Yd.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,J.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,J.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,J.h)(a0,{title:_i.title,description:_i.description,theme:t})),(0,J.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,J.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,J.h)(r0.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,J.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Xd.LIB_VERSION}),(0,J.h)("input",{type:"hidden",value:r})),(0,J.h)(n,{theme:t}),!e.isConnected&&(0,J.h)("div",{"data-testid":"connecting-spinner",className:(0,cr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,J.h)(n0.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,J.h)("p",null,"Connecting...")))))}Ur.ConnectContent=o0;function a0({title:e,description:t,theme:r}){return(0,J.h)("div",{className:(0,cr.default)("-cbwsdk-connect-item",r)},(0,J.h)("div",null,(0,J.h)(e0.CoinbaseWalletRound,null)),(0,J.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,J.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,J.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function nl({theme:e}){return(0,J.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,J.h)("li",{className:(0,cr.default)("-cbwsdk-wallet-steps-item",e)},(0,J.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,J.h)("li",{className:(0,cr.default)("-cbwsdk-wallet-steps-item",e)},(0,J.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,J.h)("span",null,"Tap ",(0,J.h)("strong",null,"Scan")," "),(0,J.h)("span",{className:(0,cr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,J.h)(t0.QRCodeIcon,{fill:i0(e)})))))}Ur.CoinbaseWalletSteps=nl;var Ds={},Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ArrowLeftIcon=void 0;const ha=rt;function c0(e){return(0,ha.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,ha.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Fs.ArrowLeftIcon=c0;var js={};Object.defineProperty(js,"__esModule",{value:!0});js.LaptopIcon=void 0;const vi=rt;function l0(e){return(0,vi.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,vi.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,vi.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}js.LaptopIcon=l0;var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.SafeIcon=void 0;const da=rt;function u0(e){return(0,da.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,da.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Hs.SafeIcon=u0;var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.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 sl=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.TryExtensionContent=void 0;const Yt=sl(wn),ze=rt,bi=Ls,h0=Fs,d0=js,f0=Hs,p0=sl(ao);function g0({theme:e}){const[t,r]=(0,bi.useState)(!1),n=(0,bi.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,bi.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,ze.h)("div",{class:(0,Yt.default)("-cbwsdk-try-extension",e)},(0,ze.h)("style",null,p0.default),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("h3",{class:(0,Yt.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,ze.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ze.h)("button",{class:(0,Yt.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,ze.h)("div",null,!t&&(0,ze.h)(h0.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(d0.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(f0.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,Yt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Ds.TryExtensionContent=g0;var co={};Object.defineProperty(co,"__esModule",{value:!0});co.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 il=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.ConnectDialog=void 0;const wi=il(wn),er=rt,yi=Ls,m0=Ur,_0=Ds,v0=il(co),b0=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,yi.useState)(!t),[s,a]=(0,yi.useState)(!t);(0,yi.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[t]);const c=r?"dark":"light";return(0,er.h)("div",{class:(0,wi.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,er.h)("style",null,v0.default),(0,er.h)("div",{class:(0,wi.default)("-cbwsdk-connect-dialog-backdrop",c,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,er.h)("div",{class:"-cbwsdk-connect-dialog"},(0,er.h)("div",{class:(0,wi.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,er.h)(m0.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,er.h)(_0.TryExtensionContent,{theme:c}))))};Ns.ConnectDialog=b0;Object.defineProperty(As,"__esModule",{value:!0});As.LinkFlow=void 0;const Ei=rt,w0=Ns;class y0{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Ei.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ei.render)((0,Ei.h)(w0.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)}}As.LinkFlow=y0;var lo={},uo={};Object.defineProperty(uo,"__esModule",{value:!0});uo.default=(()=>".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}")();(function(e){var t=D&&D.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(wn),n=rt,i=Ls,s=t(uo),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(b){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=b.darkMode}attach(b){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",b.appendChild(this.root),this.render()}presentItem(b){const S=this.nextItemKey++;return this.items.set(S,b),this.render(),()=>{this.items.delete(S),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([b,S])=>(0,n.h)(e.SnackbarInstance,Object.assign({},S,{key:b}))))),this.root)}}e.Snackbar=h;const d=g=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},g.children));e.SnackbarContainer=d;const f=({autoExpand:g,message:b,menuItems:S})=>{const[I,R]=(0,i.useState)(!0),[x,A]=(0,i.useState)(g??!1);(0,i.useEffect)(()=>{const M=[window.setTimeout(()=>{R(!1)},1),window.setTimeout(()=>{A(!0)},1e4)];return()=>{M.forEach(window.clearTimeout)}});const C=()=>{A(!x)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",I&&"-cbwsdk-snackbar-instance-hidden",x&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:C},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},b),(0,n.h)("div",{class:"-gear-container"},!x&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),S&&S.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},S.map((M,B)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",M.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:M.onClick,key:B},(0,n.h)("svg",{width:M.svgWidth,height:M.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":M.defaultFillRule,"clip-rule":M.defaultClipRule,d:M.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",M.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},M.info)))))};e.SnackbarInstance=f})(lo);Object.defineProperty(Nn,"__esModule",{value:!0});Nn.WalletLinkRelayUI=void 0;const E0=Ln,S0=As,k0=lo;class M0{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new k0.Snackbar({darkMode:t.darkMode}),this.linkFlow=new S0.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,E0.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Nn.WalletLinkRelayUI=M0;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.WalletLinkRelay=void 0;const Ar=yn,R0=We,Fe=O,tr=Zr,fa=ut,$t=Qr,C0=Cs,rr=Jr,I0=Nn;class xt extends fa.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var c;this.isLinked=a;const h=this.storage.getItem(fa.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const d=h.split(" "),f=this.storage.getItem("IsStandaloneSigning")==="true";if(d[0]!==""&&!a&&this.session.linked&&!f){this.isUnlinkedErrorState=!0;const g=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(tr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:g})}}},this.metadataUpdated=(a,c)=>{this.storage.setItem(a,c)},this.chainUpdated=(a,c)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:a,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(a,c))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),xt.accountRequestCallbackIds.size>0&&(Array.from(xt.accountRequestCallbackIds.values()).forEach(c=>{const h={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:c}))}),xt.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:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=$t.Session.load(this.storage)||new $t.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new C0.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:t});return i.connect(),{session:t,ui:c,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(tr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=$t.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:$t.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Fe.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Fe.hexStringFromBuffer)(t,!0),signature:(0,Fe.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Fe.bigIntStringFromBN)(t.weiValue),data:(0,Fe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Fe.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Fe.bigIntStringFromBN)(t.weiValue),data:(0,Fe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Fe.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Fe.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Fe.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Fe.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Fe.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Fe.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r==null||r()};return{promise:new Promise((a,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r==null||r(),(0,rr.isErrorResponse)(h))return c(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof I0.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=$t.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(tr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?$t.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(tr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?$t.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(tr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){xt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),xt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Ar.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Fe.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,rr.isErrorResponse)(c))return a(new Error(c.errorMessage));s(c)}),this.ui.inlineAccountsResponse()){const c=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=Ar.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}xt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Fe.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,c)=>{this.relayEventManager.callbacks.set(n,f=>{if((0,rr.isErrorResponse)(f))return c(new Error(f.errorMessage));a(f)});const h=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:R0.ProviderType.Unselected}})},d=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:f}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:d,onCancel:h,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,a){const c={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const d=(0,Fe.randomBytesHex)(8),f=b=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,c.method,b),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload}));const g=new Promise((b,S)=>{this.relayEventManager.callbacks.set(d,x=>{if(h==null||h(),(0,rr.isErrorResponse)(x))return S(new Error(x.errorMessage));b(x)});const I=x=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!1}})},R=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:R,onCancel:I,type:t,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,c)});return{cancel:f,promise:g}}addEthereumChain(t,r,n,i,s,a){const c={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const d=(0,Fe.randomBytesHex)(8),f=b=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,c.method,b),h==null||h()};return this.ui.inlineAddEthereumChain(t)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload})),{promise:new Promise((b,S)=>{this.relayEventManager.callbacks.set(d,x=>{if(h==null||h(),(0,rr.isErrorResponse)(x))return S(new Error(x.errorMessage));b(x)});const I=x=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},R=x=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:x}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:I,onApprove:R,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,c)}),cancel:f}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Fe.randomBytesHex)(8),s=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,h)=>{this.relayEventManager.callbacks.set(i,g=>{if((0,rr.isErrorResponse)(g)&&g.errorCode)return h(Ar.standardErrors.provider.custom({code:g.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,rr.isErrorResponse)(g))return h(new Error(g.errorMessage));c(g)});const d=g=>{var b;if(g){const S=(b=(0,Ar.getErrorCode)(g))!==null&&b!==void 0?b:Ar.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",g instanceof Error?g:Ar.standardErrors.provider.unsupportedChain(t),S)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},f=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:g}}})};this.ui.switchEthereumChain({onCancel:d,onApprove:f,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return $t.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Rn.WalletLinkRelay=xt;xt.accountRequestCallbackIds=new Set;var On={},Us={},ol={};(function(e){var t=D&&D.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=D&&D.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(lo,e)})(ol);var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.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 al=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.RedirectDialog=void 0;const x0=al(wn),Et=rt,A0=Ln,N0=ol,L0=al(ho);class $0{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,A0.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Et.render)(null,this.root),t&&(0,Et.render)((0,Et.h)(T0,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Us.RedirectDialog=$0;const T0=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Et.h)(N0.SnackbarContainer,{darkMode:r},(0,Et.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Et.h)("style",null,L0.default),(0,Et.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Et.h)("div",{class:(0,x0.default)("-cbwsdk-redirect-dialog-box",s)},(0,Et.h)("p",null,e),(0,Et.h)("button",{onClick:n},t))))};Object.defineProperty(On,"__esModule",{value:!0});On.MobileRelayUI=void 0;const P0=Us;class O0{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new P0.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}}On.MobileRelayUI=O0;Object.defineProperty(Mn,"__esModule",{value:!0});Mn.MobileRelay=void 0;const B0=O,D0=Rn,F0=On;class j0 extends D0.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,B0.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 F0.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Mn.MobileRelay=j0;const{Transform:H0}=uc();var U0=e=>class cl extends H0{constructor(r,n,i,s,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!V.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 V.isBuffer(r)||(r=V.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 cl(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:V0}=uc();var z0=e=>class ll extends V0{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!V.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 V.isBuffer(r)||(r=V.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ll(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const W0=U0,q0=z0;var J0=function(e){const t=W0(e),r=q0(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},ul={};const pa=[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];ul.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],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],g=e[9]^e[19]^e[29]^e[39]^e[49];let b=f^(i<<1|s>>>31),S=g^(s<<1|i>>>31);const I=e[0]^b,R=e[1]^S,x=e[10]^b,A=e[11]^S,C=e[20]^b,M=e[21]^S,B=e[30]^b,N=e[31]^S,P=e[40]^b,W=e[41]^S;b=r^(a<<1|c>>>31),S=n^(c<<1|a>>>31);const Y=e[2]^b,re=e[3]^S,Z=e[12]^b,F=e[13]^S,U=e[22]^b,E=e[23]^S,o=e[32]^b,u=e[33]^S,p=e[42]^b,m=e[43]^S;b=i^(h<<1|d>>>31),S=s^(d<<1|h>>>31);const v=e[4]^b,y=e[5]^S,k=e[14]^b,_=e[15]^S,l=e[24]^b,w=e[25]^S,T=e[34]^b,L=e[35]^S,$=e[44]^b,K=e[45]^S;b=a^(f<<1|g>>>31),S=c^(g<<1|f>>>31);const Q=e[6]^b,X=e[7]^S,rn=e[16]^b,Ce=e[17]^S,Ie=e[26]^b,nn=e[27]^S,xe=e[36]^b,Ae=e[37]^S,sn=e[46]^b,Ne=e[47]^S;b=h^(r<<1|n>>>31),S=d^(n<<1|r>>>31);const Le=e[8]^b,on=e[9]^S,$e=e[18]^b,Te=e[19]^S,an=e[28]^b,Pe=e[29]^S,Oe=e[38]^b,cn=e[39]^S,Be=e[48]^b,De=e[49]^S,gr=I,ne=R,se=A<<4|x>>>28,mr=x<<4|A>>>28,ie=C<<3|M>>>29,oe=M<<3|C>>>29,_r=N<<9|B>>>23,ae=B<<9|N>>>23,ce=P<<18|W>>>14,vr=W<<18|P>>>14,le=Y<<1|re>>>31,ue=re<<1|Y>>>31,br=F<<12|Z>>>20,he=Z<<12|F>>>20,de=U<<10|E>>>22,wr=E<<10|U>>>22,fe=u<<13|o>>>19,pe=o<<13|u>>>19,yr=p<<2|m>>>30,ge=m<<2|p>>>30,me=y<<30|v>>>2,Er=v<<30|y>>>2,_e=k<<6|_>>>26,ve=_<<6|k>>>26,Sr=w<<11|l>>>21,be=l<<11|w>>>21,we=T<<15|L>>>17,kr=L<<15|T>>>17,ye=K<<29|$>>>3,Ee=$<<29|K>>>3,Mr=Q<<28|X>>>4,Se=X<<28|Q>>>4,ke=Ce<<23|rn>>>9,Rr=rn<<23|Ce>>>9,Me=Ie<<25|nn>>>7,Re=nn<<25|Ie>>>7,Ft=xe<<21|Ae>>>11,jt=Ae<<21|xe>>>11,Ht=Ne<<24|sn>>>8,Ut=sn<<24|Ne>>>8,Vt=Le<<27|on>>>5,zt=on<<27|Le>>>5,Wt=$e<<20|Te>>>12,qt=Te<<20|$e>>>12,Jt=Pe<<7|an>>>25,Gt=an<<7|Pe>>>25,Zt=Oe<<8|cn>>>24,Qt=cn<<8|Oe>>>24,Kt=Be<<14|De>>>18,Xt=De<<14|Be>>>18;e[0]=gr^~br&Sr,e[1]=ne^~he&be,e[10]=Mr^~Wt&ie,e[11]=Se^~qt&oe,e[20]=le^~_e&Me,e[21]=ue^~ve&Re,e[30]=Vt^~se&de,e[31]=zt^~mr&wr,e[40]=me^~ke&Jt,e[41]=Er^~Rr&Gt,e[2]=br^~Sr&Ft,e[3]=he^~be&jt,e[12]=Wt^~ie&fe,e[13]=qt^~oe&pe,e[22]=_e^~Me&Zt,e[23]=ve^~Re&Qt,e[32]=se^~de&we,e[33]=mr^~wr&kr,e[42]=ke^~Jt&_r,e[43]=Rr^~Gt&ae,e[4]=Sr^~Ft&Kt,e[5]=be^~jt&Xt,e[14]=ie^~fe&ye,e[15]=oe^~pe&Ee,e[24]=Me^~Zt&ce,e[25]=Re^~Qt&vr,e[34]=de^~we&Ht,e[35]=wr^~kr&Ut,e[44]=Jt^~_r&yr,e[45]=Gt^~ae&ge,e[6]=Ft^~Kt&gr,e[7]=jt^~Xt&ne,e[16]=fe^~ye&Mr,e[17]=pe^~Ee&Se,e[26]=Zt^~ce&le,e[27]=Qt^~vr&ue,e[36]=we^~Ht&Vt,e[37]=kr^~Ut&zt,e[46]=_r^~yr&me,e[47]=ae^~ge&Er,e[8]=Kt^~gr&br,e[9]=Xt^~ne&he,e[18]=ye^~Mr&Wt,e[19]=Ee^~Se&qt,e[28]=ce^~le&_e,e[29]=vr^~ue&ve,e[38]=Ht^~Vt&se,e[39]=Ut^~zt&mr,e[48]=yr^~me&ke,e[49]=ge^~Er&Rr,e[0]^=pa[t*2],e[1]^=pa[t*2+1]}};const fs=ul;function Xr(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Xr.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Xr.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(fs.p1600(this.state),this.count=0)};Xr.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&fs.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),fs.p1600(this.state),this.count=0,this.squeezing=!0};Xr.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=V.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&&(fs.p1600(this.state),this.count=0);return t};Xr.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var G0=Xr,Z0=J0(G0);const Q0=Z0,K0=vs;function hl(e){return V.allocUnsafe(e).fill(0)}function dl(e,t,r){const n=hl(t);return e=Vs(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function X0(e,t){return dl(e,t,!0)}function Vs(e){if(!V.isBuffer(e))if(Array.isArray(e))e=V.from(e);else if(typeof e=="string")fl(e)?e=V.from(tf(pl(e)),"hex"):e=V.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=V.allocUnsafe(0);else if(K0.isBN(e))e=e.toArrayLike(V);else if(e.toArray)e=V.from(e.toArray());else throw new Error("invalid type");return e}function Y0(e){return e=Vs(e),"0x"+e.toString("hex")}function ef(e,t){return e=Vs(e),t||(t=256),Q0("keccak"+t).update(e).digest()}function tf(e){return e.length%2?"0"+e:e}function fl(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function pl(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var gl={zeros:hl,setLength:dl,setLengthRight:X0,isHexString:fl,stripHexPrefix:pl,toBuffer:Vs,bufferToHex:Y0,keccak:ef};const lr=gl,or=vs;function ml(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Pr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function ga(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function _l(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function sr(e){var t=typeof e;if(t==="string")return lr.isHexString(e)?new or(lr.stripHexPrefix(e),16):new or(e,10);if(t==="number")return new or(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function yt(e,t){var r,n,i,s;if(e==="address")return yt("uint160",sr(t));if(e==="bool")return yt("uint8",t?1:0);if(e==="string")return yt("bytes",new V(t,"utf8"));if(nf(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=_l(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(yt(e,t[s]));if(r==="dynamic"){var a=yt("uint256",t.length);i.unshift(a)}return V.concat(i)}else{if(e==="bytes")return t=new V(t),i=V.concat([yt("uint256",t.length),t]),t.length%32!==0&&(i=V.concat([i,lr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Pr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return lr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Pr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=sr(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(V,"be",32)}else if(e.startsWith("int")){if(r=Pr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=sr(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(V,"be",32)}else if(e.startsWith("ufixed")){if(r=ga(e),n=sr(t),n<0)throw new Error("Supplied ufixed is negative");return yt("uint256",n.mul(new or(2).pow(new or(r[1]))))}else if(e.startsWith("fixed"))return r=ga(e),yt("int256",sr(t).mul(new or(2).pow(new or(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function rf(e){return e==="string"||e==="bytes"||_l(e)==="dynamic"}function nf(e){return e.lastIndexOf("]")===e.length-1}function sf(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var a=ml(e[s]),c=t[s],h=yt(a,c);rf(a)?(r.push(yt("uint256",i)),n.push(h),i+=h.length):r.push(h)}return V.concat(r.concat(n))}function vl(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<e.length;s++){var a=ml(e[s]),c=t[s];if(a==="bytes")i.push(c);else if(a==="string")i.push(new V(c,"utf8"));else if(a==="bool")i.push(new V(c?"01":"00","hex"));else if(a==="address")i.push(lr.setLength(c,20));else if(a.startsWith("bytes")){if(r=Pr(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(lr.setLengthRight(c,r))}else if(a.startsWith("uint")){if(r=Pr(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=sr(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(V,"be",r/8))}else if(a.startsWith("int")){if(r=Pr(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=sr(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(V,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return V.concat(i)}function of(e,t){return lr.keccak(vl(e,t))}var af={rawEncode:sf,solidityPack:vl,soliditySHA3:of};const pt=gl,gn=af,bl={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 i=["bytes32"],s=[this.hashType(e,r)];if(n){const a=(c,h,d)=>{if(r[h]!==void 0)return["bytes32",d==null?"0x0000000000000000000000000000000000000000000000000000000000000000":pt.keccak(this.encodeData(h,d,r,n))];if(d===void 0)throw new Error(`missing value for field ${c} of type ${h}`);if(h==="bytes")return["bytes32",pt.keccak(d)];if(h==="string")return typeof d=="string"&&(d=V.from(d,"utf8")),["bytes32",pt.keccak(d)];if(h.lastIndexOf("]")===h.length-1){const f=h.slice(0,h.lastIndexOf("[")),g=d.map(b=>a(c,f,b));return["bytes32",pt.keccak(gn.rawEncode(g.map(([b])=>b),g.map(([,b])=>b)))]}return[h,d]};for(const c of r[e]){const[h,d]=a(c.name,c.type,t[c.name]);i.push(h),s.push(d)}}else for(const a of r[e]){let c=t[a.name];if(c!==void 0)if(a.type==="bytes")i.push("bytes32"),c=pt.keccak(c),s.push(c);else if(a.type==="string")i.push("bytes32"),typeof c=="string"&&(c=V.from(c,"utf8")),c=pt.keccak(c),s.push(c);else if(r[a.type]!==void 0)i.push("bytes32"),c=pt.keccak(this.encodeData(a.type,c,r,n)),s.push(c);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(c)}}return gn.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:a,type:c})=>c+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return pt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return pt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in bl.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=[V.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),pt.keccak(V.concat(n))}};var cf={TYPED_MESSAGE_SCHEMA:bl,TypedDataUtils:Si,hashForSignTypedDataLegacy:function(e){return lf(e.data)},hashForSignTypedData_v3:function(e){return Si.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Si.hash(e.data)}};function lf(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(s){return s.type==="bytes"?pt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return gn.soliditySHA3(["bytes32","bytes32"],[gn.soliditySHA3(new Array(e.length).fill("string"),i),gn.soliditySHA3(n,r)])}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.filterFromParam=Vr.FilterPolyfill=void 0;const Lr=We,Ye=O,uf=5*60*1e3,ir={jsonrpc:"2.0",id:0};class hf{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Lr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=wl(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ye.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Ye.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Ye.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,Ye.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,Ye.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Yn())}async getFilterLogs(t){const r=(0,Ye.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_getLogs",params:[ma(n)]})):Yn()}makeFilterId(){return(0,Lr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}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 Yn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return es();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_getLogs",params:[ma(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const c=a.result.map(d=>(0,Ye.intNumberFromHexString)(d.blockNumber||"0x0")),h=Math.max(...c);if(h&&h>n){const d=(0,Lr.IntNumber)(h+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${d}`),this.cursors.set(t,d)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Yn();const n=await this.getCurrentBlockHeight();if(r>n)return es();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,Ye.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Lr.IntNumber)(a))))).filter(a=>!!a),s=(0,Lr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},ir),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(es())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}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)},uf);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_blockNumber",params:[]}));return(0,Ye.intNumberFromHexString)((0,Ye.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},ir),{method:"eth_getBlockByNumber",params:[(0,Ye.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ye.ensureHexString)(r.result.hash):null}}Vr.FilterPolyfill=hf;function wl(e){return{fromBlock:_a(e.fromBlock),toBlock:_a(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Vr.filterFromParam=wl;function ma(e){const t={fromBlock:va(e.fromBlock),toBlock:va(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function _a(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Lr.IntNumber)(0);if((0,Ye.isHexString)(e))return(0,Ye.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function va(e){return e==="latest"?e:(0,Ye.hexStringFromIntNumber)(e)}function Yn(){return Object.assign(Object.assign({},ir),{error:{code:-32e3,message:"filter not found"}})}function es(){return Object.assign(Object.assign({},ir),{result:[]})}var zs={},yl={},Ws={},fo=df;function df(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 ba=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(a,c){if(t.multiArgs){const h=new Array(arguments.length-1);for(let d=1;d<arguments.length;d++)h[d-1]=arguments[d];a?(h.unshift(a),s(h)):i(h)}else a?s(a):i(c)}):n.push(function(a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let h=0;h<arguments.length;h++)c[h]=arguments[h];i(c)}else i(a)}),e.apply(this,n)})};var ff=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):ba(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?ba(s,t):s}return n},Bn={},Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});const pf=lc;function wa(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function gf(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let mf=class extends pf.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")wa(s,this,r);else{const a=s.length,c=gf(s);for(let h=0;h<a;h+=1)wa(c[h],this,r)}return!0}};Dn.default=mf;var _f=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BaseBlockTracker=void 0;const vf=_f(Dn),bf=1e3,wf=(e,t)=>e+t,ya=["sync","latest"];class yf extends vf.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*bf,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){ya.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 ya.map(t=>this.listenerCount(t)).reduce(wf)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Ea(t),i=Ea(r);return this._usePastBlocks&&n<i||n>i}_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}}Bn.BaseBlockTracker=yf;function Ea(e){return Number.parseInt(e,16)}var El={},Sl={},Ke={};class kl extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:c}=t,h=c.length===0?i:`At path: ${c.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Ef(e){return dt(e)&&typeof e[Symbol.iterator]=="function"}function dt(e){return typeof e=="object"&&e!=null}function Sa(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function qe(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Sf(e){const{done:t,value:r}=e.next();return t?void 0:r}function kf(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:c,message:h=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${qe(n)}\``}=e;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:s,...e,message:h}}function*Hi(e,t,r,n){Ef(e)||(e=[e]);for(const i of e){const s=kf(i,t,r,n);s&&(yield s)}}function*po(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,c={path:n,branch:i};if(s&&(e=t.coercer(e,c),a&&t.type!=="type"&&dt(t.schema)&&dt(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let h="valid";for(const d of t.validator(e,c))d.explanation=r.message,h="not_valid",yield[d,void 0];for(let[d,f,g]of t.entries(e,c)){const b=po(f,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,f],coerce:s,mask:a,message:r.message});for(const S of b)S[0]?(h=S[0].refinement!=null?"not_refined":"not_valid",yield[S[0],void 0]):s&&(f=S[1],d===void 0?e=f:e instanceof Map?e.set(d,f):e instanceof Set?e.add(f):dt(e)&&(f!==void 0||d in e)&&(e[d]=f))}if(h!=="not_valid")for(const d of t.refiner(e,c))d.explanation=r.message,h="not_refined",yield[d,void 0];h==="valid"&&(yield[void 0,e])}class Ve{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:c=function*(){}}=t;this.type=r,this.schema=n,this.entries=c,this.coercer=a,i?this.validator=(h,d)=>{const f=i(h,d);return Hi(f,d,this,h)}:this.validator=()=>[],s?this.refiner=(h,d)=>{const f=s(h,d);return Hi(f,d,this,h)}:this.refiner=()=>[]}assert(t,r){return Ml(t,this,r)}create(t,r){return Rl(t,this,r)}is(t){return go(t,this)}mask(t,r){return Cl(t,this,r)}validate(t,r={}){return Yr(t,this,r)}}function Ml(e,t,r){const n=Yr(e,t,{message:r});if(n[0])throw n[0]}function Rl(e,t,r){const n=Yr(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Cl(e,t,r){const n=Yr(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function go(e,t){return!Yr(e,t)[0]}function Yr(e,t,r={}){const n=po(e,t,r),i=Sf(n);return i[0]?[new kl(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function Mf(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?jn(n):Fn(n)}function nt(e,t){return new Ve({type:e,schema:null,validator:t})}function Rf(e,t){return new Ve({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function Cf(e){return new Ve({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function If(e){let t;return new Ve({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function xf(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return jn(n);default:return Fn(n)}}function Af(e){const t=e instanceof Ve,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Il(r[n]);return t&&e.type==="type"?jn(r):Fn(r)}function Nf(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return jn(n);default:return Fn(n)}}function Lf(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),nt(e,t)}function $f(){return nt("any",()=>!0)}function Tf(e){return new Ve({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${qe(t)}`}})}function Pf(){return nt("bigint",e=>typeof e=="bigint")}function Of(){return nt("boolean",e=>typeof e=="boolean")}function Bf(){return nt("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${qe(e)}`)}function Df(e){const t={},r=e.map(n=>qe(n)).join();for(const n of e)t[n]=n;return new Ve({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${qe(n)}`}})}function Ff(){return nt("func",e=>typeof e=="function"||`Expected a function, but received: ${qe(e)}`)}function jf(e){return nt("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${qe(t)}`)}function Hf(){return nt("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${qe(e)}`)}function Uf(e){return new Ve({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function Vf(e){const t=qe(e),r=typeof e;return new Ve({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${qe(n)}`}})}function zf(e,t){return new Ve({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${qe(r)}`}})}function mo(){return nt("never",()=>!1)}function Wf(e){return new Ve({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function qf(){return nt("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${qe(e)}`)}function Fn(e){const t=e?Object.keys(e):[],r=mo();return new Ve({type:"object",schema:e||null,*entries(n){if(e&&dt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return dt(n)||`Expected an object, but received: ${qe(n)}`},coercer(n){return dt(n)?{...n}:n}})}function Il(e){return new Ve({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Jf(e,t){return new Ve({type:"record",schema:null,*entries(r){if(dt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return dt(r)||`Expected an object, but received: ${qe(r)}`}})}function Gf(){return nt("regexp",e=>e instanceof RegExp)}function Zf(e){return new Ve({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${qe(t)}`}})}function xl(){return nt("string",e=>typeof e=="string"||`Expected a string, but received: ${qe(e)}`)}function Qf(e){const t=mo();return new Ve({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${qe(r)}`}})}function jn(e){const t=Object.keys(e);return new Ve({type:"type",schema:e,*entries(r){if(dt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return dt(r)||`Expected an object, but received: ${qe(r)}`},coercer(r){return dt(r)?{...r}:r}})}function Kf(e){const t=e.map(r=>r.type).join(" | ");return new Ve({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=po(r,s,n),[c]=a;if(c[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${qe(r)}`,...i]}})}function Al(){return nt("unknown",()=>!0)}function _o(e,t,r){return new Ve({...e,coercer:(n,i)=>go(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Xf(e,t,r={}){return _o(e,Al(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&Sa(n)&&Sa(i)){const s={...n};let a=!1;for(const c in i)s[c]===void 0&&(s[c]=i[c],a=!0);if(a)return s}return n})}function Yf(e){return _o(e,xl(),t=>t.trim())}function e1(e){return fr(e,"empty",t=>{const r=Nl(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Nl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function t1(e,t,r={}){const{exclusive:n}=r;return fr(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function r1(e,t,r={}){const{exclusive:n}=r;return fr(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function n1(e){return fr(e,"nonempty",t=>Nl(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function s1(e,t){return fr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function i1(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return fr(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return t<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return t<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function fr(e,t,r){return new Ve({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),a=Hi(s,i,e,n);for(const c of a)yield{...c,refinement:t}}})}const o1=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ve,StructError:kl,any:$f,array:Tf,assert:Ml,assign:Mf,bigint:Pf,boolean:Of,coerce:_o,create:Rl,date:Bf,defaulted:Xf,define:nt,deprecated:Rf,dynamic:Cf,empty:e1,enums:Df,func:Ff,instance:jf,integer:Hf,intersection:Uf,is:go,lazy:If,literal:Vf,map:zf,mask:Cl,max:t1,min:r1,never:mo,nonempty:n1,nullable:Wf,number:qf,object:Fn,omit:xf,optional:Il,partial:Af,pattern:s1,pick:Nf,record:Jf,refine:fr,regexp:Gf,set:Zf,size:i1,string:xl,struct:Lf,trimmed:Yf,tuple:Qf,type:jn,union:Kf,unknown:Al,validate:Yr},Symbol.toStringTag,{value:"Module"})),pr=qi(o1);Object.defineProperty(Ke,"__esModule",{value:!0});Ke.assertExhaustive=Ke.assertStruct=Ke.assert=Ke.AssertionError=void 0;const a1=pr;function c1(e){return typeof e=="object"&&e!==null&&"message"in e}function l1(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 u1(e){const t=c1(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Ll(e,t){return l1(e)?new e({message:t}):e({message:t})}class vo extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Ke.AssertionError=vo;function h1(e,t="Assertion failed.",r=vo){if(!e)throw t instanceof Error?t:Ll(r,t)}Ke.assert=h1;function d1(e,t,r="Assertion failed",n=vo){try{(0,a1.assert)(e,t)}catch(i){throw Ll(n,`${r}: ${u1(i)}.`)}}Ke.assertStruct=d1;function f1(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ke.assertExhaustive=f1;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.base64=void 0;const p1=pr,g1=Ke,m1=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,g1.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let c;return i?c=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):c=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,p1.pattern)(e,c)};Hn.base64=m1;var G={},Un={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=pr,r=Ke;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(d){return(0,t.is)(d,e.HexStruct)}e.isHexString=n;function i(d){return(0,t.is)(d,e.StrictHexStruct)}e.isStrictHexString=i;function s(d){(0,r.assert)(n(d),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function a(d){(0,r.assert)(i(d),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function c(d){return d.startsWith("0x")?d:d.startsWith("0X")?`0x${d.substring(2)}`:`0x${d}`}e.add0x=c;function h(d){return d.startsWith("0x")||d.startsWith("0X")?d.substring(2):d}e.remove0x=h})(Un);Object.defineProperty(G,"__esModule",{value:!0});G.createDataView=G.concatBytes=G.valueToBytes=G.stringToBytes=G.numberToBytes=G.signedBigIntToBytes=G.bigIntToBytes=G.hexToBytes=G.bytesToString=G.bytesToNumber=G.bytesToSignedBigInt=G.bytesToBigInt=G.bytesToHex=G.assertIsBytes=G.isBytes=void 0;const ot=Ke,Ui=Un,ka=48,Ma=58,Ra=87;function _1(){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 v1=_1();function bo(e){return e instanceof Uint8Array}G.isBytes=bo;function en(e){(0,ot.assert)(bo(e),"Value must be a Uint8Array.")}G.assertIsBytes=en;function $l(e){if(en(e),e.length===0)return"0x";const t=v1(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Ui.add0x)(r.join(""))}G.bytesToHex=$l;function Tl(e){en(e);const t=$l(e);return BigInt(t)}G.bytesToBigInt=Tl;function b1(e){en(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}G.bytesToSignedBigInt=b1;function w1(e){en(e);const t=Tl(e);return(0,ot.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}G.bytesToNumber=w1;function y1(e){return en(e),new TextDecoder().decode(e)}G.bytesToString=y1;function qs(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Ui.assertIsHexString)(e);const r=(0,Ui.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const a=n.charCodeAt(s*2),c=n.charCodeAt(s*2+1),h=a-(a<Ma?ka:Ra),d=c-(c<Ma?ka:Ra);i[s]=h*16+d}return i}G.hexToBytes=qs;function Pl(e){(0,ot.assert)(typeof e=="bigint","Value must be a bigint."),(0,ot.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return qs(t)}G.bigIntToBytes=Pl;function E1(e,t){(0,ot.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function S1(e,t){(0,ot.assert)(typeof e=="bigint","Value must be a bigint."),(0,ot.assert)(typeof t=="number","Byte length must be a number."),(0,ot.assert)(t>0,"Byte length must be greater than 0."),(0,ot.assert)(E1(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}G.signedBigIntToBytes=S1;function Ol(e){(0,ot.assert)(typeof e=="number","Value must be a number."),(0,ot.assert)(e>=0,"Value must be a non-negative number."),(0,ot.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return qs(t)}G.numberToBytes=Ol;function Bl(e){return(0,ot.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}G.stringToBytes=Bl;function Dl(e){if(typeof e=="bigint")return Pl(e);if(typeof e=="number")return Ol(e);if(typeof e=="string")return e.startsWith("0x")?qs(e):Bl(e);if(bo(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}G.valueToBytes=Dl;function k1(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=Dl(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}G.concatBytes=k1;function M1(e){if(typeof V<"u"&&e instanceof V){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}G.createDataView=M1;var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.ChecksumStruct=void 0;const Ca=pr,R1=Hn;Js.ChecksumStruct=(0,Ca.size)((0,R1.base64)((0,Ca.string)(),{paddingRequired:!0}),44,44);var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.createHex=Rt.createBytes=Rt.createBigInt=Rt.createNumber=void 0;const Ue=pr,C1=Ke,Fl=G,Gs=Un,jl=(0,Ue.union)([(0,Ue.number)(),(0,Ue.bigint)(),(0,Ue.string)(),Gs.StrictHexStruct]),I1=(0,Ue.coerce)((0,Ue.number)(),jl,Number),x1=(0,Ue.coerce)((0,Ue.bigint)(),jl,BigInt);(0,Ue.union)([Gs.StrictHexStruct,(0,Ue.instance)(Uint8Array)]);const A1=(0,Ue.coerce)((0,Ue.instance)(Uint8Array),(0,Ue.union)([Gs.StrictHexStruct]),Fl.hexToBytes),N1=(0,Ue.coerce)(Gs.StrictHexStruct,(0,Ue.instance)(Uint8Array),Fl.bytesToHex);function L1(e){try{const t=(0,Ue.create)(e,I1);return(0,C1.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Rt.createNumber=L1;function $1(e){try{return(0,Ue.create)(e,x1)}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Rt.createBigInt=$1;function T1(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Ue.create)(e,A1)}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Rt.createBytes=T1;function P1(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Ue.create)(e,N1)}catch(t){throw t instanceof Ue.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Rt.createHex=P1;var zr={},Hl=D&&D.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},et=D&&D.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ft,bt;Object.defineProperty(zr,"__esModule",{value:!0});zr.FrozenSet=zr.FrozenMap=void 0;class wo{constructor(t){ft.set(this,void 0),Hl(this,ft,new Map(t),"f"),Object.freeze(this)}get size(){return et(this,ft,"f").size}[(ft=new WeakMap,Symbol.iterator)](){return et(this,ft,"f")[Symbol.iterator]()}entries(){return et(this,ft,"f").entries()}forEach(t,r){return et(this,ft,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return et(this,ft,"f").get(t)}has(t){return et(this,ft,"f").has(t)}keys(){return et(this,ft,"f").keys()}values(){return et(this,ft,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}zr.FrozenMap=wo;class yo{constructor(t){bt.set(this,void 0),Hl(this,bt,new Set(t),"f"),Object.freeze(this)}get size(){return et(this,bt,"f").size}[(bt=new WeakMap,Symbol.iterator)](){return et(this,bt,"f")[Symbol.iterator]()}entries(){return et(this,bt,"f").entries()}forEach(t,r){return et(this,bt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return et(this,bt,"f").has(t)}keys(){return et(this,bt,"f").keys()}values(){return et(this,bt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}zr.FrozenSet=yo;Object.freeze(wo);Object.freeze(wo.prototype);Object.freeze(yo);Object.freeze(yo.prototype);var Ul={};Object.defineProperty(Ul,"__esModule",{value:!0});var Vl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=pr,r=Ke,n=()=>(0,t.define)("finite number",N=>(0,t.is)(N,(0,t.number)())&&Number.isFinite(N));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(N,P)=>{function W(Y,re){const F=[...re.validator(Y,P)];return F.length>0?F:!0}try{const Y=W(N,e.UnsafeJsonStruct);return Y!==!0?Y:W(JSON.parse(JSON.stringify(N)),e.UnsafeJsonStruct)}catch(Y){return Y instanceof RangeError?"Circular reference detected":!1}});function i(N){return(0,t.is)(N,e.JsonStruct)}e.isValidJson=i;function s(N){(0,r.assertStruct)(N,e.JsonStruct,"Invalid JSON value");const P=JSON.stringify(N);return new TextEncoder().encode(P).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function a(N){return(0,t.is)(N,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function c(N,P){(0,r.assertStruct)(N,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",P)}e.assertIsJsonRpcNotification=c;function h(N){return(0,t.is)(N,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function d(N,P){(0,r.assertStruct)(N,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",P)}e.assertIsJsonRpcRequest=d,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function f(N){return(0,t.is)(N,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=f;function g(N,P){(0,r.assertStruct)(N,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",P)}e.assertIsPendingJsonRpcResponse=g;function b(N){return(0,t.is)(N,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=b;function S(N,P){(0,r.assertStruct)(N,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",P)}e.assertIsJsonRpcResponse=S;function I(N){return(0,t.is)(N,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=I;function R(N,P){(0,r.assertStruct)(N,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",P)}e.assertIsJsonRpcSuccess=R;function x(N){return(0,t.is)(N,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=x;function A(N,P){(0,r.assertStruct)(N,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",P)}e.assertIsJsonRpcFailure=A;function C(N){return(0,t.is)(N,e.JsonRpcErrorStruct)}e.isJsonRpcError=C;function M(N,P){(0,r.assertStruct)(N,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",P)}e.assertIsJsonRpcError=M;function B(N){const{permitEmptyString:P,permitFractions:W,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},N);return Z=>!!(typeof Z=="number"&&(W||Number.isInteger(Z))||typeof Z=="string"&&(P||Z.length>0)||Y&&Z===null)}e.getJsonRpcIdValidator=B})(Vl);var zl={};Object.defineProperty(zl,"__esModule",{value:!0});var Wr={},O1=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createModuleLogger=Wr.createProjectLogger=void 0;const B1=O1(Mu()),D1=(0,B1.default)("metamask");function F1(e){return D1.extend(e)}Wr.createProjectLogger=F1;function j1(e,t){return e.extend(t)}Wr.createModuleLogger=j1;var Wl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(d){return Array.isArray(d)&&d.length>0}e.isNonEmptyArray=t;function r(d){return d==null}e.isNullOrUndefined=r;function n(d){return!!d&&typeof d=="object"&&!Array.isArray(d)}e.isObject=n;const i=(d,f)=>Object.hasOwnProperty.call(d,f);e.hasProperty=i,function(d){d[d.Null=4]="Null",d[d.Comma=1]="Comma",d[d.Wrapper=1]="Wrapper",d[d.True=4]="True",d[d.False=5]="False",d[d.Quote=1]="Quote",d[d.Colon=1]="Colon",d[d.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(d){if(typeof d!="object"||d===null)return!1;try{let f=d;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(d)===f}catch{return!1}}e.isPlainObject=s;function a(d){return d.charCodeAt(0)<=127}e.isASCII=a;function c(d){var f;return d.split("").reduce((b,S)=>a(S)?b+1:b+2,0)+((f=d.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&f!==void 0?f:[]).length}e.calculateStringSize=c;function h(d){return d.toString().length}e.calculateNumberSize=h})(Wl);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.hexToBigInt=Ct.hexToNumber=Ct.bigIntToHex=Ct.numberToHex=void 0;const Or=Ke,vn=Un,H1=e=>((0,Or.assert)(typeof e=="number","Value must be a number."),(0,Or.assert)(e>=0,"Value must be a non-negative number."),(0,Or.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,vn.add0x)(e.toString(16)));Ct.numberToHex=H1;const U1=e=>((0,Or.assert)(typeof e=="bigint","Value must be a bigint."),(0,Or.assert)(e>=0,"Value must be a non-negative bigint."),(0,vn.add0x)(e.toString(16)));Ct.bigIntToHex=U1;const V1=e=>{(0,vn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Or.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ct.hexToNumber=V1;const z1=e=>((0,vn.assertIsHexString)(e),BigInt((0,vn.add0x)(e)));Ct.hexToBigInt=z1;var ql={};Object.defineProperty(ql,"__esModule",{value:!0});var Jl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!t(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(Jl);var Gl={};Object.defineProperty(Gl,"__esModule",{value:!0});var Zl={},Vi={exports:{}};const W1="2.0.0",Ql=256,q1=Number.MAX_SAFE_INTEGER||9007199254740991,J1=16,G1=Ql-6,Z1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Zs={MAX_LENGTH:Ql,MAX_SAFE_COMPONENT_LENGTH:J1,MAX_SAFE_BUILD_LENGTH:G1,MAX_SAFE_INTEGER:q1,RELEASE_TYPES:Z1,SEMVER_SPEC_VERSION:W1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Q1=typeof Eu=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Qs=Q1;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Zs,s=Qs;t=e.exports={};const a=t.re=[],c=t.safeRe=[],h=t.src=[],d=t.safeSrc=[],f=t.t={};let g=0;const b="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",i],[b,n]],I=x=>{for(const[A,C]of S)x=x.split(`${A}*`).join(`${A}{0,${C}}`).split(`${A}+`).join(`${A}{1,${C}}`);return x},R=(x,A,C)=>{const M=I(A),B=g++;s(x,B,A),f[x]=B,h[B]=A,d[B]=M,a[B]=new RegExp(A,C?"g":void 0),c[B]=new RegExp(M,C?"g":void 0)};R("NUMERICIDENTIFIER","0|[1-9]\\d*"),R("NUMERICIDENTIFIERLOOSE","\\d+"),R("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${b}*`),R("MAINVERSION",`(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})`),R("MAINVERSIONLOOSE",`(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASEIDENTIFIER",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIER]})`),R("PRERELEASEIDENTIFIERLOOSE",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIERLOOSE]})`),R("PRERELEASE",`(?:-(${h[f.PRERELEASEIDENTIFIER]}(?:\\.${h[f.PRERELEASEIDENTIFIER]})*))`),R("PRERELEASELOOSE",`(?:-?(${h[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[f.PRERELEASEIDENTIFIERLOOSE]})*))`),R("BUILDIDENTIFIER",`${b}+`),R("BUILD",`(?:\\+(${h[f.BUILDIDENTIFIER]}(?:\\.${h[f.BUILDIDENTIFIER]})*))`),R("FULLPLAIN",`v?${h[f.MAINVERSION]}${h[f.PRERELEASE]}?${h[f.BUILD]}?`),R("FULL",`^${h[f.FULLPLAIN]}$`),R("LOOSEPLAIN",`[v=\\s]*${h[f.MAINVERSIONLOOSE]}${h[f.PRERELEASELOOSE]}?${h[f.BUILD]}?`),R("LOOSE",`^${h[f.LOOSEPLAIN]}$`),R("GTLT","((?:<|>)?=?)"),R("XRANGEIDENTIFIERLOOSE",`${h[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),R("XRANGEIDENTIFIER",`${h[f.NUMERICIDENTIFIER]}|x|X|\\*`),R("XRANGEPLAIN",`[v=\\s]*(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:${h[f.PRERELEASE]})?${h[f.BUILD]}?)?)?`),R("XRANGEPLAINLOOSE",`[v=\\s]*(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:${h[f.PRERELEASELOOSE]})?${h[f.BUILD]}?)?)?`),R("XRANGE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAIN]}$`),R("XRANGELOOSE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAINLOOSE]}$`),R("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),R("COERCE",`${h[f.COERCEPLAIN]}(?:$|[^\\d])`),R("COERCEFULL",h[f.COERCEPLAIN]+`(?:${h[f.PRERELEASE]})?(?:${h[f.BUILD]})?(?:$|[^\\d])`),R("COERCERTL",h[f.COERCE],!0),R("COERCERTLFULL",h[f.COERCEFULL],!0),R("LONETILDE","(?:~>?)"),R("TILDETRIM",`(\\s*)${h[f.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",R("TILDE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAIN]}$`),R("TILDELOOSE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAINLOOSE]}$`),R("LONECARET","(?:\\^)"),R("CARETTRIM",`(\\s*)${h[f.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",R("CARET",`^${h[f.LONECARET]}${h[f.XRANGEPLAIN]}$`),R("CARETLOOSE",`^${h[f.LONECARET]}${h[f.XRANGEPLAINLOOSE]}$`),R("COMPARATORLOOSE",`^${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]})$|^$`),R("COMPARATOR",`^${h[f.GTLT]}\\s*(${h[f.FULLPLAIN]})$|^$`),R("COMPARATORTRIM",`(\\s*)${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]}|${h[f.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",R("HYPHENRANGE",`^\\s*(${h[f.XRANGEPLAIN]})\\s+-\\s+(${h[f.XRANGEPLAIN]})\\s*$`),R("HYPHENRANGELOOSE",`^\\s*(${h[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[f.XRANGEPLAINLOOSE]})\\s*$`),R("STAR","(<|>)?=?\\s*\\*"),R("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),R("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Vi,Vi.exports);var Vn=Vi.exports;const K1=Object.freeze({loose:!0}),X1=Object.freeze({}),Y1=e=>e?typeof e!="object"?K1:e:X1;var Eo=Y1;const Ia=/^[0-9]+$/,Kl=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=Ia.test(e),n=Ia.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},ep=(e,t)=>Kl(t,e);var Xl={compareIdentifiers:Kl,rcompareIdentifiers:ep};const ts=Qs,{MAX_LENGTH:xa,MAX_SAFE_INTEGER:rs}=Zs,{safeRe:ns,t:ss}=Vn,tp=Eo,{compareIdentifiers:ki}=Xl;let rp=class wt{constructor(t,r){if(r=tp(r),t instanceof wt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>xa)throw new TypeError(`version is longer than ${xa} characters`);ts("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?ns[ss.LOOSE]:ns[ss.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>rs||this.major<0)throw new TypeError("Invalid major version");if(this.minor>rs||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>rs||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<rs)return s}return i}):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(ts("SemVer.compare",this.version,this.options,t),!(t instanceof wt)){if(typeof t=="string"&&t===this.version)return 0;t=new wt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof wt||(t=new wt(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof wt||(t=new wt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(ts("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ki(n,i)}while(++r)}compareBuild(t){t instanceof wt||(t=new wt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(ts("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return ki(n,i)}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 i=`-${r}`.match(this.options.loose?ns[ss.PRERELEASELOOSE]:ns[ss.PRERELEASE]);if(!i||i[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 i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),ki(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var tt=rp;const Aa=tt,np=(e,t,r=!1)=>{if(e instanceof Aa)return e;try{return new Aa(e,t)}catch(n){if(!r)return null;throw n}};var tn=np;const sp=tn,ip=(e,t)=>{const r=sp(e,t);return r?r.version:null};var op=ip;const ap=tn,cp=(e,t)=>{const r=ap(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var lp=cp;const Na=tt,up=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Na(e instanceof Na?e.version:e,r).inc(t,n,i).version}catch{return null}};var hp=up;const La=tn,dp=(e,t)=>{const r=La(e,null,!0),n=La(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,c=s?n:r,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}const f=h?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};var fp=dp;const pp=tt,gp=(e,t)=>new pp(e,t).major;var mp=gp;const _p=tt,vp=(e,t)=>new _p(e,t).minor;var bp=vp;const wp=tt,yp=(e,t)=>new wp(e,t).patch;var Ep=yp;const Sp=tn,kp=(e,t)=>{const r=Sp(e,t);return r&&r.prerelease.length?r.prerelease:null};var Mp=kp;const $a=tt,Rp=(e,t,r)=>new $a(e,r).compare(new $a(t,r));var mt=Rp;const Cp=mt,Ip=(e,t,r)=>Cp(t,e,r);var xp=Ip;const Ap=mt,Np=(e,t)=>Ap(e,t,!0);var Lp=Np;const Ta=tt,$p=(e,t,r)=>{const n=new Ta(e,r),i=new Ta(t,r);return n.compare(i)||n.compareBuild(i)};var So=$p;const Tp=So,Pp=(e,t)=>e.sort((r,n)=>Tp(r,n,t));var Op=Pp;const Bp=So,Dp=(e,t)=>e.sort((r,n)=>Bp(n,r,t));var Fp=Dp;const jp=mt,Hp=(e,t,r)=>jp(e,t,r)>0;var Ks=Hp;const Up=mt,Vp=(e,t,r)=>Up(e,t,r)<0;var ko=Vp;const zp=mt,Wp=(e,t,r)=>zp(e,t,r)===0;var Yl=Wp;const qp=mt,Jp=(e,t,r)=>qp(e,t,r)!==0;var eu=Jp;const Gp=mt,Zp=(e,t,r)=>Gp(e,t,r)>=0;var Mo=Zp;const Qp=mt,Kp=(e,t,r)=>Qp(e,t,r)<=0;var Ro=Kp;const Xp=Yl,Yp=eu,eg=Ks,tg=Mo,rg=ko,ng=Ro,sg=(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 Xp(e,r,n);case"!=":return Yp(e,r,n);case">":return eg(e,r,n);case">=":return tg(e,r,n);case"<":return rg(e,r,n);case"<=":return ng(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var tu=sg;const ig=tt,og=tn,{safeRe:is,t:os}=Vn,ag=(e,t)=>{if(e instanceof ig)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?is[os.COERCEFULL]:is[os.COERCE]);else{const h=t.includePrerelease?is[os.COERCERTLFULL]:is[os.COERCERTL];let d;for(;(d=h.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),h.lastIndex=d.index+d[1].length+d[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return og(`${n}.${i}.${s}${a}${c}`,t)};var cg=ag;class lg{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 i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var ug=lg,Mi,Pa;function _t(){if(Pa)return Mi;Pa=1;const e=/\s+/g;class t{constructor(u,p){if(p=i(p),u instanceof t)return u.loose===!!p.loose&&u.includePrerelease===!!p.includePrerelease?u:new t(u.raw,p);if(u instanceof s)return this.raw=u.value,this.set=[[u]],this.formatted=void 0,this;if(this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease,this.raw=u.trim().replace(e," "),this.set=this.raw.split("||").map(m=>this.parseRange(m.trim())).filter(m=>m.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const m=this.set[0];if(this.set=this.set.filter(v=>!R(v[0])),this.set.length===0)this.set=[m];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&x(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let u=0;u<this.set.length;u++){u>0&&(this.formatted+="||");const p=this.set[u];for(let m=0;m<p.length;m++)m>0&&(this.formatted+=" "),this.formatted+=p[m].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(u){const m=((this.options.includePrerelease&&S)|(this.options.loose&&I))+":"+u,v=n.get(m);if(v)return v;const y=this.options.loose,k=y?h[d.HYPHENRANGELOOSE]:h[d.HYPHENRANGE];u=u.replace(k,U(this.options.includePrerelease)),a("hyphen replace",u),u=u.replace(h[d.COMPARATORTRIM],f),a("comparator trim",u),u=u.replace(h[d.TILDETRIM],g),a("tilde trim",u),u=u.replace(h[d.CARETTRIM],b),a("caret trim",u);let _=u.split(" ").map(L=>C(L,this.options)).join(" ").split(/\s+/).map(L=>F(L,this.options));y&&(_=_.filter(L=>(a("loose invalid filter",L,this.options),!!L.match(h[d.COMPARATORLOOSE])))),a("range list",_);const l=new Map,w=_.map(L=>new s(L,this.options));for(const L of w){if(R(L))return[L];l.set(L.value,L)}l.size>1&&l.has("")&&l.delete("");const T=[...l.values()];return n.set(m,T),T}intersects(u,p){if(!(u instanceof t))throw new TypeError("a Range is required");return this.set.some(m=>A(m,p)&&u.set.some(v=>A(v,p)&&m.every(y=>v.every(k=>y.intersects(k,p)))))}test(u){if(!u)return!1;if(typeof u=="string")try{u=new c(u,this.options)}catch{return!1}for(let p=0;p<this.set.length;p++)if(E(this.set[p],u,this.options))return!0;return!1}}Mi=t;const r=ug,n=new r,i=Eo,s=Xs(),a=Qs,c=tt,{safeRe:h,t:d,comparatorTrimReplace:f,tildeTrimReplace:g,caretTrimReplace:b}=Vn,{FLAG_INCLUDE_PRERELEASE:S,FLAG_LOOSE:I}=Zs,R=o=>o.value==="<0.0.0-0",x=o=>o.value==="",A=(o,u)=>{let p=!0;const m=o.slice();let v=m.pop();for(;p&&m.length;)p=m.every(y=>v.intersects(y,u)),v=m.pop();return p},C=(o,u)=>(o=o.replace(h[d.BUILD],""),a("comp",o,u),o=P(o,u),a("caret",o),o=B(o,u),a("tildes",o),o=Y(o,u),a("xrange",o),o=Z(o,u),a("stars",o),o),M=o=>!o||o.toLowerCase()==="x"||o==="*",B=(o,u)=>o.trim().split(/\s+/).map(p=>N(p,u)).join(" "),N=(o,u)=>{const p=u.loose?h[d.TILDELOOSE]:h[d.TILDE];return o.replace(p,(m,v,y,k,_)=>{a("tilde",o,m,v,y,k,_);let l;return M(v)?l="":M(y)?l=`>=${v}.0.0 <${+v+1}.0.0-0`:M(k)?l=`>=${v}.${y}.0 <${v}.${+y+1}.0-0`:_?(a("replaceTilde pr",_),l=`>=${v}.${y}.${k}-${_} <${v}.${+y+1}.0-0`):l=`>=${v}.${y}.${k} <${v}.${+y+1}.0-0`,a("tilde return",l),l})},P=(o,u)=>o.trim().split(/\s+/).map(p=>W(p,u)).join(" "),W=(o,u)=>{a("caret",o,u);const p=u.loose?h[d.CARETLOOSE]:h[d.CARET],m=u.includePrerelease?"-0":"";return o.replace(p,(v,y,k,_,l)=>{a("caret",o,v,y,k,_,l);let w;return M(y)?w="":M(k)?w=`>=${y}.0.0${m} <${+y+1}.0.0-0`:M(_)?y==="0"?w=`>=${y}.${k}.0${m} <${y}.${+k+1}.0-0`:w=`>=${y}.${k}.0${m} <${+y+1}.0.0-0`:l?(a("replaceCaret pr",l),y==="0"?k==="0"?w=`>=${y}.${k}.${_}-${l} <${y}.${k}.${+_+1}-0`:w=`>=${y}.${k}.${_}-${l} <${y}.${+k+1}.0-0`:w=`>=${y}.${k}.${_}-${l} <${+y+1}.0.0-0`):(a("no pr"),y==="0"?k==="0"?w=`>=${y}.${k}.${_}${m} <${y}.${k}.${+_+1}-0`:w=`>=${y}.${k}.${_}${m} <${y}.${+k+1}.0-0`:w=`>=${y}.${k}.${_} <${+y+1}.0.0-0`),a("caret return",w),w})},Y=(o,u)=>(a("replaceXRanges",o,u),o.split(/\s+/).map(p=>re(p,u)).join(" ")),re=(o,u)=>{o=o.trim();const p=u.loose?h[d.XRANGELOOSE]:h[d.XRANGE];return o.replace(p,(m,v,y,k,_,l)=>{a("xRange",o,m,v,y,k,_,l);const w=M(y),T=w||M(k),L=T||M(_),$=L;return v==="="&&$&&(v=""),l=u.includePrerelease?"-0":"",w?v===">"||v==="<"?m="<0.0.0-0":m="*":v&&$?(T&&(k=0),_=0,v===">"?(v=">=",T?(y=+y+1,k=0,_=0):(k=+k+1,_=0)):v==="<="&&(v="<",T?y=+y+1:k=+k+1),v==="<"&&(l="-0"),m=`${v+y}.${k}.${_}${l}`):T?m=`>=${y}.0.0${l} <${+y+1}.0.0-0`:L&&(m=`>=${y}.${k}.0${l} <${y}.${+k+1}.0-0`),a("xRange return",m),m})},Z=(o,u)=>(a("replaceStars",o,u),o.trim().replace(h[d.STAR],"")),F=(o,u)=>(a("replaceGTE0",o,u),o.trim().replace(h[u.includePrerelease?d.GTE0PRE:d.GTE0],"")),U=o=>(u,p,m,v,y,k,_,l,w,T,L,$)=>(M(m)?p="":M(v)?p=`>=${m}.0.0${o?"-0":""}`:M(y)?p=`>=${m}.${v}.0${o?"-0":""}`:k?p=`>=${p}`:p=`>=${p}${o?"-0":""}`,M(w)?l="":M(T)?l=`<${+w+1}.0.0-0`:M(L)?l=`<${w}.${+T+1}.0-0`:$?l=`<=${w}.${T}.${L}-${$}`:o?l=`<${w}.${T}.${+L+1}-0`:l=`<=${l}`,`${p} ${l}`.trim()),E=(o,u,p)=>{for(let m=0;m<o.length;m++)if(!o[m].test(u))return!1;if(u.prerelease.length&&!p.includePrerelease){for(let m=0;m<o.length;m++)if(a(o[m].semver),o[m].semver!==s.ANY&&o[m].semver.prerelease.length>0){const v=o[m].semver;if(v.major===u.major&&v.minor===u.minor&&v.patch===u.patch)return!0}return!1}return!0};return Mi}var Ri,Oa;function Xs(){if(Oa)return Ri;Oa=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,g){if(g=r(g),f instanceof t){if(f.loose===!!g.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),a("comparator",f,g),this.options=g,this.loose=!!g.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(f){const g=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],b=f.match(g);if(!b)throw new TypeError(`Invalid comparator: ${f}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new c(b[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(a("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new c(f,this.options)}catch{return!1}return s(f,this.operator,this.semver,this.options)}intersects(f,g){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(f.value,g).test(this.value):f.operator===""?f.value===""?!0:new h(this.value,g).test(f.semver):(g=r(g),g.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!g.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||s(this.semver,"<",f.semver,g)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||s(this.semver,">",f.semver,g)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}Ri=t;const r=Eo,{safeRe:n,t:i}=Vn,s=tu,a=Qs,c=tt,h=_t();return Ri}const hg=_t(),dg=(e,t,r)=>{try{t=new hg(t,r)}catch{return!1}return t.test(e)};var Ys=dg;const fg=_t(),pg=(e,t)=>new fg(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var gg=pg;const mg=tt,_g=_t(),vg=(e,t,r)=>{let n=null,i=null,s=null;try{s=new _g(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new mg(n,r))}),n};var bg=vg;const wg=tt,yg=_t(),Eg=(e,t,r)=>{let n=null,i=null,s=null;try{s=new yg(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new wg(n,r))}),n};var Sg=Eg;const Ci=tt,kg=_t(),Ba=Ks,Mg=(e,t)=>{e=new kg(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 i=e.set[n];let s=null;i.forEach(a=>{const c=new Ci(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Ba(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Ba(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Rg=Mg;const Cg=_t(),Ig=(e,t)=>{try{return new Cg(e,t).range||"*"}catch{return null}};var xg=Ig;const Ag=tt,ru=Xs(),{ANY:Ng}=ru,Lg=_t(),$g=Ys,Da=Ks,Fa=ko,Tg=Ro,Pg=Mo,Og=(e,t,r,n)=>{e=new Ag(e,n),t=new Lg(t,n);let i,s,a,c,h;switch(r){case">":i=Da,s=Tg,a=Fa,c=">",h=">=";break;case"<":i=Fa,s=Pg,a=Da,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if($g(e,t,n))return!1;for(let d=0;d<t.set.length;++d){const f=t.set[d];let g=null,b=null;if(f.forEach(S=>{S.semver===Ng&&(S=new ru(">=0.0.0")),g=g||S,b=b||S,i(S.semver,g.semver,n)?g=S:a(S.semver,b.semver,n)&&(b=S)}),g.operator===c||g.operator===h||(!b.operator||b.operator===c)&&s(e,b.semver))return!1;if(b.operator===h&&a(e,b.semver))return!1}return!0};var Co=Og;const Bg=Co,Dg=(e,t,r)=>Bg(e,t,">",r);var Fg=Dg;const jg=Co,Hg=(e,t,r)=>jg(e,t,"<",r);var Ug=Hg;const ja=_t(),Vg=(e,t,r)=>(e=new ja(e,r),t=new ja(t,r),e.intersects(t,r));var zg=Vg;const Wg=Ys,qg=mt;var Jg=(e,t,r)=>{const n=[];let i=null,s=null;const a=e.sort((f,g)=>qg(f,g,r));for(const f of a)Wg(f,t,r)?(s=f,i||(i=f)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const c=[];for(const[f,g]of n)f===g?c.push(f):!g&&f===a[0]?c.push("*"):g?f===a[0]?c.push(`<=${g}`):c.push(`${f} - ${g}`):c.push(`>=${f}`);const h=c.join(" || "),d=typeof t.raw=="string"?t.raw:String(t);return h.length<d.length?h:t};const Ha=_t(),Io=Xs(),{ANY:Ii}=Io,un=Ys,xo=mt,Gg=(e,t,r={})=>{if(e===t)return!0;e=new Ha(e,r),t=new Ha(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const a=Qg(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},Zg=[new Io(">=0.0.0-0")],Ua=[new Io(">=0.0.0")],Qg=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Ii){if(t.length===1&&t[0].semver===Ii)return!0;r.includePrerelease?e=Zg:e=Ua}if(t.length===1&&t[0].semver===Ii){if(r.includePrerelease)return!0;t=Ua}const n=new Set;let i,s;for(const S of e)S.operator===">"||S.operator===">="?i=Va(i,S,r):S.operator==="<"||S.operator==="<="?s=za(s,S,r):n.add(S.semver);if(n.size>1)return null;let a;if(i&&s){if(a=xo(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const S of n){if(i&&!un(S,String(i),r)||s&&!un(S,String(s),r))return null;for(const I of t)if(!un(S,String(I),r))return!1;return!0}let c,h,d,f,g=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(const S of t){if(f=f||S.operator===">"||S.operator===">=",d=d||S.operator==="<"||S.operator==="<=",i){if(b&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===b.major&&S.semver.minor===b.minor&&S.semver.patch===b.patch&&(b=!1),S.operator===">"||S.operator===">="){if(c=Va(i,S,r),c===S&&c!==i)return!1}else if(i.operator===">="&&!un(i.semver,String(S),r))return!1}if(s){if(g&&S.semver.prerelease&&S.semver.prerelease.length&&S.semver.major===g.major&&S.semver.minor===g.minor&&S.semver.patch===g.patch&&(g=!1),S.operator==="<"||S.operator==="<="){if(h=za(s,S,r),h===S&&h!==s)return!1}else if(s.operator==="<="&&!un(s.semver,String(S),r))return!1}if(!S.operator&&(s||i)&&a!==0)return!1}return!(i&&d&&!s&&a!==0||s&&f&&!i&&a!==0||b||g)},Va=(e,t,r)=>{if(!e)return t;const n=xo(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},za=(e,t,r)=>{if(!e)return t;const n=xo(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Kg=Gg;const xi=Vn,Wa=Zs,Xg=tt,qa=Xl,Yg=tn,em=op,tm=lp,rm=hp,nm=fp,sm=mp,im=bp,om=Ep,am=Mp,cm=mt,lm=xp,um=Lp,hm=So,dm=Op,fm=Fp,pm=Ks,gm=ko,mm=Yl,_m=eu,vm=Mo,bm=Ro,wm=tu,ym=cg,Em=Xs(),Sm=_t(),km=Ys,Mm=gg,Rm=bg,Cm=Sg,Im=Rg,xm=xg,Am=Co,Nm=Fg,Lm=Ug,$m=zg,Tm=Jg,Pm=Kg;var Om={parse:Yg,valid:em,clean:tm,inc:rm,diff:nm,major:sm,minor:im,patch:om,prerelease:am,compare:cm,rcompare:lm,compareLoose:um,compareBuild:hm,sort:dm,rsort:fm,gt:pm,lt:gm,eq:mm,neq:_m,gte:vm,lte:bm,cmp:wm,coerce:ym,Comparator:Em,Range:Sm,satisfies:km,toComparators:Mm,maxSatisfying:Rm,minSatisfying:Cm,minVersion:Im,validRange:xm,outside:Am,gtr:Nm,ltr:Lm,intersects:$m,simplifyRange:Tm,subset:Pm,SemVer:Xg,re:xi.re,src:xi.src,tokens:xi.t,SEMVER_SPEC_VERSION:Wa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Wa.RELEASE_TYPES,compareIdentifiers:qa.compareIdentifiers,rcompareIdentifiers:qa.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=Om,r=pr,n=Ke;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",g=>(0,t.valid)(g)===null?`Expected SemVer version, got "${g}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",g=>(0,t.validRange)(g)===null?`Expected SemVer range, got "${g}"`:!0);function i(g){return(0,r.is)(g,e.VersionStruct)}e.isValidSemVerVersion=i;function s(g){return(0,r.is)(g,e.VersionRangeStruct)}e.isValidSemVerRange=s;function a(g){(0,n.assertStruct)(g,e.VersionStruct)}e.assertIsSemVerVersion=a;function c(g){(0,n.assertStruct)(g,e.VersionRangeStruct)}e.assertIsSemVerRange=c;function h(g,b){return(0,t.gt)(g,b)}e.gtVersion=h;function d(g,b){return(0,t.gtr)(g,b)}e.gtRange=d;function f(g,b){return(0,t.satisfies)(g,b,{includePrerelease:!0})}e.satisfiesVersionRange=f})(Zl);(function(e){var t=D&&D.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=D&&D.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ke,e),r(Hn,e),r(G,e),r(Js,e),r(Rt,e),r(zr,e),r(Ul,e),r(Un,e),r(Vl,e),r(zl,e),r(Wr,e),r(Wl,e),r(Ct,e),r(ql,e),r(Jl,e),r(Gl,e),r(Zl,e)})(Sl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Sl;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(El);var nu=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.PollingBlockTracker=void 0;const Bm=nu(fo),Dm=nu(ff),Fm=Bn,Ja=El,Ga=(0,Ja.createModuleLogger)(Ja.projectLogger,"polling-block-tracker"),jm=(0,Bm.default)(),Hm=1e3;class Um extends Fm.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*Hm,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=Za(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 i=Za(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:jm(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Ga("Making request",t);const r=await(0,Dm.default)(n=>this._provider.sendAsync(t,n))();if(Ga("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4
4
  ${r.error.message}`);return r.result}}Ws.PollingBlockTracker=Um;function Za(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var ei={},Vm=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ei,"__esModule",{value:!0});ei.SubscribeBlockTracker=void 0;const zm=Vm(fo),Wm=Bn,qm=(0,zm.default)();class Jm extends Wm.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,i)=>{this._provider.sendAsync({id:qm(),method:t,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}ei.SubscribeBlockTracker=Jm;(function(e){var t=D&&D.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=D&&D.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ws,e),r(ei,e)})(yl);var Ao={},ti={},zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.getUniqueId=void 0;const su=4294967295;let Ai=Math.floor(Math.random()*su);function Gm(){return Ai=(Ai+1)%su,Ai}zn.getUniqueId=Gm;Object.defineProperty(ti,"__esModule",{value:!0});ti.createIdRemapMiddleware=void 0;const Zm=zn;function Qm(){return(e,t,r,n)=>{const i=e.id,s=Zm.getUniqueId();e.id=s,t.id=s,r(a=>{e.id=i,t.id=i,a()})}}ti.createIdRemapMiddleware=Qm;var ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.createAsyncMiddleware=void 0;function Km(e){return async(t,r,n,i)=>{let s;const a=new Promise(f=>{s=f});let c=null,h=!1;const d=async()=>{h=!0,n(f=>{c=f,s()}),await a};try{await e(t,r,d),h?(await a,c(null)):i(null)}catch(f){c?c(f):i(f)}}}ri.createAsyncMiddleware=Km;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.createScaffoldMiddleware=void 0;function Xm(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}ni.createScaffoldMiddleware=Xm;var Wn={},No={};Object.defineProperty(No,"__esModule",{value:!0});const Ym=lc;function Qa(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function e_(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let t_=class extends Ym.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Qa(s,this,r);else{const a=s.length,c=e_(s);for(let h=0;h<a;h+=1)Qa(c[h],this,r)}return!0}};No.default=t_;var iu={},Ot={},r_=bn;bn.default=bn;bn.stable=cu;bn.stableStringify=cu;var ps="[...]",ou="[Circular]",ur=[],ar=[];function au(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function bn(e,t,r,n){typeof n>"u"&&(n=au()),zi(e,"",0,[],void 0,0,n);var i;try{ar.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,lu(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ur.length!==0;){var s=ur.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Br(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),ur.push([n,r,t,i])):ar.push([t,r,e]):(n[r]=e,ur.push([n,r,t]))}function zi(e,t,r,n,i,s,a){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Br(ou,e,t,i);return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){Br(ps,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Br(ps,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)zi(e[c],c,c,n,e,s,a);else{var h=Object.keys(e);for(c=0;c<h.length;c++){var d=h[c];zi(e[d],d,c,n,e,s,a)}}n.pop()}}function n_(e,t){return e<t?-1:e>t?1:0}function cu(e,t,r,n){typeof n>"u"&&(n=au());var i=Wi(e,"",0,[],void 0,0,n)||e,s;try{ar.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,lu(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ur.length!==0;){var a=ur.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function Wi(e,t,r,n,i,s,a){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Br(ou,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){Br(ps,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Br(ps,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)Wi(e[c],c,c,n,e,s,a);else{var h={},d=Object.keys(e).sort(n_);for(c=0;c<d.length;c++){var f=d[c];Wi(e[f],f,c,n,e,s,a),h[f]=e[f]}if(typeof i<"u")ur.push([i,t,e]),i[t]=h;else return h}n.pop()}}function lu(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(ar.length>0)for(var n=0;n<ar.length;n++){var i=ar[n];if(i[1]===t&&i[0]===r){r=i[2],ar.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Ot,"__esModule",{value:!0});Ot.EthereumProviderError=Ot.EthereumRpcError=void 0;const s_=r_;class uu 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 s_.default(this.serialize(),a_,2)}}Ot.EthereumRpcError=uu;class i_ extends uu{constructor(t,r,n){if(!o_(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Ot.EthereumProviderError=i_;function o_(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function a_(e,t){if(t!=="[Circular]")return t}var Lo={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.errorValues=Bt.errorCodes=void 0;Bt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Bt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Bt,r=Ot,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(b,S=i){if(Number.isInteger(b)){const I=b.toString();if(g(t.errorValues,I))return t.errorValues[I].message;if(d(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return S}e.getMessageFromCode=a;function c(b){if(!Number.isInteger(b))return!1;const S=b.toString();return!!(t.errorValues[S]||d(b))}e.isValidCode=c;function h(b,{fallbackError:S=s,shouldIncludeStack:I=!1}={}){var R,x;if(!S||!Number.isInteger(S.code)||typeof S.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof r.EthereumRpcError)return b.serialize();const A={};if(b&&typeof b=="object"&&!Array.isArray(b)&&g(b,"code")&&c(b.code)){const M=b;A.code=M.code,M.message&&typeof M.message=="string"?(A.message=M.message,g(M,"data")&&(A.data=M.data)):(A.message=a(A.code),A.data={originalError:f(b)})}else{A.code=S.code;const M=(R=b)===null||R===void 0?void 0:R.message;A.message=M&&typeof M=="string"?M:S.message,A.data={originalError:f(b)}}const C=(x=b)===null||x===void 0?void 0:x.stack;return I&&b&&C&&typeof C=="string"&&(A.stack=C),A}e.serializeError=h;function d(b){return b>=-32099&&b<=-32e3}function f(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function g(b,S){return Object.prototype.hasOwnProperty.call(b,S)}})(Lo);var si={};Object.defineProperty(si,"__esModule",{value:!0});si.ethErrors=void 0;const $o=Ot,hu=Lo,Xe=Bt;si.ethErrors={rpc:{parse:e=>ct(Xe.errorCodes.rpc.parse,e),invalidRequest:e=>ct(Xe.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ct(Xe.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ct(Xe.errorCodes.rpc.methodNotFound,e),internal:e=>ct(Xe.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ct(t,e)},invalidInput:e=>ct(Xe.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ct(Xe.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ct(Xe.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ct(Xe.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ct(Xe.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ct(Xe.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>hn(Xe.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>hn(Xe.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>hn(Xe.errorCodes.provider.unsupportedMethod,e),disconnected:e=>hn(Xe.errorCodes.provider.disconnected,e),chainDisconnected:e=>hn(Xe.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new $o.EthereumProviderError(t,r,n)}}};function ct(e,t){const[r,n]=du(t);return new $o.EthereumRpcError(e,r||hu.getMessageFromCode(e),n)}function hn(e,t){const[r,n]=du(t);return new $o.EthereumProviderError(e,r||hu.getMessageFromCode(e),n)}function du(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ot;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Lo;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=si;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Bt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(iu);var c_=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.JsonRpcEngine=void 0;const l_=c_(No),lt=iu;class It extends l_.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,i)=>{try{const[s,a,c]=await It._runAllMiddleware(t,r,this._middleware);return a?(await It._runReturnHandlers(c),i(s)):n(async h=>{try{await It._runReturnHandlers(c)}catch(d){return h(d)}return h()})}catch(s){return i(s)}}}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,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const a=new lt.EthereumRpcError(lt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){const a=new lt.EthereumRpcError(lt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=lt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await It._runAllMiddleware(t,r,this._middleware);if(It._checkForCompletion(t,r,i),await It._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,a=!1;for(const c of n)if([s,a]=await It._runMiddleware(t,r,c,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const a=h=>{const d=h||r.error;d&&(r.error=lt.serializeError(d)),s([d,!0])},c=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new lt.EthereumRpcError(lt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request: