@dcl/vesting-dashboard 3.0.3-8724403273.commit-e21874a → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{fortmatic-550e60f5.js → fortmatic-48f7a617.js} +1 -1
- package/assets/{index-3451f60a.js → index-16c0bfbb.js} +1 -1
- package/assets/{index-7badeb0b.js → index-20251482.js} +6 -6
- package/assets/{index-81eb548b.js → index-2480279b.js} +1 -1
- package/assets/{index-d979007c.js → index-388c1e9a.js} +1 -1
- package/assets/{index-f9849129.css → index-3d278c57.css} +7 -7
- package/assets/{index-a5a20808.js → index-510b6d06.js} +1 -1
- package/assets/{index-08c49e5a.js → index-579cd24f.js} +1 -1
- package/assets/{index-88b6478d.js → index-d67545ff.js} +1 -1
- package/assets/{index.es-868f8356.js → index.es-e50d9fe6.js} +2 -2
- package/index.html +4 -4
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as bd,h as gd,d as A,i as ti,B,j as md,k as sl,g as xn,p as ko,l as ni,b as yd}from"./index-7badeb0b.js";import{_ as g}from"./tslib.es6-c2094241.js";function vd(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Go={},Qn={},ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.walletLogo=void 0;const _d=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 `}};ri.walletLogo=_d;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.ScopedLocalStorage=void 0;class wd{constructor(e){this.scope=e}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`${this.scope}:${e}`}}ii.ScopedLocalStorage=wd;var dn={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});const Sd=bd;function yc(t,e,n){try{Reflect.apply(t,e,n)}catch(r){setTimeout(()=>{throw r})}}function Ed(t){const e=t.length,n=new Array(e);for(let r=0;r<e;r+=1)n[r]=t[r];return n}let Cd=class extends Sd.EventEmitter{emit(e,...n){let r=e==="error";const i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){let o;if(n.length>0&&([o]=n),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")yc(s,this,n);else{const o=s.length,a=Ed(s);for(let c=0;c<o;c+=1)yc(a[c],this,n)}return!0}};Qt.default=Cd;var rr={},Rt={},Id=Zn;Zn.default=Zn;Zn.stable=cl;Zn.stableStringify=cl;var Vr="[...]",ol="[Circular]",Ut=[],Vt=[];function al(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Zn(t,e,n,r){typeof r>"u"&&(r=al()),Ro(t,"",0,[],void 0,0,r);var i;try{Vt.length===0?i=JSON.stringify(t,e,n):i=JSON.stringify(t,ul(e),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ut.length!==0;){var s=Ut.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function cn(t,e,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:t}),Ut.push([r,n,e,i])):Vt.push([e,n,t]):(r[n]=t,Ut.push([r,n,e]))}function Ro(t,e,n,r,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<r.length;a++)if(r[a]===t){cn(ol,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){cn(Vr,t,e,i);return}if(typeof o.edgesLimit<"u"&&n+1>o.edgesLimit){cn(Vr,t,e,i);return}if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Ro(t[a],a,a,r,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var u=c[a];Ro(t[u],u,a,r,t,s,o)}}r.pop()}}function xd(t,e){return t<e?-1:t>e?1:0}function cl(t,e,n,r){typeof r>"u"&&(r=al());var i=Mo(t,"",0,[],void 0,0,r)||t,s;try{Vt.length===0?s=JSON.stringify(i,e,n):s=JSON.stringify(i,ul(e),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ut.length!==0;){var o=Ut.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Mo(t,e,n,r,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<r.length;a++)if(r[a]===t){cn(ol,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){cn(Vr,t,e,i);return}if(typeof o.edgesLimit<"u"&&n+1>o.edgesLimit){cn(Vr,t,e,i);return}if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Mo(t[a],a,a,r,t,s,o);else{var c={},u=Object.keys(t).sort(xd);for(a=0;a<u.length;a++){var l=u[a];Mo(t[l],l,a,r,t,s,o),c[l]=t[l]}if(typeof i<"u")Ut.push([i,e,t]),i[e]=c;else return c}r.pop()}}function ul(t){return t=typeof t<"u"?t:function(e,n){return n},function(e,n){if(Vt.length>0)for(var r=0;r<Vt.length;r++){var i=Vt[r];if(i[1]===e&&i[0]===n){n=i[2],Vt.splice(r,1);break}}return t.call(this,e,n)}}Object.defineProperty(Rt,"__esModule",{value:!0});Rt.EthereumProviderError=Rt.EthereumRpcError=void 0;const kd=Id;class ll extends Error{constructor(e,n,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,r!==void 0&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return kd.default(this.serialize(),Ad,2)}}Rt.EthereumRpcError=ll;class Rd extends ll{constructor(e,n,r){if(!Md(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,r)}}Rt.EthereumProviderError=Rd;function Md(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Ad(t,e){if(e!=="[Circular]")return e}var Jo={},Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.errorValues=Mt.errorCodes=void 0;Mt.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}};Mt.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(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Mt,n=Rt,r=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:r,message:o(r)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(f,d=i){if(Number.isInteger(f)){const p=f.toString();if(h(e.errorValues,p))return e.errorValues[p].message;if(u(f))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return d}t.getMessageFromCode=o;function a(f){if(!Number.isInteger(f))return!1;const d=f.toString();return!!(e.errorValues[d]||u(f))}t.isValidCode=a;function c(f,{fallbackError:d=s,shouldIncludeStack:p=!1}={}){var _,m;if(!d||!Number.isInteger(d.code)||typeof d.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(f instanceof n.EthereumRpcError)return f.serialize();const b={};if(f&&typeof f=="object"&&!Array.isArray(f)&&h(f,"code")&&a(f.code)){const S=f;b.code=S.code,S.message&&typeof S.message=="string"?(b.message=S.message,h(S,"data")&&(b.data=S.data)):(b.message=o(b.code),b.data={originalError:l(f)})}else{b.code=d.code;const S=(_=f)===null||_===void 0?void 0:_.message;b.message=S&&typeof S=="string"?S:d.message,b.data={originalError:l(f)}}const y=(m=f)===null||m===void 0?void 0:m.stack;return p&&f&&y&&typeof y=="string"&&(b.stack=y),b}t.serializeError=c;function u(f){return f>=-32099&&f<=-32e3}function l(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function h(f,d){return Object.prototype.hasOwnProperty.call(f,d)}})(Jo);var si={};Object.defineProperty(si,"__esModule",{value:!0});si.ethErrors=void 0;const Qo=Rt,hl=Jo,Se=Mt;si.ethErrors={rpc:{parse:t=>De(Se.errorCodes.rpc.parse,t),invalidRequest:t=>De(Se.errorCodes.rpc.invalidRequest,t),invalidParams:t=>De(Se.errorCodes.rpc.invalidParams,t),methodNotFound:t=>De(Se.errorCodes.rpc.methodNotFound,t),internal:t=>De(Se.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return De(e,t)},invalidInput:t=>De(Se.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>De(Se.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>De(Se.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>De(Se.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>De(Se.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>De(Se.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Pn(Se.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Pn(Se.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Pn(Se.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Pn(Se.errorCodes.provider.disconnected,t),chainDisconnected:t=>Pn(Se.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new Qo.EthereumProviderError(e,n,r)}}};function De(t,e){const[n,r]=fl(e);return new Qo.EthereumRpcError(t,n||hl.getMessageFromCode(t),r)}function Pn(t,e){const[n,r]=fl(e);return new Qo.EthereumProviderError(t,n||hl.getMessageFromCode(t),r)}function fl(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Rt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const n=Jo;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=si;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=Mt;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(rr);var kn={};Object.defineProperty(kn,"__esModule",{value:!0});kn.EVENTS=void 0;kn.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",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Rn={},x={},Td=String.prototype.replace,Nd=/%20/g,Ks={RFC1738:"RFC1738",RFC3986:"RFC3986"},Zo={default:Ks.RFC3986,formatters:{RFC1738:function(t){return Td.call(t,Nd,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ks.RFC1738,RFC3986:Ks.RFC3986},Od=Zo,Xs=Object.prototype.hasOwnProperty,$t=Array.isArray,et=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ld=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if($t(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]<"u"&&i.push(r[s]);n.obj[n.prop]=i}}},dl=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},jd=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if($t(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Xs.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return $t(e)&&!$t(n)&&(i=dl(e,r)),$t(e)&&$t(n)?(n.forEach(function(s,o){if(Xs.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(n).reduce(function(s,o){var a=n[o];return Xs.call(s,o)?s[o]=t(s[o],a,r):s[o]=a,s},i)},$d=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Pd=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Dd=function(e,n,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var u=o.charCodeAt(c);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===Od.RFC1738&&(u===40||u===41)){a+=o.charAt(c);continue}if(u<128){a=a+et[u];continue}if(u<2048){a=a+(et[192|u>>6]+et[128|u&63]);continue}if(u<55296||u>=57344){a=a+(et[224|u>>12]+et[128|u>>6&63]+et[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|o.charCodeAt(c)&1023),a+=et[240|u>>18]+et[128|u>>12&63]+et[128|u>>6&63]+et[128|u&63]}return a},Fd=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var s=n[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var u=a[c],l=o[u];typeof l=="object"&&l!==null&&r.indexOf(l)===-1&&(n.push({obj:o,prop:u}),r.push(l))}return Ld(n),e},Bd=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Vd=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Hd=function(e,n){return[].concat(e,n)},Wd=function(e,n){if($t(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},pl={arrayToObject:dl,assign:$d,combine:Hd,compact:Fd,decode:Pd,encode:Dd,isBuffer:Vd,isRegExp:Bd,maybeMap:Wd,merge:jd},bl=gd,$r=pl,Wn=Zo,Ud=Object.prototype.hasOwnProperty,vc={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},pt=Array.isArray,zd=Array.prototype.push,gl=function(t,e){zd.apply(t,pt(e)?e:[e])},qd=Date.prototype.toISOString,_c=Wn.default,Ie={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:$r.encode,encodeValuesOnly:!1,format:_c,formatter:Wn.formatters[_c],indices:!1,serializeDate:function(e){return qd.call(e)},skipNulls:!1,strictNullHandling:!1},Gd=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},eo={},Jd=function t(e,n,r,i,s,o,a,c,u,l,h,f,d,p,_,m){for(var b=e,y=m,S=0,k=!1;(y=y.get(eo))!==void 0&&!k;){var E=y.get(e);if(S+=1,typeof E<"u"){if(E===S)throw new RangeError("Cyclic object value");k=!0}typeof y.get(eo)>"u"&&(S=0)}if(typeof c=="function"?b=c(n,b):b instanceof Date?b=h(b):r==="comma"&&pt(b)&&(b=$r.maybeMap(b,function(C){return C instanceof Date?h(C):C})),b===null){if(s)return a&&!p?a(n,Ie.encoder,_,"key",f):n;b=""}if(Gd(b)||$r.isBuffer(b)){if(a){var N=p?n:a(n,Ie.encoder,_,"key",f);return[d(N)+"="+d(a(b,Ie.encoder,_,"value",f))]}return[d(n)+"="+d(String(b))]}var U=[];if(typeof b>"u")return U;var z;if(r==="comma"&&pt(b))p&&a&&(b=$r.maybeMap(b,a)),z=[{value:b.length>0?b.join(",")||null:void 0}];else if(pt(c))z=c;else{var P=Object.keys(b);z=u?P.sort(u):P}for(var q=i&&pt(b)&&b.length===1?n+"[]":n,ue=0;ue<z.length;++ue){var G=z[ue],w=typeof G=="object"&&typeof G.value<"u"?G.value:b[G];if(!(o&&w===null)){var v=pt(b)?typeof r=="function"?r(q,G):q:q+(l?"."+G:"["+G+"]");m.set(e,S);var R=bl();R.set(eo,m),gl(U,t(w,v,r,i,s,o,r==="comma"&&p&&pt(b)?null:a,c,u,l,h,f,d,p,_,R))}}return U},Qd=function(e){if(!e)return Ie;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||Ie.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Wn.default;if(typeof e.format<"u"){if(!Ud.call(Wn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Wn.formatters[r],s=Ie.filter;return(typeof e.filter=="function"||pt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Ie.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Ie.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ie.charsetSentinel,delimiter:typeof e.delimiter>"u"?Ie.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Ie.encode,encoder:typeof e.encoder=="function"?e.encoder:Ie.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Ie.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Ie.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Ie.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ie.strictNullHandling}},Zd=function(t,e){var n=t,r=Qd(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):pt(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in vc?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=vc[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var l=bl(),h=0;h<i.length;++h){var f=i[h];r.skipNulls&&n[f]===null||gl(o,Jd(n[f],f,c,u,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}var d=o.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},pn=pl,Ao=Object.prototype.hasOwnProperty,Yd=Array.isArray,be={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:pn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Kd=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},ml=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Xd="utf8=%26%2310003%3B",ep="utf8=%E2%9C%93",tp=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=i.split(n.delimiter,s),a=-1,c,u=n.charset;if(n.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===ep?u="utf-8":o[c]===Xd&&(u="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var l=o[c],h=l.indexOf("]="),f=h===-1?l.indexOf("="):h+1,d,p;f===-1?(d=n.decoder(l,be.decoder,u,"key"),p=n.strictNullHandling?null:""):(d=n.decoder(l.slice(0,f),be.decoder,u,"key"),p=pn.maybeMap(ml(l.slice(f+1),n),function(_){return n.decoder(_,be.decoder,u,"value")})),p&&n.interpretNumericEntities&&u==="iso-8859-1"&&(p=Kd(p)),l.indexOf("[]=")>-1&&(p=Yd(p)?[p]:p),Ao.call(r,d)?r[d]=pn.combine(r[d],p):r[d]=p}return r},np=function(t,e,n,r){for(var i=r?e:ml(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!n.parseArrays&&c===""?o={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[],o[u]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},rp=function(e,n,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),u=c?s.slice(0,c.index):s,l=[];if(u){if(!r.plainObjects&&Ao.call(Object.prototype,u)&&!r.allowPrototypes)return;l.push(u)}for(var h=0;r.depth>0&&(c=a.exec(s))!==null&&h<r.depth;){if(h+=1,!r.plainObjects&&Ao.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+s.slice(c.index)+"]"),np(l,n,r,i)}},ip=function(e){if(!e)return be;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?be.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?be.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:be.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:be.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:be.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:be.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:be.comma,decoder:typeof e.decoder=="function"?e.decoder:be.decoder,delimiter:typeof e.delimiter=="string"||pn.isRegExp(e.delimiter)?e.delimiter:be.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:be.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:be.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:be.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:be.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:be.strictNullHandling}},sp=function(t,e){var n=ip(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?tp(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],c=rp(a,r[a],n,typeof t=="string");i=pn.merge(i,c,n)}return n.allowSparse===!0?i:pn.compact(i)},op=Zd,ap=sp,cp=Zo,up={formats:cp,parse:ap,stringify:op},ir={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return r=>r}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function n(r){return Math.floor(r)}t.IntNumber=n,t.RegExpString=e(),function(r){r.CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(ir);var lp=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(x,"__esModule",{value:!0});x.isInIFrame=x.createQrUrl=x.getFavicon=x.range=x.isBigNumber=x.ensureParsedJSONObject=x.ensureBN=x.ensureRegExpString=x.ensureIntNumber=x.ensureBuffer=x.ensureAddressString=x.ensureEvenLengthHexString=x.ensureHexString=x.isHexString=x.prepend0x=x.strip0x=x.has0xPrefix=x.hexStringFromIntNumber=x.intNumberFromHexString=x.bigIntStringFromBN=x.hexStringFromBuffer=x.hexStringToUint8Array=x.uint8ArrayToHex=x.randomBytesHex=void 0;const It=lp(ti),hp=up,We=ir,yl=/^[0-9]*$/,vl=/^[a-f0-9]*$/;function fp(t){return _l(crypto.getRandomValues(new Uint8Array(t)))}x.randomBytesHex=fp;function _l(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}x.uint8ArrayToHex=_l;function dp(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}x.hexStringToUint8Array=dp;function pp(t,e=!1){const n=t.toString("hex");return(0,We.HexString)(e?"0x"+n:n)}x.hexStringFromBuffer=pp;function bp(t){return(0,We.BigIntString)(t.toString(10))}x.bigIntStringFromBN=bp;function gp(t){return(0,We.IntNumber)(new It.default(or(t,!1),16).toNumber())}x.intNumberFromHexString=gp;function mp(t){return(0,We.HexString)("0x"+new It.default(t).toString(16))}x.hexStringFromIntNumber=mp;function Yo(t){return t.startsWith("0x")||t.startsWith("0X")}x.has0xPrefix=Yo;function oi(t){return Yo(t)?t.slice(2):t}x.strip0x=oi;function wl(t){return Yo(t)?"0x"+t.slice(2):"0x"+t}x.prepend0x=wl;function sr(t){if(typeof t!="string")return!1;const e=oi(t).toLowerCase();return vl.test(e)}x.isHexString=sr;function Sl(t,e=!1){if(typeof t=="string"){const n=oi(t).toLowerCase();if(vl.test(n))return(0,We.HexString)(e?"0x"+n:n)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}x.ensureHexString=Sl;function or(t,e=!1){let n=Sl(t,!1);return n.length%2===1&&(n=(0,We.HexString)("0"+n)),e?(0,We.HexString)("0x"+n):n}x.ensureEvenLengthHexString=or;function yp(t){if(typeof t=="string"){const e=oi(t).toLowerCase();if(sr(e)&&e.length===40)return(0,We.AddressString)(wl(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)}x.ensureAddressString=yp;function vp(t){if(B.isBuffer(t))return t;if(typeof t=="string")if(sr(t)){const e=or(t,!1);return B.from(e,"hex")}else return B.from(t,"utf8");throw new Error(`Not binary data: ${String(t)}`)}x.ensureBuffer=vp;function El(t){if(typeof t=="number"&&Number.isInteger(t))return(0,We.IntNumber)(t);if(typeof t=="string"){if(yl.test(t))return(0,We.IntNumber)(Number(t));if(sr(t))return(0,We.IntNumber)(new It.default(or(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}x.ensureIntNumber=El;function _p(t){if(t instanceof RegExp)return(0,We.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)}x.ensureRegExpString=_p;function wp(t){if(t!==null&&(It.default.isBN(t)||Cl(t)))return new It.default(t.toString(10),10);if(typeof t=="number")return new It.default(El(t));if(typeof t=="string"){if(yl.test(t))return new It.default(t,10);if(sr(t))return new It.default(or(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)}x.ensureBN=wp;function Sp(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)}x.ensureParsedJSONObject=Sp;function Cl(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}x.isBigNumber=Cl;function Ep(t,e){return Array.from({length:e-t},(n,r)=>t+r)}x.range=Ep;function Cp(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}x.getFavicon=Cp;function Ip(t,e,n,r,i,s){const o=r?"parent-id":"id",a=(0,hp.stringify)({[o]:t,secret:e,server:n,v:i,chainId:s});return`${n}/#/link?${a}`}x.createQrUrl=Ip;function xp(){try{return window.frameElement!==null}catch{return!1}}x.isInIFrame=xp;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Session=void 0;const wc=md,Sc=x,Ec="session:id",Cc="session:secret",Ic="session:linked";class Ko{constructor(e,n,r,i){this._storage=e,this._id=n||(0,Sc.randomBytesHex)(16),this._secret=r||(0,Sc.randomBytesHex)(32),this._key=new wc.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const n=e.getItem(Ec),r=e.getItem(Ic),i=e.getItem(Cc);return n&&i?new Ko(e,n,i,r==="1"):null}static hash(e){return new wc.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Ec,this._id),this._storage.setItem(Cc,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ic,this._linked?"1":"0")}}Rn.Session=Ko;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.WalletSDKRelayAbstract=Ye.APP_VERSION_KEY=Ye.LOCAL_STORAGE_ADDRESSES_KEY=Ye.WALLET_USER_NAME_KEY=void 0;const xc=rr;Ye.WALLET_USER_NAME_KEY="walletUsername";Ye.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ye.APP_VERSION_KEY="AppVersion";class kp{async makeEthereumJSONRPCRequest(e,n){if(!n)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(n,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>{if(!r)throw xc.ethErrors.rpc.parse({});const i=r,{error:s}=i;if(s)throw(0,xc.serializeError)(s);return i})}}Ye.WalletSDKRelayAbstract=kp;const{Transform:Rp}=sl;var Mp=t=>class Il extends Rp{constructor(n,r,i,s,o){super(o),this._rate=n,this._capacity=r,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,i){let s=null;try{this.update(n,r)}catch(o){s=o}i(s)}_flush(n){let r=null;try{this.push(this.digest())}catch(i){r=i}n(r)}update(n,r){if(!B.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return B.isBuffer(n)||(n=B.from(n,r)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let r=this._state.squeeze(this._hashBitLength/8);return n!==void 0&&(r=r.toString(n)),this._resetState(),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new Il(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const{Transform:Ap}=sl;var Tp=t=>class xl extends Ap{constructor(n,r,i,s){super(s),this._rate=n,this._capacity=r,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,i){let s=null;try{this.update(n,r)}catch(o){s=o}i(s)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,r){if(!B.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return B.isBuffer(n)||(n=B.from(n,r)),this._state.absorb(n),this}squeeze(n,r){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(n);return r!==void 0&&(i=i.toString(r)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new xl(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const Np=Mp,Op=Tp;var Lp=function(t){const e=Np(t),n=Op(t);return function(r,i){switch(typeof r=="string"?r.toLowerCase():r){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new n(1344,256,31,i);case"shake256":return new n(1088,512,31,i);default:throw new Error("Invald algorithm: "+r)}}},kl={};const kc=[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];kl.p1600=function(t){for(let e=0;e<24;++e){const n=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let f=l^(i<<1|s>>>31),d=h^(s<<1|i>>>31);const p=t[0]^f,_=t[1]^d,m=t[10]^f,b=t[11]^d,y=t[20]^f,S=t[21]^d,k=t[30]^f,E=t[31]^d,N=t[40]^f,U=t[41]^d;f=n^(o<<1|a>>>31),d=r^(a<<1|o>>>31);const z=t[2]^f,P=t[3]^d,q=t[12]^f,ue=t[13]^d,G=t[22]^f,w=t[23]^d,v=t[32]^f,R=t[33]^d,C=t[42]^f,T=t[43]^d;f=i^(c<<1|u>>>31),d=s^(u<<1|c>>>31);const I=t[4]^f,L=t[5]^d,J=t[14]^f,D=t[15]^d,X=t[24]^f,we=t[25]^d,ne=t[34]^f,wt=t[35]^d,ts=t[44]^f,Ya=t[45]^d;f=o^(l<<1|h>>>31),d=a^(h<<1|l>>>31);const Ka=t[6]^f,Xa=t[7]^d,ec=t[16]^f,tc=t[17]^d,nc=t[26]^f,rc=t[27]^d,ic=t[36]^f,sc=t[37]^d,oc=t[46]^f,ac=t[47]^d;f=c^(n<<1|r>>>31),d=u^(r<<1|n>>>31);const cc=t[8]^f,uc=t[9]^d,lc=t[18]^f,hc=t[19]^d,fc=t[28]^f,dc=t[29]^d,pc=t[38]^f,bc=t[39]^d,gc=t[48]^f,mc=t[49]^d,ns=p,rs=_,is=b<<4|m>>>28,ss=m<<4|b>>>28,os=y<<3|S>>>29,as=S<<3|y>>>29,cs=E<<9|k>>>23,us=k<<9|E>>>23,ls=N<<18|U>>>14,hs=U<<18|N>>>14,fs=z<<1|P>>>31,ds=P<<1|z>>>31,ps=ue<<12|q>>>20,bs=q<<12|ue>>>20,gs=G<<10|w>>>22,ms=w<<10|G>>>22,ys=R<<13|v>>>19,vs=v<<13|R>>>19,_s=C<<2|T>>>30,ws=T<<2|C>>>30,Ss=L<<30|I>>>2,Es=I<<30|L>>>2,Cs=J<<6|D>>>26,Is=D<<6|J>>>26,xs=we<<11|X>>>21,ks=X<<11|we>>>21,Rs=ne<<15|wt>>>17,Ms=wt<<15|ne>>>17,As=Ya<<29|ts>>>3,Ts=ts<<29|Ya>>>3,Ns=Ka<<28|Xa>>>4,Os=Xa<<28|Ka>>>4,Ls=tc<<23|ec>>>9,js=ec<<23|tc>>>9,$s=nc<<25|rc>>>7,Ps=rc<<25|nc>>>7,Ds=ic<<21|sc>>>11,Fs=sc<<21|ic>>>11,Bs=ac<<24|oc>>>8,Vs=oc<<24|ac>>>8,Hs=cc<<27|uc>>>5,Ws=uc<<27|cc>>>5,Us=lc<<20|hc>>>12,zs=hc<<20|lc>>>12,qs=dc<<7|fc>>>25,Gs=fc<<7|dc>>>25,Js=pc<<8|bc>>>24,Qs=bc<<8|pc>>>24,Zs=gc<<14|mc>>>18,Ys=mc<<14|gc>>>18;t[0]=ns^~ps&xs,t[1]=rs^~bs&ks,t[10]=Ns^~Us&os,t[11]=Os^~zs&as,t[20]=fs^~Cs&$s,t[21]=ds^~Is&Ps,t[30]=Hs^~is&gs,t[31]=Ws^~ss&ms,t[40]=Ss^~Ls&qs,t[41]=Es^~js&Gs,t[2]=ps^~xs&Ds,t[3]=bs^~ks&Fs,t[12]=Us^~os&ys,t[13]=zs^~as&vs,t[22]=Cs^~$s&Js,t[23]=Is^~Ps&Qs,t[32]=is^~gs&Rs,t[33]=ss^~ms&Ms,t[42]=Ls^~qs&cs,t[43]=js^~Gs&us,t[4]=xs^~Ds&Zs,t[5]=ks^~Fs&Ys,t[14]=os^~ys&As,t[15]=as^~vs&Ts,t[24]=$s^~Js&ls,t[25]=Ps^~Qs&hs,t[34]=gs^~Rs&Bs,t[35]=ms^~Ms&Vs,t[44]=qs^~cs&_s,t[45]=Gs^~us&ws,t[6]=Ds^~Zs&ns,t[7]=Fs^~Ys&rs,t[16]=ys^~As&Ns,t[17]=vs^~Ts&Os,t[26]=Js^~ls&fs,t[27]=Qs^~hs&ds,t[36]=Rs^~Bs&Hs,t[37]=Ms^~Vs&Ws,t[46]=cs^~_s&Ss,t[47]=us^~ws&Es,t[8]=Zs^~ns&ps,t[9]=Ys^~rs&bs,t[18]=As^~Ns&Us,t[19]=Ts^~Os&zs,t[28]=ls^~fs&Cs,t[29]=hs^~ds&Is,t[38]=Bs^~Hs&is,t[39]=Vs^~Ws&ss,t[48]=_s^~Ss&Ls,t[49]=ws^~Es&js,t[0]^=kc[e*2],t[1]^=kc[e*2+1]}};const Hr=kl;function Mn(){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}Mn.prototype.initialize=function(t,e){for(let n=0;n<50;++n)this.state[n]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};Mn.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Hr.p1600(this.state),this.count=0)};Mn.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&Hr.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Hr.p1600(this.state),this.count=0,this.squeezing=!0};Mn.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=B.alloc(t);for(let n=0;n<t;++n)e[n]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Hr.p1600(this.state),this.count=0);return e};Mn.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var jp=Mn,$p=Lp(jp);const Pp=$p,Dp=ti;function Rl(t){return B.allocUnsafe(t).fill(0)}function Ml(t,e,n){const r=Rl(e);return t=ai(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function Fp(t,e){return Ml(t,e,!0)}function ai(t){if(!B.isBuffer(t))if(Array.isArray(t))t=B.from(t);else if(typeof t=="string")Al(t)?t=B.from(Hp(Tl(t)),"hex"):t=B.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=B.allocUnsafe(0);else if(Dp.isBN(t))t=t.toArrayLike(B);else if(t.toArray)t=B.from(t.toArray());else throw new Error("invalid type");return t}function Bp(t){return t=ai(t),"0x"+t.toString("hex")}function Vp(t,e){return t=ai(t),e||(e=256),Pp("keccak"+e).update(t).digest()}function Hp(t){return t.length%2?"0"+t:t}function Al(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Tl(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var Nl={zeros:Rl,setLength:Ml,setLengthRight:Fp,isHexString:Al,stripHexPrefix:Tl,toBuffer:ai,bufferToHex:Bp,keccak:Vp};const zt=Nl,Ht=ti;function Ol(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function un(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Rc(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Ll(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Pt(t){var e=typeof t;if(e==="string")return zt.isHexString(t)?new Ht(zt.stripHexPrefix(t),16):new Ht(t,10);if(e==="number")return new Ht(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function it(t,e){var n,r,i,s;if(t==="address")return it("uint160",Pt(e));if(t==="bool")return it("uint8",e?1:0);if(t==="string")return it("bytes",new B(e,"utf8"));if(Up(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=Ll(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(it(t,e[s]));if(n==="dynamic"){var o=it("uint256",e.length);i.unshift(o)}return B.concat(i)}else{if(t==="bytes")return e=new B(e),i=B.concat([it("uint256",e.length),e]),e.length%32!==0&&(i=B.concat([i,zt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=un(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return zt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=un(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Pt(e),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(B,"be",32)}else if(t.startsWith("int")){if(n=un(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Pt(e),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(B,"be",32)}else if(t.startsWith("ufixed")){if(n=Rc(t),r=Pt(e),r<0)throw new Error("Supplied ufixed is negative");return it("uint256",r.mul(new Ht(2).pow(new Ht(n[1]))))}else if(t.startsWith("fixed"))return n=Rc(t),it("int256",Pt(e).mul(new Ht(2).pow(new Ht(n[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Wp(t){return t==="string"||t==="bytes"||Ll(t)==="dynamic"}function Up(t){return t.lastIndexOf("]")===t.length-1}function zp(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=Ol(t[s]),a=e[s],c=it(o,a);Wp(o)?(n.push(it("uint256",i)),r.push(c),i+=c.length):n.push(c)}return B.concat(n.concat(r))}function jl(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=Ol(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new B(a,"utf8"));else if(o==="bool")i.push(new B(a?"01":"00","hex"));else if(o==="address")i.push(zt.setLength(a,20));else if(o.startsWith("bytes")){if(n=un(o),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(zt.setLengthRight(a,n))}else if(o.startsWith("uint")){if(n=un(o),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Pt(a),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(B,"be",n/8))}else if(o.startsWith("int")){if(n=un(o),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Pt(a),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(B,"be",n/8))}else throw new Error("Unsupported or invalid type: "+o)}return B.concat(i)}function qp(t,e){return zt.keccak(jl(t,e))}var Gp={rawEncode:zp,solidityPack:jl,soliditySHA3:qp};const Je=Nl,Un=Gp,$l={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"]},to={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(a,c,u)=>{if(n[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Je.keccak(this.encodeData(c,u,n,r))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Je.keccak(u)];if(c==="string")return typeof u=="string"&&(u=B.from(u,"utf8")),["bytes32",Je.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const l=c.slice(0,c.lastIndexOf("[")),h=u.map(f=>o(a,l,f));return["bytes32",Je.keccak(Un.rawEncode(h.map(([f])=>f),h.map(([,f])=>f)))]}return[c,u]};for(const a of n[t]){const[c,u]=o(a.name,a.type,e[a.name]);i.push(c),s.push(u)}}else for(const o of n[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Je.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=B.from(a,"utf8")),a=Je.keccak(a),s.push(a);else if(n[o.type]!==void 0)i.push("bytes32"),a=Je.keccak(this.encodeData(o.type,a,n,r)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Un.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return Je.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return Je.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in $l.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[B.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),Je.keccak(B.concat(r))}};var Jp={TYPED_MESSAGE_SCHEMA:$l,TypedDataUtils:to,hashForSignTypedDataLegacy:function(t){return Qp(t.data)},hashForSignTypedData_v3:function(t){return to.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return to.hash(t.data)}};function Qp(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(s){return s.type==="bytes"?Je.toBuffer(s.value):s.value}),r=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Un.soliditySHA3(["bytes32","bytes32"],[Un.soliditySHA3(new Array(t.length).fill("string"),i),Un.soliditySHA3(r,n)])}var bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.filterFromParam=bn.FilterPolyfill=void 0;const sn=ir,ke=x,Zp=5*60*1e3,Dt={jsonrpc:"2.0",id:0};class Yp{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,sn.IntNumber)(1),this.provider=e}async newFilter(e){const n=Pl(e),r=this.makeFilterId(),i=await this.setInitialCursorPosition(r,n.fromBlock);return console.log(`Installing new log filter(${r}):`,n,"initial cursor position:",i),this.logFilters.set(r,n),this.setFilterTimeout(r),(0,ke.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.blockFilters.add(e),this.setFilterTimeout(e),(0,ke.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,ke.hexStringFromIntNumber)(e)}uninstallFilter(e){const n=(0,ke.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${n})`),this.deleteFilter(n),!0}getFilterChanges(e){const n=(0,ke.intNumberFromHexString)(e);return this.timeouts.has(n)&&this.setFilterTimeout(n),this.logFilters.has(n)?this.getLogFilterChanges(n):this.blockFilters.has(n)?this.getBlockFilterChanges(n):this.pendingTransactionFilters.has(n)?this.getPendingTransactionFilterChanges(n):Promise.resolve(Cr())}async getFilterLogs(e){const n=(0,ke.intNumberFromHexString)(e),r=this.logFilters.get(n);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getLogs",params:[Mc(r)]})):Cr()}makeFilterId(){return(0,sn.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((n,r)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return r(i);if(Array.isArray(s)||s==null)return r(new Error(`unexpected response received: ${JSON.stringify(s)}`));n(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const n=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!n)return Cr();const i=await this.getCurrentBlockHeight(),s=n.toBlock==="latest"?i:n.toBlock;if(r>i||r>n.toBlock)return Ir();console.log(`Fetching logs from ${r} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getLogs",params:[Mc(Object.assign(Object.assign({},n),{fromBlock:r,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(u=>(0,ke.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>r){const u=(0,sn.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${u}`),this.cursors.set(e,u)}}return o}async getBlockFilterChanges(e){const n=this.cursors.get(e);if(!n)return Cr();const r=await this.getCurrentBlockHeight();if(n>r)return Ir();console.log(`Fetching blocks from ${n} to ${r} for filter (${e})`);const i=(await Promise.all((0,ke.range)(n,r+1).map(o=>this.getBlockHashByNumber((0,sn.IntNumber)(o))))).filter(o=>!!o),s=(0,sn.IntNumber)(n+i.length);return console.log(`Moving cursor position for filter (${e}) from ${n} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Dt),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Ir())}async setInitialCursorPosition(e,n){const r=await this.getCurrentBlockHeight(),i=typeof n=="number"&&n>r?n:r;return this.cursors.set(e,i),i}setFilterTimeout(e){const n=this.timeouts.get(e);n&&window.clearTimeout(n);const r=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Zp);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_blockNumber",params:[]}));return(0,ke.intNumberFromHexString)((0,ke.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getBlockByNumber",params:[(0,ke.hexStringFromIntNumber)(e),!1]}));return n.result&&typeof n.result.hash=="string"?(0,ke.ensureHexString)(n.result.hash):null}}bn.FilterPolyfill=Yp;function Pl(t){return{fromBlock:Ac(t.fromBlock),toBlock:Ac(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}bn.filterFromParam=Pl;function Mc(t){const e={fromBlock:Tc(t.fromBlock),toBlock:Tc(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Ac(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,sn.IntNumber)(0);if((0,ke.isHexString)(t))return(0,ke.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Tc(t){return t==="latest"?t:(0,ke.hexStringFromIntNumber)(t)}function Cr(){return Object.assign(Object.assign({},Dt),{error:{code:-32e3,message:"filter not found"}})}function Ir(){return Object.assign(Object.assign({},Dt),{result:[]})}var Dl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(Dl);var ci={},Fl={},ui={},Xo=Kp;function Kp(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,n=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return n=n%e,n++}}const Nc=(t,e)=>function(){const n=e.promiseModule,r=new Array(arguments.length);for(let i=0;i<arguments.length;i++)r[i]=arguments[i];return new n((i,s)=>{e.errorFirst?r.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let u=1;u<arguments.length;u++)c[u-1]=arguments[u];o?(c.unshift(o),s(c)):i(c)}else o?s(o):i(a)}):r.push(function(o){if(e.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];i(a)}else i(o)}),t.apply(this,r)})};var Xp=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const n=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let r;typeof t=="function"?r=function(){return e.excludeMain?t.apply(this,arguments):Nc(t,e).apply(this,arguments)}:r=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];r[i]=typeof s=="function"&&n(i)?Nc(s,e):s}return r},ar={},e0=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseBlockTracker=void 0;const t0=e0(Qt),n0=1e3,r0=(t,e)=>t+e,Oc=["sync","latest"];class i0 extends t0.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*n0,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(n=>this.once("latest",n))}removeAllListeners(e){return e?super.removeAllListeners(e):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(e){Oc.includes(e)&&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 Oc.map(e=>this.listenerCount(e)).reduce(r0)}_newPotentialLatest(e){const n=this._currentBlock;n&&Lc(e)<=Lc(n)||this._setCurrentBlock(e)}_setCurrentBlock(e){const n=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:n,newBlock:e})}_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}}ar.BaseBlockTracker=i0;function Lc(t){return Number.parseInt(t,16)}var Bl={},Vl={},_e={};class Hl extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function s0(t){return Ue(t)&&typeof t[Symbol.iterator]=="function"}function Ue(t){return typeof t=="object"&&t!=null}function jc(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function de(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function o0(t){const{done:e,value:n}=t.next();return e?void 0:n}function a0(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${de(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*To(t,e,n,r){s0(t)||(t=[t]);for(const i of t){const s=a0(i,e,n,r);s&&(yield s)}}function*ea(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Ue(e.schema)&&Ue(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,a))u.explanation=n.message,c="not_valid",yield[u,void 0];for(let[u,l,h]of e.entries(t,a)){const f=ea(l,h,{path:u===void 0?r:[...r,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:n.message});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):s&&(l=d[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):Ue(t)&&(l!==void 0||u in t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,a))u.explanation=n.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class le{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return To(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return To(l,u,this,c)}:this.refiner=()=>[]}assert(e,n){return Wl(e,this,n)}create(e,n){return Ul(e,this,n)}is(e){return ta(e,this)}mask(e,n){return zl(e,this,n)}validate(e,n={}){return An(e,this,n)}}function Wl(t,e,n){const r=An(t,e,{message:n});if(r[0])throw r[0]}function Ul(t,e,n){const r=An(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function zl(t,e,n){const r=An(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function ta(t,e){return!An(t,e)[0]}function An(t,e,n={}){const r=ea(t,e,n),i=o0(r);return i[0]?[new Hl(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function c0(...t){const e=t[0].type==="type",n=t.map(i=>i.schema),r=Object.assign({},...n);return e?ra(r):cr(r)}function Ne(t,e){return new le({type:t,schema:null,validator:e})}function u0(t,e){return new le({...t,refiner:(n,r)=>n===void 0||t.refiner(n,r),validator(n,r){return n===void 0?!0:(e(n,r),t.validator(n,r))}})}function l0(t){return new le({type:"dynamic",schema:null,*entries(e,n){yield*t(e,n).entries(e,n)},validator(e,n){return t(e,n).validator(e,n)},coercer(e,n){return t(e,n).coercer(e,n)},refiner(e,n){return t(e,n).refiner(e,n)}})}function h0(t){let e;return new le({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator(n,r){return e??(e=t()),e.validator(n,r)},coercer(n,r){return e??(e=t()),e.coercer(n,r)},refiner(n,r){return e??(e=t()),e.refiner(n,r)}})}function f0(t,e){const{schema:n}=t,r={...n};for(const i of e)delete r[i];switch(t.type){case"type":return ra(r);default:return cr(r)}}function d0(t){const e=t instanceof le?{...t.schema}:{...t};for(const n in e)e[n]=ql(e[n]);return cr(e)}function p0(t,e){const{schema:n}=t,r={};for(const i of e)r[i]=n[i];return cr(r)}function b0(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ne(t,e)}function g0(){return Ne("any",()=>!0)}function m0(t){return new le({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${de(e)}`}})}function y0(){return Ne("bigint",t=>typeof t=="bigint")}function v0(){return Ne("boolean",t=>typeof t=="boolean")}function _0(){return Ne("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${de(t)}`)}function w0(t){const e={},n=t.map(r=>de(r)).join();for(const r of t)e[r]=r;return new le({type:"enums",schema:e,validator(r){return t.includes(r)||`Expected one of \`${n}\`, but received: ${de(r)}`}})}function S0(){return Ne("func",t=>typeof t=="function"||`Expected a function, but received: ${de(t)}`)}function E0(t){return Ne("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${de(e)}`)}function C0(){return Ne("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${de(t)}`)}function I0(t){return new le({type:"intersection",schema:null,*entries(e,n){for(const r of t)yield*r.entries(e,n)},*validator(e,n){for(const r of t)yield*r.validator(e,n)},*refiner(e,n){for(const r of t)yield*r.refiner(e,n)}})}function x0(t){const e=de(t),n=typeof t;return new le({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${de(r)}`}})}function k0(t,e){return new le({type:"map",schema:null,*entries(n){if(t&&e&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,t],yield[r,i,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${de(n)}`}})}function na(){return Ne("never",()=>!1)}function R0(t){return new le({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function M0(){return Ne("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${de(t)}`)}function cr(t){const e=t?Object.keys(t):[],n=na();return new le({type:"object",schema:t||null,*entries(r){if(t&&Ue(r)){const i=new Set(Object.keys(r));for(const s of e)i.delete(s),yield[s,r[s],t[s]];for(const s of i)yield[s,r[s],n]}},validator(r){return Ue(r)||`Expected an object, but received: ${de(r)}`},coercer(r){return Ue(r)?{...r}:r}})}function ql(t){return new le({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function A0(t,e){return new le({type:"record",schema:null,*entries(n){if(Ue(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Ue(n)||`Expected an object, but received: ${de(n)}`}})}function T0(){return Ne("regexp",t=>t instanceof RegExp)}function N0(t){return new le({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const n of e)yield[n,n,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${de(e)}`}})}function Gl(){return Ne("string",t=>typeof t=="string"||`Expected a string, but received: ${de(t)}`)}function O0(t){const e=na();return new le({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${de(n)}`}})}function ra(t){const e=Object.keys(t);return new le({type:"type",schema:t,*entries(n){if(Ue(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Ue(n)||`Expected an object, but received: ${de(n)}`},coercer(n){return Ue(n)?{...n}:n}})}function L0(t){const e=t.map(n=>n.type).join(" | ");return new le({type:"union",schema:null,coercer(n){for(const r of t){const[i,s]=r.validate(n,{coerce:!0});if(!i)return s}return n},validator(n,r){const i=[];for(const s of t){const[...o]=ea(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${de(n)}`,...i]}})}function Jl(){return Ne("unknown",()=>!0)}function ia(t,e,n){return new le({...t,coercer:(r,i)=>ta(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}function j0(t,e,n={}){return ia(t,Jl(),r=>{const i=typeof e=="function"?e():e;if(r===void 0)return i;if(!n.strict&&jc(r)&&jc(i)){const s={...r};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return r})}function $0(t){return ia(t,Gl(),e=>e.trim())}function P0(t){return Zt(t,"empty",e=>{const n=Ql(e);return n===0||`Expected an empty ${t.type} but received one with a size of \`${n}\``})}function Ql(t){return t instanceof Map||t instanceof Set?t.size:t.length}function D0(t,e,n={}){const{exclusive:r}=n;return Zt(t,"max",i=>r?i<e:i<=e||`Expected a ${t.type} less than ${r?"":"or equal to "}${e} but received \`${i}\``)}function F0(t,e,n={}){const{exclusive:r}=n;return Zt(t,"min",i=>r?i>e:i>=e||`Expected a ${t.type} greater than ${r?"":"or equal to "}${e} but received \`${i}\``)}function B0(t){return Zt(t,"nonempty",e=>Ql(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function V0(t,e){return Zt(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function H0(t,e,n=e){const r=`Expected a ${t.type}`,i=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Zt(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=n||`${r} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}})}function Zt(t,e,n){return new le({...t,*refiner(r,i){yield*t.refiner(r,i);const s=n(r,i),o=To(s,i,t,r);for(const a of o)yield{...a,refinement:e}}})}const W0=Object.freeze(Object.defineProperty({__proto__:null,Struct:le,StructError:Hl,any:g0,array:m0,assert:Wl,assign:c0,bigint:y0,boolean:v0,coerce:ia,create:Ul,date:_0,defaulted:j0,define:Ne,deprecated:u0,dynamic:l0,empty:P0,enums:w0,func:S0,instance:E0,integer:C0,intersection:I0,is:ta,lazy:h0,literal:x0,map:k0,mask:zl,max:D0,min:F0,never:na,nonempty:B0,nullable:R0,number:M0,object:cr,omit:f0,optional:ql,partial:d0,pattern:V0,pick:p0,record:A0,refine:Zt,regexp:T0,set:N0,size:H0,string:Gl,struct:b0,trimmed:$0,tuple:O0,type:ra,union:L0,unknown:Jl,validate:An},Symbol.toStringTag,{value:"Module"})),Yt=xn(W0);Object.defineProperty(_e,"__esModule",{value:!0});_e.assertExhaustive=_e.assertStruct=_e.assert=_e.AssertionError=void 0;const U0=Yt;function z0(t){return typeof t=="object"&&t!==null&&"message"in t}function q0(t){var e,n;return typeof((n=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||n===void 0?void 0:n.name)=="string"}function G0(t){const e=z0(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Zl(t,e){return q0(t)?new t({message:e}):t({message:e})}class sa extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}_e.AssertionError=sa;function J0(t,e="Assertion failed.",n=sa){if(!t)throw e instanceof Error?e:Zl(n,e)}_e.assert=J0;function Q0(t,e,n="Assertion failed",r=sa){try{(0,U0.assert)(t,e)}catch(i){throw Zl(r,`${n}: ${G0(i)}.`)}}_e.assertStruct=Q0;function Z0(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}_e.assertExhaustive=Z0;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.base64=void 0;const Y0=Yt,K0=_e,X0=(t,e={})=>{var n,r;const i=(n=e.paddingRequired)!==null&&n!==void 0?n:!1,s=(r=e.characterSet)!==null&&r!==void 0?r:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,K0.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Y0.pattern)(t,a)};ur.base64=X0;var Q={},lr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Yt,n=_e;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function r(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=r;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,n.assert)(r(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(u){(0,n.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=a;function c(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=c})(lr);Object.defineProperty(Q,"__esModule",{value:!0});Q.createDataView=Q.concatBytes=Q.valueToBytes=Q.stringToBytes=Q.numberToBytes=Q.signedBigIntToBytes=Q.bigIntToBytes=Q.hexToBytes=Q.bytesToString=Q.bytesToNumber=Q.bytesToSignedBigInt=Q.bytesToBigInt=Q.bytesToHex=Q.assertIsBytes=Q.isBytes=void 0;const je=_e,No=lr,$c=48,Pc=58,Dc=87;function eb(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const tb=eb();function oa(t){return t instanceof Uint8Array}Q.isBytes=oa;function Tn(t){(0,je.assert)(oa(t),"Value must be a Uint8Array.")}Q.assertIsBytes=Tn;function Yl(t){if(Tn(t),t.length===0)return"0x";const e=tb(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return(0,No.add0x)(n.join(""))}Q.bytesToHex=Yl;function Kl(t){Tn(t);const e=Yl(t);return BigInt(e)}Q.bytesToBigInt=Kl;function nb(t){Tn(t);let e=BigInt(0);for(const n of t)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(t.length*8,e)}Q.bytesToSignedBigInt=nb;function rb(t){Tn(t);const e=Kl(t);return(0,je.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}Q.bytesToNumber=rb;function ib(t){return Tn(t),new TextDecoder().decode(t)}Q.bytesToString=ib;function li(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,No.assertIsHexString)(t);const n=(0,No.remove0x)(t).toLowerCase(),r=n.length%2===0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let s=0;s<i.length;s++){const o=r.charCodeAt(s*2),a=r.charCodeAt(s*2+1),c=o-(o<Pc?$c:Dc),u=a-(a<Pc?$c:Dc);i[s]=c*16+u}return i}Q.hexToBytes=li;function Xl(t){(0,je.assert)(typeof t=="bigint","Value must be a bigint."),(0,je.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return li(e)}Q.bigIntToBytes=Xl;function sb(t,e){(0,je.assert)(e>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(e*8+-1))}function ob(t,e){(0,je.assert)(typeof t=="bigint","Value must be a bigint."),(0,je.assert)(typeof e=="number","Byte length must be a number."),(0,je.assert)(e>0,"Byte length must be greater than 0."),(0,je.assert)(sb(t,e),"Byte length is too small to represent the given value.");let n=t;const r=new Uint8Array(e);for(let i=0;i<r.length;i++)r[i]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}Q.signedBigIntToBytes=ob;function eh(t){(0,je.assert)(typeof t=="number","Value must be a number."),(0,je.assert)(t>=0,"Value must be a non-negative number."),(0,je.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return li(e)}Q.numberToBytes=eh;function th(t){return(0,je.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}Q.stringToBytes=th;function nh(t){if(typeof t=="bigint")return Xl(t);if(typeof t=="number")return eh(t);if(typeof t=="string")return t.startsWith("0x")?li(t):th(t);if(oa(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}Q.valueToBytes=nh;function ab(t){const e=new Array(t.length);let n=0;for(let i=0;i<t.length;i++){const s=nh(t[i]);e[i]=s,n+=s.length}const r=new Uint8Array(n);for(let i=0,s=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r}Q.concatBytes=ab;function cb(t){if(typeof B<"u"&&t instanceof B){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}Q.createDataView=cb;var hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.ChecksumStruct=void 0;const Fc=Yt,ub=ur;hi.ChecksumStruct=(0,Fc.size)((0,ub.base64)((0,Fc.string)(),{paddingRequired:!0}),44,44);var at={};Object.defineProperty(at,"__esModule",{value:!0});at.createHex=at.createBytes=at.createBigInt=at.createNumber=void 0;const ie=Yt,lb=_e,rh=Q,fi=lr,ih=(0,ie.union)([(0,ie.number)(),(0,ie.bigint)(),(0,ie.string)(),fi.StrictHexStruct]),hb=(0,ie.coerce)((0,ie.number)(),ih,Number),fb=(0,ie.coerce)((0,ie.bigint)(),ih,BigInt);(0,ie.union)([fi.StrictHexStruct,(0,ie.instance)(Uint8Array)]);const db=(0,ie.coerce)((0,ie.instance)(Uint8Array),(0,ie.union)([fi.StrictHexStruct]),rh.hexToBytes),pb=(0,ie.coerce)(fi.StrictHexStruct,(0,ie.instance)(Uint8Array),rh.bytesToHex);function bb(t){try{const e=(0,ie.create)(t,hb);return(0,lb.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ie.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}at.createNumber=bb;function gb(t){try{return(0,ie.create)(t,fb)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}at.createBigInt=gb;function mb(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ie.create)(t,db)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}at.createBytes=mb;function yb(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ie.create)(t,pb)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}at.createHex=yb;var gn={},sh=A&&A.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Re=A&&A.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},qe,tt;Object.defineProperty(gn,"__esModule",{value:!0});gn.FrozenSet=gn.FrozenMap=void 0;class aa{constructor(e){qe.set(this,void 0),sh(this,qe,new Map(e),"f"),Object.freeze(this)}get size(){return Re(this,qe,"f").size}[(qe=new WeakMap,Symbol.iterator)](){return Re(this,qe,"f")[Symbol.iterator]()}entries(){return Re(this,qe,"f").entries()}forEach(e,n){return Re(this,qe,"f").forEach((r,i,s)=>e.call(n,r,i,this))}get(e){return Re(this,qe,"f").get(e)}has(e){return Re(this,qe,"f").has(e)}keys(){return Re(this,qe,"f").keys()}values(){return Re(this,qe,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,n])=>`${String(e)} => ${String(n)}`).join(", ")} `:""}}`}}gn.FrozenMap=aa;class ca{constructor(e){tt.set(this,void 0),sh(this,tt,new Set(e),"f"),Object.freeze(this)}get size(){return Re(this,tt,"f").size}[(tt=new WeakMap,Symbol.iterator)](){return Re(this,tt,"f")[Symbol.iterator]()}entries(){return Re(this,tt,"f").entries()}forEach(e,n){return Re(this,tt,"f").forEach((r,i,s)=>e.call(n,r,i,this))}has(e){return Re(this,tt,"f").has(e)}keys(){return Re(this,tt,"f").keys()}values(){return Re(this,tt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}gn.FrozenSet=ca;Object.freeze(aa);Object.freeze(aa.prototype);Object.freeze(ca);Object.freeze(ca.prototype);var oh={},ua={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function n(u){return u==null}t.isNullOrUndefined=n;function r(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=r;const i=(u,l)=>Object.hasOwnProperty.call(u,l);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let l=u;for(;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(u)===l}catch{return!1}}t.isPlainObject=s;function o(u){return u.charCodeAt(0)<=127}t.isASCII=o;function a(u){var l;return u.split("").reduce((f,d)=>o(d)?f+1:f+2,0)+((l=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&l!==void 0?l:[]).length}t.calculateStringSize=a;function c(u){return u.toString().length}t.calculateNumberSize=c})(ua);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Yt,n=_e,r=ua;t.JsonStruct=(0,e.define)("Json",E=>{const[N]=k(E,!0);return N?!0:"Expected a valid JSON-serializable value"});function i(E){return(0,e.is)(E,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(E){return(0,e.is)(E,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(E,N){(0,n.assertStruct)(E,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",N)}t.assertIsJsonRpcNotification=o;function a(E){return(0,e.is)(E,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(E,N){(0,n.assertStruct)(E,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",N)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function u(E){return(0,e.is)(E,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=u;function l(E,N){(0,n.assertStruct)(E,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",N)}t.assertIsPendingJsonRpcResponse=l;function h(E){return(0,e.is)(E,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=h;function f(E,N){(0,n.assertStruct)(E,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",N)}t.assertIsJsonRpcResponse=f;function d(E){return(0,e.is)(E,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=d;function p(E,N){(0,n.assertStruct)(E,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",N)}t.assertIsJsonRpcSuccess=p;function _(E){return(0,e.is)(E,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=_;function m(E,N){(0,n.assertStruct)(E,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",N)}t.assertIsJsonRpcFailure=m;function b(E){return(0,e.is)(E,t.JsonRpcErrorStruct)}t.isJsonRpcError=b;function y(E,N){(0,n.assertStruct)(E,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",N)}t.assertIsJsonRpcError=y;function S(E){const{permitEmptyString:N,permitFractions:U,permitNull:z}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},E);return q=>!!(typeof q=="number"&&(U||Number.isInteger(q))||typeof q=="string"&&(N||q.length>0)||z&&q===null)}t.getJsonRpcIdValidator=S;function k(E,N=!1){const U=new Set;function z(P,q){if(P===void 0)return[!1,0];if(P===null)return[!0,q?0:r.JsonSize.Null];const ue=typeof P;try{if(ue==="function")return[!1,0];if(ue==="string"||P instanceof String)return[!0,q?0:(0,r.calculateStringSize)(P)+r.JsonSize.Quote*2];if(ue==="boolean"||P instanceof Boolean)return q?[!0,0]:[!0,P==!0?r.JsonSize.True:r.JsonSize.False];if(ue==="number"||P instanceof Number)return q?[!0,0]:[!0,(0,r.calculateNumberSize)(P)];if(P instanceof Date)return q?[!0,0]:[!0,isNaN(P.getDate())?r.JsonSize.Null:r.JsonSize.Date+r.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,r.isPlainObject)(P)&&!Array.isArray(P))return[!1,0];if(U.has(P))return[!1,0];U.add(P);try{return[!0,Object.entries(P).reduce((G,[w,v],R,C)=>{let[T,I]=z(v,q);if(!T)throw new Error("JSON validation did not pass. Validation process stopped.");if(U.delete(P),q)return 0;const L=Array.isArray(P)?0:w.length+r.JsonSize.Comma+r.JsonSize.Colon*2,J=R<C.length-1?r.JsonSize.Comma:0;return G+L+I+J},q?0:r.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return z(E,N)}t.validateJsonAndGetSize=k})(oh);var mn={},Oo={exports:{}},no,Bc;function vb(){if(Bc)return no;Bc=1;var t=1e3,e=t*60,n=e*60,r=n*24,i=r*7,s=r*365.25;no=function(l,h){h=h||{};var f=typeof l;if(f==="string"&&l.length>0)return o(l);if(f==="number"&&isFinite(l))return h.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(h){var f=parseFloat(h[1]),d=(h[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*e;case"seconds":case"second":case"secs":case"sec":case"s":return f*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var h=Math.abs(l);return h>=r?Math.round(l/r)+"d":h>=n?Math.round(l/n)+"h":h>=e?Math.round(l/e)+"m":h>=t?Math.round(l/t)+"s":l+"ms"}function c(l){var h=Math.abs(l);return h>=r?u(l,h,r,"day"):h>=n?u(l,h,n,"hour"):h>=e?u(l,h,e,"minute"):h>=t?u(l,h,t,"second"):l+" ms"}function u(l,h,f,d){var p=h>=f*1.5;return Math.round(l/f)+" "+d+(p?"s":"")}return no}function _b(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=i,n.enabled=o,n.humanize=vb(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let h=0;for(let f=0;f<l.length;f++)h=(h<<5)-h+l.charCodeAt(f),h|=0;return n.colors[Math.abs(h)%n.colors.length]}n.selectColor=e;function n(l){let h,f=null,d,p;function _(...m){if(!_.enabled)return;const b=_,y=Number(new Date),S=y-(h||y);b.diff=S,b.prev=h,b.curr=y,h=y,m[0]=n.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let k=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";k++;const z=n.formatters[U];if(typeof z=="function"){const P=m[k];N=z.call(b,P),m.splice(k,1),k--}return N}),n.formatArgs.call(b,m),(b.log||n.log).apply(b,m)}return _.namespace=l,_.useColors=n.useColors(),_.color=n.selectColor(l),_.extend=r,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(d!==n.namespaces&&(d=n.namespaces,p=n.enabled(l)),p),set:m=>{f=m}}),typeof n.init=="function"&&n.init(_),_}function r(l,h){const f=n(this.namespace+(typeof h>"u"?":":h)+l);return f.log=this.log,f}function i(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let h;const f=(typeof l=="string"?l:"").split(/[\s,]+/),d=f.length;for(h=0;h<d;h++)f[h]&&(l=f[h].replace(/\*/g,".*?"),l[0]==="-"?n.skips.push(new RegExp("^"+l.slice(1)+"$")):n.names.push(new RegExp("^"+l+"$")))}function s(){const l=[...n.names.map(a),...n.skips.map(a).map(h=>"-"+h)].join(",");return n.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let h,f;for(h=0,f=n.skips.length;h<f;h++)if(n.skips[h].test(l))return!1;for(h=0,f=n.names.length;h<f;h++)if(n.names[h].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var wb=_b;(function(t,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=n,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let l=0,h=0;c[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(l++,f==="%c"&&(h=l))}),c.splice(h,0,u)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof ko<"u"&&"env"in ko&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=wb(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(Oo,Oo.exports);var Sb=Oo.exports,Eb=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mn,"__esModule",{value:!0});mn.createModuleLogger=mn.createProjectLogger=void 0;const Cb=Eb(Sb),Ib=(0,Cb.default)("metamask");function xb(t){return Ib.extend(t)}mn.createProjectLogger=xb;function kb(t,e){return t.extend(e)}mn.createModuleLogger=kb;var ct={};Object.defineProperty(ct,"__esModule",{value:!0});ct.hexToBigInt=ct.hexToNumber=ct.bigIntToHex=ct.numberToHex=void 0;const ln=_e,Yn=lr,Rb=t=>((0,ln.assert)(typeof t=="number","Value must be a number."),(0,ln.assert)(t>=0,"Value must be a non-negative number."),(0,ln.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Yn.add0x)(t.toString(16)));ct.numberToHex=Rb;const Mb=t=>((0,ln.assert)(typeof t=="bigint","Value must be a bigint."),(0,ln.assert)(t>=0,"Value must be a non-negative bigint."),(0,Yn.add0x)(t.toString(16)));ct.bigIntToHex=Mb;const Ab=t=>{(0,Yn.assertIsHexString)(t);const e=parseInt(t,16);return(0,ln.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};ct.hexToNumber=Ab;const Tb=t=>((0,Yn.assertIsHexString)(t),BigInt((0,Yn.add0x)(t)));ct.hexToBigInt=Tb;var ah={};Object.defineProperty(ah,"__esModule",{value:!0});var ch={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.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"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,n=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function r(s,o){return n(s,"count"),s*o}t.inMilliseconds=r;function i(s){return n(s,"timestamp"),Date.now()-s}t.timeSince=i})(ch);var uh={},Lo={exports:{}};const Nb="2.0.0",lh=256,Ob=Number.MAX_SAFE_INTEGER||9007199254740991,Lb=16,jb=lh-6,$b=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var di={MAX_LENGTH:lh,MAX_SAFE_COMPONENT_LENGTH:Lb,MAX_SAFE_BUILD_LENGTH:jb,MAX_SAFE_INTEGER:Ob,RELEASE_TYPES:$b,SEMVER_SPEC_VERSION:Nb,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Pb=typeof ko=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var pi=Pb;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=di,s=pi;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],u=e.t={};let l=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,r]],d=_=>{for(const[m,b]of f)_=_.split(`${m}*`).join(`${m}{0,${b}}`).split(`${m}+`).join(`${m}{1,${b}}`);return _},p=(_,m,b)=>{const y=d(m),S=l++;s(_,S,m),u[_]=S,c[S]=m,o[S]=new RegExp(m,b?"g":void 0),a[S]=new RegExp(y,b?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),p("FULL",`^${c[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),p("LOOSE",`^${c[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),p("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[u.COERCE],!0),p("COERCERTLFULL",c[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Lo,Lo.exports);var hr=Lo.exports;const Db=Object.freeze({loose:!0}),Fb=Object.freeze({}),Bb=t=>t?typeof t!="object"?Db:t:Fb;var la=Bb;const Vc=/^[0-9]+$/,hh=(t,e)=>{const n=Vc.test(t),r=Vc.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},Vb=(t,e)=>hh(e,t);var fh={compareIdentifiers:hh,rcompareIdentifiers:Vb};const xr=pi,{MAX_LENGTH:Hc,MAX_SAFE_INTEGER:kr}=di,{safeRe:Wc,t:Uc}=hr,Hb=la,{compareIdentifiers:en}=fh;let Wb=class rt{constructor(e,n){if(n=Hb(n),e instanceof rt){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Hc)throw new TypeError(`version is longer than ${Hc} characters`);xr("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?Wc[Uc.LOOSE]:Wc[Uc.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>kr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>kr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>kr||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<kr)return s}return i}):this.prerelease=[],this.build=r[5]?r[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(e){if(xr("SemVer.compare",this.version,this.options,e),!(e instanceof rt)){if(typeof e=="string"&&e===this.version)return 0;e=new rt(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof rt||(e=new rt(e,this.options)),en(this.major,e.major)||en(this.minor,e.minor)||en(this.patch,e.patch)}comparePre(e){if(e instanceof rt||(e=new rt(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(xr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return en(r,i)}while(++n)}compareBuild(e){e instanceof rt||(e=new rt(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(xr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return en(r,i)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);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(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");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(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),en(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Te=Wb;const zc=Te,Ub=(t,e,n=!1)=>{if(t instanceof zc)return t;try{return new zc(t,e)}catch(r){if(!n)return null;throw r}};var Nn=Ub;const zb=Nn,qb=(t,e)=>{const n=zb(t,e);return n?n.version:null};var Gb=qb;const Jb=Nn,Qb=(t,e)=>{const n=Jb(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var Zb=Qb;const qc=Te,Yb=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new qc(t instanceof qc?t.version:t,n).inc(e,r,i).version}catch{return null}};var Kb=Yb;const Gc=Nn,Xb=(t,e)=>{const n=Gc(t,null,!0),r=Gc(e,null,!0),i=n.compare(r);if(i===0)return null;const s=i>0,o=s?n:r,a=s?r:n,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const l=c?"pre":"";return n.major!==r.major?l+"major":n.minor!==r.minor?l+"minor":n.patch!==r.patch?l+"patch":"prerelease"};var eg=Xb;const tg=Te,ng=(t,e)=>new tg(t,e).major;var rg=ng;const ig=Te,sg=(t,e)=>new ig(t,e).minor;var og=sg;const ag=Te,cg=(t,e)=>new ag(t,e).patch;var ug=cg;const lg=Nn,hg=(t,e)=>{const n=lg(t,e);return n&&n.prerelease.length?n.prerelease:null};var fg=hg;const Jc=Te,dg=(t,e,n)=>new Jc(t,n).compare(new Jc(e,n));var Ke=dg;const pg=Ke,bg=(t,e,n)=>pg(e,t,n);var gg=bg;const mg=Ke,yg=(t,e)=>mg(t,e,!0);var vg=yg;const Qc=Te,_g=(t,e,n)=>{const r=new Qc(t,n),i=new Qc(e,n);return r.compare(i)||r.compareBuild(i)};var ha=_g;const wg=ha,Sg=(t,e)=>t.sort((n,r)=>wg(n,r,e));var Eg=Sg;const Cg=ha,Ig=(t,e)=>t.sort((n,r)=>Cg(r,n,e));var xg=Ig;const kg=Ke,Rg=(t,e,n)=>kg(t,e,n)>0;var bi=Rg;const Mg=Ke,Ag=(t,e,n)=>Mg(t,e,n)<0;var fa=Ag;const Tg=Ke,Ng=(t,e,n)=>Tg(t,e,n)===0;var dh=Ng;const Og=Ke,Lg=(t,e,n)=>Og(t,e,n)!==0;var ph=Lg;const jg=Ke,$g=(t,e,n)=>jg(t,e,n)>=0;var da=$g;const Pg=Ke,Dg=(t,e,n)=>Pg(t,e,n)<=0;var pa=Dg;const Fg=dh,Bg=ph,Vg=bi,Hg=da,Wg=fa,Ug=pa,zg=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Fg(t,n,r);case"!=":return Bg(t,n,r);case">":return Vg(t,n,r);case">=":return Hg(t,n,r);case"<":return Wg(t,n,r);case"<=":return Ug(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var bh=zg;const qg=Te,Gg=Nn,{safeRe:Rr,t:Mr}=hr,Jg=(t,e)=>{if(t instanceof qg)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Rr[Mr.COERCEFULL]:Rr[Mr.COERCE]);else{const c=e.includePrerelease?Rr[Mr.COERCERTLFULL]:Rr[Mr.COERCERTL];let u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(n===null)return null;const r=n[2],i=n[3]||"0",s=n[4]||"0",o=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Gg(`${r}.${i}.${s}${o}${a}`,e)};var Qg=Jg,ro,Zc;function Zg(){return Zc||(Zc=1,ro=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),ro}var Yg=Z;Z.Node=qt;Z.create=Z;function Z(t){var e=this;if(e instanceof Z||(e=new Z),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}Z.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Z.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Z.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Z.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Xg(this,arguments[t]);return this.length};Z.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)em(this,arguments[t]);return this.length};Z.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Z.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Z.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};Z.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};Z.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};Z.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};Z.prototype.map=function(t,e){e=e||this;for(var n=new Z,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};Z.prototype.mapReverse=function(t,e){e=e||this;for(var n=new Z,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};Z.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=t(n,r.value,i),r=r.next;return n};Z.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=t(n,r.value,i),r=r.prev;return n};Z.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};Z.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};Z.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new Z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)n.push(i.value);return n};Z.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new Z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>t;r--,i=i.prev)n.push(i.value);return n};Z.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=Kg(this,i,n[r]);return s};Z.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function Kg(t,e,n){var r=e===t.head?new qt(n,null,e,t):new qt(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function Xg(t,e){t.tail=new qt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function em(t,e){t.head=new qt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function qt(t,e,n,r){if(!(this instanceof qt))return new qt(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{Zg()(Z)}catch{}const tm=Yg,Ft=Symbol("max"),bt=Symbol("length"),tn=Symbol("lengthCalculator"),zn=Symbol("allowStale"),Wt=Symbol("maxAge"),ft=Symbol("dispose"),Yc=Symbol("noDisposeOnSet"),ge=Symbol("lruList"),Qe=Symbol("cache"),gh=Symbol("updateAgeOnGet"),io=()=>1;class nm{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Ft]=e.max||1/0;const n=e.length||io;if(this[tn]=typeof n!="function"?io:n,this[zn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Wt]=e.maxAge||0,this[ft]=e.dispose,this[Yc]=e.noDisposeOnSet||!1,this[gh]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Ft]=e||1/0,Dn(this)}get max(){return this[Ft]}set allowStale(e){this[zn]=!!e}get allowStale(){return this[zn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Wt]=e,Dn(this)}get maxAge(){return this[Wt]}set lengthCalculator(e){typeof e!="function"&&(e=io),e!==this[tn]&&(this[tn]=e,this[bt]=0,this[ge].forEach(n=>{n.length=this[tn](n.value,n.key),this[bt]+=n.length})),Dn(this)}get lengthCalculator(){return this[tn]}get length(){return this[bt]}get itemCount(){return this[ge].length}rforEach(e,n){n=n||this;for(let r=this[ge].tail;r!==null;){const i=r.prev;Kc(this,e,r,n),r=i}}forEach(e,n){n=n||this;for(let r=this[ge].head;r!==null;){const i=r.next;Kc(this,e,r,n),r=i}}keys(){return this[ge].toArray().map(e=>e.key)}values(){return this[ge].toArray().map(e=>e.value)}reset(){this[ft]&&this[ge]&&this[ge].length&&this[ge].forEach(e=>this[ft](e.key,e.value)),this[Qe]=new Map,this[ge]=new tm,this[bt]=0}dump(){return this[ge].map(e=>Wr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ge]}set(e,n,r){if(r=r||this[Wt],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[tn](n,e);if(this[Qe].has(e)){if(s>this[Ft])return hn(this,this[Qe].get(e)),!1;const c=this[Qe].get(e).value;return this[ft]&&(this[Yc]||this[ft](e,c.value)),c.now=i,c.maxAge=r,c.value=n,this[bt]+=s-c.length,c.length=s,this.get(e),Dn(this),!0}const o=new rm(e,n,s,i,r);return o.length>this[Ft]?(this[ft]&&this[ft](e,n),!1):(this[bt]+=o.length,this[ge].unshift(o),this[Qe].set(e,this[ge].head),Dn(this),!0)}has(e){if(!this[Qe].has(e))return!1;const n=this[Qe].get(e).value;return!Wr(this,n)}get(e){return so(this,e,!0)}peek(e){return so(this,e,!1)}pop(){const e=this[ge].tail;return e?(hn(this,e),e.value):null}del(e){hn(this,this[Qe].get(e))}load(e){this.reset();const n=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Qe].forEach((e,n)=>so(this,n,!1))}}const so=(t,e,n)=>{const r=t[Qe].get(e);if(r){const i=r.value;if(Wr(t,i)){if(hn(t,r),!t[zn])return}else n&&(t[gh]&&(r.value.now=Date.now()),t[ge].unshiftNode(r));return i.value}},Wr=(t,e)=>{if(!e||!e.maxAge&&!t[Wt])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Wt]&&n>t[Wt]},Dn=t=>{if(t[bt]>t[Ft])for(let e=t[ge].tail;t[bt]>t[Ft]&&e!==null;){const n=e.prev;hn(t,e),e=n}},hn=(t,e)=>{if(e){const n=e.value;t[ft]&&t[ft](n.key,n.value),t[bt]-=n.length,t[Qe].delete(n.key),t[ge].removeNode(e)}};class rm{constructor(e,n,r,i,s){this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Kc=(t,e,n,r)=>{let i=n.value;Wr(t,i)&&(hn(t,n),t[zn]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var im=nm,oo,Xc;function Xe(){if(Xc)return oo;Xc=1;class t{constructor(v,R){if(R=r(R),v instanceof t)return v.loose===!!R.loose&&v.includePrerelease===!!R.includePrerelease?v:new t(v.raw,R);if(v instanceof i)return this.raw=v.value,this.set=[[v]],this.format(),this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=v.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(C=>this.parseRange(C.trim())).filter(C=>C.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const C=this.set[0];if(this.set=this.set.filter(T=>!p(T[0])),this.set.length===0)this.set=[C];else if(this.set.length>1){for(const T of this.set)if(T.length===1&&_(T[0])){this.set=[T];break}}}this.format()}format(){return this.range=this.set.map(v=>v.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(v){const C=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+v,T=n.get(C);if(T)return T;const I=this.options.loose,L=I?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];v=v.replace(L,ue(this.options.includePrerelease)),s("hyphen replace",v),v=v.replace(a[c.COMPARATORTRIM],u),s("comparator trim",v),v=v.replace(a[c.TILDETRIM],l),s("tilde trim",v),v=v.replace(a[c.CARETTRIM],h),s("caret trim",v);let J=v.split(" ").map(ne=>b(ne,this.options)).join(" ").split(/\s+/).map(ne=>q(ne,this.options));I&&(J=J.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(a[c.COMPARATORLOOSE])))),s("range list",J);const D=new Map,X=J.map(ne=>new i(ne,this.options));for(const ne of X){if(p(ne))return[ne];D.set(ne.value,ne)}D.size>1&&D.has("")&&D.delete("");const we=[...D.values()];return n.set(C,we),we}intersects(v,R){if(!(v instanceof t))throw new TypeError("a Range is required");return this.set.some(C=>m(C,R)&&v.set.some(T=>m(T,R)&&C.every(I=>T.every(L=>I.intersects(L,R)))))}test(v){if(!v)return!1;if(typeof v=="string")try{v=new o(v,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(G(this.set[R],v,this.options))return!0;return!1}}oo=t;const e=im,n=new e({max:1e3}),r=la,i=gi(),s=pi,o=Te,{safeRe:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=hr,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=di,p=w=>w.value==="<0.0.0-0",_=w=>w.value==="",m=(w,v)=>{let R=!0;const C=w.slice();let T=C.pop();for(;R&&C.length;)R=C.every(I=>T.intersects(I,v)),T=C.pop();return R},b=(w,v)=>(s("comp",w,v),w=E(w,v),s("caret",w),w=S(w,v),s("tildes",w),w=U(w,v),s("xrange",w),w=P(w,v),s("stars",w),w),y=w=>!w||w.toLowerCase()==="x"||w==="*",S=(w,v)=>w.trim().split(/\s+/).map(R=>k(R,v)).join(" "),k=(w,v)=>{const R=v.loose?a[c.TILDELOOSE]:a[c.TILDE];return w.replace(R,(C,T,I,L,J)=>{s("tilde",w,C,T,I,L,J);let D;return y(T)?D="":y(I)?D=`>=${T}.0.0 <${+T+1}.0.0-0`:y(L)?D=`>=${T}.${I}.0 <${T}.${+I+1}.0-0`:J?(s("replaceTilde pr",J),D=`>=${T}.${I}.${L}-${J} <${T}.${+I+1}.0-0`):D=`>=${T}.${I}.${L} <${T}.${+I+1}.0-0`,s("tilde return",D),D})},E=(w,v)=>w.trim().split(/\s+/).map(R=>N(R,v)).join(" "),N=(w,v)=>{s("caret",w,v);const R=v.loose?a[c.CARETLOOSE]:a[c.CARET],C=v.includePrerelease?"-0":"";return w.replace(R,(T,I,L,J,D)=>{s("caret",w,T,I,L,J,D);let X;return y(I)?X="":y(L)?X=`>=${I}.0.0${C} <${+I+1}.0.0-0`:y(J)?I==="0"?X=`>=${I}.${L}.0${C} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.0${C} <${+I+1}.0.0-0`:D?(s("replaceCaret pr",D),I==="0"?L==="0"?X=`>=${I}.${L}.${J}-${D} <${I}.${L}.${+J+1}-0`:X=`>=${I}.${L}.${J}-${D} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.${J}-${D} <${+I+1}.0.0-0`):(s("no pr"),I==="0"?L==="0"?X=`>=${I}.${L}.${J}${C} <${I}.${L}.${+J+1}-0`:X=`>=${I}.${L}.${J}${C} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.${J} <${+I+1}.0.0-0`),s("caret return",X),X})},U=(w,v)=>(s("replaceXRanges",w,v),w.split(/\s+/).map(R=>z(R,v)).join(" ")),z=(w,v)=>{w=w.trim();const R=v.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return w.replace(R,(C,T,I,L,J,D)=>{s("xRange",w,C,T,I,L,J,D);const X=y(I),we=X||y(L),ne=we||y(J),wt=ne;return T==="="&&wt&&(T=""),D=v.includePrerelease?"-0":"",X?T===">"||T==="<"?C="<0.0.0-0":C="*":T&&wt?(we&&(L=0),J=0,T===">"?(T=">=",we?(I=+I+1,L=0,J=0):(L=+L+1,J=0)):T==="<="&&(T="<",we?I=+I+1:L=+L+1),T==="<"&&(D="-0"),C=`${T+I}.${L}.${J}${D}`):we?C=`>=${I}.0.0${D} <${+I+1}.0.0-0`:ne&&(C=`>=${I}.${L}.0${D} <${I}.${+L+1}.0-0`),s("xRange return",C),C})},P=(w,v)=>(s("replaceStars",w,v),w.trim().replace(a[c.STAR],"")),q=(w,v)=>(s("replaceGTE0",w,v),w.trim().replace(a[v.includePrerelease?c.GTE0PRE:c.GTE0],"")),ue=w=>(v,R,C,T,I,L,J,D,X,we,ne,wt,ts)=>(y(C)?R="":y(T)?R=`>=${C}.0.0${w?"-0":""}`:y(I)?R=`>=${C}.${T}.0${w?"-0":""}`:L?R=`>=${R}`:R=`>=${R}${w?"-0":""}`,y(X)?D="":y(we)?D=`<${+X+1}.0.0-0`:y(ne)?D=`<${X}.${+we+1}.0-0`:wt?D=`<=${X}.${we}.${ne}-${wt}`:w?D=`<${X}.${we}.${+ne+1}-0`:D=`<=${D}`,`${R} ${D}`.trim()),G=(w,v,R)=>{for(let C=0;C<w.length;C++)if(!w[C].test(v))return!1;if(v.prerelease.length&&!R.includePrerelease){for(let C=0;C<w.length;C++)if(s(w[C].semver),w[C].semver!==i.ANY&&w[C].semver.prerelease.length>0){const T=w[C].semver;if(T.major===v.major&&T.minor===v.minor&&T.patch===v.patch)return!0}return!1}return!0};return oo}var ao,eu;function gi(){if(eu)return ao;eu=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,h){if(h=n(h),l instanceof e){if(l.loose===!!h.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,h),this.options=h,this.loose=!!h.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const h=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],f=l.match(h);if(!f)throw new TypeError(`Invalid comparator: ${l}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,h){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,h).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,h).test(l.semver):(h=n(h),h.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,h)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,h)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ao=e;const n=la,{safeRe:r,t:i}=hr,s=bh,o=pi,a=Te,c=Xe();return ao}const sm=Xe(),om=(t,e,n)=>{try{e=new sm(e,n)}catch{return!1}return e.test(t)};var mi=om;const am=Xe(),cm=(t,e)=>new am(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));var um=cm;const lm=Te,hm=Xe(),fm=(t,e,n)=>{let r=null,i=null,s=null;try{s=new hm(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new lm(r,n))}),r};var dm=fm;const pm=Te,bm=Xe(),gm=(t,e,n)=>{let r=null,i=null,s=null;try{s=new bm(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new pm(r,n))}),r};var mm=gm;const co=Te,ym=Xe(),tu=bi,vm=(t,e)=>{t=new ym(t,e);let n=new co("0.0.0");if(t.test(n)||(n=new co("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){const i=t.set[r];let s=null;i.forEach(o=>{const a=new co(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||tu(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||tu(n,s))&&(n=s)}return n&&t.test(n)?n:null};var _m=vm;const wm=Xe(),Sm=(t,e)=>{try{return new wm(t,e).range||"*"}catch{return null}};var Em=Sm;const Cm=Te,mh=gi(),{ANY:Im}=mh,xm=Xe(),km=mi,nu=bi,ru=fa,Rm=pa,Mm=da,Am=(t,e,n,r)=>{t=new Cm(t,r),e=new xm(e,r);let i,s,o,a,c;switch(n){case">":i=nu,s=Rm,o=ru,a=">",c=">=";break;case"<":i=ru,s=Mm,o=nu,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(km(t,e,r))return!1;for(let u=0;u<e.set.length;++u){const l=e.set[u];let h=null,f=null;if(l.forEach(d=>{d.semver===Im&&(d=new mh(">=0.0.0")),h=h||d,f=f||d,i(d.semver,h.semver,r)?h=d:o(d.semver,f.semver,r)&&(f=d)}),h.operator===a||h.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&o(t,f.semver))return!1}return!0};var ba=Am;const Tm=ba,Nm=(t,e,n)=>Tm(t,e,">",n);var Om=Nm;const Lm=ba,jm=(t,e,n)=>Lm(t,e,"<",n);var $m=jm;const iu=Xe(),Pm=(t,e,n)=>(t=new iu(t,n),e=new iu(e,n),t.intersects(e,n));var Dm=Pm;const Fm=mi,Bm=Ke;var Vm=(t,e,n)=>{const r=[];let i=null,s=null;const o=t.sort((l,h)=>Bm(l,h,n));for(const l of o)Fm(l,e,n)?(s=l,i||(i=l)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);const a=[];for(const[l,h]of r)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e};const su=Xe(),ga=gi(),{ANY:uo}=ga,Fn=mi,ma=Ke,Hm=(t,e,n={})=>{if(t===e)return!0;t=new su(t,n),e=new su(e,n);let r=!1;e:for(const i of t.set){for(const s of e.set){const o=Um(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},Wm=[new ga(">=0.0.0-0")],ou=[new ga(">=0.0.0")],Um=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===uo){if(e.length===1&&e[0].semver===uo)return!0;n.includePrerelease?t=Wm:t=ou}if(e.length===1&&e[0].semver===uo){if(n.includePrerelease)return!0;e=ou}const r=new Set;let i,s;for(const d of t)d.operator===">"||d.operator===">="?i=au(i,d,n):d.operator==="<"||d.operator==="<="?s=cu(s,d,n):r.add(d.semver);if(r.size>1)return null;let o;if(i&&s){if(o=ma(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const d of r){if(i&&!Fn(d,String(i),n)||s&&!Fn(d,String(s),n))return null;for(const p of e)if(!Fn(d,String(p),n))return!1;return!0}let a,c,u,l,h=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const d of e){if(l=l||d.operator===">"||d.operator===">=",u=u||d.operator==="<"||d.operator==="<=",i){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=au(i,d,n),a===d&&a!==i)return!1}else if(i.operator===">="&&!Fn(i.semver,String(d),n))return!1}if(s){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator==="<"||d.operator==="<="){if(c=cu(s,d,n),c===d&&c!==s)return!1}else if(s.operator==="<="&&!Fn(s.semver,String(d),n))return!1}if(!d.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||f||h)},au=(t,e,n)=>{if(!t)return e;const r=ma(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},cu=(t,e,n)=>{if(!t)return e;const r=ma(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};var zm=Hm;const lo=hr,uu=di,qm=Te,lu=fh,Gm=Nn,Jm=Gb,Qm=Zb,Zm=Kb,Ym=eg,Km=rg,Xm=og,e1=ug,t1=fg,n1=Ke,r1=gg,i1=vg,s1=ha,o1=Eg,a1=xg,c1=bi,u1=fa,l1=dh,h1=ph,f1=da,d1=pa,p1=bh,b1=Qg,g1=gi(),m1=Xe(),y1=mi,v1=um,_1=dm,w1=mm,S1=_m,E1=Em,C1=ba,I1=Om,x1=$m,k1=Dm,R1=Vm,M1=zm;var A1={parse:Gm,valid:Jm,clean:Qm,inc:Zm,diff:Ym,major:Km,minor:Xm,patch:e1,prerelease:t1,compare:n1,rcompare:r1,compareLoose:i1,compareBuild:s1,sort:o1,rsort:a1,gt:c1,lt:u1,eq:l1,neq:h1,gte:f1,lte:d1,cmp:p1,coerce:b1,Comparator:g1,Range:m1,satisfies:y1,toComparators:v1,maxSatisfying:_1,minSatisfying:w1,minVersion:S1,validRange:E1,outside:C1,gtr:I1,ltr:x1,intersects:k1,simplifyRange:R1,subset:M1,SemVer:qm,re:lo.re,src:lo.src,tokens:lo.t,SEMVER_SPEC_VERSION:uu.SEMVER_SPEC_VERSION,RELEASE_TYPES:uu.RELEASE_TYPES,compareIdentifiers:lu.compareIdentifiers,rcompareIdentifiers:lu.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=A1,n=Yt,r=_e;t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",h=>(0,e.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",h=>(0,e.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function i(h){return(0,n.is)(h,t.VersionStruct)}t.isValidSemVerVersion=i;function s(h){return(0,n.is)(h,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(h){(0,r.assertStruct)(h,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(h){(0,r.assertStruct)(h,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(h,f){return(0,e.gt)(h,f)}t.gtVersion=c;function u(h,f){return(0,e.gtr)(h,f)}t.gtRange=u;function l(h,f){return(0,e.satisfies)(h,f,{includePrerelease:!0})}t.satisfiesVersionRange=l})(uh);(function(t){var e=A&&A.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=A&&A.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(_e,t),n(ur,t),n(Q,t),n(hi,t),n(at,t),n(gn,t),n(lr,t),n(oh,t),n(mn,t),n(ua,t),n(ct,t),n(ah,t),n(ch,t),n(uh,t)})(Vl);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Vl;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Bl);var yh=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});ui.PollingBlockTracker=void 0;const T1=yh(Xo),N1=yh(Xp),O1=ar,hu=Bl,fu=(0,hu.createModuleLogger)(hu.projectLogger,"polling-block-tracker"),L1=(0,T1.default)(),j1=1e3;class $1 extends O1.BaseBlockTracker{constructor(e={}){var n;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(n=e.blockResetDuration)!==null&&n!==void 0?n:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*j1,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const n=du(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}catch(n){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
1
|
+
import{e as bd,h as gd,d as A,i as ti,B,j as md,k as sl,g as xn,p as ko,l as ni,b as yd}from"./index-20251482.js";import{_ as g}from"./tslib.es6-c2094241.js";function vd(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Go={},Qn={},ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.walletLogo=void 0;const _d=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 `}};ri.walletLogo=_d;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.ScopedLocalStorage=void 0;class wd{constructor(e){this.scope=e}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`${this.scope}:${e}`}}ii.ScopedLocalStorage=wd;var dn={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});const Sd=bd;function yc(t,e,n){try{Reflect.apply(t,e,n)}catch(r){setTimeout(()=>{throw r})}}function Ed(t){const e=t.length,n=new Array(e);for(let r=0;r<e;r+=1)n[r]=t[r];return n}let Cd=class extends Sd.EventEmitter{emit(e,...n){let r=e==="error";const i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){let o;if(n.length>0&&([o]=n),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")yc(s,this,n);else{const o=s.length,a=Ed(s);for(let c=0;c<o;c+=1)yc(a[c],this,n)}return!0}};Qt.default=Cd;var rr={},Rt={},Id=Zn;Zn.default=Zn;Zn.stable=cl;Zn.stableStringify=cl;var Vr="[...]",ol="[Circular]",Ut=[],Vt=[];function al(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Zn(t,e,n,r){typeof r>"u"&&(r=al()),Ro(t,"",0,[],void 0,0,r);var i;try{Vt.length===0?i=JSON.stringify(t,e,n):i=JSON.stringify(t,ul(e),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ut.length!==0;){var s=Ut.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function cn(t,e,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:t}),Ut.push([r,n,e,i])):Vt.push([e,n,t]):(r[n]=t,Ut.push([r,n,e]))}function Ro(t,e,n,r,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<r.length;a++)if(r[a]===t){cn(ol,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){cn(Vr,t,e,i);return}if(typeof o.edgesLimit<"u"&&n+1>o.edgesLimit){cn(Vr,t,e,i);return}if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Ro(t[a],a,a,r,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var u=c[a];Ro(t[u],u,a,r,t,s,o)}}r.pop()}}function xd(t,e){return t<e?-1:t>e?1:0}function cl(t,e,n,r){typeof r>"u"&&(r=al());var i=Mo(t,"",0,[],void 0,0,r)||t,s;try{Vt.length===0?s=JSON.stringify(i,e,n):s=JSON.stringify(i,ul(e),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ut.length!==0;){var o=Ut.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Mo(t,e,n,r,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<r.length;a++)if(r[a]===t){cn(ol,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){cn(Vr,t,e,i);return}if(typeof o.edgesLimit<"u"&&n+1>o.edgesLimit){cn(Vr,t,e,i);return}if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Mo(t[a],a,a,r,t,s,o);else{var c={},u=Object.keys(t).sort(xd);for(a=0;a<u.length;a++){var l=u[a];Mo(t[l],l,a,r,t,s,o),c[l]=t[l]}if(typeof i<"u")Ut.push([i,e,t]),i[e]=c;else return c}r.pop()}}function ul(t){return t=typeof t<"u"?t:function(e,n){return n},function(e,n){if(Vt.length>0)for(var r=0;r<Vt.length;r++){var i=Vt[r];if(i[1]===e&&i[0]===n){n=i[2],Vt.splice(r,1);break}}return t.call(this,e,n)}}Object.defineProperty(Rt,"__esModule",{value:!0});Rt.EthereumProviderError=Rt.EthereumRpcError=void 0;const kd=Id;class ll extends Error{constructor(e,n,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=e,r!==void 0&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return kd.default(this.serialize(),Ad,2)}}Rt.EthereumRpcError=ll;class Rd extends ll{constructor(e,n,r){if(!Md(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,n,r)}}Rt.EthereumProviderError=Rd;function Md(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Ad(t,e){if(e!=="[Circular]")return e}var Jo={},Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.errorValues=Mt.errorCodes=void 0;Mt.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}};Mt.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(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Mt,n=Rt,r=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:r,message:o(r)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(f,d=i){if(Number.isInteger(f)){const p=f.toString();if(h(e.errorValues,p))return e.errorValues[p].message;if(u(f))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return d}t.getMessageFromCode=o;function a(f){if(!Number.isInteger(f))return!1;const d=f.toString();return!!(e.errorValues[d]||u(f))}t.isValidCode=a;function c(f,{fallbackError:d=s,shouldIncludeStack:p=!1}={}){var _,m;if(!d||!Number.isInteger(d.code)||typeof d.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(f instanceof n.EthereumRpcError)return f.serialize();const b={};if(f&&typeof f=="object"&&!Array.isArray(f)&&h(f,"code")&&a(f.code)){const S=f;b.code=S.code,S.message&&typeof S.message=="string"?(b.message=S.message,h(S,"data")&&(b.data=S.data)):(b.message=o(b.code),b.data={originalError:l(f)})}else{b.code=d.code;const S=(_=f)===null||_===void 0?void 0:_.message;b.message=S&&typeof S=="string"?S:d.message,b.data={originalError:l(f)}}const y=(m=f)===null||m===void 0?void 0:m.stack;return p&&f&&y&&typeof y=="string"&&(b.stack=y),b}t.serializeError=c;function u(f){return f>=-32099&&f<=-32e3}function l(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function h(f,d){return Object.prototype.hasOwnProperty.call(f,d)}})(Jo);var si={};Object.defineProperty(si,"__esModule",{value:!0});si.ethErrors=void 0;const Qo=Rt,hl=Jo,Se=Mt;si.ethErrors={rpc:{parse:t=>De(Se.errorCodes.rpc.parse,t),invalidRequest:t=>De(Se.errorCodes.rpc.invalidRequest,t),invalidParams:t=>De(Se.errorCodes.rpc.invalidParams,t),methodNotFound:t=>De(Se.errorCodes.rpc.methodNotFound,t),internal:t=>De(Se.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return De(e,t)},invalidInput:t=>De(Se.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>De(Se.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>De(Se.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>De(Se.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>De(Se.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>De(Se.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Pn(Se.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Pn(Se.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Pn(Se.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Pn(Se.errorCodes.provider.disconnected,t),chainDisconnected:t=>Pn(Se.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new Qo.EthereumProviderError(e,n,r)}}};function De(t,e){const[n,r]=fl(e);return new Qo.EthereumRpcError(t,n||hl.getMessageFromCode(t),r)}function Pn(t,e){const[n,r]=fl(e);return new Qo.EthereumProviderError(t,n||hl.getMessageFromCode(t),r)}function fl(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Rt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const n=Jo;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=si;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=Mt;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(rr);var kn={};Object.defineProperty(kn,"__esModule",{value:!0});kn.EVENTS=void 0;kn.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",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Rn={},x={},Td=String.prototype.replace,Nd=/%20/g,Ks={RFC1738:"RFC1738",RFC3986:"RFC3986"},Zo={default:Ks.RFC3986,formatters:{RFC1738:function(t){return Td.call(t,Nd,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ks.RFC1738,RFC3986:Ks.RFC3986},Od=Zo,Xs=Object.prototype.hasOwnProperty,$t=Array.isArray,et=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Ld=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if($t(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]<"u"&&i.push(r[s]);n.obj[n.prop]=i}}},dl=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},jd=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if($t(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Xs.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return $t(e)&&!$t(n)&&(i=dl(e,r)),$t(e)&&$t(n)?(n.forEach(function(s,o){if(Xs.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(n).reduce(function(s,o){var a=n[o];return Xs.call(s,o)?s[o]=t(s[o],a,r):s[o]=a,s},i)},$d=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Pd=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Dd=function(e,n,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var u=o.charCodeAt(c);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===Od.RFC1738&&(u===40||u===41)){a+=o.charAt(c);continue}if(u<128){a=a+et[u];continue}if(u<2048){a=a+(et[192|u>>6]+et[128|u&63]);continue}if(u<55296||u>=57344){a=a+(et[224|u>>12]+et[128|u>>6&63]+et[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|o.charCodeAt(c)&1023),a+=et[240|u>>18]+et[128|u>>12&63]+et[128|u>>6&63]+et[128|u&63]}return a},Fd=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var s=n[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var u=a[c],l=o[u];typeof l=="object"&&l!==null&&r.indexOf(l)===-1&&(n.push({obj:o,prop:u}),r.push(l))}return Ld(n),e},Bd=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Vd=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Hd=function(e,n){return[].concat(e,n)},Wd=function(e,n){if($t(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},pl={arrayToObject:dl,assign:$d,combine:Hd,compact:Fd,decode:Pd,encode:Dd,isBuffer:Vd,isRegExp:Bd,maybeMap:Wd,merge:jd},bl=gd,$r=pl,Wn=Zo,Ud=Object.prototype.hasOwnProperty,vc={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},pt=Array.isArray,zd=Array.prototype.push,gl=function(t,e){zd.apply(t,pt(e)?e:[e])},qd=Date.prototype.toISOString,_c=Wn.default,Ie={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:$r.encode,encodeValuesOnly:!1,format:_c,formatter:Wn.formatters[_c],indices:!1,serializeDate:function(e){return qd.call(e)},skipNulls:!1,strictNullHandling:!1},Gd=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},eo={},Jd=function t(e,n,r,i,s,o,a,c,u,l,h,f,d,p,_,m){for(var b=e,y=m,S=0,k=!1;(y=y.get(eo))!==void 0&&!k;){var E=y.get(e);if(S+=1,typeof E<"u"){if(E===S)throw new RangeError("Cyclic object value");k=!0}typeof y.get(eo)>"u"&&(S=0)}if(typeof c=="function"?b=c(n,b):b instanceof Date?b=h(b):r==="comma"&&pt(b)&&(b=$r.maybeMap(b,function(C){return C instanceof Date?h(C):C})),b===null){if(s)return a&&!p?a(n,Ie.encoder,_,"key",f):n;b=""}if(Gd(b)||$r.isBuffer(b)){if(a){var N=p?n:a(n,Ie.encoder,_,"key",f);return[d(N)+"="+d(a(b,Ie.encoder,_,"value",f))]}return[d(n)+"="+d(String(b))]}var U=[];if(typeof b>"u")return U;var z;if(r==="comma"&&pt(b))p&&a&&(b=$r.maybeMap(b,a)),z=[{value:b.length>0?b.join(",")||null:void 0}];else if(pt(c))z=c;else{var P=Object.keys(b);z=u?P.sort(u):P}for(var q=i&&pt(b)&&b.length===1?n+"[]":n,ue=0;ue<z.length;++ue){var G=z[ue],w=typeof G=="object"&&typeof G.value<"u"?G.value:b[G];if(!(o&&w===null)){var v=pt(b)?typeof r=="function"?r(q,G):q:q+(l?"."+G:"["+G+"]");m.set(e,S);var R=bl();R.set(eo,m),gl(U,t(w,v,r,i,s,o,r==="comma"&&p&&pt(b)?null:a,c,u,l,h,f,d,p,_,R))}}return U},Qd=function(e){if(!e)return Ie;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||Ie.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Wn.default;if(typeof e.format<"u"){if(!Ud.call(Wn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Wn.formatters[r],s=Ie.filter;return(typeof e.filter=="function"||pt(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Ie.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Ie.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ie.charsetSentinel,delimiter:typeof e.delimiter>"u"?Ie.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Ie.encode,encoder:typeof e.encoder=="function"?e.encoder:Ie.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Ie.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Ie.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Ie.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ie.strictNullHandling}},Zd=function(t,e){var n=t,r=Qd(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):pt(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in vc?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=vc[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var l=bl(),h=0;h<i.length;++h){var f=i[h];r.skipNulls&&n[f]===null||gl(o,Jd(n[f],f,c,u,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}var d=o.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},pn=pl,Ao=Object.prototype.hasOwnProperty,Yd=Array.isArray,be={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:pn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Kd=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},ml=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Xd="utf8=%26%2310003%3B",ep="utf8=%E2%9C%93",tp=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=i.split(n.delimiter,s),a=-1,c,u=n.charset;if(n.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===ep?u="utf-8":o[c]===Xd&&(u="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var l=o[c],h=l.indexOf("]="),f=h===-1?l.indexOf("="):h+1,d,p;f===-1?(d=n.decoder(l,be.decoder,u,"key"),p=n.strictNullHandling?null:""):(d=n.decoder(l.slice(0,f),be.decoder,u,"key"),p=pn.maybeMap(ml(l.slice(f+1),n),function(_){return n.decoder(_,be.decoder,u,"value")})),p&&n.interpretNumericEntities&&u==="iso-8859-1"&&(p=Kd(p)),l.indexOf("[]=")>-1&&(p=Yd(p)?[p]:p),Ao.call(r,d)?r[d]=pn.combine(r[d],p):r[d]=p}return r},np=function(t,e,n,r){for(var i=r?e:ml(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!n.parseArrays&&c===""?o={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[],o[u]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},rp=function(e,n,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),u=c?s.slice(0,c.index):s,l=[];if(u){if(!r.plainObjects&&Ao.call(Object.prototype,u)&&!r.allowPrototypes)return;l.push(u)}for(var h=0;r.depth>0&&(c=a.exec(s))!==null&&h<r.depth;){if(h+=1,!r.plainObjects&&Ao.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+s.slice(c.index)+"]"),np(l,n,r,i)}},ip=function(e){if(!e)return be;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?be.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?be.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:be.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:be.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:be.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:be.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:be.comma,decoder:typeof e.decoder=="function"?e.decoder:be.decoder,delimiter:typeof e.delimiter=="string"||pn.isRegExp(e.delimiter)?e.delimiter:be.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:be.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:be.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:be.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:be.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:be.strictNullHandling}},sp=function(t,e){var n=ip(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?tp(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],c=rp(a,r[a],n,typeof t=="string");i=pn.merge(i,c,n)}return n.allowSparse===!0?i:pn.compact(i)},op=Zd,ap=sp,cp=Zo,up={formats:cp,parse:ap,stringify:op},ir={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return r=>r}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function n(r){return Math.floor(r)}t.IntNumber=n,t.RegExpString=e(),function(r){r.CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(ir);var lp=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(x,"__esModule",{value:!0});x.isInIFrame=x.createQrUrl=x.getFavicon=x.range=x.isBigNumber=x.ensureParsedJSONObject=x.ensureBN=x.ensureRegExpString=x.ensureIntNumber=x.ensureBuffer=x.ensureAddressString=x.ensureEvenLengthHexString=x.ensureHexString=x.isHexString=x.prepend0x=x.strip0x=x.has0xPrefix=x.hexStringFromIntNumber=x.intNumberFromHexString=x.bigIntStringFromBN=x.hexStringFromBuffer=x.hexStringToUint8Array=x.uint8ArrayToHex=x.randomBytesHex=void 0;const It=lp(ti),hp=up,We=ir,yl=/^[0-9]*$/,vl=/^[a-f0-9]*$/;function fp(t){return _l(crypto.getRandomValues(new Uint8Array(t)))}x.randomBytesHex=fp;function _l(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}x.uint8ArrayToHex=_l;function dp(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}x.hexStringToUint8Array=dp;function pp(t,e=!1){const n=t.toString("hex");return(0,We.HexString)(e?"0x"+n:n)}x.hexStringFromBuffer=pp;function bp(t){return(0,We.BigIntString)(t.toString(10))}x.bigIntStringFromBN=bp;function gp(t){return(0,We.IntNumber)(new It.default(or(t,!1),16).toNumber())}x.intNumberFromHexString=gp;function mp(t){return(0,We.HexString)("0x"+new It.default(t).toString(16))}x.hexStringFromIntNumber=mp;function Yo(t){return t.startsWith("0x")||t.startsWith("0X")}x.has0xPrefix=Yo;function oi(t){return Yo(t)?t.slice(2):t}x.strip0x=oi;function wl(t){return Yo(t)?"0x"+t.slice(2):"0x"+t}x.prepend0x=wl;function sr(t){if(typeof t!="string")return!1;const e=oi(t).toLowerCase();return vl.test(e)}x.isHexString=sr;function Sl(t,e=!1){if(typeof t=="string"){const n=oi(t).toLowerCase();if(vl.test(n))return(0,We.HexString)(e?"0x"+n:n)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}x.ensureHexString=Sl;function or(t,e=!1){let n=Sl(t,!1);return n.length%2===1&&(n=(0,We.HexString)("0"+n)),e?(0,We.HexString)("0x"+n):n}x.ensureEvenLengthHexString=or;function yp(t){if(typeof t=="string"){const e=oi(t).toLowerCase();if(sr(e)&&e.length===40)return(0,We.AddressString)(wl(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)}x.ensureAddressString=yp;function vp(t){if(B.isBuffer(t))return t;if(typeof t=="string")if(sr(t)){const e=or(t,!1);return B.from(e,"hex")}else return B.from(t,"utf8");throw new Error(`Not binary data: ${String(t)}`)}x.ensureBuffer=vp;function El(t){if(typeof t=="number"&&Number.isInteger(t))return(0,We.IntNumber)(t);if(typeof t=="string"){if(yl.test(t))return(0,We.IntNumber)(Number(t));if(sr(t))return(0,We.IntNumber)(new It.default(or(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}x.ensureIntNumber=El;function _p(t){if(t instanceof RegExp)return(0,We.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)}x.ensureRegExpString=_p;function wp(t){if(t!==null&&(It.default.isBN(t)||Cl(t)))return new It.default(t.toString(10),10);if(typeof t=="number")return new It.default(El(t));if(typeof t=="string"){if(yl.test(t))return new It.default(t,10);if(sr(t))return new It.default(or(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)}x.ensureBN=wp;function Sp(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)}x.ensureParsedJSONObject=Sp;function Cl(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}x.isBigNumber=Cl;function Ep(t,e){return Array.from({length:e-t},(n,r)=>t+r)}x.range=Ep;function Cp(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}x.getFavicon=Cp;function Ip(t,e,n,r,i,s){const o=r?"parent-id":"id",a=(0,hp.stringify)({[o]:t,secret:e,server:n,v:i,chainId:s});return`${n}/#/link?${a}`}x.createQrUrl=Ip;function xp(){try{return window.frameElement!==null}catch{return!1}}x.isInIFrame=xp;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Session=void 0;const wc=md,Sc=x,Ec="session:id",Cc="session:secret",Ic="session:linked";class Ko{constructor(e,n,r,i){this._storage=e,this._id=n||(0,Sc.randomBytesHex)(16),this._secret=r||(0,Sc.randomBytesHex)(32),this._key=new wc.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const n=e.getItem(Ec),r=e.getItem(Ic),i=e.getItem(Cc);return n&&i?new Ko(e,n,i,r==="1"):null}static hash(e){return new wc.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Ec,this._id),this._storage.setItem(Cc,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ic,this._linked?"1":"0")}}Rn.Session=Ko;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.WalletSDKRelayAbstract=Ye.APP_VERSION_KEY=Ye.LOCAL_STORAGE_ADDRESSES_KEY=Ye.WALLET_USER_NAME_KEY=void 0;const xc=rr;Ye.WALLET_USER_NAME_KEY="walletUsername";Ye.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ye.APP_VERSION_KEY="AppVersion";class kp{async makeEthereumJSONRPCRequest(e,n){if(!n)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(n,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>{if(!r)throw xc.ethErrors.rpc.parse({});const i=r,{error:s}=i;if(s)throw(0,xc.serializeError)(s);return i})}}Ye.WalletSDKRelayAbstract=kp;const{Transform:Rp}=sl;var Mp=t=>class Il extends Rp{constructor(n,r,i,s,o){super(o),this._rate=n,this._capacity=r,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,i){let s=null;try{this.update(n,r)}catch(o){s=o}i(s)}_flush(n){let r=null;try{this.push(this.digest())}catch(i){r=i}n(r)}update(n,r){if(!B.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return B.isBuffer(n)||(n=B.from(n,r)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let r=this._state.squeeze(this._hashBitLength/8);return n!==void 0&&(r=r.toString(n)),this._resetState(),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new Il(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const{Transform:Ap}=sl;var Tp=t=>class xl extends Ap{constructor(n,r,i,s){super(s),this._rate=n,this._capacity=r,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(n,r),this._finalized=!1}_transform(n,r,i){let s=null;try{this.update(n,r)}catch(o){s=o}i(s)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,r){if(!B.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return B.isBuffer(n)||(n=B.from(n,r)),this._state.absorb(n),this}squeeze(n,r){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(n);return r!==void 0&&(i=i.toString(r)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new xl(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}};const Np=Mp,Op=Tp;var Lp=function(t){const e=Np(t),n=Op(t);return function(r,i){switch(typeof r=="string"?r.toLowerCase():r){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new n(1344,256,31,i);case"shake256":return new n(1088,512,31,i);default:throw new Error("Invald algorithm: "+r)}}},kl={};const kc=[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];kl.p1600=function(t){for(let e=0;e<24;++e){const n=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let f=l^(i<<1|s>>>31),d=h^(s<<1|i>>>31);const p=t[0]^f,_=t[1]^d,m=t[10]^f,b=t[11]^d,y=t[20]^f,S=t[21]^d,k=t[30]^f,E=t[31]^d,N=t[40]^f,U=t[41]^d;f=n^(o<<1|a>>>31),d=r^(a<<1|o>>>31);const z=t[2]^f,P=t[3]^d,q=t[12]^f,ue=t[13]^d,G=t[22]^f,w=t[23]^d,v=t[32]^f,R=t[33]^d,C=t[42]^f,T=t[43]^d;f=i^(c<<1|u>>>31),d=s^(u<<1|c>>>31);const I=t[4]^f,L=t[5]^d,J=t[14]^f,D=t[15]^d,X=t[24]^f,we=t[25]^d,ne=t[34]^f,wt=t[35]^d,ts=t[44]^f,Ya=t[45]^d;f=o^(l<<1|h>>>31),d=a^(h<<1|l>>>31);const Ka=t[6]^f,Xa=t[7]^d,ec=t[16]^f,tc=t[17]^d,nc=t[26]^f,rc=t[27]^d,ic=t[36]^f,sc=t[37]^d,oc=t[46]^f,ac=t[47]^d;f=c^(n<<1|r>>>31),d=u^(r<<1|n>>>31);const cc=t[8]^f,uc=t[9]^d,lc=t[18]^f,hc=t[19]^d,fc=t[28]^f,dc=t[29]^d,pc=t[38]^f,bc=t[39]^d,gc=t[48]^f,mc=t[49]^d,ns=p,rs=_,is=b<<4|m>>>28,ss=m<<4|b>>>28,os=y<<3|S>>>29,as=S<<3|y>>>29,cs=E<<9|k>>>23,us=k<<9|E>>>23,ls=N<<18|U>>>14,hs=U<<18|N>>>14,fs=z<<1|P>>>31,ds=P<<1|z>>>31,ps=ue<<12|q>>>20,bs=q<<12|ue>>>20,gs=G<<10|w>>>22,ms=w<<10|G>>>22,ys=R<<13|v>>>19,vs=v<<13|R>>>19,_s=C<<2|T>>>30,ws=T<<2|C>>>30,Ss=L<<30|I>>>2,Es=I<<30|L>>>2,Cs=J<<6|D>>>26,Is=D<<6|J>>>26,xs=we<<11|X>>>21,ks=X<<11|we>>>21,Rs=ne<<15|wt>>>17,Ms=wt<<15|ne>>>17,As=Ya<<29|ts>>>3,Ts=ts<<29|Ya>>>3,Ns=Ka<<28|Xa>>>4,Os=Xa<<28|Ka>>>4,Ls=tc<<23|ec>>>9,js=ec<<23|tc>>>9,$s=nc<<25|rc>>>7,Ps=rc<<25|nc>>>7,Ds=ic<<21|sc>>>11,Fs=sc<<21|ic>>>11,Bs=ac<<24|oc>>>8,Vs=oc<<24|ac>>>8,Hs=cc<<27|uc>>>5,Ws=uc<<27|cc>>>5,Us=lc<<20|hc>>>12,zs=hc<<20|lc>>>12,qs=dc<<7|fc>>>25,Gs=fc<<7|dc>>>25,Js=pc<<8|bc>>>24,Qs=bc<<8|pc>>>24,Zs=gc<<14|mc>>>18,Ys=mc<<14|gc>>>18;t[0]=ns^~ps&xs,t[1]=rs^~bs&ks,t[10]=Ns^~Us&os,t[11]=Os^~zs&as,t[20]=fs^~Cs&$s,t[21]=ds^~Is&Ps,t[30]=Hs^~is&gs,t[31]=Ws^~ss&ms,t[40]=Ss^~Ls&qs,t[41]=Es^~js&Gs,t[2]=ps^~xs&Ds,t[3]=bs^~ks&Fs,t[12]=Us^~os&ys,t[13]=zs^~as&vs,t[22]=Cs^~$s&Js,t[23]=Is^~Ps&Qs,t[32]=is^~gs&Rs,t[33]=ss^~ms&Ms,t[42]=Ls^~qs&cs,t[43]=js^~Gs&us,t[4]=xs^~Ds&Zs,t[5]=ks^~Fs&Ys,t[14]=os^~ys&As,t[15]=as^~vs&Ts,t[24]=$s^~Js&ls,t[25]=Ps^~Qs&hs,t[34]=gs^~Rs&Bs,t[35]=ms^~Ms&Vs,t[44]=qs^~cs&_s,t[45]=Gs^~us&ws,t[6]=Ds^~Zs&ns,t[7]=Fs^~Ys&rs,t[16]=ys^~As&Ns,t[17]=vs^~Ts&Os,t[26]=Js^~ls&fs,t[27]=Qs^~hs&ds,t[36]=Rs^~Bs&Hs,t[37]=Ms^~Vs&Ws,t[46]=cs^~_s&Ss,t[47]=us^~ws&Es,t[8]=Zs^~ns&ps,t[9]=Ys^~rs&bs,t[18]=As^~Ns&Us,t[19]=Ts^~Os&zs,t[28]=ls^~fs&Cs,t[29]=hs^~ds&Is,t[38]=Bs^~Hs&is,t[39]=Vs^~Ws&ss,t[48]=_s^~Ss&Ls,t[49]=ws^~Es&js,t[0]^=kc[e*2],t[1]^=kc[e*2+1]}};const Hr=kl;function Mn(){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}Mn.prototype.initialize=function(t,e){for(let n=0;n<50;++n)this.state[n]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};Mn.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Hr.p1600(this.state),this.count=0)};Mn.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&Hr.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Hr.p1600(this.state),this.count=0,this.squeezing=!0};Mn.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=B.alloc(t);for(let n=0;n<t;++n)e[n]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Hr.p1600(this.state),this.count=0);return e};Mn.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var jp=Mn,$p=Lp(jp);const Pp=$p,Dp=ti;function Rl(t){return B.allocUnsafe(t).fill(0)}function Ml(t,e,n){const r=Rl(e);return t=ai(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function Fp(t,e){return Ml(t,e,!0)}function ai(t){if(!B.isBuffer(t))if(Array.isArray(t))t=B.from(t);else if(typeof t=="string")Al(t)?t=B.from(Hp(Tl(t)),"hex"):t=B.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=B.allocUnsafe(0);else if(Dp.isBN(t))t=t.toArrayLike(B);else if(t.toArray)t=B.from(t.toArray());else throw new Error("invalid type");return t}function Bp(t){return t=ai(t),"0x"+t.toString("hex")}function Vp(t,e){return t=ai(t),e||(e=256),Pp("keccak"+e).update(t).digest()}function Hp(t){return t.length%2?"0"+t:t}function Al(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Tl(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var Nl={zeros:Rl,setLength:Ml,setLengthRight:Fp,isHexString:Al,stripHexPrefix:Tl,toBuffer:ai,bufferToHex:Bp,keccak:Vp};const zt=Nl,Ht=ti;function Ol(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function un(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Rc(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Ll(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Pt(t){var e=typeof t;if(e==="string")return zt.isHexString(t)?new Ht(zt.stripHexPrefix(t),16):new Ht(t,10);if(e==="number")return new Ht(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function it(t,e){var n,r,i,s;if(t==="address")return it("uint160",Pt(e));if(t==="bool")return it("uint8",e?1:0);if(t==="string")return it("bytes",new B(e,"utf8"));if(Up(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=Ll(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(it(t,e[s]));if(n==="dynamic"){var o=it("uint256",e.length);i.unshift(o)}return B.concat(i)}else{if(t==="bytes")return e=new B(e),i=B.concat([it("uint256",e.length),e]),e.length%32!==0&&(i=B.concat([i,zt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=un(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return zt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=un(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Pt(e),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(B,"be",32)}else if(t.startsWith("int")){if(n=un(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Pt(e),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(B,"be",32)}else if(t.startsWith("ufixed")){if(n=Rc(t),r=Pt(e),r<0)throw new Error("Supplied ufixed is negative");return it("uint256",r.mul(new Ht(2).pow(new Ht(n[1]))))}else if(t.startsWith("fixed"))return n=Rc(t),it("int256",Pt(e).mul(new Ht(2).pow(new Ht(n[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Wp(t){return t==="string"||t==="bytes"||Ll(t)==="dynamic"}function Up(t){return t.lastIndexOf("]")===t.length-1}function zp(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=Ol(t[s]),a=e[s],c=it(o,a);Wp(o)?(n.push(it("uint256",i)),r.push(c),i+=c.length):n.push(c)}return B.concat(n.concat(r))}function jl(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=Ol(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new B(a,"utf8"));else if(o==="bool")i.push(new B(a?"01":"00","hex"));else if(o==="address")i.push(zt.setLength(a,20));else if(o.startsWith("bytes")){if(n=un(o),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(zt.setLengthRight(a,n))}else if(o.startsWith("uint")){if(n=un(o),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Pt(a),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(B,"be",n/8))}else if(o.startsWith("int")){if(n=un(o),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Pt(a),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(B,"be",n/8))}else throw new Error("Unsupported or invalid type: "+o)}return B.concat(i)}function qp(t,e){return zt.keccak(jl(t,e))}var Gp={rawEncode:zp,solidityPack:jl,soliditySHA3:qp};const Je=Nl,Un=Gp,$l={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"]},to={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(a,c,u)=>{if(n[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Je.keccak(this.encodeData(c,u,n,r))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Je.keccak(u)];if(c==="string")return typeof u=="string"&&(u=B.from(u,"utf8")),["bytes32",Je.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const l=c.slice(0,c.lastIndexOf("[")),h=u.map(f=>o(a,l,f));return["bytes32",Je.keccak(Un.rawEncode(h.map(([f])=>f),h.map(([,f])=>f)))]}return[c,u]};for(const a of n[t]){const[c,u]=o(a.name,a.type,e[a.name]);i.push(c),s.push(u)}}else for(const o of n[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Je.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=B.from(a,"utf8")),a=Je.keccak(a),s.push(a);else if(n[o.type]!==void 0)i.push("bytes32"),a=Je.keccak(this.encodeData(o.type,a,n,r)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Un.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return Je.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return Je.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in $l.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[B.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),Je.keccak(B.concat(r))}};var Jp={TYPED_MESSAGE_SCHEMA:$l,TypedDataUtils:to,hashForSignTypedDataLegacy:function(t){return Qp(t.data)},hashForSignTypedData_v3:function(t){return to.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return to.hash(t.data)}};function Qp(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(s){return s.type==="bytes"?Je.toBuffer(s.value):s.value}),r=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Un.soliditySHA3(["bytes32","bytes32"],[Un.soliditySHA3(new Array(t.length).fill("string"),i),Un.soliditySHA3(r,n)])}var bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.filterFromParam=bn.FilterPolyfill=void 0;const sn=ir,ke=x,Zp=5*60*1e3,Dt={jsonrpc:"2.0",id:0};class Yp{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,sn.IntNumber)(1),this.provider=e}async newFilter(e){const n=Pl(e),r=this.makeFilterId(),i=await this.setInitialCursorPosition(r,n.fromBlock);return console.log(`Installing new log filter(${r}):`,n,"initial cursor position:",i),this.logFilters.set(r,n),this.setFilterTimeout(r),(0,ke.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.blockFilters.add(e),this.setFilterTimeout(e),(0,ke.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,ke.hexStringFromIntNumber)(e)}uninstallFilter(e){const n=(0,ke.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${n})`),this.deleteFilter(n),!0}getFilterChanges(e){const n=(0,ke.intNumberFromHexString)(e);return this.timeouts.has(n)&&this.setFilterTimeout(n),this.logFilters.has(n)?this.getLogFilterChanges(n):this.blockFilters.has(n)?this.getBlockFilterChanges(n):this.pendingTransactionFilters.has(n)?this.getPendingTransactionFilterChanges(n):Promise.resolve(Cr())}async getFilterLogs(e){const n=(0,ke.intNumberFromHexString)(e),r=this.logFilters.get(n);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getLogs",params:[Mc(r)]})):Cr()}makeFilterId(){return(0,sn.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((n,r)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return r(i);if(Array.isArray(s)||s==null)return r(new Error(`unexpected response received: ${JSON.stringify(s)}`));n(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const n=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!n)return Cr();const i=await this.getCurrentBlockHeight(),s=n.toBlock==="latest"?i:n.toBlock;if(r>i||r>n.toBlock)return Ir();console.log(`Fetching logs from ${r} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getLogs",params:[Mc(Object.assign(Object.assign({},n),{fromBlock:r,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(u=>(0,ke.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>r){const u=(0,sn.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${u}`),this.cursors.set(e,u)}}return o}async getBlockFilterChanges(e){const n=this.cursors.get(e);if(!n)return Cr();const r=await this.getCurrentBlockHeight();if(n>r)return Ir();console.log(`Fetching blocks from ${n} to ${r} for filter (${e})`);const i=(await Promise.all((0,ke.range)(n,r+1).map(o=>this.getBlockHashByNumber((0,sn.IntNumber)(o))))).filter(o=>!!o),s=(0,sn.IntNumber)(n+i.length);return console.log(`Moving cursor position for filter (${e}) from ${n} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Dt),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Ir())}async setInitialCursorPosition(e,n){const r=await this.getCurrentBlockHeight(),i=typeof n=="number"&&n>r?n:r;return this.cursors.set(e,i),i}setFilterTimeout(e){const n=this.timeouts.get(e);n&&window.clearTimeout(n);const r=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Zp);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_blockNumber",params:[]}));return(0,ke.intNumberFromHexString)((0,ke.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},Dt),{method:"eth_getBlockByNumber",params:[(0,ke.hexStringFromIntNumber)(e),!1]}));return n.result&&typeof n.result.hash=="string"?(0,ke.ensureHexString)(n.result.hash):null}}bn.FilterPolyfill=Yp;function Pl(t){return{fromBlock:Ac(t.fromBlock),toBlock:Ac(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}bn.filterFromParam=Pl;function Mc(t){const e={fromBlock:Tc(t.fromBlock),toBlock:Tc(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Ac(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,sn.IntNumber)(0);if((0,ke.isHexString)(t))return(0,ke.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Tc(t){return t==="latest"?t:(0,ke.hexStringFromIntNumber)(t)}function Cr(){return Object.assign(Object.assign({},Dt),{error:{code:-32e3,message:"filter not found"}})}function Ir(){return Object.assign(Object.assign({},Dt),{result:[]})}var Dl={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(Dl);var ci={},Fl={},ui={},Xo=Kp;function Kp(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,n=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return n=n%e,n++}}const Nc=(t,e)=>function(){const n=e.promiseModule,r=new Array(arguments.length);for(let i=0;i<arguments.length;i++)r[i]=arguments[i];return new n((i,s)=>{e.errorFirst?r.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let u=1;u<arguments.length;u++)c[u-1]=arguments[u];o?(c.unshift(o),s(c)):i(c)}else o?s(o):i(a)}):r.push(function(o){if(e.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];i(a)}else i(o)}),t.apply(this,r)})};var Xp=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const n=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let r;typeof t=="function"?r=function(){return e.excludeMain?t.apply(this,arguments):Nc(t,e).apply(this,arguments)}:r=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];r[i]=typeof s=="function"&&n(i)?Nc(s,e):s}return r},ar={},e0=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseBlockTracker=void 0;const t0=e0(Qt),n0=1e3,r0=(t,e)=>t+e,Oc=["sync","latest"];class i0 extends t0.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*n0,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(n=>this.once("latest",n))}removeAllListeners(e){return e?super.removeAllListeners(e):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(e){Oc.includes(e)&&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 Oc.map(e=>this.listenerCount(e)).reduce(r0)}_newPotentialLatest(e){const n=this._currentBlock;n&&Lc(e)<=Lc(n)||this._setCurrentBlock(e)}_setCurrentBlock(e){const n=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:n,newBlock:e})}_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}}ar.BaseBlockTracker=i0;function Lc(t){return Number.parseInt(t,16)}var Bl={},Vl={},_e={};class Hl extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function s0(t){return Ue(t)&&typeof t[Symbol.iterator]=="function"}function Ue(t){return typeof t=="object"&&t!=null}function jc(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function de(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function o0(t){const{done:e,value:n}=t.next();return e?void 0:n}function a0(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${de(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*To(t,e,n,r){s0(t)||(t=[t]);for(const i of t){const s=a0(i,e,n,r);s&&(yield s)}}function*ea(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Ue(e.schema)&&Ue(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,a))u.explanation=n.message,c="not_valid",yield[u,void 0];for(let[u,l,h]of e.entries(t,a)){const f=ea(l,h,{path:u===void 0?r:[...r,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:n.message});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):s&&(l=d[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):Ue(t)&&(l!==void 0||u in t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,a))u.explanation=n.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class le{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return To(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return To(l,u,this,c)}:this.refiner=()=>[]}assert(e,n){return Wl(e,this,n)}create(e,n){return Ul(e,this,n)}is(e){return ta(e,this)}mask(e,n){return zl(e,this,n)}validate(e,n={}){return An(e,this,n)}}function Wl(t,e,n){const r=An(t,e,{message:n});if(r[0])throw r[0]}function Ul(t,e,n){const r=An(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function zl(t,e,n){const r=An(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function ta(t,e){return!An(t,e)[0]}function An(t,e,n={}){const r=ea(t,e,n),i=o0(r);return i[0]?[new Hl(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function c0(...t){const e=t[0].type==="type",n=t.map(i=>i.schema),r=Object.assign({},...n);return e?ra(r):cr(r)}function Ne(t,e){return new le({type:t,schema:null,validator:e})}function u0(t,e){return new le({...t,refiner:(n,r)=>n===void 0||t.refiner(n,r),validator(n,r){return n===void 0?!0:(e(n,r),t.validator(n,r))}})}function l0(t){return new le({type:"dynamic",schema:null,*entries(e,n){yield*t(e,n).entries(e,n)},validator(e,n){return t(e,n).validator(e,n)},coercer(e,n){return t(e,n).coercer(e,n)},refiner(e,n){return t(e,n).refiner(e,n)}})}function h0(t){let e;return new le({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator(n,r){return e??(e=t()),e.validator(n,r)},coercer(n,r){return e??(e=t()),e.coercer(n,r)},refiner(n,r){return e??(e=t()),e.refiner(n,r)}})}function f0(t,e){const{schema:n}=t,r={...n};for(const i of e)delete r[i];switch(t.type){case"type":return ra(r);default:return cr(r)}}function d0(t){const e=t instanceof le?{...t.schema}:{...t};for(const n in e)e[n]=ql(e[n]);return cr(e)}function p0(t,e){const{schema:n}=t,r={};for(const i of e)r[i]=n[i];return cr(r)}function b0(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ne(t,e)}function g0(){return Ne("any",()=>!0)}function m0(t){return new le({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${de(e)}`}})}function y0(){return Ne("bigint",t=>typeof t=="bigint")}function v0(){return Ne("boolean",t=>typeof t=="boolean")}function _0(){return Ne("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${de(t)}`)}function w0(t){const e={},n=t.map(r=>de(r)).join();for(const r of t)e[r]=r;return new le({type:"enums",schema:e,validator(r){return t.includes(r)||`Expected one of \`${n}\`, but received: ${de(r)}`}})}function S0(){return Ne("func",t=>typeof t=="function"||`Expected a function, but received: ${de(t)}`)}function E0(t){return Ne("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${de(e)}`)}function C0(){return Ne("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${de(t)}`)}function I0(t){return new le({type:"intersection",schema:null,*entries(e,n){for(const r of t)yield*r.entries(e,n)},*validator(e,n){for(const r of t)yield*r.validator(e,n)},*refiner(e,n){for(const r of t)yield*r.refiner(e,n)}})}function x0(t){const e=de(t),n=typeof t;return new le({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${de(r)}`}})}function k0(t,e){return new le({type:"map",schema:null,*entries(n){if(t&&e&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,t],yield[r,i,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${de(n)}`}})}function na(){return Ne("never",()=>!1)}function R0(t){return new le({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function M0(){return Ne("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${de(t)}`)}function cr(t){const e=t?Object.keys(t):[],n=na();return new le({type:"object",schema:t||null,*entries(r){if(t&&Ue(r)){const i=new Set(Object.keys(r));for(const s of e)i.delete(s),yield[s,r[s],t[s]];for(const s of i)yield[s,r[s],n]}},validator(r){return Ue(r)||`Expected an object, but received: ${de(r)}`},coercer(r){return Ue(r)?{...r}:r}})}function ql(t){return new le({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function A0(t,e){return new le({type:"record",schema:null,*entries(n){if(Ue(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Ue(n)||`Expected an object, but received: ${de(n)}`}})}function T0(){return Ne("regexp",t=>t instanceof RegExp)}function N0(t){return new le({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const n of e)yield[n,n,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${de(e)}`}})}function Gl(){return Ne("string",t=>typeof t=="string"||`Expected a string, but received: ${de(t)}`)}function O0(t){const e=na();return new le({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${de(n)}`}})}function ra(t){const e=Object.keys(t);return new le({type:"type",schema:t,*entries(n){if(Ue(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Ue(n)||`Expected an object, but received: ${de(n)}`},coercer(n){return Ue(n)?{...n}:n}})}function L0(t){const e=t.map(n=>n.type).join(" | ");return new le({type:"union",schema:null,coercer(n){for(const r of t){const[i,s]=r.validate(n,{coerce:!0});if(!i)return s}return n},validator(n,r){const i=[];for(const s of t){const[...o]=ea(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${de(n)}`,...i]}})}function Jl(){return Ne("unknown",()=>!0)}function ia(t,e,n){return new le({...t,coercer:(r,i)=>ta(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}function j0(t,e,n={}){return ia(t,Jl(),r=>{const i=typeof e=="function"?e():e;if(r===void 0)return i;if(!n.strict&&jc(r)&&jc(i)){const s={...r};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return r})}function $0(t){return ia(t,Gl(),e=>e.trim())}function P0(t){return Zt(t,"empty",e=>{const n=Ql(e);return n===0||`Expected an empty ${t.type} but received one with a size of \`${n}\``})}function Ql(t){return t instanceof Map||t instanceof Set?t.size:t.length}function D0(t,e,n={}){const{exclusive:r}=n;return Zt(t,"max",i=>r?i<e:i<=e||`Expected a ${t.type} less than ${r?"":"or equal to "}${e} but received \`${i}\``)}function F0(t,e,n={}){const{exclusive:r}=n;return Zt(t,"min",i=>r?i>e:i>=e||`Expected a ${t.type} greater than ${r?"":"or equal to "}${e} but received \`${i}\``)}function B0(t){return Zt(t,"nonempty",e=>Ql(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function V0(t,e){return Zt(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function H0(t,e,n=e){const r=`Expected a ${t.type}`,i=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Zt(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=n||`${r} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}})}function Zt(t,e,n){return new le({...t,*refiner(r,i){yield*t.refiner(r,i);const s=n(r,i),o=To(s,i,t,r);for(const a of o)yield{...a,refinement:e}}})}const W0=Object.freeze(Object.defineProperty({__proto__:null,Struct:le,StructError:Hl,any:g0,array:m0,assert:Wl,assign:c0,bigint:y0,boolean:v0,coerce:ia,create:Ul,date:_0,defaulted:j0,define:Ne,deprecated:u0,dynamic:l0,empty:P0,enums:w0,func:S0,instance:E0,integer:C0,intersection:I0,is:ta,lazy:h0,literal:x0,map:k0,mask:zl,max:D0,min:F0,never:na,nonempty:B0,nullable:R0,number:M0,object:cr,omit:f0,optional:ql,partial:d0,pattern:V0,pick:p0,record:A0,refine:Zt,regexp:T0,set:N0,size:H0,string:Gl,struct:b0,trimmed:$0,tuple:O0,type:ra,union:L0,unknown:Jl,validate:An},Symbol.toStringTag,{value:"Module"})),Yt=xn(W0);Object.defineProperty(_e,"__esModule",{value:!0});_e.assertExhaustive=_e.assertStruct=_e.assert=_e.AssertionError=void 0;const U0=Yt;function z0(t){return typeof t=="object"&&t!==null&&"message"in t}function q0(t){var e,n;return typeof((n=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||n===void 0?void 0:n.name)=="string"}function G0(t){const e=z0(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Zl(t,e){return q0(t)?new t({message:e}):t({message:e})}class sa extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}_e.AssertionError=sa;function J0(t,e="Assertion failed.",n=sa){if(!t)throw e instanceof Error?e:Zl(n,e)}_e.assert=J0;function Q0(t,e,n="Assertion failed",r=sa){try{(0,U0.assert)(t,e)}catch(i){throw Zl(r,`${n}: ${G0(i)}.`)}}_e.assertStruct=Q0;function Z0(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}_e.assertExhaustive=Z0;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.base64=void 0;const Y0=Yt,K0=_e,X0=(t,e={})=>{var n,r;const i=(n=e.paddingRequired)!==null&&n!==void 0?n:!1,s=(r=e.characterSet)!==null&&r!==void 0?r:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,K0.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Y0.pattern)(t,a)};ur.base64=X0;var Q={},lr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Yt,n=_e;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function r(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=r;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,n.assert)(r(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(u){(0,n.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=a;function c(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=c})(lr);Object.defineProperty(Q,"__esModule",{value:!0});Q.createDataView=Q.concatBytes=Q.valueToBytes=Q.stringToBytes=Q.numberToBytes=Q.signedBigIntToBytes=Q.bigIntToBytes=Q.hexToBytes=Q.bytesToString=Q.bytesToNumber=Q.bytesToSignedBigInt=Q.bytesToBigInt=Q.bytesToHex=Q.assertIsBytes=Q.isBytes=void 0;const je=_e,No=lr,$c=48,Pc=58,Dc=87;function eb(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const tb=eb();function oa(t){return t instanceof Uint8Array}Q.isBytes=oa;function Tn(t){(0,je.assert)(oa(t),"Value must be a Uint8Array.")}Q.assertIsBytes=Tn;function Yl(t){if(Tn(t),t.length===0)return"0x";const e=tb(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return(0,No.add0x)(n.join(""))}Q.bytesToHex=Yl;function Kl(t){Tn(t);const e=Yl(t);return BigInt(e)}Q.bytesToBigInt=Kl;function nb(t){Tn(t);let e=BigInt(0);for(const n of t)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(t.length*8,e)}Q.bytesToSignedBigInt=nb;function rb(t){Tn(t);const e=Kl(t);return(0,je.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}Q.bytesToNumber=rb;function ib(t){return Tn(t),new TextDecoder().decode(t)}Q.bytesToString=ib;function li(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,No.assertIsHexString)(t);const n=(0,No.remove0x)(t).toLowerCase(),r=n.length%2===0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let s=0;s<i.length;s++){const o=r.charCodeAt(s*2),a=r.charCodeAt(s*2+1),c=o-(o<Pc?$c:Dc),u=a-(a<Pc?$c:Dc);i[s]=c*16+u}return i}Q.hexToBytes=li;function Xl(t){(0,je.assert)(typeof t=="bigint","Value must be a bigint."),(0,je.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return li(e)}Q.bigIntToBytes=Xl;function sb(t,e){(0,je.assert)(e>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(e*8+-1))}function ob(t,e){(0,je.assert)(typeof t=="bigint","Value must be a bigint."),(0,je.assert)(typeof e=="number","Byte length must be a number."),(0,je.assert)(e>0,"Byte length must be greater than 0."),(0,je.assert)(sb(t,e),"Byte length is too small to represent the given value.");let n=t;const r=new Uint8Array(e);for(let i=0;i<r.length;i++)r[i]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}Q.signedBigIntToBytes=ob;function eh(t){(0,je.assert)(typeof t=="number","Value must be a number."),(0,je.assert)(t>=0,"Value must be a non-negative number."),(0,je.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return li(e)}Q.numberToBytes=eh;function th(t){return(0,je.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}Q.stringToBytes=th;function nh(t){if(typeof t=="bigint")return Xl(t);if(typeof t=="number")return eh(t);if(typeof t=="string")return t.startsWith("0x")?li(t):th(t);if(oa(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}Q.valueToBytes=nh;function ab(t){const e=new Array(t.length);let n=0;for(let i=0;i<t.length;i++){const s=nh(t[i]);e[i]=s,n+=s.length}const r=new Uint8Array(n);for(let i=0,s=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r}Q.concatBytes=ab;function cb(t){if(typeof B<"u"&&t instanceof B){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}Q.createDataView=cb;var hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.ChecksumStruct=void 0;const Fc=Yt,ub=ur;hi.ChecksumStruct=(0,Fc.size)((0,ub.base64)((0,Fc.string)(),{paddingRequired:!0}),44,44);var at={};Object.defineProperty(at,"__esModule",{value:!0});at.createHex=at.createBytes=at.createBigInt=at.createNumber=void 0;const ie=Yt,lb=_e,rh=Q,fi=lr,ih=(0,ie.union)([(0,ie.number)(),(0,ie.bigint)(),(0,ie.string)(),fi.StrictHexStruct]),hb=(0,ie.coerce)((0,ie.number)(),ih,Number),fb=(0,ie.coerce)((0,ie.bigint)(),ih,BigInt);(0,ie.union)([fi.StrictHexStruct,(0,ie.instance)(Uint8Array)]);const db=(0,ie.coerce)((0,ie.instance)(Uint8Array),(0,ie.union)([fi.StrictHexStruct]),rh.hexToBytes),pb=(0,ie.coerce)(fi.StrictHexStruct,(0,ie.instance)(Uint8Array),rh.bytesToHex);function bb(t){try{const e=(0,ie.create)(t,hb);return(0,lb.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ie.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}at.createNumber=bb;function gb(t){try{return(0,ie.create)(t,fb)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}at.createBigInt=gb;function mb(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ie.create)(t,db)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}at.createBytes=mb;function yb(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ie.create)(t,pb)}catch(e){throw e instanceof ie.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}at.createHex=yb;var gn={},sh=A&&A.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Re=A&&A.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},qe,tt;Object.defineProperty(gn,"__esModule",{value:!0});gn.FrozenSet=gn.FrozenMap=void 0;class aa{constructor(e){qe.set(this,void 0),sh(this,qe,new Map(e),"f"),Object.freeze(this)}get size(){return Re(this,qe,"f").size}[(qe=new WeakMap,Symbol.iterator)](){return Re(this,qe,"f")[Symbol.iterator]()}entries(){return Re(this,qe,"f").entries()}forEach(e,n){return Re(this,qe,"f").forEach((r,i,s)=>e.call(n,r,i,this))}get(e){return Re(this,qe,"f").get(e)}has(e){return Re(this,qe,"f").has(e)}keys(){return Re(this,qe,"f").keys()}values(){return Re(this,qe,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,n])=>`${String(e)} => ${String(n)}`).join(", ")} `:""}}`}}gn.FrozenMap=aa;class ca{constructor(e){tt.set(this,void 0),sh(this,tt,new Set(e),"f"),Object.freeze(this)}get size(){return Re(this,tt,"f").size}[(tt=new WeakMap,Symbol.iterator)](){return Re(this,tt,"f")[Symbol.iterator]()}entries(){return Re(this,tt,"f").entries()}forEach(e,n){return Re(this,tt,"f").forEach((r,i,s)=>e.call(n,r,i,this))}has(e){return Re(this,tt,"f").has(e)}keys(){return Re(this,tt,"f").keys()}values(){return Re(this,tt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}gn.FrozenSet=ca;Object.freeze(aa);Object.freeze(aa.prototype);Object.freeze(ca);Object.freeze(ca.prototype);var oh={},ua={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function n(u){return u==null}t.isNullOrUndefined=n;function r(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=r;const i=(u,l)=>Object.hasOwnProperty.call(u,l);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let l=u;for(;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(u)===l}catch{return!1}}t.isPlainObject=s;function o(u){return u.charCodeAt(0)<=127}t.isASCII=o;function a(u){var l;return u.split("").reduce((f,d)=>o(d)?f+1:f+2,0)+((l=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&l!==void 0?l:[]).length}t.calculateStringSize=a;function c(u){return u.toString().length}t.calculateNumberSize=c})(ua);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Yt,n=_e,r=ua;t.JsonStruct=(0,e.define)("Json",E=>{const[N]=k(E,!0);return N?!0:"Expected a valid JSON-serializable value"});function i(E){return(0,e.is)(E,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(E){return(0,e.is)(E,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(E,N){(0,n.assertStruct)(E,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",N)}t.assertIsJsonRpcNotification=o;function a(E){return(0,e.is)(E,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(E,N){(0,n.assertStruct)(E,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",N)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function u(E){return(0,e.is)(E,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=u;function l(E,N){(0,n.assertStruct)(E,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",N)}t.assertIsPendingJsonRpcResponse=l;function h(E){return(0,e.is)(E,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=h;function f(E,N){(0,n.assertStruct)(E,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",N)}t.assertIsJsonRpcResponse=f;function d(E){return(0,e.is)(E,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=d;function p(E,N){(0,n.assertStruct)(E,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",N)}t.assertIsJsonRpcSuccess=p;function _(E){return(0,e.is)(E,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=_;function m(E,N){(0,n.assertStruct)(E,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",N)}t.assertIsJsonRpcFailure=m;function b(E){return(0,e.is)(E,t.JsonRpcErrorStruct)}t.isJsonRpcError=b;function y(E,N){(0,n.assertStruct)(E,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",N)}t.assertIsJsonRpcError=y;function S(E){const{permitEmptyString:N,permitFractions:U,permitNull:z}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},E);return q=>!!(typeof q=="number"&&(U||Number.isInteger(q))||typeof q=="string"&&(N||q.length>0)||z&&q===null)}t.getJsonRpcIdValidator=S;function k(E,N=!1){const U=new Set;function z(P,q){if(P===void 0)return[!1,0];if(P===null)return[!0,q?0:r.JsonSize.Null];const ue=typeof P;try{if(ue==="function")return[!1,0];if(ue==="string"||P instanceof String)return[!0,q?0:(0,r.calculateStringSize)(P)+r.JsonSize.Quote*2];if(ue==="boolean"||P instanceof Boolean)return q?[!0,0]:[!0,P==!0?r.JsonSize.True:r.JsonSize.False];if(ue==="number"||P instanceof Number)return q?[!0,0]:[!0,(0,r.calculateNumberSize)(P)];if(P instanceof Date)return q?[!0,0]:[!0,isNaN(P.getDate())?r.JsonSize.Null:r.JsonSize.Date+r.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,r.isPlainObject)(P)&&!Array.isArray(P))return[!1,0];if(U.has(P))return[!1,0];U.add(P);try{return[!0,Object.entries(P).reduce((G,[w,v],R,C)=>{let[T,I]=z(v,q);if(!T)throw new Error("JSON validation did not pass. Validation process stopped.");if(U.delete(P),q)return 0;const L=Array.isArray(P)?0:w.length+r.JsonSize.Comma+r.JsonSize.Colon*2,J=R<C.length-1?r.JsonSize.Comma:0;return G+L+I+J},q?0:r.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return z(E,N)}t.validateJsonAndGetSize=k})(oh);var mn={},Oo={exports:{}},no,Bc;function vb(){if(Bc)return no;Bc=1;var t=1e3,e=t*60,n=e*60,r=n*24,i=r*7,s=r*365.25;no=function(l,h){h=h||{};var f=typeof l;if(f==="string"&&l.length>0)return o(l);if(f==="number"&&isFinite(l))return h.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(h){var f=parseFloat(h[1]),d=(h[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*e;case"seconds":case"second":case"secs":case"sec":case"s":return f*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var h=Math.abs(l);return h>=r?Math.round(l/r)+"d":h>=n?Math.round(l/n)+"h":h>=e?Math.round(l/e)+"m":h>=t?Math.round(l/t)+"s":l+"ms"}function c(l){var h=Math.abs(l);return h>=r?u(l,h,r,"day"):h>=n?u(l,h,n,"hour"):h>=e?u(l,h,e,"minute"):h>=t?u(l,h,t,"second"):l+" ms"}function u(l,h,f,d){var p=h>=f*1.5;return Math.round(l/f)+" "+d+(p?"s":"")}return no}function _b(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=i,n.enabled=o,n.humanize=vb(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let h=0;for(let f=0;f<l.length;f++)h=(h<<5)-h+l.charCodeAt(f),h|=0;return n.colors[Math.abs(h)%n.colors.length]}n.selectColor=e;function n(l){let h,f=null,d,p;function _(...m){if(!_.enabled)return;const b=_,y=Number(new Date),S=y-(h||y);b.diff=S,b.prev=h,b.curr=y,h=y,m[0]=n.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let k=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";k++;const z=n.formatters[U];if(typeof z=="function"){const P=m[k];N=z.call(b,P),m.splice(k,1),k--}return N}),n.formatArgs.call(b,m),(b.log||n.log).apply(b,m)}return _.namespace=l,_.useColors=n.useColors(),_.color=n.selectColor(l),_.extend=r,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(d!==n.namespaces&&(d=n.namespaces,p=n.enabled(l)),p),set:m=>{f=m}}),typeof n.init=="function"&&n.init(_),_}function r(l,h){const f=n(this.namespace+(typeof h>"u"?":":h)+l);return f.log=this.log,f}function i(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let h;const f=(typeof l=="string"?l:"").split(/[\s,]+/),d=f.length;for(h=0;h<d;h++)f[h]&&(l=f[h].replace(/\*/g,".*?"),l[0]==="-"?n.skips.push(new RegExp("^"+l.slice(1)+"$")):n.names.push(new RegExp("^"+l+"$")))}function s(){const l=[...n.names.map(a),...n.skips.map(a).map(h=>"-"+h)].join(",");return n.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let h,f;for(h=0,f=n.skips.length;h<f;h++)if(n.skips[h].test(l))return!1;for(h=0,f=n.names.length;h<f;h++)if(n.names[h].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var wb=_b;(function(t,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=n,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let l=0,h=0;c[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(l++,f==="%c"&&(h=l))}),c.splice(h,0,u)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof ko<"u"&&"env"in ko&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=wb(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(Oo,Oo.exports);var Sb=Oo.exports,Eb=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mn,"__esModule",{value:!0});mn.createModuleLogger=mn.createProjectLogger=void 0;const Cb=Eb(Sb),Ib=(0,Cb.default)("metamask");function xb(t){return Ib.extend(t)}mn.createProjectLogger=xb;function kb(t,e){return t.extend(e)}mn.createModuleLogger=kb;var ct={};Object.defineProperty(ct,"__esModule",{value:!0});ct.hexToBigInt=ct.hexToNumber=ct.bigIntToHex=ct.numberToHex=void 0;const ln=_e,Yn=lr,Rb=t=>((0,ln.assert)(typeof t=="number","Value must be a number."),(0,ln.assert)(t>=0,"Value must be a non-negative number."),(0,ln.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Yn.add0x)(t.toString(16)));ct.numberToHex=Rb;const Mb=t=>((0,ln.assert)(typeof t=="bigint","Value must be a bigint."),(0,ln.assert)(t>=0,"Value must be a non-negative bigint."),(0,Yn.add0x)(t.toString(16)));ct.bigIntToHex=Mb;const Ab=t=>{(0,Yn.assertIsHexString)(t);const e=parseInt(t,16);return(0,ln.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};ct.hexToNumber=Ab;const Tb=t=>((0,Yn.assertIsHexString)(t),BigInt((0,Yn.add0x)(t)));ct.hexToBigInt=Tb;var ah={};Object.defineProperty(ah,"__esModule",{value:!0});var ch={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.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"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,n=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function r(s,o){return n(s,"count"),s*o}t.inMilliseconds=r;function i(s){return n(s,"timestamp"),Date.now()-s}t.timeSince=i})(ch);var uh={},Lo={exports:{}};const Nb="2.0.0",lh=256,Ob=Number.MAX_SAFE_INTEGER||9007199254740991,Lb=16,jb=lh-6,$b=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var di={MAX_LENGTH:lh,MAX_SAFE_COMPONENT_LENGTH:Lb,MAX_SAFE_BUILD_LENGTH:jb,MAX_SAFE_INTEGER:Ob,RELEASE_TYPES:$b,SEMVER_SPEC_VERSION:Nb,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Pb=typeof ko=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var pi=Pb;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=di,s=pi;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],u=e.t={};let l=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,r]],d=_=>{for(const[m,b]of f)_=_.split(`${m}*`).join(`${m}{0,${b}}`).split(`${m}+`).join(`${m}{1,${b}}`);return _},p=(_,m,b)=>{const y=d(m),S=l++;s(_,S,m),u[_]=S,c[S]=m,o[S]=new RegExp(m,b?"g":void 0),a[S]=new RegExp(y,b?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),p("FULL",`^${c[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),p("LOOSE",`^${c[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),p("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[u.COERCE],!0),p("COERCERTLFULL",c[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Lo,Lo.exports);var hr=Lo.exports;const Db=Object.freeze({loose:!0}),Fb=Object.freeze({}),Bb=t=>t?typeof t!="object"?Db:t:Fb;var la=Bb;const Vc=/^[0-9]+$/,hh=(t,e)=>{const n=Vc.test(t),r=Vc.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},Vb=(t,e)=>hh(e,t);var fh={compareIdentifiers:hh,rcompareIdentifiers:Vb};const xr=pi,{MAX_LENGTH:Hc,MAX_SAFE_INTEGER:kr}=di,{safeRe:Wc,t:Uc}=hr,Hb=la,{compareIdentifiers:en}=fh;let Wb=class rt{constructor(e,n){if(n=Hb(n),e instanceof rt){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Hc)throw new TypeError(`version is longer than ${Hc} characters`);xr("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?Wc[Uc.LOOSE]:Wc[Uc.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>kr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>kr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>kr||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<kr)return s}return i}):this.prerelease=[],this.build=r[5]?r[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(e){if(xr("SemVer.compare",this.version,this.options,e),!(e instanceof rt)){if(typeof e=="string"&&e===this.version)return 0;e=new rt(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof rt||(e=new rt(e,this.options)),en(this.major,e.major)||en(this.minor,e.minor)||en(this.patch,e.patch)}comparePre(e){if(e instanceof rt||(e=new rt(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(xr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return en(r,i)}while(++n)}compareBuild(e){e instanceof rt||(e=new rt(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(xr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return en(r,i)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);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(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");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(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),en(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Te=Wb;const zc=Te,Ub=(t,e,n=!1)=>{if(t instanceof zc)return t;try{return new zc(t,e)}catch(r){if(!n)return null;throw r}};var Nn=Ub;const zb=Nn,qb=(t,e)=>{const n=zb(t,e);return n?n.version:null};var Gb=qb;const Jb=Nn,Qb=(t,e)=>{const n=Jb(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var Zb=Qb;const qc=Te,Yb=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new qc(t instanceof qc?t.version:t,n).inc(e,r,i).version}catch{return null}};var Kb=Yb;const Gc=Nn,Xb=(t,e)=>{const n=Gc(t,null,!0),r=Gc(e,null,!0),i=n.compare(r);if(i===0)return null;const s=i>0,o=s?n:r,a=s?r:n,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const l=c?"pre":"";return n.major!==r.major?l+"major":n.minor!==r.minor?l+"minor":n.patch!==r.patch?l+"patch":"prerelease"};var eg=Xb;const tg=Te,ng=(t,e)=>new tg(t,e).major;var rg=ng;const ig=Te,sg=(t,e)=>new ig(t,e).minor;var og=sg;const ag=Te,cg=(t,e)=>new ag(t,e).patch;var ug=cg;const lg=Nn,hg=(t,e)=>{const n=lg(t,e);return n&&n.prerelease.length?n.prerelease:null};var fg=hg;const Jc=Te,dg=(t,e,n)=>new Jc(t,n).compare(new Jc(e,n));var Ke=dg;const pg=Ke,bg=(t,e,n)=>pg(e,t,n);var gg=bg;const mg=Ke,yg=(t,e)=>mg(t,e,!0);var vg=yg;const Qc=Te,_g=(t,e,n)=>{const r=new Qc(t,n),i=new Qc(e,n);return r.compare(i)||r.compareBuild(i)};var ha=_g;const wg=ha,Sg=(t,e)=>t.sort((n,r)=>wg(n,r,e));var Eg=Sg;const Cg=ha,Ig=(t,e)=>t.sort((n,r)=>Cg(r,n,e));var xg=Ig;const kg=Ke,Rg=(t,e,n)=>kg(t,e,n)>0;var bi=Rg;const Mg=Ke,Ag=(t,e,n)=>Mg(t,e,n)<0;var fa=Ag;const Tg=Ke,Ng=(t,e,n)=>Tg(t,e,n)===0;var dh=Ng;const Og=Ke,Lg=(t,e,n)=>Og(t,e,n)!==0;var ph=Lg;const jg=Ke,$g=(t,e,n)=>jg(t,e,n)>=0;var da=$g;const Pg=Ke,Dg=(t,e,n)=>Pg(t,e,n)<=0;var pa=Dg;const Fg=dh,Bg=ph,Vg=bi,Hg=da,Wg=fa,Ug=pa,zg=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Fg(t,n,r);case"!=":return Bg(t,n,r);case">":return Vg(t,n,r);case">=":return Hg(t,n,r);case"<":return Wg(t,n,r);case"<=":return Ug(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var bh=zg;const qg=Te,Gg=Nn,{safeRe:Rr,t:Mr}=hr,Jg=(t,e)=>{if(t instanceof qg)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Rr[Mr.COERCEFULL]:Rr[Mr.COERCE]);else{const c=e.includePrerelease?Rr[Mr.COERCERTLFULL]:Rr[Mr.COERCERTL];let u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(n===null)return null;const r=n[2],i=n[3]||"0",s=n[4]||"0",o=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Gg(`${r}.${i}.${s}${o}${a}`,e)};var Qg=Jg,ro,Zc;function Zg(){return Zc||(Zc=1,ro=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),ro}var Yg=Z;Z.Node=qt;Z.create=Z;function Z(t){var e=this;if(e instanceof Z||(e=new Z),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}Z.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Z.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Z.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Z.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Xg(this,arguments[t]);return this.length};Z.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)em(this,arguments[t]);return this.length};Z.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Z.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Z.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};Z.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};Z.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};Z.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};Z.prototype.map=function(t,e){e=e||this;for(var n=new Z,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};Z.prototype.mapReverse=function(t,e){e=e||this;for(var n=new Z,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};Z.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=t(n,r.value,i),r=r.next;return n};Z.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=t(n,r.value,i),r=r.prev;return n};Z.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};Z.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};Z.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new Z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)n.push(i.value);return n};Z.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new Z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>t;r--,i=i.prev)n.push(i.value);return n};Z.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=Kg(this,i,n[r]);return s};Z.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function Kg(t,e,n){var r=e===t.head?new qt(n,null,e,t):new qt(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function Xg(t,e){t.tail=new qt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function em(t,e){t.head=new qt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function qt(t,e,n,r){if(!(this instanceof qt))return new qt(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{Zg()(Z)}catch{}const tm=Yg,Ft=Symbol("max"),bt=Symbol("length"),tn=Symbol("lengthCalculator"),zn=Symbol("allowStale"),Wt=Symbol("maxAge"),ft=Symbol("dispose"),Yc=Symbol("noDisposeOnSet"),ge=Symbol("lruList"),Qe=Symbol("cache"),gh=Symbol("updateAgeOnGet"),io=()=>1;class nm{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Ft]=e.max||1/0;const n=e.length||io;if(this[tn]=typeof n!="function"?io:n,this[zn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Wt]=e.maxAge||0,this[ft]=e.dispose,this[Yc]=e.noDisposeOnSet||!1,this[gh]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Ft]=e||1/0,Dn(this)}get max(){return this[Ft]}set allowStale(e){this[zn]=!!e}get allowStale(){return this[zn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Wt]=e,Dn(this)}get maxAge(){return this[Wt]}set lengthCalculator(e){typeof e!="function"&&(e=io),e!==this[tn]&&(this[tn]=e,this[bt]=0,this[ge].forEach(n=>{n.length=this[tn](n.value,n.key),this[bt]+=n.length})),Dn(this)}get lengthCalculator(){return this[tn]}get length(){return this[bt]}get itemCount(){return this[ge].length}rforEach(e,n){n=n||this;for(let r=this[ge].tail;r!==null;){const i=r.prev;Kc(this,e,r,n),r=i}}forEach(e,n){n=n||this;for(let r=this[ge].head;r!==null;){const i=r.next;Kc(this,e,r,n),r=i}}keys(){return this[ge].toArray().map(e=>e.key)}values(){return this[ge].toArray().map(e=>e.value)}reset(){this[ft]&&this[ge]&&this[ge].length&&this[ge].forEach(e=>this[ft](e.key,e.value)),this[Qe]=new Map,this[ge]=new tm,this[bt]=0}dump(){return this[ge].map(e=>Wr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ge]}set(e,n,r){if(r=r||this[Wt],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[tn](n,e);if(this[Qe].has(e)){if(s>this[Ft])return hn(this,this[Qe].get(e)),!1;const c=this[Qe].get(e).value;return this[ft]&&(this[Yc]||this[ft](e,c.value)),c.now=i,c.maxAge=r,c.value=n,this[bt]+=s-c.length,c.length=s,this.get(e),Dn(this),!0}const o=new rm(e,n,s,i,r);return o.length>this[Ft]?(this[ft]&&this[ft](e,n),!1):(this[bt]+=o.length,this[ge].unshift(o),this[Qe].set(e,this[ge].head),Dn(this),!0)}has(e){if(!this[Qe].has(e))return!1;const n=this[Qe].get(e).value;return!Wr(this,n)}get(e){return so(this,e,!0)}peek(e){return so(this,e,!1)}pop(){const e=this[ge].tail;return e?(hn(this,e),e.value):null}del(e){hn(this,this[Qe].get(e))}load(e){this.reset();const n=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Qe].forEach((e,n)=>so(this,n,!1))}}const so=(t,e,n)=>{const r=t[Qe].get(e);if(r){const i=r.value;if(Wr(t,i)){if(hn(t,r),!t[zn])return}else n&&(t[gh]&&(r.value.now=Date.now()),t[ge].unshiftNode(r));return i.value}},Wr=(t,e)=>{if(!e||!e.maxAge&&!t[Wt])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Wt]&&n>t[Wt]},Dn=t=>{if(t[bt]>t[Ft])for(let e=t[ge].tail;t[bt]>t[Ft]&&e!==null;){const n=e.prev;hn(t,e),e=n}},hn=(t,e)=>{if(e){const n=e.value;t[ft]&&t[ft](n.key,n.value),t[bt]-=n.length,t[Qe].delete(n.key),t[ge].removeNode(e)}};class rm{constructor(e,n,r,i,s){this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Kc=(t,e,n,r)=>{let i=n.value;Wr(t,i)&&(hn(t,n),t[zn]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var im=nm,oo,Xc;function Xe(){if(Xc)return oo;Xc=1;class t{constructor(v,R){if(R=r(R),v instanceof t)return v.loose===!!R.loose&&v.includePrerelease===!!R.includePrerelease?v:new t(v.raw,R);if(v instanceof i)return this.raw=v.value,this.set=[[v]],this.format(),this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=v.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(C=>this.parseRange(C.trim())).filter(C=>C.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const C=this.set[0];if(this.set=this.set.filter(T=>!p(T[0])),this.set.length===0)this.set=[C];else if(this.set.length>1){for(const T of this.set)if(T.length===1&&_(T[0])){this.set=[T];break}}}this.format()}format(){return this.range=this.set.map(v=>v.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(v){const C=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+v,T=n.get(C);if(T)return T;const I=this.options.loose,L=I?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];v=v.replace(L,ue(this.options.includePrerelease)),s("hyphen replace",v),v=v.replace(a[c.COMPARATORTRIM],u),s("comparator trim",v),v=v.replace(a[c.TILDETRIM],l),s("tilde trim",v),v=v.replace(a[c.CARETTRIM],h),s("caret trim",v);let J=v.split(" ").map(ne=>b(ne,this.options)).join(" ").split(/\s+/).map(ne=>q(ne,this.options));I&&(J=J.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(a[c.COMPARATORLOOSE])))),s("range list",J);const D=new Map,X=J.map(ne=>new i(ne,this.options));for(const ne of X){if(p(ne))return[ne];D.set(ne.value,ne)}D.size>1&&D.has("")&&D.delete("");const we=[...D.values()];return n.set(C,we),we}intersects(v,R){if(!(v instanceof t))throw new TypeError("a Range is required");return this.set.some(C=>m(C,R)&&v.set.some(T=>m(T,R)&&C.every(I=>T.every(L=>I.intersects(L,R)))))}test(v){if(!v)return!1;if(typeof v=="string")try{v=new o(v,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(G(this.set[R],v,this.options))return!0;return!1}}oo=t;const e=im,n=new e({max:1e3}),r=la,i=gi(),s=pi,o=Te,{safeRe:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=hr,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=di,p=w=>w.value==="<0.0.0-0",_=w=>w.value==="",m=(w,v)=>{let R=!0;const C=w.slice();let T=C.pop();for(;R&&C.length;)R=C.every(I=>T.intersects(I,v)),T=C.pop();return R},b=(w,v)=>(s("comp",w,v),w=E(w,v),s("caret",w),w=S(w,v),s("tildes",w),w=U(w,v),s("xrange",w),w=P(w,v),s("stars",w),w),y=w=>!w||w.toLowerCase()==="x"||w==="*",S=(w,v)=>w.trim().split(/\s+/).map(R=>k(R,v)).join(" "),k=(w,v)=>{const R=v.loose?a[c.TILDELOOSE]:a[c.TILDE];return w.replace(R,(C,T,I,L,J)=>{s("tilde",w,C,T,I,L,J);let D;return y(T)?D="":y(I)?D=`>=${T}.0.0 <${+T+1}.0.0-0`:y(L)?D=`>=${T}.${I}.0 <${T}.${+I+1}.0-0`:J?(s("replaceTilde pr",J),D=`>=${T}.${I}.${L}-${J} <${T}.${+I+1}.0-0`):D=`>=${T}.${I}.${L} <${T}.${+I+1}.0-0`,s("tilde return",D),D})},E=(w,v)=>w.trim().split(/\s+/).map(R=>N(R,v)).join(" "),N=(w,v)=>{s("caret",w,v);const R=v.loose?a[c.CARETLOOSE]:a[c.CARET],C=v.includePrerelease?"-0":"";return w.replace(R,(T,I,L,J,D)=>{s("caret",w,T,I,L,J,D);let X;return y(I)?X="":y(L)?X=`>=${I}.0.0${C} <${+I+1}.0.0-0`:y(J)?I==="0"?X=`>=${I}.${L}.0${C} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.0${C} <${+I+1}.0.0-0`:D?(s("replaceCaret pr",D),I==="0"?L==="0"?X=`>=${I}.${L}.${J}-${D} <${I}.${L}.${+J+1}-0`:X=`>=${I}.${L}.${J}-${D} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.${J}-${D} <${+I+1}.0.0-0`):(s("no pr"),I==="0"?L==="0"?X=`>=${I}.${L}.${J}${C} <${I}.${L}.${+J+1}-0`:X=`>=${I}.${L}.${J}${C} <${I}.${+L+1}.0-0`:X=`>=${I}.${L}.${J} <${+I+1}.0.0-0`),s("caret return",X),X})},U=(w,v)=>(s("replaceXRanges",w,v),w.split(/\s+/).map(R=>z(R,v)).join(" ")),z=(w,v)=>{w=w.trim();const R=v.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return w.replace(R,(C,T,I,L,J,D)=>{s("xRange",w,C,T,I,L,J,D);const X=y(I),we=X||y(L),ne=we||y(J),wt=ne;return T==="="&&wt&&(T=""),D=v.includePrerelease?"-0":"",X?T===">"||T==="<"?C="<0.0.0-0":C="*":T&&wt?(we&&(L=0),J=0,T===">"?(T=">=",we?(I=+I+1,L=0,J=0):(L=+L+1,J=0)):T==="<="&&(T="<",we?I=+I+1:L=+L+1),T==="<"&&(D="-0"),C=`${T+I}.${L}.${J}${D}`):we?C=`>=${I}.0.0${D} <${+I+1}.0.0-0`:ne&&(C=`>=${I}.${L}.0${D} <${I}.${+L+1}.0-0`),s("xRange return",C),C})},P=(w,v)=>(s("replaceStars",w,v),w.trim().replace(a[c.STAR],"")),q=(w,v)=>(s("replaceGTE0",w,v),w.trim().replace(a[v.includePrerelease?c.GTE0PRE:c.GTE0],"")),ue=w=>(v,R,C,T,I,L,J,D,X,we,ne,wt,ts)=>(y(C)?R="":y(T)?R=`>=${C}.0.0${w?"-0":""}`:y(I)?R=`>=${C}.${T}.0${w?"-0":""}`:L?R=`>=${R}`:R=`>=${R}${w?"-0":""}`,y(X)?D="":y(we)?D=`<${+X+1}.0.0-0`:y(ne)?D=`<${X}.${+we+1}.0-0`:wt?D=`<=${X}.${we}.${ne}-${wt}`:w?D=`<${X}.${we}.${+ne+1}-0`:D=`<=${D}`,`${R} ${D}`.trim()),G=(w,v,R)=>{for(let C=0;C<w.length;C++)if(!w[C].test(v))return!1;if(v.prerelease.length&&!R.includePrerelease){for(let C=0;C<w.length;C++)if(s(w[C].semver),w[C].semver!==i.ANY&&w[C].semver.prerelease.length>0){const T=w[C].semver;if(T.major===v.major&&T.minor===v.minor&&T.patch===v.patch)return!0}return!1}return!0};return oo}var ao,eu;function gi(){if(eu)return ao;eu=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,h){if(h=n(h),l instanceof e){if(l.loose===!!h.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,h),this.options=h,this.loose=!!h.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const h=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],f=l.match(h);if(!f)throw new TypeError(`Invalid comparator: ${l}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,h){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,h).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,h).test(l.semver):(h=n(h),h.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,h)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,h)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ao=e;const n=la,{safeRe:r,t:i}=hr,s=bh,o=pi,a=Te,c=Xe();return ao}const sm=Xe(),om=(t,e,n)=>{try{e=new sm(e,n)}catch{return!1}return e.test(t)};var mi=om;const am=Xe(),cm=(t,e)=>new am(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));var um=cm;const lm=Te,hm=Xe(),fm=(t,e,n)=>{let r=null,i=null,s=null;try{s=new hm(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new lm(r,n))}),r};var dm=fm;const pm=Te,bm=Xe(),gm=(t,e,n)=>{let r=null,i=null,s=null;try{s=new bm(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new pm(r,n))}),r};var mm=gm;const co=Te,ym=Xe(),tu=bi,vm=(t,e)=>{t=new ym(t,e);let n=new co("0.0.0");if(t.test(n)||(n=new co("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){const i=t.set[r];let s=null;i.forEach(o=>{const a=new co(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||tu(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||tu(n,s))&&(n=s)}return n&&t.test(n)?n:null};var _m=vm;const wm=Xe(),Sm=(t,e)=>{try{return new wm(t,e).range||"*"}catch{return null}};var Em=Sm;const Cm=Te,mh=gi(),{ANY:Im}=mh,xm=Xe(),km=mi,nu=bi,ru=fa,Rm=pa,Mm=da,Am=(t,e,n,r)=>{t=new Cm(t,r),e=new xm(e,r);let i,s,o,a,c;switch(n){case">":i=nu,s=Rm,o=ru,a=">",c=">=";break;case"<":i=ru,s=Mm,o=nu,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(km(t,e,r))return!1;for(let u=0;u<e.set.length;++u){const l=e.set[u];let h=null,f=null;if(l.forEach(d=>{d.semver===Im&&(d=new mh(">=0.0.0")),h=h||d,f=f||d,i(d.semver,h.semver,r)?h=d:o(d.semver,f.semver,r)&&(f=d)}),h.operator===a||h.operator===c||(!f.operator||f.operator===a)&&s(t,f.semver))return!1;if(f.operator===c&&o(t,f.semver))return!1}return!0};var ba=Am;const Tm=ba,Nm=(t,e,n)=>Tm(t,e,">",n);var Om=Nm;const Lm=ba,jm=(t,e,n)=>Lm(t,e,"<",n);var $m=jm;const iu=Xe(),Pm=(t,e,n)=>(t=new iu(t,n),e=new iu(e,n),t.intersects(e,n));var Dm=Pm;const Fm=mi,Bm=Ke;var Vm=(t,e,n)=>{const r=[];let i=null,s=null;const o=t.sort((l,h)=>Bm(l,h,n));for(const l of o)Fm(l,e,n)?(s=l,i||(i=l)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);const a=[];for(const[l,h]of r)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e};const su=Xe(),ga=gi(),{ANY:uo}=ga,Fn=mi,ma=Ke,Hm=(t,e,n={})=>{if(t===e)return!0;t=new su(t,n),e=new su(e,n);let r=!1;e:for(const i of t.set){for(const s of e.set){const o=Um(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},Wm=[new ga(">=0.0.0-0")],ou=[new ga(">=0.0.0")],Um=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===uo){if(e.length===1&&e[0].semver===uo)return!0;n.includePrerelease?t=Wm:t=ou}if(e.length===1&&e[0].semver===uo){if(n.includePrerelease)return!0;e=ou}const r=new Set;let i,s;for(const d of t)d.operator===">"||d.operator===">="?i=au(i,d,n):d.operator==="<"||d.operator==="<="?s=cu(s,d,n):r.add(d.semver);if(r.size>1)return null;let o;if(i&&s){if(o=ma(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const d of r){if(i&&!Fn(d,String(i),n)||s&&!Fn(d,String(s),n))return null;for(const p of e)if(!Fn(d,String(p),n))return!1;return!0}let a,c,u,l,h=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const d of e){if(l=l||d.operator===">"||d.operator===">=",u=u||d.operator==="<"||d.operator==="<=",i){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=au(i,d,n),a===d&&a!==i)return!1}else if(i.operator===">="&&!Fn(i.semver,String(d),n))return!1}if(s){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator==="<"||d.operator==="<="){if(c=cu(s,d,n),c===d&&c!==s)return!1}else if(s.operator==="<="&&!Fn(s.semver,String(d),n))return!1}if(!d.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||f||h)},au=(t,e,n)=>{if(!t)return e;const r=ma(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},cu=(t,e,n)=>{if(!t)return e;const r=ma(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};var zm=Hm;const lo=hr,uu=di,qm=Te,lu=fh,Gm=Nn,Jm=Gb,Qm=Zb,Zm=Kb,Ym=eg,Km=rg,Xm=og,e1=ug,t1=fg,n1=Ke,r1=gg,i1=vg,s1=ha,o1=Eg,a1=xg,c1=bi,u1=fa,l1=dh,h1=ph,f1=da,d1=pa,p1=bh,b1=Qg,g1=gi(),m1=Xe(),y1=mi,v1=um,_1=dm,w1=mm,S1=_m,E1=Em,C1=ba,I1=Om,x1=$m,k1=Dm,R1=Vm,M1=zm;var A1={parse:Gm,valid:Jm,clean:Qm,inc:Zm,diff:Ym,major:Km,minor:Xm,patch:e1,prerelease:t1,compare:n1,rcompare:r1,compareLoose:i1,compareBuild:s1,sort:o1,rsort:a1,gt:c1,lt:u1,eq:l1,neq:h1,gte:f1,lte:d1,cmp:p1,coerce:b1,Comparator:g1,Range:m1,satisfies:y1,toComparators:v1,maxSatisfying:_1,minSatisfying:w1,minVersion:S1,validRange:E1,outside:C1,gtr:I1,ltr:x1,intersects:k1,simplifyRange:R1,subset:M1,SemVer:qm,re:lo.re,src:lo.src,tokens:lo.t,SEMVER_SPEC_VERSION:uu.SEMVER_SPEC_VERSION,RELEASE_TYPES:uu.RELEASE_TYPES,compareIdentifiers:lu.compareIdentifiers,rcompareIdentifiers:lu.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=A1,n=Yt,r=_e;t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",h=>(0,e.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",h=>(0,e.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function i(h){return(0,n.is)(h,t.VersionStruct)}t.isValidSemVerVersion=i;function s(h){return(0,n.is)(h,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(h){(0,r.assertStruct)(h,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(h){(0,r.assertStruct)(h,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(h,f){return(0,e.gt)(h,f)}t.gtVersion=c;function u(h,f){return(0,e.gtr)(h,f)}t.gtRange=u;function l(h,f){return(0,e.satisfies)(h,f,{includePrerelease:!0})}t.satisfiesVersionRange=l})(uh);(function(t){var e=A&&A.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=A&&A.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(_e,t),n(ur,t),n(Q,t),n(hi,t),n(at,t),n(gn,t),n(lr,t),n(oh,t),n(mn,t),n(ua,t),n(ct,t),n(ah,t),n(ch,t),n(uh,t)})(Vl);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Vl;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Bl);var yh=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});ui.PollingBlockTracker=void 0;const T1=yh(Xo),N1=yh(Xp),O1=ar,hu=Bl,fu=(0,hu.createModuleLogger)(hu.projectLogger,"polling-block-tracker"),L1=(0,T1.default)(),j1=1e3;class $1 extends O1.BaseBlockTracker{constructor(e={}){var n;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(n=e.blockResetDuration)!==null&&n!==void 0?n:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*j1,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const n=du(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}catch(n){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
2
2
|
${(e=n.stack)!==null&&e!==void 0?e:n}`);try{this.emit("error",r)}catch{console.error(r)}const i=du(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:L1(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),fu("Making request",e);const n=await(0,N1.default)(r=>this._provider.sendAsync(e,r))();if(fu("Got response",n),n.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
3
3
|
${n.error.message}`);return n.result}}ui.PollingBlockTracker=$1;function du(t,e){return new Promise(n=>{const r=setTimeout(n,t);r.unref&&e&&r.unref()})}var yi={},P1=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yi,"__esModule",{value:!0});yi.SubscribeBlockTracker=void 0;const D1=P1(Xo),F1=ar,B1=(0,D1.default)();class V1 extends F1.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...n){return new Promise((r,i)=>{this._provider.sendAsync({id:B1(),method:e,params:n,jsonrpc:"2.0"},(s,o)=>{s?i(s):r(o.result)})})}_handleSubData(e,n){var r;n.method==="eth_subscription"&&((r=n.params)===null||r===void 0?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(n.params.result.number)}}yi.SubscribeBlockTracker=V1;var vh={};Object.defineProperty(vh,"__esModule",{value:!0});(function(t){var e=A&&A.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=A&&A.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(ui,t),n(yi,t),n(vh,t)})(Fl);var ya={},vi={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.getUniqueId=void 0;const _h=4294967295;let ho=Math.floor(Math.random()*_h);function H1(){return ho=(ho+1)%_h,ho}fr.getUniqueId=H1;Object.defineProperty(vi,"__esModule",{value:!0});vi.createIdRemapMiddleware=void 0;const W1=fr;function U1(){return(t,e,n,r)=>{const i=t.id,s=W1.getUniqueId();t.id=s,e.id=s,n(o=>{t.id=i,e.id=i,o()})}}vi.createIdRemapMiddleware=U1;var _i={};Object.defineProperty(_i,"__esModule",{value:!0});_i.createAsyncMiddleware=void 0;function z1(t){return async(e,n,r,i)=>{let s;const o=new Promise(l=>{s=l});let a=null,c=!1;const u=async()=>{c=!0,r(l=>{a=l,s()}),await o};try{await t(e,n,u),c?(await o,a(null)):i(null)}catch(l){a?a(l):i(l)}}}_i.createAsyncMiddleware=z1;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.createScaffoldMiddleware=void 0;function q1(t){return(e,n,r,i)=>{const s=t[e.method];return s===void 0?r():typeof s=="function"?s(e,n,r,i):(n.result=s,i())}}wi.createScaffoldMiddleware=q1;var dr={},G1=A&&A.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dr,"__esModule",{value:!0});dr.JsonRpcEngine=void 0;const J1=G1(Qt),Fe=rr;class dt extends J1.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,n){if(n&&typeof n!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?n?this._handleBatch(e,n):this._handleBatch(e):n?this._handle(e,n):this._promiseHandle(e)}asMiddleware(){return async(e,n,r,i)=>{try{const[s,o,a]=await dt._runAllMiddleware(e,n,this._middleware);return o?(await dt._runReturnHandlers(a),i(s)):r(async c=>{try{await dt._runReturnHandlers(a)}catch(u){return c(u)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,n){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return n?n(null,r):r}catch(r){if(n)return n(r);throw r}}_promiseHandle(e){return new Promise(n=>{this._handle(e,(r,i)=>{n(i)})})}async _handle(e,n){if(!e||Array.isArray(e)||typeof e!="object"){const o=new Fe.EthereumRpcError(Fe.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return n(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new Fe.EthereumRpcError(Fe.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return n(o,{id:e.id,jsonrpc:"2.0",error:o})}const r=Object.assign({},e),i={id:r.id,jsonrpc:r.jsonrpc};let s=null;try{await this._processRequest(r,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Fe.serializeError(s))),n(s,i)}async _processRequest(e,n){const[r,i,s]=await dt._runAllMiddleware(e,n,this._middleware);if(dt._checkForCompletion(e,n,i),await dt._runReturnHandlers(s),r)throw r}static async _runAllMiddleware(e,n,r){const i=[];let s=null,o=!1;for(const a of r)if([s,o]=await dt._runMiddleware(e,n,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,n,r,i){return new Promise(s=>{const o=c=>{const u=c||n.error;u&&(n.error=Fe.serializeError(u)),s([u,!0])},a=c=>{n.error?o(n.error):(c&&(typeof c!="function"&&o(new Fe.EthereumRpcError(Fe.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
|
|
4
4
|
${fo(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{r(e,n,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const n of e)await new Promise((r,i)=>{n(s=>s?i(s):r())})}static _checkForCompletion(e,n,r){if(!("result"in n)&&!("error"in n))throw new Fe.EthereumRpcError(Fe.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|