@dcl/top-scenes 0.0.1-20574479717.commit-6139329
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/PhArrowCircleDown-B305t-Sh.js +14 -0
- package/assets/PhArrowClockwise-CJPxQhr_.js +14 -0
- package/assets/PhArrowDown-C4hT9BVu.js +14 -0
- package/assets/PhArrowLeft-Way4Cu-r.js +14 -0
- package/assets/PhArrowRight-Cp5ZME0F.js +14 -0
- package/assets/PhArrowSquareOut-NnrK69c5.js +14 -0
- package/assets/PhArrowUp-Dph6j8rm.js +14 -0
- package/assets/PhArrowUpRight-BpJjRRRh.js +14 -0
- package/assets/PhArrowsClockwise-CFUT8X7R.js +14 -0
- package/assets/PhArrowsDownUp-BjBI4ckC.js +14 -0
- package/assets/PhArrowsLeftRight-CuLpbKRk.js +14 -0
- package/assets/PhBank-Dchr4XQJ.js +14 -0
- package/assets/PhBrowser-dUu2TrC1.js +14 -0
- package/assets/PhCaretDown-78IuKU3V.js +14 -0
- package/assets/PhCaretLeft-_aiyH7n1.js +14 -0
- package/assets/PhCaretRight-8zJQEuDX.js +14 -0
- package/assets/PhCaretUp-CiCxKWwN.js +14 -0
- package/assets/PhCheck-CcADx8br.js +14 -0
- package/assets/PhCircleHalf-BYzSzd2h.js +14 -0
- package/assets/PhClock-UItiXeJq.js +14 -0
- package/assets/PhCompass-CUy3uA7t.js +14 -0
- package/assets/PhCopy-C-PDgSlZ.js +14 -0
- package/assets/PhCreditCard-CWRaUT6F.js +14 -0
- package/assets/PhCurrencyDollar-Cqla3AXT.js +14 -0
- package/assets/PhDesktop-BBIPrYLl.js +14 -0
- package/assets/PhDeviceMobile-BdsPaATg.js +14 -0
- package/assets/PhDotsThree-BMXCQl-0.js +14 -0
- package/assets/PhEnvelope-yUsis6yU.js +14 -0
- package/assets/PhFunnelSimple-Ba7BbWTp.js +14 -0
- package/assets/PhGlobe-DgLxBk5U.js +14 -0
- package/assets/PhIdentificationCard-Czjmq9Z3.js +14 -0
- package/assets/PhImage-BAJ_erz6.js +14 -0
- package/assets/PhInfo-Cr4DhVUE.js +14 -0
- package/assets/PhLightbulb-BX_7duTr.js +14 -0
- package/assets/PhMagnifyingGlass-Mygfryvz.js +14 -0
- package/assets/PhPaperPlaneRight-BeuCA660.js +14 -0
- package/assets/PhPlus-BMjcHjsT.js +14 -0
- package/assets/PhPower-CGffGmdb.js +14 -0
- package/assets/PhPuzzlePiece-wm_GpVSi.js +14 -0
- package/assets/PhQrCode-DRwRzXCH.js +14 -0
- package/assets/PhQuestion-M09j2U0T.js +14 -0
- package/assets/PhQuestionMark-BP9EMB6h.js +14 -0
- package/assets/PhSealCheck-BfG80yKn.js +14 -0
- package/assets/PhSignOut-C5YOWlPT.js +14 -0
- package/assets/PhSpinner-BXooDYzU.js +14 -0
- package/assets/PhTrash-Biq6rmmL.js +14 -0
- package/assets/PhUser-CAgZSpGe.js +14 -0
- package/assets/PhVault-l2PHF38a.js +14 -0
- package/assets/PhWarning-DPEydIPw.js +14 -0
- package/assets/PhWarningCircle-BqjT745H.js +14 -0
- package/assets/PhX-s-SmVExa.js +14 -0
- package/assets/Position_Star_Medium_1-D9_Xr-8o.webp +0 -0
- package/assets/Position_Star_Medium_3-eBrgImJU.webp +0 -0
- package/assets/RoobertPRO-Bold-BLoSpx-h.otf +0 -0
- package/assets/RoobertPRO-Bold-zQ2qeH97.ttf +0 -0
- package/assets/auto-track-Bi0QWiGn.js +1 -0
- package/assets/banner_bg-C4LBAGqQ.webp +0 -0
- package/assets/banner_overlay-DrNLUz7T.webp +0 -0
- package/assets/basic-F0r-7YBm.js +1435 -0
- package/assets/core-BBTIgWQG.js +233 -0
- package/assets/create-submenu-DEFVbrc5.png +0 -0
- package/assets/explore-submenu-KVl6Dc-h.png +0 -0
- package/assets/features-7K-B420g.js +5 -0
- package/assets/fortmatic-OXkYrVpn.js +13 -0
- package/assets/governance-submenu-CXxLX9nT.png +0 -0
- package/assets/index-0Rek36uX.js +2 -0
- package/assets/index-4s-7e_Q6.js +12 -0
- package/assets/index-B4dMpmQQ.js +1 -0
- package/assets/index-BFmw0mfC.js +1 -0
- package/assets/index-BMZR33LX.js +1322 -0
- package/assets/index-BTDAEI3l.js +1 -0
- package/assets/index-BcSn1UAG.js +1 -0
- package/assets/index-CFiK0Deq.js +41 -0
- package/assets/index-CIX4hu1f.js +36 -0
- package/assets/index-Cgd-ACTe.js +752 -0
- package/assets/index-D0cZbiaE.js +5 -0
- package/assets/index-DgO0Zigb.js +1 -0
- package/assets/index-P9m1hcFq.js +1 -0
- package/assets/index-SSgaCJsD.js +1 -0
- package/assets/index-olsbfI2m.js +2 -0
- package/assets/index.umd-COk1Z8BG.js +1 -0
- package/assets/inherits_browser-Dbwsx_3T.js +1 -0
- package/assets/is-plan-event-enabled-DS1Agtkw.js +1 -0
- package/assets/learn-submenu-Xs1jOwfy.png +0 -0
- package/assets/man-default1-BEO13leF.png +0 -0
- package/assets/marketplace-submenu-CjxTqNhj.png +0 -0
- package/assets/property-C9JG5tag.js +27 -0
- package/assets/scene-thumbnail-CbK-_jZx.webp +0 -0
- package/assets/w3m-modal-Donko-xo.js +1209 -0
- package/index.html +43 -0
- package/package.json +21 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{g as sn,c as te,b as Xc,s as Rh,d as Ch,f as Mh,h as kh,t as xh,e as Ii,a as Ih}from"./index-Cgd-ACTe.js";import{i as Mt,t as Ah}from"./inherits_browser-Dbwsx_3T.js";function Th(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Nh={},Bh=Object.freeze(Object.defineProperty({__proto__:null,default:Nh},Symbol.toStringTag,{value:"Module"})),Io=sn(Bh);var Lh={}.toString,Ph=Array.isArray||function(e){return Lh.call(e)=="[object Array]"},el=Function.prototype.toString,Wr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,lo,mi;if(typeof Wr=="function"&&typeof Object.defineProperty=="function")try{lo=Object.defineProperty({},"length",{get:function(){throw mi}}),mi={},Wr(function(){throw 42},null,lo)}catch(e){e!==mi&&(Wr=null)}else Wr=null;var Oh=/^\s*class\b/,uo=function(t){try{var r=el.call(t);return Oh.test(r)}catch{return!1}},As=function(t){try{return uo(t)?!1:(el.call(t),!0)}catch{return!1}},yi=Object.prototype.toString,Fh="[object Object]",Dh="[object Function]",jh="[object GeneratorFunction]",Uh="[object HTMLAllCollection]",$h="[object HTML document.all class]",Hh="[object HTMLCollection]",Wh=typeof Symbol=="function"&&!!Symbol.toStringTag,Vh=!(0 in[,]),ho=function(){return!1};if(typeof document=="object"){var zh=document.all;yi.call(zh)===yi.call(document.all)&&(ho=function(t){if((Vh||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=yi.call(t);return(r===Uh||r===$h||r===Hh||r===Fh)&&t("")==null}catch{}return!1})}var qh=Wr?function(t){if(ho(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Wr(t,null,lo)}catch(r){if(r!==mi)return!1}return!uo(t)&&As(t)}:function(t){if(ho(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Wh)return As(t);if(uo(t))return!1;var r=yi.call(t);return r!==Dh&&r!==jh&&!/^\[object HTML/.test(r)?!1:As(t)},Gh=qh,Jh=Object.prototype.toString,tl=Object.prototype.hasOwnProperty,Zh=function(t,r,n){for(var i=0,s=t.length;i<s;i++)tl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))},Kh=function(t,r,n){for(var i=0,s=t.length;i<s;i++)n==null?r(t.charAt(i),i,t):r.call(n,t.charAt(i),i,t)},Qh=function(t,r,n){for(var i in t)tl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))};function Yh(e){return Jh.call(e)==="[object Array]"}var Xh=function(t,r,n){if(!Gh(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Yh(t)?Zh(t,r,i):typeof t=="string"?Kh(t,r,i):Qh(t,r,i)},ef=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Ts=ef,tf=typeof globalThis>"u"?te:globalThis,rf=function(){for(var t=[],r=0;r<Ts.length;r++)typeof tf[Ts[r]]=="function"&&(t[t.length]=Ts[r]);return t},Si=Xh,nf=rf,ya=kh,Ao=Xc,wi=Ch,ri=Mh,sf=Ao("Object.prototype.toString"),rl=Rh(),wa=typeof globalThis>"u"?te:globalThis,fo=nf(),To=Ao("String.prototype.slice"),of=Ao("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},Ri={__proto__:null};rl&&wi&&ri?Si(fo,function(e){var t=new wa[e];if(Symbol.toStringTag in t&&ri){var r=ri(t),n=wi(r,Symbol.toStringTag);if(!n&&r){var i=ri(r);n=wi(i,Symbol.toStringTag)}Ri["$"+e]=ya(n.get)}}):Si(fo,function(e){var t=new wa[e],r=t.slice||t.set;r&&(Ri["$"+e]=ya(r))});var af=function(t){var r=!1;return Si(Ri,function(n,i){if(!r)try{"$"+n(t)===i&&(r=To(i,1))}catch{}}),r},cf=function(t){var r=!1;return Si(Ri,function(n,i){if(!r)try{n(t),r=To(i,1)}catch{}}),r},lf=function(t){if(!t||typeof t!="object")return!1;if(!rl){var r=To(sf(t),8,-1);return of(fo,r)>-1?r:r!=="Object"?!1:cf(t)}return wi?af(t):null},No={},bn={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.walletLogo=void 0;const uf=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Ai.walletLogo=uf;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.LINK_API_URL=void 0;Ti.LINK_API_URL="https://www.walletlink.org";var X={},Bo={exports:{}};Bo.exports;(function(e){(function(t,r){function n(A,c){if(!A)throw new Error(c||"Assertion failed")}function i(A,c){A.super_=c;var d=function(){};d.prototype=c.prototype,A.prototype=new d,A.prototype.constructor=A}function s(A,c,d){if(s.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,A!==null&&((c==="le"||c==="be")&&(d=c,c=10),this._init(A||0,c||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=Io.Buffer}catch{}s.isBN=function(c){return c instanceof s?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===s.wordSize&&Array.isArray(c.words)},s.max=function(c,d){return c.cmp(d)>0?c:d},s.min=function(c,d){return c.cmp(d)<0?c:d},s.prototype._init=function(c,d,y){if(typeof c=="number")return this._initNumber(c,d,y);if(typeof c=="object")return this._initArray(c,d,y);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),c=c.toString().replace(/\s+/g,"");var v=0;c[0]==="-"&&(v++,this.negative=1),v<c.length&&(d===16?this._parseHex(c,v,y):(this._parseBase(c,d,v),y==="le"&&this._initArray(this.toArray(),d,y)))},s.prototype._initNumber=function(c,d,y){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(n(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),d,y)},s.prototype._initArray=function(c,d,y){if(n(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var S,x,B=0;if(y==="be")for(v=c.length-1,S=0;v>=0;v-=3)x=c[v]|c[v-1]<<8|c[v-2]<<16,this.words[S]|=x<<B&67108863,this.words[S+1]=x>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);else if(y==="le")for(v=0,S=0;v<c.length;v+=3)x=c[v]|c[v+1]<<8|c[v+2]<<16,this.words[S]|=x<<B&67108863,this.words[S+1]=x>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);return this._strip()};function o(A,c){var d=A.charCodeAt(c);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+A)}function h(A,c,d){var y=o(A,d);return d-1>=c&&(y|=o(A,d-1)<<4),y}s.prototype._parseHex=function(c,d,y){this.length=Math.ceil((c.length-d)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var S=0,x=0,B;if(y==="be")for(v=c.length-1;v>=d;v-=2)B=h(c,d,v)<<S,this.words[x]|=B&67108863,S>=18?(S-=18,x+=1,this.words[x]|=B>>>26):S+=8;else{var b=c.length-d;for(v=b%2===0?d+1:d;v<c.length;v+=2)B=h(c,d,v)<<S,this.words[x]|=B&67108863,S>=18?(S-=18,x+=1,this.words[x]|=B>>>26):S+=8}this._strip()};function p(A,c,d,y){for(var v=0,S=0,x=Math.min(A.length,d),B=c;B<x;B++){var b=A.charCodeAt(B)-48;v*=y,b>=49?S=b-49+10:b>=17?S=b-17+10:S=b,n(b>=0&&S<y,"Invalid character"),v+=S}return v}s.prototype._parseBase=function(c,d,y){this.words=[0],this.length=1;for(var v=0,S=1;S<=67108863;S*=d)v++;v--,S=S/d|0;for(var x=c.length-y,B=x%v,b=Math.min(x,x-B)+y,u=0,R=y;R<b;R+=v)u=p(c,R,R+v,d),this.imuln(S),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(B!==0){var Q=1;for(u=p(c,R,c.length,d),R=0;R<B;R++)Q*=d;this.imuln(Q),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},s.prototype.copy=function(c){c.words=new Array(this.length);for(var d=0;d<this.length;d++)c.words[d]=this.words[d];c.length=this.length,c.negative=this.negative,c.red=this.red};function g(A,c){A.words=c.words,A.length=c.length,A.negative=c.negative,A.red=c.red}if(s.prototype._move=function(c){g(c,this)},s.prototype.clone=function(){var c=new s(null);return this.copy(c),c},s.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=_}catch{s.prototype.inspect=_}else s.prototype.inspect=_;function _(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],D=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(c,d){c=c||10,d=d|0||1;var y;if(c===16||c==="hex"){y="";for(var v=0,S=0,x=0;x<this.length;x++){var B=this.words[x],b=((B<<v|S)&16777215).toString(16);S=B>>>24-v&16777215,v+=2,v>=26&&(v-=26,x--),S!==0||x!==this.length-1?y=w[6-b.length]+b+y:y=b+y}for(S!==0&&(y=S.toString(16)+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(c===(c|0)&&c>=2&&c<=36){var u=I[c],R=D[c];y="";var Q=this.clone();for(Q.negative=0;!Q.isZero();){var J=Q.modrn(R).toString(c);Q=Q.idivn(R),Q.isZero()?y=J+y:y=w[u-J.length]+J+y}for(this.isZero()&&(y="0"+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(c,d){return this.toArrayLike(a,c,d)}),s.prototype.toArray=function(c,d){return this.toArrayLike(Array,c,d)};var F=function(c,d){return c.allocUnsafe?c.allocUnsafe(d):new c(d)};s.prototype.toArrayLike=function(c,d,y){this._strip();var v=this.byteLength(),S=y||Math.max(1,v);n(v<=S,"byte array longer than desired length"),n(S>0,"Requested array length <= 0");var x=F(c,S),B=d==="le"?"LE":"BE";return this["_toArrayLike"+B](x,v),x},s.prototype._toArrayLikeLE=function(c,d){for(var y=0,v=0,S=0,x=0;S<this.length;S++){var B=this.words[S]<<x|v;c[y++]=B&255,y<c.length&&(c[y++]=B>>8&255),y<c.length&&(c[y++]=B>>16&255),x===6?(y<c.length&&(c[y++]=B>>24&255),v=0,x=0):(v=B>>>24,x+=2)}if(y<c.length)for(c[y++]=v;y<c.length;)c[y++]=0},s.prototype._toArrayLikeBE=function(c,d){for(var y=c.length-1,v=0,S=0,x=0;S<this.length;S++){var B=this.words[S]<<x|v;c[y--]=B&255,y>=0&&(c[y--]=B>>8&255),y>=0&&(c[y--]=B>>16&255),x===6?(y>=0&&(c[y--]=B>>24&255),v=0,x=0):(v=B>>>24,x+=2)}if(y>=0)for(c[y--]=v;y>=0;)c[y--]=0},Math.clz32?s.prototype._countBits=function(c){return 32-Math.clz32(c)}:s.prototype._countBits=function(c){var d=c,y=0;return d>=4096&&(y+=13,d>>>=13),d>=64&&(y+=7,d>>>=7),d>=8&&(y+=4,d>>>=4),d>=2&&(y+=2,d>>>=2),y+d},s.prototype._zeroBits=function(c){if(c===0)return 26;var d=c,y=0;return d&8191||(y+=13,d>>>=13),d&127||(y+=7,d>>>=7),d&15||(y+=4,d>>>=4),d&3||(y+=2,d>>>=2),d&1||y++,y},s.prototype.bitLength=function(){var c=this.words[this.length-1],d=this._countBits(c);return(this.length-1)*26+d};function O(A){for(var c=new Array(A.bitLength()),d=0;d<c.length;d++){var y=d/26|0,v=d%26;c[d]=A.words[y]>>>v&1}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(c+=y,y!==26)break}return c},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},s.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var d=0;d<c.length;d++)this.words[d]=this.words[d]|c.words[d];return this._strip()},s.prototype.ior=function(c){return n((this.negative|c.negative)===0),this.iuor(c)},s.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},s.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},s.prototype.iuand=function(c){var d;this.length>c.length?d=c:d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&c.words[y];return this.length=d.length,this._strip()},s.prototype.iand=function(c){return n((this.negative|c.negative)===0),this.iuand(c)},s.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},s.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},s.prototype.iuxor=function(c){var d,y;this.length>c.length?(d=this,y=c):(d=c,y=this);for(var v=0;v<y.length;v++)this.words[v]=d.words[v]^y.words[v];if(this!==d)for(;v<d.length;v++)this.words[v]=d.words[v];return this.length=d.length,this._strip()},s.prototype.ixor=function(c){return n((this.negative|c.negative)===0),this.iuxor(c)},s.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},s.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},s.prototype.inotn=function(c){n(typeof c=="number"&&c>=0);var d=Math.ceil(c/26)|0,y=c%26;this._expand(d),y>0&&d--;for(var v=0;v<d;v++)this.words[v]=~this.words[v]&67108863;return y>0&&(this.words[v]=~this.words[v]&67108863>>26-y),this._strip()},s.prototype.notn=function(c){return this.clone().inotn(c)},s.prototype.setn=function(c,d){n(typeof c=="number"&&c>=0);var y=c/26|0,v=c%26;return this._expand(y+1),d?this.words[y]=this.words[y]|1<<v:this.words[y]=this.words[y]&~(1<<v),this._strip()},s.prototype.iadd=function(c){var d;if(this.negative!==0&&c.negative===0)return this.negative=0,d=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,d=this.isub(c),c.negative=1,d._normSign();var y,v;this.length>c.length?(y=this,v=c):(y=c,v=this);for(var S=0,x=0;x<v.length;x++)d=(y.words[x]|0)+(v.words[x]|0)+S,this.words[x]=d&67108863,S=d>>>26;for(;S!==0&&x<y.length;x++)d=(y.words[x]|0)+S,this.words[x]=d&67108863,S=d>>>26;if(this.length=y.length,S!==0)this.words[this.length]=S,this.length++;else if(y!==this)for(;x<y.length;x++)this.words[x]=y.words[x];return this},s.prototype.add=function(c){var d;return c.negative!==0&&this.negative===0?(c.negative=0,d=this.sub(c),c.negative^=1,d):c.negative===0&&this.negative!==0?(this.negative=0,d=c.sub(this),this.negative=1,d):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},s.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var d=this.iadd(c);return c.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var y=this.cmp(c);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,S;y>0?(v=this,S=c):(v=c,S=this);for(var x=0,B=0;B<S.length;B++)d=(v.words[B]|0)-(S.words[B]|0)+x,x=d>>26,this.words[B]=d&67108863;for(;x!==0&&B<v.length;B++)d=(v.words[B]|0)+x,x=d>>26,this.words[B]=d&67108863;if(x===0&&B<v.length&&v!==this)for(;B<v.length;B++)this.words[B]=v.words[B];return this.length=Math.max(this.length,B),v!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(c){return this.clone().isub(c)};function k(A,c,d){d.negative=c.negative^A.negative;var y=A.length+c.length|0;d.length=y,y=y-1|0;var v=A.words[0]|0,S=c.words[0]|0,x=v*S,B=x&67108863,b=x/67108864|0;d.words[0]=B;for(var u=1;u<y;u++){for(var R=b>>>26,Q=b&67108863,J=Math.min(u,c.length-1),N=Math.max(0,u-A.length+1);N<=J;N++){var j=u-N|0;v=A.words[j]|0,S=c.words[N]|0,x=v*S+Q,R+=x/67108864|0,Q=x&67108863}d.words[u]=Q|0,b=R|0}return b!==0?d.words[u]=b|0:d.length--,d._strip()}var T=function(c,d,y){var v=c.words,S=d.words,x=y.words,B=0,b,u,R,Q=v[0]|0,J=Q&8191,N=Q>>>13,j=v[1]|0,V=j&8191,Z=j>>>13,ue=v[2]|0,C=ue&8191,M=ue>>>13,q=v[3]|0,G=q&8191,oe=q>>>13,he=v[4]|0,ne=he&8191,we=he>>>13,pt=v[5]|0,Se=pt&8191,Ee=pt>>>13,Qe=v[6]|0,ve=Qe&8191,Re=Qe>>>13,et=v[7]|0,be=et&8191,m=et>>>13,l=v[8]|0,f=l&8191,E=l>>>13,P=v[9]|0,U=P&8191,H=P>>>13,fe=S[0]|0,ae=fe&8191,se=fe>>>13,Ce=S[1]|0,ie=Ce&8191,xe=Ce>>>13,xr=S[2]|0,Ie=xr&8191,Ae=xr>>>13,Ir=S[3]|0,Te=Ir&8191,Ne=Ir>>>13,Ar=S[4]|0,Be=Ar&8191,Le=Ar>>>13,Tr=S[5]|0,Pe=Tr&8191,Oe=Tr>>>13,Nr=S[6]|0,Fe=Nr&8191,De=Nr>>>13,Br=S[7]|0,je=Br&8191,Ue=Br>>>13,Lr=S[8]|0,$e=Lr&8191,He=Lr>>>13,Pr=S[9]|0,We=Pr&8191,Ve=Pr>>>13;y.negative=c.negative^d.negative,y.length=19,b=Math.imul(J,ae),u=Math.imul(J,se),u=u+Math.imul(N,ae)|0,R=Math.imul(N,se);var Qt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul(V,ae),u=Math.imul(V,se),u=u+Math.imul(Z,ae)|0,R=Math.imul(Z,se),b=b+Math.imul(J,ie)|0,u=u+Math.imul(J,xe)|0,u=u+Math.imul(N,ie)|0,R=R+Math.imul(N,xe)|0;var Yt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b=Math.imul(C,ae),u=Math.imul(C,se),u=u+Math.imul(M,ae)|0,R=Math.imul(M,se),b=b+Math.imul(V,ie)|0,u=u+Math.imul(V,xe)|0,u=u+Math.imul(Z,ie)|0,R=R+Math.imul(Z,xe)|0,b=b+Math.imul(J,Ie)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(N,Ie)|0,R=R+Math.imul(N,Ae)|0;var Xt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,b=Math.imul(G,ae),u=Math.imul(G,se),u=u+Math.imul(oe,ae)|0,R=Math.imul(oe,se),b=b+Math.imul(C,ie)|0,u=u+Math.imul(C,xe)|0,u=u+Math.imul(M,ie)|0,R=R+Math.imul(M,xe)|0,b=b+Math.imul(V,Ie)|0,u=u+Math.imul(V,Ae)|0,u=u+Math.imul(Z,Ie)|0,R=R+Math.imul(Z,Ae)|0,b=b+Math.imul(J,Te)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(N,Te)|0,R=R+Math.imul(N,Ne)|0;var er=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(er>>>26)|0,er&=67108863,b=Math.imul(ne,ae),u=Math.imul(ne,se),u=u+Math.imul(we,ae)|0,R=Math.imul(we,se),b=b+Math.imul(G,ie)|0,u=u+Math.imul(G,xe)|0,u=u+Math.imul(oe,ie)|0,R=R+Math.imul(oe,xe)|0,b=b+Math.imul(C,Ie)|0,u=u+Math.imul(C,Ae)|0,u=u+Math.imul(M,Ie)|0,R=R+Math.imul(M,Ae)|0,b=b+Math.imul(V,Te)|0,u=u+Math.imul(V,Ne)|0,u=u+Math.imul(Z,Te)|0,R=R+Math.imul(Z,Ne)|0,b=b+Math.imul(J,Be)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(N,Be)|0,R=R+Math.imul(N,Le)|0;var tr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(Se,ae),u=Math.imul(Se,se),u=u+Math.imul(Ee,ae)|0,R=Math.imul(Ee,se),b=b+Math.imul(ne,ie)|0,u=u+Math.imul(ne,xe)|0,u=u+Math.imul(we,ie)|0,R=R+Math.imul(we,xe)|0,b=b+Math.imul(G,Ie)|0,u=u+Math.imul(G,Ae)|0,u=u+Math.imul(oe,Ie)|0,R=R+Math.imul(oe,Ae)|0,b=b+Math.imul(C,Te)|0,u=u+Math.imul(C,Ne)|0,u=u+Math.imul(M,Te)|0,R=R+Math.imul(M,Ne)|0,b=b+Math.imul(V,Be)|0,u=u+Math.imul(V,Le)|0,u=u+Math.imul(Z,Be)|0,R=R+Math.imul(Z,Le)|0,b=b+Math.imul(J,Pe)|0,u=u+Math.imul(J,Oe)|0,u=u+Math.imul(N,Pe)|0,R=R+Math.imul(N,Oe)|0;var rr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(rr>>>26)|0,rr&=67108863,b=Math.imul(ve,ae),u=Math.imul(ve,se),u=u+Math.imul(Re,ae)|0,R=Math.imul(Re,se),b=b+Math.imul(Se,ie)|0,u=u+Math.imul(Se,xe)|0,u=u+Math.imul(Ee,ie)|0,R=R+Math.imul(Ee,xe)|0,b=b+Math.imul(ne,Ie)|0,u=u+Math.imul(ne,Ae)|0,u=u+Math.imul(we,Ie)|0,R=R+Math.imul(we,Ae)|0,b=b+Math.imul(G,Te)|0,u=u+Math.imul(G,Ne)|0,u=u+Math.imul(oe,Te)|0,R=R+Math.imul(oe,Ne)|0,b=b+Math.imul(C,Be)|0,u=u+Math.imul(C,Le)|0,u=u+Math.imul(M,Be)|0,R=R+Math.imul(M,Le)|0,b=b+Math.imul(V,Pe)|0,u=u+Math.imul(V,Oe)|0,u=u+Math.imul(Z,Pe)|0,R=R+Math.imul(Z,Oe)|0,b=b+Math.imul(J,Fe)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(N,Fe)|0,R=R+Math.imul(N,De)|0;var nr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(nr>>>26)|0,nr&=67108863,b=Math.imul(be,ae),u=Math.imul(be,se),u=u+Math.imul(m,ae)|0,R=Math.imul(m,se),b=b+Math.imul(ve,ie)|0,u=u+Math.imul(ve,xe)|0,u=u+Math.imul(Re,ie)|0,R=R+Math.imul(Re,xe)|0,b=b+Math.imul(Se,Ie)|0,u=u+Math.imul(Se,Ae)|0,u=u+Math.imul(Ee,Ie)|0,R=R+Math.imul(Ee,Ae)|0,b=b+Math.imul(ne,Te)|0,u=u+Math.imul(ne,Ne)|0,u=u+Math.imul(we,Te)|0,R=R+Math.imul(we,Ne)|0,b=b+Math.imul(G,Be)|0,u=u+Math.imul(G,Le)|0,u=u+Math.imul(oe,Be)|0,R=R+Math.imul(oe,Le)|0,b=b+Math.imul(C,Pe)|0,u=u+Math.imul(C,Oe)|0,u=u+Math.imul(M,Pe)|0,R=R+Math.imul(M,Oe)|0,b=b+Math.imul(V,Fe)|0,u=u+Math.imul(V,De)|0,u=u+Math.imul(Z,Fe)|0,R=R+Math.imul(Z,De)|0,b=b+Math.imul(J,je)|0,u=u+Math.imul(J,Ue)|0,u=u+Math.imul(N,je)|0,R=R+Math.imul(N,Ue)|0;var ir=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ir>>>26)|0,ir&=67108863,b=Math.imul(f,ae),u=Math.imul(f,se),u=u+Math.imul(E,ae)|0,R=Math.imul(E,se),b=b+Math.imul(be,ie)|0,u=u+Math.imul(be,xe)|0,u=u+Math.imul(m,ie)|0,R=R+Math.imul(m,xe)|0,b=b+Math.imul(ve,Ie)|0,u=u+Math.imul(ve,Ae)|0,u=u+Math.imul(Re,Ie)|0,R=R+Math.imul(Re,Ae)|0,b=b+Math.imul(Se,Te)|0,u=u+Math.imul(Se,Ne)|0,u=u+Math.imul(Ee,Te)|0,R=R+Math.imul(Ee,Ne)|0,b=b+Math.imul(ne,Be)|0,u=u+Math.imul(ne,Le)|0,u=u+Math.imul(we,Be)|0,R=R+Math.imul(we,Le)|0,b=b+Math.imul(G,Pe)|0,u=u+Math.imul(G,Oe)|0,u=u+Math.imul(oe,Pe)|0,R=R+Math.imul(oe,Oe)|0,b=b+Math.imul(C,Fe)|0,u=u+Math.imul(C,De)|0,u=u+Math.imul(M,Fe)|0,R=R+Math.imul(M,De)|0,b=b+Math.imul(V,je)|0,u=u+Math.imul(V,Ue)|0,u=u+Math.imul(Z,je)|0,R=R+Math.imul(Z,Ue)|0,b=b+Math.imul(J,$e)|0,u=u+Math.imul(J,He)|0,u=u+Math.imul(N,$e)|0,R=R+Math.imul(N,He)|0;var sr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(U,ae),u=Math.imul(U,se),u=u+Math.imul(H,ae)|0,R=Math.imul(H,se),b=b+Math.imul(f,ie)|0,u=u+Math.imul(f,xe)|0,u=u+Math.imul(E,ie)|0,R=R+Math.imul(E,xe)|0,b=b+Math.imul(be,Ie)|0,u=u+Math.imul(be,Ae)|0,u=u+Math.imul(m,Ie)|0,R=R+Math.imul(m,Ae)|0,b=b+Math.imul(ve,Te)|0,u=u+Math.imul(ve,Ne)|0,u=u+Math.imul(Re,Te)|0,R=R+Math.imul(Re,Ne)|0,b=b+Math.imul(Se,Be)|0,u=u+Math.imul(Se,Le)|0,u=u+Math.imul(Ee,Be)|0,R=R+Math.imul(Ee,Le)|0,b=b+Math.imul(ne,Pe)|0,u=u+Math.imul(ne,Oe)|0,u=u+Math.imul(we,Pe)|0,R=R+Math.imul(we,Oe)|0,b=b+Math.imul(G,Fe)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(oe,Fe)|0,R=R+Math.imul(oe,De)|0,b=b+Math.imul(C,je)|0,u=u+Math.imul(C,Ue)|0,u=u+Math.imul(M,je)|0,R=R+Math.imul(M,Ue)|0,b=b+Math.imul(V,$e)|0,u=u+Math.imul(V,He)|0,u=u+Math.imul(Z,$e)|0,R=R+Math.imul(Z,He)|0,b=b+Math.imul(J,We)|0,u=u+Math.imul(J,Ve)|0,u=u+Math.imul(N,We)|0,R=R+Math.imul(N,Ve)|0;var or=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(or>>>26)|0,or&=67108863,b=Math.imul(U,ie),u=Math.imul(U,xe),u=u+Math.imul(H,ie)|0,R=Math.imul(H,xe),b=b+Math.imul(f,Ie)|0,u=u+Math.imul(f,Ae)|0,u=u+Math.imul(E,Ie)|0,R=R+Math.imul(E,Ae)|0,b=b+Math.imul(be,Te)|0,u=u+Math.imul(be,Ne)|0,u=u+Math.imul(m,Te)|0,R=R+Math.imul(m,Ne)|0,b=b+Math.imul(ve,Be)|0,u=u+Math.imul(ve,Le)|0,u=u+Math.imul(Re,Be)|0,R=R+Math.imul(Re,Le)|0,b=b+Math.imul(Se,Pe)|0,u=u+Math.imul(Se,Oe)|0,u=u+Math.imul(Ee,Pe)|0,R=R+Math.imul(Ee,Oe)|0,b=b+Math.imul(ne,Fe)|0,u=u+Math.imul(ne,De)|0,u=u+Math.imul(we,Fe)|0,R=R+Math.imul(we,De)|0,b=b+Math.imul(G,je)|0,u=u+Math.imul(G,Ue)|0,u=u+Math.imul(oe,je)|0,R=R+Math.imul(oe,Ue)|0,b=b+Math.imul(C,$e)|0,u=u+Math.imul(C,He)|0,u=u+Math.imul(M,$e)|0,R=R+Math.imul(M,He)|0,b=b+Math.imul(V,We)|0,u=u+Math.imul(V,Ve)|0,u=u+Math.imul(Z,We)|0,R=R+Math.imul(Z,Ve)|0;var ar=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,b=Math.imul(U,Ie),u=Math.imul(U,Ae),u=u+Math.imul(H,Ie)|0,R=Math.imul(H,Ae),b=b+Math.imul(f,Te)|0,u=u+Math.imul(f,Ne)|0,u=u+Math.imul(E,Te)|0,R=R+Math.imul(E,Ne)|0,b=b+Math.imul(be,Be)|0,u=u+Math.imul(be,Le)|0,u=u+Math.imul(m,Be)|0,R=R+Math.imul(m,Le)|0,b=b+Math.imul(ve,Pe)|0,u=u+Math.imul(ve,Oe)|0,u=u+Math.imul(Re,Pe)|0,R=R+Math.imul(Re,Oe)|0,b=b+Math.imul(Se,Fe)|0,u=u+Math.imul(Se,De)|0,u=u+Math.imul(Ee,Fe)|0,R=R+Math.imul(Ee,De)|0,b=b+Math.imul(ne,je)|0,u=u+Math.imul(ne,Ue)|0,u=u+Math.imul(we,je)|0,R=R+Math.imul(we,Ue)|0,b=b+Math.imul(G,$e)|0,u=u+Math.imul(G,He)|0,u=u+Math.imul(oe,$e)|0,R=R+Math.imul(oe,He)|0,b=b+Math.imul(C,We)|0,u=u+Math.imul(C,Ve)|0,u=u+Math.imul(M,We)|0,R=R+Math.imul(M,Ve)|0;var cr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,b=Math.imul(U,Te),u=Math.imul(U,Ne),u=u+Math.imul(H,Te)|0,R=Math.imul(H,Ne),b=b+Math.imul(f,Be)|0,u=u+Math.imul(f,Le)|0,u=u+Math.imul(E,Be)|0,R=R+Math.imul(E,Le)|0,b=b+Math.imul(be,Pe)|0,u=u+Math.imul(be,Oe)|0,u=u+Math.imul(m,Pe)|0,R=R+Math.imul(m,Oe)|0,b=b+Math.imul(ve,Fe)|0,u=u+Math.imul(ve,De)|0,u=u+Math.imul(Re,Fe)|0,R=R+Math.imul(Re,De)|0,b=b+Math.imul(Se,je)|0,u=u+Math.imul(Se,Ue)|0,u=u+Math.imul(Ee,je)|0,R=R+Math.imul(Ee,Ue)|0,b=b+Math.imul(ne,$e)|0,u=u+Math.imul(ne,He)|0,u=u+Math.imul(we,$e)|0,R=R+Math.imul(we,He)|0,b=b+Math.imul(G,We)|0,u=u+Math.imul(G,Ve)|0,u=u+Math.imul(oe,We)|0,R=R+Math.imul(oe,Ve)|0;var lr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,b=Math.imul(U,Be),u=Math.imul(U,Le),u=u+Math.imul(H,Be)|0,R=Math.imul(H,Le),b=b+Math.imul(f,Pe)|0,u=u+Math.imul(f,Oe)|0,u=u+Math.imul(E,Pe)|0,R=R+Math.imul(E,Oe)|0,b=b+Math.imul(be,Fe)|0,u=u+Math.imul(be,De)|0,u=u+Math.imul(m,Fe)|0,R=R+Math.imul(m,De)|0,b=b+Math.imul(ve,je)|0,u=u+Math.imul(ve,Ue)|0,u=u+Math.imul(Re,je)|0,R=R+Math.imul(Re,Ue)|0,b=b+Math.imul(Se,$e)|0,u=u+Math.imul(Se,He)|0,u=u+Math.imul(Ee,$e)|0,R=R+Math.imul(Ee,He)|0,b=b+Math.imul(ne,We)|0,u=u+Math.imul(ne,Ve)|0,u=u+Math.imul(we,We)|0,R=R+Math.imul(we,Ve)|0;var ur=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,b=Math.imul(U,Pe),u=Math.imul(U,Oe),u=u+Math.imul(H,Pe)|0,R=Math.imul(H,Oe),b=b+Math.imul(f,Fe)|0,u=u+Math.imul(f,De)|0,u=u+Math.imul(E,Fe)|0,R=R+Math.imul(E,De)|0,b=b+Math.imul(be,je)|0,u=u+Math.imul(be,Ue)|0,u=u+Math.imul(m,je)|0,R=R+Math.imul(m,Ue)|0,b=b+Math.imul(ve,$e)|0,u=u+Math.imul(ve,He)|0,u=u+Math.imul(Re,$e)|0,R=R+Math.imul(Re,He)|0,b=b+Math.imul(Se,We)|0,u=u+Math.imul(Se,Ve)|0,u=u+Math.imul(Ee,We)|0,R=R+Math.imul(Ee,Ve)|0;var Cs=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Cs>>>26)|0,Cs&=67108863,b=Math.imul(U,Fe),u=Math.imul(U,De),u=u+Math.imul(H,Fe)|0,R=Math.imul(H,De),b=b+Math.imul(f,je)|0,u=u+Math.imul(f,Ue)|0,u=u+Math.imul(E,je)|0,R=R+Math.imul(E,Ue)|0,b=b+Math.imul(be,$e)|0,u=u+Math.imul(be,He)|0,u=u+Math.imul(m,$e)|0,R=R+Math.imul(m,He)|0,b=b+Math.imul(ve,We)|0,u=u+Math.imul(ve,Ve)|0,u=u+Math.imul(Re,We)|0,R=R+Math.imul(Re,Ve)|0;var Ms=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Ms>>>26)|0,Ms&=67108863,b=Math.imul(U,je),u=Math.imul(U,Ue),u=u+Math.imul(H,je)|0,R=Math.imul(H,Ue),b=b+Math.imul(f,$e)|0,u=u+Math.imul(f,He)|0,u=u+Math.imul(E,$e)|0,R=R+Math.imul(E,He)|0,b=b+Math.imul(be,We)|0,u=u+Math.imul(be,Ve)|0,u=u+Math.imul(m,We)|0,R=R+Math.imul(m,Ve)|0;var ks=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ks>>>26)|0,ks&=67108863,b=Math.imul(U,$e),u=Math.imul(U,He),u=u+Math.imul(H,$e)|0,R=Math.imul(H,He),b=b+Math.imul(f,We)|0,u=u+Math.imul(f,Ve)|0,u=u+Math.imul(E,We)|0,R=R+Math.imul(E,Ve)|0;var xs=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(xs>>>26)|0,xs&=67108863,b=Math.imul(U,We),u=Math.imul(U,Ve),u=u+Math.imul(H,We)|0,R=Math.imul(H,Ve);var Is=(B+b|0)+((u&8191)<<13)|0;return B=(R+(u>>>13)|0)+(Is>>>26)|0,Is&=67108863,x[0]=Qt,x[1]=Yt,x[2]=Xt,x[3]=er,x[4]=tr,x[5]=rr,x[6]=nr,x[7]=ir,x[8]=sr,x[9]=or,x[10]=ar,x[11]=cr,x[12]=lr,x[13]=ur,x[14]=Cs,x[15]=Ms,x[16]=ks,x[17]=xs,x[18]=Is,B!==0&&(x[19]=B,y.length++),y};Math.imul||(T=k);function L(A,c,d){d.negative=c.negative^A.negative,d.length=A.length+c.length;for(var y=0,v=0,S=0;S<d.length-1;S++){var x=v;v=0;for(var B=y&67108863,b=Math.min(S,c.length-1),u=Math.max(0,S-A.length+1);u<=b;u++){var R=S-u,Q=A.words[R]|0,J=c.words[u]|0,N=Q*J,j=N&67108863;x=x+(N/67108864|0)|0,j=j+B|0,B=j&67108863,x=x+(j>>>26)|0,v+=x>>>26,x&=67108863}d.words[S]=B,y=x,x=v}return y!==0?d.words[S]=y:d.length--,d._strip()}function W(A,c,d){return L(A,c,d)}s.prototype.mulTo=function(c,d){var y,v=this.length+c.length;return this.length===10&&c.length===10?y=T(this,c,d):v<63?y=k(this,c,d):v<1024?y=L(this,c,d):y=W(this,c,d),y},s.prototype.mul=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),this.mulTo(c,d)},s.prototype.mulf=function(c){var d=new s(null);return d.words=new Array(this.length+c.length),W(this,c,d)},s.prototype.imul=function(c){return this.clone().mulTo(c,this)},s.prototype.imuln=function(c){var d=c<0;d&&(c=-c),n(typeof c=="number"),n(c<67108864);for(var y=0,v=0;v<this.length;v++){var S=(this.words[v]|0)*c,x=(S&67108863)+(y&67108863);y>>=26,y+=S/67108864|0,y+=x>>>26,this.words[v]=x&67108863}return y!==0&&(this.words[v]=y,this.length++),this.length=c===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(c){return this.clone().imuln(c)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(c){var d=O(c);if(d.length===0)return new s(1);for(var y=this,v=0;v<d.length&&d[v]===0;v++,y=y.sqr());if(++v<d.length)for(var S=y.sqr();v<d.length;v++,S=S.sqr())d[v]!==0&&(y=y.mul(S));return y},s.prototype.iushln=function(c){n(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,v=67108863>>>26-d<<26-d,S;if(d!==0){var x=0;for(S=0;S<this.length;S++){var B=this.words[S]&v,b=(this.words[S]|0)-B<<d;this.words[S]=b|x,x=B>>>26-d}x&&(this.words[S]=x,this.length++)}if(y!==0){for(S=this.length-1;S>=0;S--)this.words[S+y]=this.words[S];for(S=0;S<y;S++)this.words[S]=0;this.length+=y}return this._strip()},s.prototype.ishln=function(c){return n(this.negative===0),this.iushln(c)},s.prototype.iushrn=function(c,d,y){n(typeof c=="number"&&c>=0);var v;d?v=(d-d%26)/26:v=0;var S=c%26,x=Math.min((c-S)/26,this.length),B=67108863^67108863>>>S<<S,b=y;if(v-=x,v=Math.max(0,v),b){for(var u=0;u<x;u++)b.words[u]=this.words[u];b.length=x}if(x!==0)if(this.length>x)for(this.length-=x,u=0;u<this.length;u++)this.words[u]=this.words[u+x];else this.words[0]=0,this.length=1;var R=0;for(u=this.length-1;u>=0&&(R!==0||u>=v);u--){var Q=this.words[u]|0;this.words[u]=R<<26-S|Q>>>S,R=Q&B}return b&&R!==0&&(b.words[b.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(c,d,y){return n(this.negative===0),this.iushrn(c,d,y)},s.prototype.shln=function(c){return this.clone().ishln(c)},s.prototype.ushln=function(c){return this.clone().iushln(c)},s.prototype.shrn=function(c){return this.clone().ishrn(c)},s.prototype.ushrn=function(c){return this.clone().iushrn(c)},s.prototype.testn=function(c){n(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26,v=1<<d;if(this.length<=y)return!1;var S=this.words[y];return!!(S&v)},s.prototype.imaskn=function(c){n(typeof c=="number"&&c>=0);var d=c%26,y=(c-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0&&y++,this.length=Math.min(y,this.length),d!==0){var v=67108863^67108863>>>d<<d;this.words[this.length-1]&=v}return this._strip()},s.prototype.maskn=function(c){return this.clone().imaskn(c)},s.prototype.iaddn=function(c){return n(typeof c=="number"),n(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},s.prototype._iaddn=function(c){this.words[0]+=c;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(c){if(n(typeof c=="number"),n(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(c){return this.clone().iaddn(c)},s.prototype.subn=function(c){return this.clone().isubn(c)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(c,d,y){var v=c.length+y,S;this._expand(v);var x,B=0;for(S=0;S<c.length;S++){x=(this.words[S+y]|0)+B;var b=(c.words[S]|0)*d;x-=b&67108863,B=(x>>26)-(b/67108864|0),this.words[S+y]=x&67108863}for(;S<this.length-y;S++)x=(this.words[S+y]|0)+B,B=x>>26,this.words[S+y]=x&67108863;if(B===0)return this._strip();for(n(B===-1),B=0,S=0;S<this.length;S++)x=-(this.words[S]|0)+B,B=x>>26,this.words[S]=x&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(c,d){var y=this.length-c.length,v=this.clone(),S=c,x=S.words[S.length-1]|0,B=this._countBits(x);y=26-B,y!==0&&(S=S.ushln(y),v.iushln(y),x=S.words[S.length-1]|0);var b=v.length-S.length,u;if(d!=="mod"){u=new s(null),u.length=b+1,u.words=new Array(u.length);for(var R=0;R<u.length;R++)u.words[R]=0}var Q=v.clone()._ishlnsubmul(S,1,b);Q.negative===0&&(v=Q,u&&(u.words[b]=1));for(var J=b-1;J>=0;J--){var N=(v.words[S.length+J]|0)*67108864+(v.words[S.length+J-1]|0);for(N=Math.min(N/x|0,67108863),v._ishlnsubmul(S,N,J);v.negative!==0;)N--,v.negative=0,v._ishlnsubmul(S,1,J),v.isZero()||(v.negative^=1);u&&(u.words[J]=N)}return u&&u._strip(),v._strip(),d!=="div"&&y!==0&&v.iushrn(y),{div:u||null,mod:v}},s.prototype.divmod=function(c,d,y){if(n(!c.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var v,S,x;return this.negative!==0&&c.negative===0?(x=this.neg().divmod(c,d),d!=="mod"&&(v=x.div.neg()),d!=="div"&&(S=x.mod.neg(),y&&S.negative!==0&&S.iadd(c)),{div:v,mod:S}):this.negative===0&&c.negative!==0?(x=this.divmod(c.neg(),d),d!=="mod"&&(v=x.div.neg()),{div:v,mod:x.mod}):this.negative&c.negative?(x=this.neg().divmod(c.neg(),d),d!=="div"&&(S=x.mod.neg(),y&&S.negative!==0&&S.isub(c)),{div:x.div,mod:S}):c.length>this.length||this.cmp(c)<0?{div:new s(0),mod:this}:c.length===1?d==="div"?{div:this.divn(c.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new s(this.modrn(c.words[0]))}:this._wordDiv(c,d)},s.prototype.div=function(c){return this.divmod(c,"div",!1).div},s.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},s.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},s.prototype.divRound=function(c){var d=this.divmod(c);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(c):d.mod,v=c.ushrn(1),S=c.andln(1),x=y.cmp(v);return x<0||S===1&&x===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(c){var d=c<0;d&&(c=-c),n(c<=67108863);for(var y=(1<<26)%c,v=0,S=this.length-1;S>=0;S--)v=(y*v+(this.words[S]|0))%c;return d?-v:v},s.prototype.modn=function(c){return this.modrn(c)},s.prototype.idivn=function(c){var d=c<0;d&&(c=-c),n(c<=67108863);for(var y=0,v=this.length-1;v>=0;v--){var S=(this.words[v]|0)+y*67108864;this.words[v]=S/c|0,y=S%c}return this._strip(),d?this.ineg():this},s.prototype.divn=function(c){return this.clone().idivn(c)},s.prototype.egcd=function(c){n(c.negative===0),n(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new s(1),S=new s(0),x=new s(0),B=new s(1),b=0;d.isEven()&&y.isEven();)d.iushrn(1),y.iushrn(1),++b;for(var u=y.clone(),R=d.clone();!d.isZero();){for(var Q=0,J=1;!(d.words[0]&J)&&Q<26;++Q,J<<=1);if(Q>0)for(d.iushrn(Q);Q-- >0;)(v.isOdd()||S.isOdd())&&(v.iadd(u),S.isub(R)),v.iushrn(1),S.iushrn(1);for(var N=0,j=1;!(y.words[0]&j)&&N<26;++N,j<<=1);if(N>0)for(y.iushrn(N);N-- >0;)(x.isOdd()||B.isOdd())&&(x.iadd(u),B.isub(R)),x.iushrn(1),B.iushrn(1);d.cmp(y)>=0?(d.isub(y),v.isub(x),S.isub(B)):(y.isub(d),x.isub(v),B.isub(S))}return{a:x,b:B,gcd:y.iushln(b)}},s.prototype._invmp=function(c){n(c.negative===0),n(!c.isZero());var d=this,y=c.clone();d.negative!==0?d=d.umod(c):d=d.clone();for(var v=new s(1),S=new s(0),x=y.clone();d.cmpn(1)>0&&y.cmpn(1)>0;){for(var B=0,b=1;!(d.words[0]&b)&&B<26;++B,b<<=1);if(B>0)for(d.iushrn(B);B-- >0;)v.isOdd()&&v.iadd(x),v.iushrn(1);for(var u=0,R=1;!(y.words[0]&R)&&u<26;++u,R<<=1);if(u>0)for(y.iushrn(u);u-- >0;)S.isOdd()&&S.iadd(x),S.iushrn(1);d.cmp(y)>=0?(d.isub(y),v.isub(S)):(y.isub(d),S.isub(v))}var Q;return d.cmpn(1)===0?Q=v:Q=S,Q.cmpn(0)<0&&Q.iadd(c),Q},s.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var d=this.clone(),y=c.clone();d.negative=0,y.negative=0;for(var v=0;d.isEven()&&y.isEven();v++)d.iushrn(1),y.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;y.isEven();)y.iushrn(1);var S=d.cmp(y);if(S<0){var x=d;d=y,y=x}else if(S===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(v)},s.prototype.invm=function(c){return this.egcd(c).a.umod(c)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(c){return this.words[0]&c},s.prototype.bincn=function(c){n(typeof c=="number");var d=c%26,y=(c-d)/26,v=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=v,this;for(var S=v,x=y;S!==0&&x<this.length;x++){var B=this.words[x]|0;B+=S,S=B>>>26,B&=67108863,this.words[x]=B}return S!==0&&(this.words[x]=S,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(c){var d=c<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{d&&(c=-c),n(c<=67108863,"Number is too big");var v=this.words[0]|0;y=v===c?0:v<c?-1:1}return this.negative!==0?-y|0:y},s.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var d=this.ucmp(c);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var d=0,y=this.length-1;y>=0;y--){var v=this.words[y]|0,S=c.words[y]|0;if(v!==S){v<S?d=-1:v>S&&(d=1);break}}return d},s.prototype.gtn=function(c){return this.cmpn(c)===1},s.prototype.gt=function(c){return this.cmp(c)===1},s.prototype.gten=function(c){return this.cmpn(c)>=0},s.prototype.gte=function(c){return this.cmp(c)>=0},s.prototype.ltn=function(c){return this.cmpn(c)===-1},s.prototype.lt=function(c){return this.cmp(c)===-1},s.prototype.lten=function(c){return this.cmpn(c)<=0},s.prototype.lte=function(c){return this.cmp(c)<=0},s.prototype.eqn=function(c){return this.cmpn(c)===0},s.prototype.eq=function(c){return this.cmp(c)===0},s.red=function(c){return new re(c)},s.prototype.toRed=function(c){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(c){return this.red=c,this},s.prototype.forceRed=function(c){return n(!this.red,"Already a number in reduction context"),this._forceRed(c)},s.prototype.redAdd=function(c){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},s.prototype.redIAdd=function(c){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},s.prototype.redSub=function(c){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},s.prototype.redISub=function(c){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},s.prototype.redShl=function(c){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},s.prototype.redMul=function(c){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},s.prototype.redIMul=function(c){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(c){return n(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var $={k256:null,p224:null,p192:null,p25519:null};function z(A,c){this.name=A,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var c=new s(null);return c.words=new Array(Math.ceil(this.n/13)),c},z.prototype.ireduce=function(c){var d=c,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var v=y<this.n?-1:d.ucmp(this.p);return v===0?(d.words[0]=0,d.length=1):v>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},z.prototype.split=function(c,d){c.iushrn(this.n,0,d)},z.prototype.imulK=function(c){return c.imul(this.k)};function ee(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(ee,z),ee.prototype.split=function(c,d){for(var y=4194303,v=Math.min(c.length,9),S=0;S<v;S++)d.words[S]=c.words[S];if(d.length=v,c.length<=9){c.words[0]=0,c.length=1;return}var x=c.words[9];for(d.words[d.length++]=x&y,S=10;S<c.length;S++){var B=c.words[S]|0;c.words[S-10]=(B&y)<<4|x>>>22,x=B}x>>>=22,c.words[S-10]=x,x===0&&c.length>10?c.length-=10:c.length-=9},ee.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var d=0,y=0;y<c.length;y++){var v=c.words[y]|0;d+=v*977,c.words[y]=d&67108863,d=v*64+(d/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function Y(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Y,z);function K(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(K,z);function de(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(de,z),de.prototype.imulK=function(c){for(var d=0,y=0;y<c.length;y++){var v=(c.words[y]|0)*19+d,S=v&67108863;v>>>=26,c.words[y]=S,d=v}return d!==0&&(c.words[c.length++]=d),c},s._prime=function(c){if($[c])return $[c];var d;if(c==="k256")d=new ee;else if(c==="p224")d=new Y;else if(c==="p192")d=new K;else if(c==="p25519")d=new de;else throw new Error("Unknown prime "+c);return $[c]=d,d};function re(A){if(typeof A=="string"){var c=s._prime(A);this.m=c.p,this.prime=c}else n(A.gtn(1),"modulus must be greater than 1"),this.m=A,this.prime=null}re.prototype._verify1=function(c){n(c.negative===0,"red works only with positives"),n(c.red,"red works only with red numbers")},re.prototype._verify2=function(c,d){n((c.negative|d.negative)===0,"red works only with positives"),n(c.red&&c.red===d.red,"red works only with red numbers")},re.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(g(c,c.umod(this.m)._forceRed(this)),c)},re.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},re.prototype.add=function(c,d){this._verify2(c,d);var y=c.add(d);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},re.prototype.iadd=function(c,d){this._verify2(c,d);var y=c.iadd(d);return y.cmp(this.m)>=0&&y.isub(this.m),y},re.prototype.sub=function(c,d){this._verify2(c,d);var y=c.sub(d);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},re.prototype.isub=function(c,d){this._verify2(c,d);var y=c.isub(d);return y.cmpn(0)<0&&y.iadd(this.m),y},re.prototype.shl=function(c,d){return this._verify1(c),this.imod(c.ushln(d))},re.prototype.imul=function(c,d){return this._verify2(c,d),this.imod(c.imul(d))},re.prototype.mul=function(c,d){return this._verify2(c,d),this.imod(c.mul(d))},re.prototype.isqr=function(c){return this.imul(c,c.clone())},re.prototype.sqr=function(c){return this.mul(c,c)},re.prototype.sqrt=function(c){if(c.isZero())return c.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var y=this.m.add(new s(1)).iushrn(2);return this.pow(c,y)}for(var v=this.m.subn(1),S=0;!v.isZero()&&v.andln(1)===0;)S++,v.iushrn(1);n(!v.isZero());var x=new s(1).toRed(this),B=x.redNeg(),b=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,b).cmp(B)!==0;)u.redIAdd(B);for(var R=this.pow(u,v),Q=this.pow(c,v.addn(1).iushrn(1)),J=this.pow(c,v),N=S;J.cmp(x)!==0;){for(var j=J,V=0;j.cmp(x)!==0;V++)j=j.redSqr();n(V<N);var Z=this.pow(R,new s(1).iushln(N-V-1));Q=Q.redMul(Z),R=Z.redSqr(),J=J.redMul(R),N=V}return Q},re.prototype.invm=function(c){var d=c._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},re.prototype.pow=function(c,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return c.clone();var y=4,v=new Array(1<<y);v[0]=new s(1).toRed(this),v[1]=c;for(var S=2;S<v.length;S++)v[S]=this.mul(v[S-1],c);var x=v[0],B=0,b=0,u=d.bitLength()%26;for(u===0&&(u=26),S=d.length-1;S>=0;S--){for(var R=d.words[S],Q=u-1;Q>=0;Q--){var J=R>>Q&1;if(x!==v[0]&&(x=this.sqr(x)),J===0&&B===0){b=0;continue}B<<=1,B|=J,b++,!(b!==y&&(S!==0||Q!==0))&&(x=this.mul(x,v[B]),b=0,B=0)}u=26}return x},re.prototype.convertTo=function(c){var d=c.umod(this.m);return d===c?d.clone():d},re.prototype.convertFrom=function(c){var d=c.clone();return d.red=null,d},s.mont=function(c){return new ce(c)};function ce(A){re.call(this,A),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ce,re),ce.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},ce.prototype.convertFrom=function(c){var d=this.imod(c.mul(this.rinv));return d.red=null,d},ce.prototype.imul=function(c,d){if(c.isZero()||d.isZero())return c.words[0]=0,c.length=1,c;var y=c.imul(d),v=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=y.isub(v).iushrn(this.shift),x=S;return S.cmp(this.m)>=0?x=S.isub(this.m):S.cmpn(0)<0&&(x=S.iadd(this.m)),x._forceRed(this)},ce.prototype.mul=function(c,d){if(c.isZero()||d.isZero())return new s(0)._forceRed(this);var y=c.mul(d),v=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=y.isub(v).iushrn(this.shift),x=S;return S.cmp(this.m)>=0?x=S.isub(this.m):S.cmpn(0)<0&&(x=S.iadd(this.m)),x._forceRed(this)},ce.prototype.invm=function(c){var d=this.imod(c._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,te)})(Bo);var Ni=Bo.exports,Mn={},$t={};Object.defineProperty($t,"__esModule",{value:!0});$t.errorValues=$t.standardErrorCodes=void 0;$t.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};$t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Bi={},Li={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=$t,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(w,I=r){if(w&&Number.isInteger(w)){const D=w.toString();if(g(t.errorValues,D))return t.errorValues[D].message;if(h(w))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return I}e.getMessageFromCode=n;function i(w){if(!Number.isInteger(w))return!1;const I=w.toString();return!!(t.errorValues[I]||h(w))}e.isValidCode=i;function s(w){var I;if(typeof w=="number")return w;if(a(w))return(I=w.code)!==null&&I!==void 0?I:w.errorCode}e.getErrorCode=s;function a(w){return typeof w=="object"&&w!==null&&(typeof w.code=="number"||typeof w.errorCode=="number")}function o(w,{shouldIncludeStack:I=!1}={}){const D={};if(w&&typeof w=="object"&&!Array.isArray(w)&&g(w,"code")&&i(w.code)){const F=w;D.code=F.code,F.message&&typeof F.message=="string"?(D.message=F.message,g(F,"data")&&(D.data=F.data)):(D.message=n(D.code),D.data={originalError:p(w)})}else D.code=t.standardErrorCodes.rpc.internal,D.message=_(w,"message")?w.message:r,D.data={originalError:p(w)};return I&&(D.stack=_(w,"stack")?w.stack:void 0),D}e.serialize=o;function h(w){return w>=-32099&&w<=-32e3}function p(w){return w&&typeof w=="object"&&!Array.isArray(w)?Object.assign({},w):w}function g(w,I){return Object.prototype.hasOwnProperty.call(w,I)}function _(w,I){return typeof w=="object"&&w!==null&&I in w&&typeof w[I]=="string"}})(Li);Object.defineProperty(Bi,"__esModule",{value:!0});Bi.standardErrors=void 0;const nt=$t,nl=Li;Bi.standardErrors={rpc:{parse:e=>gt(nt.standardErrorCodes.rpc.parse,e),invalidRequest:e=>gt(nt.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>gt(nt.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>gt(nt.standardErrorCodes.rpc.methodNotFound,e),internal:e=>gt(nt.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return gt(t,e)},invalidInput:e=>gt(nt.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>gt(nt.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>gt(nt.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>gt(nt.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>gt(nt.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>gt(nt.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Or(nt.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Or(nt.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Or(nt.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Or(nt.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Or(nt.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Or(nt.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ol(t,r,n)}}};function gt(e,t){const[r,n]=il(t);return new sl(e,r||(0,nl.getMessageFromCode)(e),n)}function Or(e,t){const[r,n]=il(t);return new ol(e,r||(0,nl.getMessageFromCode)(e),n)}function il(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let sl=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},ol=class extends sl{constructor(t,r,n){if(!hf(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function hf(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Pi={},on={};Object.defineProperty(on,"__esModule",{value:!0});on.isErrorResponse=void 0;function ff(e){return e.errorMessage!==void 0}on.isErrorResponse=ff;var an={};Object.defineProperty(an,"__esModule",{value:!0});an.LIB_VERSION=void 0;an.LIB_VERSION="3.9.3";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.serializeError=void 0;const df=on,pf=an,gf=$t,_f=Li;function mf(e,t){const r=(0,_f.serialize)(yf(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",pf.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=wf(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Pi.serializeError=mf;function yf(e){return typeof e=="string"?{message:e,code:gf.standardErrorCodes.rpc.internal}:(0,df.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function wf(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=$t;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Bi;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Pi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Li;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Mn);var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ProviderType=Ye.RegExpString=Ye.IntNumber=Ye.BigIntString=Ye.AddressString=Ye.HexString=Ye.OpaqueType=void 0;function kn(){return e=>e}Ye.OpaqueType=kn;Ye.HexString=kn();Ye.AddressString=kn();Ye.BigIntString=kn();function vf(e){return Math.floor(e)}Ye.IntNumber=vf;Ye.RegExpString=kn();var va;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(va||(Ye.ProviderType=va={}));var bf=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.isMobileWeb=X.getLocation=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 Gt=bf(Ni),Sr=Mn,vt=Ye,al=/^[0-9]*$/,cl=/^[a-f0-9]*$/;function Ef(e){return ll(crypto.getRandomValues(new Uint8Array(e)))}X.randomBytesHex=Ef;function ll(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=ll;function Sf(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}X.hexStringToUint8Array=Sf;function Rf(e,t=!1){const r=e.toString("hex");return(0,vt.HexString)(t?`0x${r}`:r)}X.hexStringFromBuffer=Rf;function Cf(e){return(0,vt.BigIntString)(e.toString(10))}X.bigIntStringFromBN=Cf;function Mf(e){return(0,vt.IntNumber)(new Gt.default(In(e,!1),16).toNumber())}X.intNumberFromHexString=Mf;function kf(e){return(0,vt.HexString)(`0x${new Gt.default(e).toString(16)}`)}X.hexStringFromIntNumber=kf;function Lo(e){return e.startsWith("0x")||e.startsWith("0X")}X.has0xPrefix=Lo;function Oi(e){return Lo(e)?e.slice(2):e}X.strip0x=Oi;function ul(e){return Lo(e)?`0x${e.slice(2)}`:`0x${e}`}X.prepend0x=ul;function xn(e){if(typeof e!="string")return!1;const t=Oi(e).toLowerCase();return cl.test(t)}X.isHexString=xn;function hl(e,t=!1){if(typeof e=="string"){const r=Oi(e).toLowerCase();if(cl.test(r))return(0,vt.HexString)(t?`0x${r}`:r)}throw Sr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}X.ensureHexString=hl;function In(e,t=!1){let r=hl(e,!1);return r.length%2===1&&(r=(0,vt.HexString)(`0${r}`)),t?(0,vt.HexString)(`0x${r}`):r}X.ensureEvenLengthHexString=In;function xf(e){if(typeof e=="string"){const t=Oi(e).toLowerCase();if(xn(t)&&t.length===40)return(0,vt.AddressString)(ul(t))}throw Sr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}X.ensureAddressString=xf;function If(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(xn(e)){const t=In(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw Sr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}X.ensureBuffer=If;function fl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,vt.IntNumber)(e);if(typeof e=="string"){if(al.test(e))return(0,vt.IntNumber)(Number(e));if(xn(e))return(0,vt.IntNumber)(new Gt.default(In(e,!1),16).toNumber())}throw Sr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureIntNumber=fl;function Af(e){if(e instanceof RegExp)return(0,vt.RegExpString)(e.toString());throw Sr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}X.ensureRegExpString=Af;function Tf(e){if(e!==null&&(Gt.default.isBN(e)||dl(e)))return new Gt.default(e.toString(10),10);if(typeof e=="number")return new Gt.default(fl(e));if(typeof e=="string"){if(al.test(e))return new Gt.default(e,10);if(xn(e))return new Gt.default(In(e,!1),16)}throw Sr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureBN=Tf;function Nf(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw Sr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}X.ensureParsedJSONObject=Nf;function dl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}X.isBigNumber=dl;function Bf(e,t){return Array.from({length:t-e},(r,n)=>e+n)}X.range=Bf;function Lf(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}X.getFavicon=Lf;function Pf(e,t,r,n,i,s){const a=n?"parent-id":"id",o=new URLSearchParams({[a]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${o}`}X.createQrUrl=Pf;function pl(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=pl;function Of(){try{return pl()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=Of;function Ff(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}X.isMobileWeb=Ff;var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ScopedLocalStorage=void 0;class Df{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Fi.ScopedLocalStorage=Df;var Zr={},gl={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(h,p,g){this.fn=h,this.context=p,this.once=g||!1}function s(h,p,g,_,w){if(typeof g!="function")throw new TypeError("The listener must be a function");var I=new i(g,_||h,w),D=r?r+p:p;return h._events[D]?h._events[D].fn?h._events[D]=[h._events[D],I]:h._events[D].push(I):(h._events[D]=I,h._eventsCount++),h}function a(h,p){--h._eventsCount===0?h._events=new n:delete h._events[p]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var p=[],g,_;if(this._eventsCount===0)return p;for(_ in g=this._events)t.call(g,_)&&p.push(r?_.slice(1):_);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(g)):p},o.prototype.listeners=function(p){var g=r?r+p:p,_=this._events[g];if(!_)return[];if(_.fn)return[_.fn];for(var w=0,I=_.length,D=new Array(I);w<I;w++)D[w]=_[w].fn;return D},o.prototype.listenerCount=function(p){var g=r?r+p:p,_=this._events[g];return _?_.fn?1:_.length:0},o.prototype.emit=function(p,g,_,w,I,D){var F=r?r+p:p;if(!this._events[F])return!1;var O=this._events[F],k=arguments.length,T,L;if(O.fn){switch(O.once&&this.removeListener(p,O.fn,void 0,!0),k){case 1:return O.fn.call(O.context),!0;case 2:return O.fn.call(O.context,g),!0;case 3:return O.fn.call(O.context,g,_),!0;case 4:return O.fn.call(O.context,g,_,w),!0;case 5:return O.fn.call(O.context,g,_,w,I),!0;case 6:return O.fn.call(O.context,g,_,w,I,D),!0}for(L=1,T=new Array(k-1);L<k;L++)T[L-1]=arguments[L];O.fn.apply(O.context,T)}else{var W=O.length,$;for(L=0;L<W;L++)switch(O[L].once&&this.removeListener(p,O[L].fn,void 0,!0),k){case 1:O[L].fn.call(O[L].context);break;case 2:O[L].fn.call(O[L].context,g);break;case 3:O[L].fn.call(O[L].context,g,_);break;case 4:O[L].fn.call(O[L].context,g,_,w);break;default:if(!T)for($=1,T=new Array(k-1);$<k;$++)T[$-1]=arguments[$];O[L].fn.apply(O[L].context,T)}}return!0},o.prototype.on=function(p,g,_){return s(this,p,g,_,!1)},o.prototype.once=function(p,g,_){return s(this,p,g,_,!0)},o.prototype.removeListener=function(p,g,_,w){var I=r?r+p:p;if(!this._events[I])return this;if(!g)return a(this,I),this;var D=this._events[I];if(D.fn)D.fn===g&&(!w||D.once)&&(!_||D.context===_)&&a(this,I);else{for(var F=0,O=[],k=D.length;F<k;F++)(D[F].fn!==g||w&&!D[F].once||_&&D[F].context!==_)&&O.push(D[F]);O.length?this._events[I]=O.length===1?O[0]:O:a(this,I)}return this},o.prototype.removeAllListeners=function(p){var g;return p?(g=r?r+p:p,this._events[g]&&a(this,g)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(gl);var jf=gl.exports,An={},Tn={},cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.EVENTS=void 0;cn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.RelayAbstract=wt.APP_VERSION_KEY=wt.LOCAL_STORAGE_ADDRESSES_KEY=wt.WALLET_USER_NAME_KEY=void 0;const ba=Mn;wt.WALLET_USER_NAME_KEY="walletUsername";wt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";wt.APP_VERSION_KEY="AppVersion";class Uf{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw ba.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,ba.serializeError)(s,t.method);return i})}}wt.RelayAbstract=Uf;var ln={},_l={exports:{}},po={exports:{}},Nn={},Di={};Di.byteLength=Wf;Di.toByteArray=zf;Di.fromByteArray=Jf;var Bt=[],yt=[],$f=typeof Uint8Array<"u"?Uint8Array:Array,Ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Fr=0,Hf=Ns.length;Fr<Hf;++Fr)Bt[Fr]=Ns[Fr],yt[Ns.charCodeAt(Fr)]=Fr;yt[45]=62;yt[95]=63;function ml(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Wf(e){var t=ml(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Vf(e,t,r){return(t+r)*3/4-r}function zf(e){var t,r=ml(e),n=r[0],i=r[1],s=new $f(Vf(e,n,i)),a=0,o=i>0?n-4:n,h;for(h=0;h<o;h+=4)t=yt[e.charCodeAt(h)]<<18|yt[e.charCodeAt(h+1)]<<12|yt[e.charCodeAt(h+2)]<<6|yt[e.charCodeAt(h+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=t&255;return i===2&&(t=yt[e.charCodeAt(h)]<<2|yt[e.charCodeAt(h+1)]>>4,s[a++]=t&255),i===1&&(t=yt[e.charCodeAt(h)]<<10|yt[e.charCodeAt(h+1)]<<4|yt[e.charCodeAt(h+2)]>>2,s[a++]=t>>8&255,s[a++]=t&255),s}function qf(e){return Bt[e>>18&63]+Bt[e>>12&63]+Bt[e>>6&63]+Bt[e&63]}function Gf(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(qf(n));return i.join("")}function Jf(e){for(var t,r=e.length,n=r%3,i=[],s=16383,a=0,o=r-n;a<o;a+=s)i.push(Gf(e,a,a+s>o?o:a+s));return n===1?(t=e[r-1],i.push(Bt[t>>2]+Bt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Bt[t>>10]+Bt[t>>4&63]+Bt[t<<2&63]+"=")),i.join("")}var Po={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Po.read=function(e,t,r,n,i){var s,a,o=i*8-n-1,h=(1<<o)-1,p=h>>1,g=-7,_=r?i-1:0,w=r?-1:1,I=e[t+_];for(_+=w,s=I&(1<<-g)-1,I>>=-g,g+=o;g>0;s=s*256+e[t+_],_+=w,g-=8);for(a=s&(1<<-g)-1,s>>=-g,g+=n;g>0;a=a*256+e[t+_],_+=w,g-=8);if(s===0)s=1-p;else{if(s===h)return a?NaN:(I?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-p}return(I?-1:1)*a*Math.pow(2,s-n)};Po.write=function(e,t,r,n,i,s){var a,o,h,p=s*8-i-1,g=(1<<p)-1,_=g>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:s-1,D=n?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=g):(a=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-a))<1&&(a--,h*=2),a+_>=1?t+=w/h:t+=w*Math.pow(2,1-_),t*h>=2&&(a++,h/=2),a+_>=g?(o=0,a=g):a+_>=1?(o=(t*h-1)*Math.pow(2,i),a=a+_):(o=t*Math.pow(2,_-1)*Math.pow(2,i),a=0));i>=8;e[r+I]=o&255,I+=D,o/=256,i-=8);for(a=a<<i|o,p+=i;p>0;e[r+I]=a&255,I+=D,a/=256,p-=8);e[r+I-D]|=F*128};/*!
|
|
2
|
+
* The buffer module from node.js, for the browser.
|
|
3
|
+
*
|
|
4
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/(function(e){const t=Di,r=Po,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=T,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const m=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(m,l),m.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(m){if(m>i)throw new RangeError('The value "'+m+'" is invalid for option "size"');const l=new Uint8Array(m);return Object.setPrototypeOf(l,o.prototype),l}function o(m,l,f){if(typeof m=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(m)}return h(m,l,f)}o.poolSize=8192;function h(m,l,f){if(typeof m=="string")return w(m,l);if(ArrayBuffer.isView(m))return D(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(Qe(m,ArrayBuffer)||m&&Qe(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Qe(m,SharedArrayBuffer)||m&&Qe(m.buffer,SharedArrayBuffer)))return F(m,l,f);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const E=m.valueOf&&m.valueOf();if(E!=null&&E!==m)return o.from(E,l,f);const P=O(m);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return o.from(m[Symbol.toPrimitive]("string"),l,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}o.from=function(m,l,f){return h(m,l,f)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function p(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function g(m,l,f){return p(m),m<=0?a(m):l!==void 0?typeof f=="string"?a(m).fill(l,f):a(m).fill(l):a(m)}o.alloc=function(m,l,f){return g(m,l,f)};function _(m){return p(m),a(m<0?0:k(m)|0)}o.allocUnsafe=function(m){return _(m)},o.allocUnsafeSlow=function(m){return _(m)};function w(m,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const f=L(m,l)|0;let E=a(f);const P=E.write(m,l);return P!==f&&(E=E.slice(0,P)),E}function I(m){const l=m.length<0?0:k(m.length)|0,f=a(l);for(let E=0;E<l;E+=1)f[E]=m[E]&255;return f}function D(m){if(Qe(m,Uint8Array)){const l=new Uint8Array(m);return F(l.buffer,l.byteOffset,l.byteLength)}return I(m)}function F(m,l,f){if(l<0||m.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<l+(f||0))throw new RangeError('"length" is outside of buffer bounds');let E;return l===void 0&&f===void 0?E=new Uint8Array(m):f===void 0?E=new Uint8Array(m,l):E=new Uint8Array(m,l,f),Object.setPrototypeOf(E,o.prototype),E}function O(m){if(o.isBuffer(m)){const l=k(m.length)|0,f=a(l);return f.length===0||m.copy(f,0,0,l),f}if(m.length!==void 0)return typeof m.length!="number"||ve(m.length)?a(0):I(m);if(m.type==="Buffer"&&Array.isArray(m.data))return I(m.data)}function k(m){if(m>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return m|0}function T(m){return+m!=m&&(m=0),o.alloc(+m)}o.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==o.prototype},o.compare=function(l,f){if(Qe(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),Qe(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),!o.isBuffer(l)||!o.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===f)return 0;let E=l.length,P=f.length;for(let U=0,H=Math.min(E,P);U<H;++U)if(l[U]!==f[U]){E=l[U],P=f[U];break}return E<P?-1:P<E?1:0},o.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(l,f){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return o.alloc(0);let E;if(f===void 0)for(f=0,E=0;E<l.length;++E)f+=l[E].length;const P=o.allocUnsafe(f);let U=0;for(E=0;E<l.length;++E){let H=l[E];if(Qe(H,Uint8Array))U+H.length>P.length?(o.isBuffer(H)||(H=o.from(H)),H.copy(P,U)):Uint8Array.prototype.set.call(P,H,U);else if(o.isBuffer(H))H.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=H.length}return P};function L(m,l){if(o.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||Qe(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);const f=m.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&f===0)return 0;let P=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return ne(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Se(m).length;default:if(P)return E?-1:ne(m).length;l=(""+l).toLowerCase(),P=!0}}o.byteLength=L;function W(m,l,f){let E=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,l>>>=0,f<=l))return"";for(m||(m="utf8");;)switch(m){case"hex":return x(this,l,f);case"utf8":case"utf-8":return c(this,l,f);case"ascii":return v(this,l,f);case"latin1":case"binary":return S(this,l,f);case"base64":return A(this,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,l,f);default:if(E)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function $(m,l,f){const E=m[l];m[l]=m[f],m[f]=E}o.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<l;f+=2)$(this,f,f+1);return this},o.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<l;f+=4)$(this,f,f+3),$(this,f+1,f+2);return this},o.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<l;f+=8)$(this,f,f+7),$(this,f+1,f+6),$(this,f+2,f+5),$(this,f+3,f+4);return this},o.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?c(this,0,l):W.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(l){if(!o.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:o.compare(this,l)===0},o.prototype.inspect=function(){let l="";const f=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(l+=" ... "),"<Buffer "+l+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(l,f,E,P,U){if(Qe(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(f===void 0&&(f=0),E===void 0&&(E=l?l.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),f<0||E>l.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&f>=E)return 0;if(P>=U)return-1;if(f>=E)return 1;if(f>>>=0,E>>>=0,P>>>=0,U>>>=0,this===l)return 0;let H=U-P,fe=E-f;const ae=Math.min(H,fe),se=this.slice(P,U),Ce=l.slice(f,E);for(let ie=0;ie<ae;++ie)if(se[ie]!==Ce[ie]){H=se[ie],fe=Ce[ie];break}return H<fe?-1:fe<H?1:0};function z(m,l,f,E,P){if(m.length===0)return-1;if(typeof f=="string"?(E=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,ve(f)&&(f=P?0:m.length-1),f<0&&(f=m.length+f),f>=m.length){if(P)return-1;f=m.length-1}else if(f<0)if(P)f=0;else return-1;if(typeof l=="string"&&(l=o.from(l,E)),o.isBuffer(l))return l.length===0?-1:ee(m,l,f,E,P);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(m,l,f):Uint8Array.prototype.lastIndexOf.call(m,l,f):ee(m,[l],f,E,P);throw new TypeError("val must be string, number or Buffer")}function ee(m,l,f,E,P){let U=1,H=m.length,fe=l.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(m.length<2||l.length<2)return-1;U=2,H/=2,fe/=2,f/=2}function ae(Ce,ie){return U===1?Ce[ie]:Ce.readUInt16BE(ie*U)}let se;if(P){let Ce=-1;for(se=f;se<H;se++)if(ae(m,se)===ae(l,Ce===-1?0:se-Ce)){if(Ce===-1&&(Ce=se),se-Ce+1===fe)return Ce*U}else Ce!==-1&&(se-=se-Ce),Ce=-1}else for(f+fe>H&&(f=H-fe),se=f;se>=0;se--){let Ce=!0;for(let ie=0;ie<fe;ie++)if(ae(m,se+ie)!==ae(l,ie)){Ce=!1;break}if(Ce)return se}return-1}o.prototype.includes=function(l,f,E){return this.indexOf(l,f,E)!==-1},o.prototype.indexOf=function(l,f,E){return z(this,l,f,E,!0)},o.prototype.lastIndexOf=function(l,f,E){return z(this,l,f,E,!1)};function Y(m,l,f,E){f=Number(f)||0;const P=m.length-f;E?(E=Number(E),E>P&&(E=P)):E=P;const U=l.length;E>U/2&&(E=U/2);let H;for(H=0;H<E;++H){const fe=parseInt(l.substr(H*2,2),16);if(ve(fe))return H;m[f+H]=fe}return H}function K(m,l,f,E){return Ee(ne(l,m.length-f),m,f,E)}function de(m,l,f,E){return Ee(we(l),m,f,E)}function re(m,l,f,E){return Ee(Se(l),m,f,E)}function ce(m,l,f,E){return Ee(pt(l,m.length-f),m,f,E)}o.prototype.write=function(l,f,E,P){if(f===void 0)P="utf8",E=this.length,f=0;else if(E===void 0&&typeof f=="string")P=f,E=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(E)?(E=E>>>0,P===void 0&&(P="utf8")):(P=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-f;if((E===void 0||E>U)&&(E=U),l.length>0&&(E<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let H=!1;for(;;)switch(P){case"hex":return Y(this,l,f,E);case"utf8":case"utf-8":return K(this,l,f,E);case"ascii":case"latin1":case"binary":return de(this,l,f,E);case"base64":return re(this,l,f,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,l,f,E);default:if(H)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),H=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(m,l,f){return l===0&&f===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(l,f))}function c(m,l,f){f=Math.min(m.length,f);const E=[];let P=l;for(;P<f;){const U=m[P];let H=null,fe=U>239?4:U>223?3:U>191?2:1;if(P+fe<=f){let ae,se,Ce,ie;switch(fe){case 1:U<128&&(H=U);break;case 2:ae=m[P+1],(ae&192)===128&&(ie=(U&31)<<6|ae&63,ie>127&&(H=ie));break;case 3:ae=m[P+1],se=m[P+2],(ae&192)===128&&(se&192)===128&&(ie=(U&15)<<12|(ae&63)<<6|se&63,ie>2047&&(ie<55296||ie>57343)&&(H=ie));break;case 4:ae=m[P+1],se=m[P+2],Ce=m[P+3],(ae&192)===128&&(se&192)===128&&(Ce&192)===128&&(ie=(U&15)<<18|(ae&63)<<12|(se&63)<<6|Ce&63,ie>65535&&ie<1114112&&(H=ie))}}H===null?(H=65533,fe=1):H>65535&&(H-=65536,E.push(H>>>10&1023|55296),H=56320|H&1023),E.push(H),P+=fe}return y(E)}const d=4096;function y(m){const l=m.length;if(l<=d)return String.fromCharCode.apply(String,m);let f="",E=0;for(;E<l;)f+=String.fromCharCode.apply(String,m.slice(E,E+=d));return f}function v(m,l,f){let E="";f=Math.min(m.length,f);for(let P=l;P<f;++P)E+=String.fromCharCode(m[P]&127);return E}function S(m,l,f){let E="";f=Math.min(m.length,f);for(let P=l;P<f;++P)E+=String.fromCharCode(m[P]);return E}function x(m,l,f){const E=m.length;(!l||l<0)&&(l=0),(!f||f<0||f>E)&&(f=E);let P="";for(let U=l;U<f;++U)P+=Re[m[U]];return P}function B(m,l,f){const E=m.slice(l,f);let P="";for(let U=0;U<E.length-1;U+=2)P+=String.fromCharCode(E[U]+E[U+1]*256);return P}o.prototype.slice=function(l,f){const E=this.length;l=~~l,f=f===void 0?E:~~f,l<0?(l+=E,l<0&&(l=0)):l>E&&(l=E),f<0?(f+=E,f<0&&(f=0)):f>E&&(f=E),f<l&&(f=l);const P=this.subarray(l,f);return Object.setPrototypeOf(P,o.prototype),P};function b(m,l,f){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+l>f)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(l,f,E){l=l>>>0,f=f>>>0,E||b(l,f,this.length);let P=this[l],U=1,H=0;for(;++H<f&&(U*=256);)P+=this[l+H]*U;return P},o.prototype.readUintBE=o.prototype.readUIntBE=function(l,f,E){l=l>>>0,f=f>>>0,E||b(l,f,this.length);let P=this[l+--f],U=1;for(;f>0&&(U*=256);)P+=this[l+--f]*U;return P},o.prototype.readUint8=o.prototype.readUInt8=function(l,f){return l=l>>>0,f||b(l,1,this.length),this[l]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(l,f){return l=l>>>0,f||b(l,2,this.length),this[l]|this[l+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(l,f){return l=l>>>0,f||b(l,2,this.length),this[l]<<8|this[l+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(l,f){return l=l>>>0,f||b(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(l,f){return l=l>>>0,f||b(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},o.prototype.readBigUInt64LE=et(function(l){l=l>>>0,q(l,"offset");const f=this[l],E=this[l+7];(f===void 0||E===void 0)&&G(l,this.length-8);const P=f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,U=this[++l]+this[++l]*2**8+this[++l]*2**16+E*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),o.prototype.readBigUInt64BE=et(function(l){l=l>>>0,q(l,"offset");const f=this[l],E=this[l+7];(f===void 0||E===void 0)&&G(l,this.length-8);const P=f*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],U=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+E;return(BigInt(P)<<BigInt(32))+BigInt(U)}),o.prototype.readIntLE=function(l,f,E){l=l>>>0,f=f>>>0,E||b(l,f,this.length);let P=this[l],U=1,H=0;for(;++H<f&&(U*=256);)P+=this[l+H]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*f)),P},o.prototype.readIntBE=function(l,f,E){l=l>>>0,f=f>>>0,E||b(l,f,this.length);let P=f,U=1,H=this[l+--P];for(;P>0&&(U*=256);)H+=this[l+--P]*U;return U*=128,H>=U&&(H-=Math.pow(2,8*f)),H},o.prototype.readInt8=function(l,f){return l=l>>>0,f||b(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},o.prototype.readInt16LE=function(l,f){l=l>>>0,f||b(l,2,this.length);const E=this[l]|this[l+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(l,f){l=l>>>0,f||b(l,2,this.length);const E=this[l+1]|this[l]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(l,f){return l=l>>>0,f||b(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},o.prototype.readInt32BE=function(l,f){return l=l>>>0,f||b(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},o.prototype.readBigInt64LE=et(function(l){l=l>>>0,q(l,"offset");const f=this[l],E=this[l+7];(f===void 0||E===void 0)&&G(l,this.length-8);const P=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(E<<24);return(BigInt(P)<<BigInt(32))+BigInt(f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),o.prototype.readBigInt64BE=et(function(l){l=l>>>0,q(l,"offset");const f=this[l],E=this[l+7];(f===void 0||E===void 0)&&G(l,this.length-8);const P=(f<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(P)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+E)}),o.prototype.readFloatLE=function(l,f){return l=l>>>0,f||b(l,4,this.length),r.read(this,l,!0,23,4)},o.prototype.readFloatBE=function(l,f){return l=l>>>0,f||b(l,4,this.length),r.read(this,l,!1,23,4)},o.prototype.readDoubleLE=function(l,f){return l=l>>>0,f||b(l,8,this.length),r.read(this,l,!0,52,8)},o.prototype.readDoubleBE=function(l,f){return l=l>>>0,f||b(l,8,this.length),r.read(this,l,!1,52,8)};function u(m,l,f,E,P,U){if(!o.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>P||l<U)throw new RangeError('"value" argument is out of bounds');if(f+E>m.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(l,f,E,P){if(l=+l,f=f>>>0,E=E>>>0,!P){const fe=Math.pow(2,8*E)-1;u(this,l,f,E,fe,0)}let U=1,H=0;for(this[f]=l&255;++H<E&&(U*=256);)this[f+H]=l/U&255;return f+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(l,f,E,P){if(l=+l,f=f>>>0,E=E>>>0,!P){const fe=Math.pow(2,8*E)-1;u(this,l,f,E,fe,0)}let U=E-1,H=1;for(this[f+U]=l&255;--U>=0&&(H*=256);)this[f+U]=l/H&255;return f+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,1,255,0),this[f]=l&255,f+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,2,65535,0),this[f]=l&255,this[f+1]=l>>>8,f+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,2,65535,0),this[f]=l>>>8,this[f+1]=l&255,f+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,4,4294967295,0),this[f+3]=l>>>24,this[f+2]=l>>>16,this[f+1]=l>>>8,this[f]=l&255,f+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,4,4294967295,0),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4};function R(m,l,f,E,P){M(l,E,P,m,f,7);let U=Number(l&BigInt(4294967295));m[f++]=U,U=U>>8,m[f++]=U,U=U>>8,m[f++]=U,U=U>>8,m[f++]=U;let H=Number(l>>BigInt(32)&BigInt(4294967295));return m[f++]=H,H=H>>8,m[f++]=H,H=H>>8,m[f++]=H,H=H>>8,m[f++]=H,f}function Q(m,l,f,E,P){M(l,E,P,m,f,7);let U=Number(l&BigInt(4294967295));m[f+7]=U,U=U>>8,m[f+6]=U,U=U>>8,m[f+5]=U,U=U>>8,m[f+4]=U;let H=Number(l>>BigInt(32)&BigInt(4294967295));return m[f+3]=H,H=H>>8,m[f+2]=H,H=H>>8,m[f+1]=H,H=H>>8,m[f]=H,f+8}o.prototype.writeBigUInt64LE=et(function(l,f=0){return R(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=et(function(l,f=0){return Q(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(l,f,E,P){if(l=+l,f=f>>>0,!P){const ae=Math.pow(2,8*E-1);u(this,l,f,E,ae-1,-ae)}let U=0,H=1,fe=0;for(this[f]=l&255;++U<E&&(H*=256);)l<0&&fe===0&&this[f+U-1]!==0&&(fe=1),this[f+U]=(l/H>>0)-fe&255;return f+E},o.prototype.writeIntBE=function(l,f,E,P){if(l=+l,f=f>>>0,!P){const ae=Math.pow(2,8*E-1);u(this,l,f,E,ae-1,-ae)}let U=E-1,H=1,fe=0;for(this[f+U]=l&255;--U>=0&&(H*=256);)l<0&&fe===0&&this[f+U+1]!==0&&(fe=1),this[f+U]=(l/H>>0)-fe&255;return f+E},o.prototype.writeInt8=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,1,127,-128),l<0&&(l=255+l+1),this[f]=l&255,f+1},o.prototype.writeInt16LE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,2,32767,-32768),this[f]=l&255,this[f+1]=l>>>8,f+2},o.prototype.writeInt16BE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,2,32767,-32768),this[f]=l>>>8,this[f+1]=l&255,f+2},o.prototype.writeInt32LE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,4,2147483647,-2147483648),this[f]=l&255,this[f+1]=l>>>8,this[f+2]=l>>>16,this[f+3]=l>>>24,f+4},o.prototype.writeInt32BE=function(l,f,E){return l=+l,f=f>>>0,E||u(this,l,f,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4},o.prototype.writeBigInt64LE=et(function(l,f=0){return R(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=et(function(l,f=0){return Q(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(m,l,f,E,P,U){if(f+E>m.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function N(m,l,f,E,P){return l=+l,f=f>>>0,P||J(m,l,f,4),r.write(m,l,f,E,23,4),f+4}o.prototype.writeFloatLE=function(l,f,E){return N(this,l,f,!0,E)},o.prototype.writeFloatBE=function(l,f,E){return N(this,l,f,!1,E)};function j(m,l,f,E,P){return l=+l,f=f>>>0,P||J(m,l,f,8),r.write(m,l,f,E,52,8),f+8}o.prototype.writeDoubleLE=function(l,f,E){return j(this,l,f,!0,E)},o.prototype.writeDoubleBE=function(l,f,E){return j(this,l,f,!1,E)},o.prototype.copy=function(l,f,E,P){if(!o.isBuffer(l))throw new TypeError("argument should be a Buffer");if(E||(E=0),!P&&P!==0&&(P=this.length),f>=l.length&&(f=l.length),f||(f=0),P>0&&P<E&&(P=E),P===E||l.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),l.length-f<P-E&&(P=l.length-f+E);const U=P-E;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,E,P):Uint8Array.prototype.set.call(l,this.subarray(E,P),f),U},o.prototype.fill=function(l,f,E,P){if(typeof l=="string"){if(typeof f=="string"?(P=f,f=0,E=this.length):typeof E=="string"&&(P=E,E=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!o.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(l.length===1){const H=l.charCodeAt(0);(P==="utf8"&&H<128||P==="latin1")&&(l=H)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(f<0||this.length<f||this.length<E)throw new RangeError("Out of range index");if(E<=f)return this;f=f>>>0,E=E===void 0?this.length:E>>>0,l||(l=0);let U;if(typeof l=="number")for(U=f;U<E;++U)this[U]=l;else{const H=o.isBuffer(l)?l:o.from(l,P),fe=H.length;if(fe===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(U=0;U<E-f;++U)this[U+f]=H[U%fe]}return this};const V={};function Z(m,l,f){V[m]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(m,l){return`The "${m}" argument must be of type number. Received type ${typeof l}`},TypeError),Z("ERR_OUT_OF_RANGE",function(m,l,f){let E=`The value of "${m}" is out of range.`,P=f;return Number.isInteger(f)&&Math.abs(f)>2**32?P=ue(String(f)):typeof f=="bigint"&&(P=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(P=ue(P)),P+="n"),E+=` It must be ${l}. Received ${P}`,E},RangeError);function ue(m){let l="",f=m.length;const E=m[0]==="-"?1:0;for(;f>=E+4;f-=3)l=`_${m.slice(f-3,f)}${l}`;return`${m.slice(0,f)}${l}`}function C(m,l,f){q(l,"offset"),(m[l]===void 0||m[l+f]===void 0)&&G(l,m.length-(f+1))}function M(m,l,f,E,P,U){if(m>f||m<l){const H=typeof l=="bigint"?"n":"";let fe;throw l===0||l===BigInt(0)?fe=`>= 0${H} and < 2${H} ** ${(U+1)*8}${H}`:fe=`>= -(2${H} ** ${(U+1)*8-1}${H}) and < 2 ** ${(U+1)*8-1}${H}`,new V.ERR_OUT_OF_RANGE("value",fe,m)}C(E,P,U)}function q(m,l){if(typeof m!="number")throw new V.ERR_INVALID_ARG_TYPE(l,"number",m)}function G(m,l,f){throw Math.floor(m)!==m?(q(m,f),new V.ERR_OUT_OF_RANGE("offset","an integer",m)):l<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,m)}const oe=/[^+/0-9A-Za-z-_]/g;function he(m){if(m=m.split("=")[0],m=m.trim().replace(oe,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function ne(m,l){l=l||1/0;let f;const E=m.length;let P=null;const U=[];for(let H=0;H<E;++H){if(f=m.charCodeAt(H),f>55295&&f<57344){if(!P){if(f>56319){(l-=3)>-1&&U.push(239,191,189);continue}else if(H+1===E){(l-=3)>-1&&U.push(239,191,189);continue}P=f;continue}if(f<56320){(l-=3)>-1&&U.push(239,191,189),P=f;continue}f=(P-55296<<10|f-56320)+65536}else P&&(l-=3)>-1&&U.push(239,191,189);if(P=null,f<128){if((l-=1)<0)break;U.push(f)}else if(f<2048){if((l-=2)<0)break;U.push(f>>6|192,f&63|128)}else if(f<65536){if((l-=3)<0)break;U.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((l-=4)<0)break;U.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return U}function we(m){const l=[];for(let f=0;f<m.length;++f)l.push(m.charCodeAt(f)&255);return l}function pt(m,l){let f,E,P;const U=[];for(let H=0;H<m.length&&!((l-=2)<0);++H)f=m.charCodeAt(H),E=f>>8,P=f%256,U.push(P),U.push(E);return U}function Se(m){return t.toByteArray(he(m))}function Ee(m,l,f,E){let P;for(P=0;P<E&&!(P+f>=l.length||P>=m.length);++P)l[P+f]=m[P];return P}function Qe(m,l){return m instanceof l||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===l.name}function ve(m){return m!==m}const Re=function(){const m="0123456789abcdef",l=new Array(256);for(let f=0;f<16;++f){const E=f*16;for(let P=0;P<16;++P)l[E+P]=m[f]+m[P]}return l}();function et(m){return typeof BigInt>"u"?be:m}function be(){throw new Error("BigInt not supported")}})(Nn);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Nn,n=r.Buffer;function i(a,o){for(var h in a)o[h]=a[h]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(a,o,h){return n(a,o,h)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,o,h){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,h)},s.alloc=function(a,o,h){if(typeof a!="number")throw new TypeError("Argument must be a number");var p=n(a);return o!==void 0?typeof h=="string"?p.fill(o,h):p.fill(o):p.fill(0),p},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(po,po.exports);var Vt=po.exports,Bs,Ea;function Zf(){if(Ea)return Bs;Ea=1;var e=lf;return Bs=function(r){return!!e(r)},Bs}var Kf=xh,Qf=Xc,Yf=Qf("TypedArray.prototype.buffer",!0),Xf=Zf(),ed=Yf||function(t){if(!Xf(t))throw new Kf("Not a Typed Array");return t.buffer},Ct=Vt.Buffer,td=Ph,rd=ed,nd=ArrayBuffer.isView||function(t){try{return rd(t),!0}catch{return!1}},id=typeof Uint8Array<"u",yl=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",sd=yl&&(Ct.prototype instanceof Uint8Array||Ct.TYPED_ARRAY_SUPPORT),od=function(t,r){if(Ct.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Ct.from(t):t;if(typeof t=="string")return Ct.from(t,r);if(yl&&nd(t)){if(t.byteLength===0)return Ct.alloc(0);if(sd){var n=Ct.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=Ct.from(i);if(s.length===t.byteLength)return s}if(id&&t instanceof Uint8Array)return Ct.from(t);var a=td(t);if(a)for(var o=0;o<t.length;o+=1){var h=t[o];if(typeof h!="number"||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||Ct.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Ct.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},ad=Vt.Buffer,cd=od;function ji(e,t){this._block=ad.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}ji.prototype.update=function(e,t){e=cd(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,a=0;a<i;){for(var o=s%n,h=Math.min(i-a,n-o),p=0;p<h;p++)r[o+p]=e[a+p];s+=h,a+=h,s%n===0&&this._update(r)}return this._len+=i,this};ji.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};ji.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var un=ji,ld=Mt,wl=un,ud=Vt.Buffer,hd=[1518500249,1859775393,-1894007588,-899497514],fd=new Array(80);function Bn(){this.init(),this._w=fd,wl.call(this,64,56)}ld(Bn,wl);Bn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function dd(e){return e<<5|e>>>27}function pd(e){return e<<30|e>>>2}function gd(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Bn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=t[o-3]^t[o-8]^t[o-14]^t[o-16];for(var h=0;h<80;++h){var p=~~(h/20),g=dd(r)+gd(p,n,i,s)+a+t[h]+hd[p]|0;a=s,s=i,i=pd(n),n=r,r=g}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Bn.prototype._hash=function(){var e=ud.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var _d=Bn,md=Mt,vl=un,yd=Vt.Buffer,wd=[1518500249,1859775393,-1894007588,-899497514],vd=new Array(80);function Ln(){this.init(),this._w=vd,vl.call(this,64,56)}md(Ln,vl);Ln.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function bd(e){return e<<1|e>>>31}function Ed(e){return e<<5|e>>>27}function Sd(e){return e<<30|e>>>2}function Rd(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Ln.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=bd(t[o-3]^t[o-8]^t[o-14]^t[o-16]);for(var h=0;h<80;++h){var p=~~(h/20),g=Ed(r)+Rd(p,n,i,s)+a+t[h]+wd[p]|0;a=s,s=i,i=Sd(n),n=r,r=g}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Ln.prototype._hash=function(){var e=yd.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Cd=Ln,Md=Mt,bl=un,kd=Vt.Buffer,xd=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Id=new Array(64);function Pn(){this.init(),this._w=Id,bl.call(this,64,56)}Md(Pn,bl);Pn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Ad(e,t,r){return r^e&(t^r)}function Td(e,t,r){return e&t|r&(e|t)}function Nd(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Bd(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Ld(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Pd(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Pn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,o=this._f|0,h=this._g|0,p=this._h|0,g=0;g<16;++g)t[g]=e.readInt32BE(g*4);for(;g<64;++g)t[g]=Pd(t[g-2])+t[g-7]+Ld(t[g-15])+t[g-16]|0;for(var _=0;_<64;++_){var w=p+Bd(a)+Ad(a,o,h)+xd[_]+t[_]|0,I=Nd(r)+Td(r,n,i)|0;p=h,h=o,o=a,a=s+w|0,s=i,i=n,n=r,r=w+I|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=o+this._f|0,this._g=h+this._g|0,this._h=p+this._h|0};Pn.prototype._hash=function(){var e=kd.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var El=Pn,Od=Mt,Fd=El,Dd=un,jd=Vt.Buffer,Ud=new Array(64);function Ui(){this.init(),this._w=Ud,Dd.call(this,64,56)}Od(Ui,Fd);Ui.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Ui.prototype._hash=function(){var e=jd.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var $d=Ui,Hd=Mt,Sl=un,Wd=Vt.Buffer,Sa=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Vd=new Array(160);function On(){this.init(),this._w=Vd,Sl.call(this,128,112)}Hd(On,Sl);On.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ra(e,t,r){return r^e&(t^r)}function Ca(e,t,r){return e&t|r&(e|t)}function Ma(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ka(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function zd(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function qd(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Jd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function tt(e,t){return e>>>0<t>>>0?1:0}On.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,a=this._eh|0,o=this._fh|0,h=this._gh|0,p=this._hh|0,g=this._al|0,_=this._bl|0,w=this._cl|0,I=this._dl|0,D=this._el|0,F=this._fl|0,O=this._gl|0,k=this._hl|0,T=0;T<32;T+=2)t[T]=e.readInt32BE(T*4),t[T+1]=e.readInt32BE(T*4+4);for(;T<160;T+=2){var L=t[T-30],W=t[T-15*2+1],$=zd(L,W),z=qd(W,L);L=t[T-2*2],W=t[T-2*2+1];var ee=Gd(L,W),Y=Jd(W,L),K=t[T-7*2],de=t[T-7*2+1],re=t[T-16*2],ce=t[T-16*2+1],A=z+de|0,c=$+K+tt(A,z)|0;A=A+Y|0,c=c+ee+tt(A,Y)|0,A=A+ce|0,c=c+re+tt(A,ce)|0,t[T]=c,t[T+1]=A}for(var d=0;d<160;d+=2){c=t[d],A=t[d+1];var y=Ca(r,n,i),v=Ca(g,_,w),S=Ma(r,g),x=Ma(g,r),B=ka(a,D),b=ka(D,a),u=Sa[d],R=Sa[d+1],Q=Ra(a,o,h),J=Ra(D,F,O),N=k+b|0,j=p+B+tt(N,k)|0;N=N+J|0,j=j+Q+tt(N,J)|0,N=N+R|0,j=j+u+tt(N,R)|0,N=N+A|0,j=j+c+tt(N,A)|0;var V=x+v|0,Z=S+y+tt(V,x)|0;p=h,k=O,h=o,O=F,o=a,F=D,D=I+N|0,a=s+j+tt(D,I)|0,s=i,I=w,i=n,w=_,n=r,_=g,g=N+V|0,r=j+Z+tt(g,N)|0}this._al=this._al+g|0,this._bl=this._bl+_|0,this._cl=this._cl+w|0,this._dl=this._dl+I|0,this._el=this._el+D|0,this._fl=this._fl+F|0,this._gl=this._gl+O|0,this._hl=this._hl+k|0,this._ah=this._ah+r+tt(this._al,g)|0,this._bh=this._bh+n+tt(this._bl,_)|0,this._ch=this._ch+i+tt(this._cl,w)|0,this._dh=this._dh+s+tt(this._dl,I)|0,this._eh=this._eh+a+tt(this._el,D)|0,this._fh=this._fh+o+tt(this._fl,F)|0,this._gh=this._gh+h+tt(this._gl,O)|0,this._hh=this._hh+p+tt(this._hl,k)|0};On.prototype._hash=function(){var e=Wd.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Rl=On,Zd=Mt,Kd=Rl,Qd=un,Yd=Vt.Buffer,Xd=new Array(160);function $i(){this.init(),this._w=Xd,Qd.call(this,128,112)}Zd($i,Kd);$i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};$i.prototype._hash=function(){var e=Yd.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var e0=$i;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=_d,e.exports.sha1=Cd,e.exports.sha224=$d,e.exports.sha256=El,e.exports.sha384=e0,e.exports.sha512=Rl})(_l);var t0=_l.exports;Object.defineProperty(ln,"__esModule",{value:!0});ln.Session=void 0;const xa=t0,Ia=X,Aa="session:id",Ta="session:secret",Na="session:linked";class Oo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Ia.randomBytesHex)(16),this._secret=n||(0,Ia.randomBytesHex)(32),this._key=new xa.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Aa),n=t.getItem(Na),i=t.getItem(Ta);return r&&i?new Oo(t,r,i,n==="1"):null}static hash(t){return new xa.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Aa,this._id),this._storage.setItem(Ta,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Na,this._linked?"1":"0")}}ln.Session=Oo;var Hi={},Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.Cipher=void 0;const ni=X;class r0{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,ni.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),o=16,h=a.slice(a.byteLength-o),p=a.slice(0,a.byteLength-o),g=new Uint8Array(h),_=new Uint8Array(p),w=new Uint8Array([...n,...g,..._]);return(0,ni.uint8ArrayToHex)(w)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,ni.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,ni.hexStringToUint8Array)(t),o=a.slice(0,12),h=a.slice(12,28),p=a.slice(28),g=new Uint8Array([...p,...h]),_={name:"AES-GCM",iv:new Uint8Array(o)};try{const w=await window.crypto.subtle.decrypt(_,s,g),I=new TextDecoder;n(I.decode(w))}catch(w){i(w)}})()})}}Wi.Cipher=r0;var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.WalletLinkHTTP=void 0;class n0{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Vi.WalletLinkHTTP=n0;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.WalletLinkWebSocket=Kr.ConnectionState=void 0;var Vr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Vr||(Kr.ConnectionState=Vr={}));class i0{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Vr.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Vr.DISCONNECTED)},i.onopen=s=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Vr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,o;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Vr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Kr.WalletLinkWebSocket=i0;Object.defineProperty(Hi,"__esModule",{value:!0});Hi.WalletLinkConnection=void 0;const Dr=Ye,s0=Wi,xt=cn,Ba=wt,jr=ln,o0=Vi,ii=Kr,La=1e4,a0=6e4;class c0{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Dr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=o=>{if(!o)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",p=>o.JsonRpcUrl&&this.handleChainUpdated(p,o.JsonRpcUrl)]]).forEach((p,g)=>{const _=o[g];_!==void 0&&p(_)})},this.handleDestroyed=o=>{var h,p;o==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(p=this.diagnostic)===null||p===void 0||p.log(xt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:jr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async o=>{var h,p;try{const g=await this.cipher.decrypt(o);(h=this.listener)===null||h===void 0||h.accountUpdated(g)}catch{(p=this.diagnostic)===null||p===void 0||p.log(xt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(o,h)=>{var p,g;try{const _=await this.cipher.decrypt(h);(p=this.listener)===null||p===void 0||p.metadataUpdated(o,_)}catch{(g=this.diagnostic)===null||g===void 0||g.log(xt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:o})}},this.handleWalletUsernameUpdated=async o=>{this.handleMetadataUpdated(Ba.WALLET_USER_NAME_KEY,o)},this.handleAppVersionUpdated=async o=>{this.handleMetadataUpdated(Ba.APP_VERSION_KEY,o)},this.handleChainUpdated=async(o,h)=>{var p,g;try{const _=await this.cipher.decrypt(o),w=await this.cipher.decrypt(h);(p=this.listener)===null||p===void 0||p.chainUpdated(_,w)}catch{(g=this.diagnostic)===null||g===void 0||g.log(xt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new s0.Cipher(t.secret),this.diagnostic=i,this.listener=n;const a=new ii.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async o=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(xt.EVENTS.CONNECTED_STATE_CHANGE,{state:o,sessionIdHash:jr.Session.hash(t.id)});let p=!1;switch(o){case ii.ConnectionState.DISCONNECTED:if(!this.destroyed){const g=async()=>{await new Promise(_=>setTimeout(_,5e3)),this.destroyed||a.connect().catch(()=>{g()})};g()}break;case ii.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),p=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},La),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case ii.ConnectionState.CONNECTING:break}this.connected!==p&&(this.connected=p)}),a.setIncomingDataListener(o=>{var h,p,g;switch(o.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const _=o.type==="IsLinkedOK"?o.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(xt.EVENTS.LINKED,{sessionIdHash:jr.Session.hash(t.id),linked:_,type:o.type,onlineGuests:o.onlineGuests}),this.linked=_||o.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(p=this.diagnostic)===null||p===void 0||p.log(xt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:jr.Session.hash(t.id),metadata_keys:o&&o.metadata?Object.keys(o.metadata):void 0}),this.handleSessionMetadataUpdated(o.metadata);break}case"Event":{this.handleIncomingEvent(o);break}}o.id!==void 0&&((g=this.requestResolutions.get(o.id))===null||g===void 0||g(o))}),this.ws=a,this.http=new o0.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(xt.EVENTS.STARTED_CONNECTING,{sessionIdHash:jr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(xt.EVENTS.DISCONNECTED,{sessionIdHash:jr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(xt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>La*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=a0){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Hi.WalletLinkConnection=c0;var Fn={},Dn={},Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var l0=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.injectCssReset=void 0;const u0=l0(Fo);function h0(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(u0.default)),document.documentElement.appendChild(e)}Dn.injectCssReset=h0;var zi={},jn,ke,Cl,Ml,gr,Pa,kl,xl,Il,Do,go,_o,Al,En={},Tl=[],f0=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Un=Array.isArray;function Pt(e,t){for(var r in t)e[r]=t[r];return e}function jo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function mo(e,t,r){var n,i,s,a={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?jn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)a[s]===void 0&&(a[s]=e.defaultProps[s]);return yn(e,a,n,i,null)}function yn(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Cl,__i:-1,__u:0};return i==null&&ke.vnode!=null&&ke.vnode(s),s}function d0(){return{current:null}}function $n(e){return e.children}function wn(e,t){this.props=e,this.context=t}function Qr(e,t){if(t==null)return e.__?Qr(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Qr(e):null}function Nl(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Nl(e)}}function yo(e){(!e.__d&&(e.__d=!0)&&gr.push(e)&&!Ci.__r++||Pa!=ke.debounceRendering)&&((Pa=ke.debounceRendering)||kl)(Ci)}function Ci(){for(var e,t,r,n,i,s,a,o=1;gr.length;)gr.length>o&&gr.sort(xl),e=gr.shift(),o=gr.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,s=[],a=[],t.__P&&((r=Pt({},n)).__v=n.__v+1,ke.vnode&&ke.vnode(r),Uo(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,s,i??Qr(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Ol(s,r,a),n.__e=n.__=null,r.__e!=i&&Nl(r)));Ci.__r=0}function Bl(e,t,r,n,i,s,a,o,h,p,g){var _,w,I,D,F,O,k,T=n&&n.__k||Tl,L=t.length;for(h=p0(r,t,T,h,L),_=0;_<L;_++)(I=r.__k[_])!=null&&(w=I.__i==-1?En:T[I.__i]||En,I.__i=_,O=Uo(e,I,w,i,s,a,o,h,p,g),D=I.__e,I.ref&&w.ref!=I.ref&&(w.ref&&$o(w.ref,null,I),g.push(I.ref,I.__c||D,I)),F==null&&D!=null&&(F=D),(k=!!(4&I.__u))||w.__k===I.__k?h=Ll(I,h,e,k):typeof I.type=="function"&&O!==void 0?h=O:D&&(h=D.nextSibling),I.__u&=-7);return r.__e=F,h}function p0(e,t,r,n,i){var s,a,o,h,p,g=r.length,_=g,w=0;for(e.__k=new Array(i),s=0;s<i;s++)(a=t[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[s]=yn(null,a,null,null,null):Un(a)?a=e.__k[s]=yn($n,{children:a},null,null,null):a.constructor==null&&a.__b>0?a=e.__k[s]=yn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[s]=a,h=s+w,a.__=e,a.__b=e.__b+1,(p=a.__i=g0(a,r,h,_))!=-1&&(_--,(o=r[p])&&(o.__u|=2)),o==null||o.__v==null?(p==-1&&(i>g?w--:i<g&&w++),typeof a.type!="function"&&(a.__u|=4)):p!=h&&(p==h-1?w--:p==h+1?w++:(p>h?w--:w++,a.__u|=4))):e.__k[s]=null;if(_)for(s=0;s<g;s++)(o=r[s])!=null&&!(2&o.__u)&&(o.__e==n&&(n=Qr(o)),Dl(o,o));return n}function Ll(e,t,r,n){var i,s;if(typeof e.type=="function"){for(i=e.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=e,t=Ll(i[s],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Qr(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Pl(e,t){return t=t||[],e==null||typeof e=="boolean"||(Un(e)?e.some(function(r){Pl(r,t)}):t.push(e)),t}function g0(e,t,r,n){var i,s,a,o=e.key,h=e.type,p=t[r],g=p!=null&&(2&p.__u)==0;if(p===null&&o==null||g&&o==p.key&&h==p.type)return r;if(n>(g?1:0)){for(i=r-1,s=r+1;i>=0||s<t.length;)if((p=t[a=i>=0?i--:s++])!=null&&!(2&p.__u)&&o==p.key&&h==p.type)return a}return-1}function Oa(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||f0.test(t)?r:r+"px"}function si(e,t,r,n,i){var s,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Oa(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Oa(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(Il,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.u=n.u:(r.u=Do,e.addEventListener(t,s?_o:go,s)):e.removeEventListener(t,s?_o:go,s);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Fa(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Do++;else if(t.t<r.u)return;return r(ke.event?ke.event(t):t)}}}function Uo(e,t,r,n,i,s,a,o,h,p){var g,_,w,I,D,F,O,k,T,L,W,$,z,ee,Y,K,de,re=t.type;if(t.constructor!=null)return null;128&r.__u&&(h=!!(32&r.__u),s=[o=t.__e=r.__e]),(g=ke.__b)&&g(t);e:if(typeof re=="function")try{if(k=t.props,T="prototype"in re&&re.prototype.render,L=(g=re.contextType)&&n[g.__c],W=g?L?L.props.value:g.__:n,r.__c?O=(_=t.__c=r.__c).__=_.__E:(T?t.__c=_=new re(k,W):(t.__c=_=new wn(k,W),_.constructor=re,_.render=m0),L&&L.sub(_),_.state||(_.state={}),_.__n=n,w=_.__d=!0,_.__h=[],_._sb=[]),T&&_.__s==null&&(_.__s=_.state),T&&re.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=Pt({},_.__s)),Pt(_.__s,re.getDerivedStateFromProps(k,_.__s))),I=_.props,D=_.state,_.__v=t,w)T&&re.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),T&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(T&&re.getDerivedStateFromProps==null&&k!==I&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(k,W),t.__v==r.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(k,_.__s,W)===!1){for(t.__v!=r.__v&&(_.props=k,_.state=_.__s,_.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ce){ce&&(ce.__=t)}),$=0;$<_._sb.length;$++)_.__h.push(_._sb[$]);_._sb=[],_.__h.length&&a.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(k,_.__s,W),T&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(I,D,F)})}if(_.context=W,_.props=k,_.__P=e,_.__e=!1,z=ke.__r,ee=0,T){for(_.state=_.__s,_.__d=!1,z&&z(t),g=_.render(_.props,_.state,_.context),Y=0;Y<_._sb.length;Y++)_.__h.push(_._sb[Y]);_._sb=[]}else do _.__d=!1,z&&z(t),g=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++ee<25);_.state=_.__s,_.getChildContext!=null&&(n=Pt(Pt({},n),_.getChildContext())),T&&!w&&_.getSnapshotBeforeUpdate!=null&&(F=_.getSnapshotBeforeUpdate(I,D)),K=g,g!=null&&g.type===$n&&g.key==null&&(K=Fl(g.props.children)),o=Bl(e,Un(K)?K:[K],t,r,n,i,s,a,o,h,p),_.base=t.__e,t.__u&=-161,_.__h.length&&a.push(_),O&&(_.__E=_.__=null)}catch(ce){if(t.__v=null,h||s!=null)if(ce.then){for(t.__u|=h?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;s[s.indexOf(o)]=null,t.__e=o}else{for(de=s.length;de--;)jo(s[de]);wo(t)}else t.__e=r.__e,t.__k=r.__k,ce.then||wo(t);ke.__e(ce,t,r)}else s==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):o=t.__e=_0(r.__e,t,r,n,i,s,a,h,p);return(g=ke.diffed)&&g(t),128&t.__u?void 0:o}function wo(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(wo)}function Ol(e,t,r){for(var n=0;n<r.length;n++)$o(r[n],r[++n],r[++n]);ke.__c&&ke.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(s){s.call(i)})}catch(s){ke.__e(s,i.__v)}})}function Fl(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Un(e)?e.map(Fl):Pt({},e)}function _0(e,t,r,n,i,s,a,o,h){var p,g,_,w,I,D,F,O=r.props||En,k=t.props,T=t.type;if(T=="svg"?i="http://www.w3.org/2000/svg":T=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(p=0;p<s.length;p++)if((I=s[p])&&"setAttribute"in I==!!T&&(T?I.localName==T:I.nodeType==3)){e=I,s[p]=null;break}}if(e==null){if(T==null)return document.createTextNode(k);e=document.createElementNS(i,T,k.is&&k),o&&(ke.__m&&ke.__m(t,s),o=!1),s=null}if(T==null)O===k||o&&e.data==k||(e.data=k);else{if(s=s&&jn.call(e.childNodes),!o&&s!=null)for(O={},p=0;p<e.attributes.length;p++)O[(I=e.attributes[p]).name]=I.value;for(p in O)if(I=O[p],p!="children"){if(p=="dangerouslySetInnerHTML")_=I;else if(!(p in k)){if(p=="value"&&"defaultValue"in k||p=="checked"&&"defaultChecked"in k)continue;si(e,p,null,I,i)}}for(p in k)I=k[p],p=="children"?w=I:p=="dangerouslySetInnerHTML"?g=I:p=="value"?D=I:p=="checked"?F=I:o&&typeof I!="function"||O[p]===I||si(e,p,I,O[p],i);if(g)o||_&&(g.__html==_.__html||g.__html==e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(_&&(e.innerHTML=""),Bl(t.type=="template"?e.content:e,Un(w)?w:[w],t,r,n,T=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:r.__k&&Qr(r,0),o,h),s!=null)for(p=s.length;p--;)jo(s[p]);o||(p="value",T=="progress"&&D==null?e.removeAttribute("value"):D!=null&&(D!==e[p]||T=="progress"&&!D||T=="option"&&D!=O[p])&&si(e,p,D,O[p],i),p="checked",F!=null&&F!=e[p]&&si(e,p,F,O[p],i))}return e}function $o(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){ke.__e(i,r)}}function Dl(e,t,r){var n,i;if(ke.unmount&&ke.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||$o(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){ke.__e(s,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Dl(n[i],t,r||typeof e.type!="function");r||jo(e.__e),e.__c=e.__=e.__e=void 0}function m0(e,t,r){return this.constructor(e,r)}function jl(e,t,r){var n,i,s,a;t==document&&(t=document.documentElement),ke.__&&ke.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,s=[],a=[],Uo(t,e=(!n&&r||t).__k=mo($n,null,[e]),i||En,En,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?jn.call(t.childNodes):null,s,!n&&r?r:i?i.__e:t.firstChild,n,a),Ol(s,e,a)}function Ul(e,t){jl(e,t,Ul)}function y0(e,t,r){var n,i,s,a,o=Pt({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s]===void 0&&a!=null?a[s]:t[s];return arguments.length>2&&(o.children=arguments.length>3?jn.call(arguments,2):r),yn(e.type,o,n||e.key,i||e.ref,null)}function w0(e){function t(r){var n,i;return this.getChildContext||(n=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&n.forEach(function(a){a.__e=!0,yo(a)})},this.sub=function(s){n.add(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){n&&n.delete(s),a&&a.call(s)}}),r.children}return t.__c="__cC"+Al++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t}jn=Tl.slice,ke={__e:function(e,t,r,n){for(var i,s,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(o){e=o}throw e}},Cl=0,Ml=function(e){return e!=null&&e.constructor==null},wn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Pt({},this.state),typeof e=="function"&&(e=e(Pt({},r),this.props)),e&&Pt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),yo(this))},wn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),yo(this))},wn.prototype.render=$n,gr=[],kl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xl=function(e,t){return e.__v.__b-t.__v.__b},Ci.__r=0,Il=/(PointerCapture)$|Capture$/i,Do=0,go=Fa(!1),_o=Fa(!0),Al=0;const v0=Object.freeze(Object.defineProperty({__proto__:null,Component:wn,Fragment:$n,cloneElement:y0,createContext:w0,createElement:mo,createRef:d0,h:mo,hydrate:Ul,get isValidElement(){return Ml},get options(){return ke},render:jl,toChildArray:Pl},Symbol.toStringTag,{value:"Module"})),lt=sn(v0);var qi={};function $l(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=$l(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Da(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=$l(e))&&(n&&(n+=" "),n+=t);return n}const b0=Object.freeze(Object.defineProperty({__proto__:null,clsx:Da,default:Da},Symbol.toStringTag,{value:"Module"})),Hn=sn(b0);var Ht,Me,Ls,ja,Yr=0,Hl=[],Ge=ke,Ua=Ge.__b,$a=Ge.__r,Ha=Ge.diffed,Wa=Ge.__c,Va=Ge.unmount,za=Ge.__;function Rr(e,t){Ge.__h&&Ge.__h(Me,e,Yr||t),Yr=0;var r=Me.__H||(Me.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Wl(e){return Yr=1,Vl(ql,e)}function Vl(e,t,r){var n=Rr(Ht++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):ql(void 0,t),function(o){var h=n.__N?n.__N[0]:n.__[0],p=n.t(h,o);h!==p&&(n.__N=[p,n.__[1]],n.__c.setState({}))}],n.__c=Me,!Me.__f)){var i=function(o,h,p){if(!n.__c.__H)return!0;var g=n.__c.__H.__.filter(function(w){return!!w.__c});if(g.every(function(w){return!w.__N}))return!s||s.call(this,o,h,p);var _=n.__c.props!==o;return g.forEach(function(w){if(w.__N){var I=w.__[0];w.__=w.__N,w.__N=void 0,I!==w.__[0]&&(_=!0)}}),s&&s.call(this,o,h,p)||_};Me.__f=!0;var s=Me.shouldComponentUpdate,a=Me.componentWillUpdate;Me.componentWillUpdate=function(o,h,p){if(this.__e){var g=s;s=void 0,i(o,h,p),s=g}a&&a.call(this,o,h,p)},Me.shouldComponentUpdate=i}return n.__N||n.__}function E0(e,t){var r=Rr(Ht++,3);!Ge.__s&&Wo(r.__H,t)&&(r.__=e,r.u=t,Me.__H.__h.push(r))}function zl(e,t){var r=Rr(Ht++,4);!Ge.__s&&Wo(r.__H,t)&&(r.__=e,r.u=t,Me.__h.push(r))}function S0(e){return Yr=5,Ho(function(){return{current:e}},[])}function R0(e,t,r){Yr=6,zl(function(){if(typeof e=="function"){var n=e(t());return function(){e(null),n&&typeof n=="function"&&n()}}if(e)return e.current=t(),function(){return e.current=null}},r==null?r:r.concat(e))}function Ho(e,t){var r=Rr(Ht++,7);return Wo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function C0(e,t){return Yr=8,Ho(function(){return e},t)}function M0(e){var t=Me.context[e.__c],r=Rr(Ht++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(Me)),t.props.value):e.__}function k0(e,t){Ge.useDebugValue&&Ge.useDebugValue(t?t(e):e)}function x0(e){var t=Rr(Ht++,10),r=Wl();return t.__=e,Me.componentDidCatch||(Me.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function I0(){var e=Rr(Ht++,11);if(!e.__){for(var t=Me.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function A0(){for(var e;e=Hl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(vi),e.__H.__h.forEach(vo),e.__H.__h=[]}catch(t){e.__H.__h=[],Ge.__e(t,e.__v)}}Ge.__b=function(e){Me=null,Ua&&Ua(e)},Ge.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),za&&za(e,t)},Ge.__r=function(e){$a&&$a(e),Ht=0;var t=(Me=e.__c).__H;t&&(Ls===Me?(t.__h=[],Me.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(vi),t.__h.forEach(vo),t.__h=[],Ht=0)),Ls=Me},Ge.diffed=function(e){Ha&&Ha(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Hl.push(t)!==1&&ja===Ge.requestAnimationFrame||((ja=Ge.requestAnimationFrame)||T0)(A0)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ls=Me=null},Ge.__c=function(e,t){t.some(function(r){try{r.__h.forEach(vi),r.__h=r.__h.filter(function(n){return!n.__||vo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ge.__e(n,r.__v)}}),Wa&&Wa(e,t)},Ge.unmount=function(e){Va&&Va(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{vi(n)}catch(i){t=i}}),r.__H=void 0,t&&Ge.__e(t,r.__v))};var qa=typeof requestAnimationFrame=="function";function T0(e){var t,r=function(){clearTimeout(n),qa&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);qa&&(t=requestAnimationFrame(r))}function vi(e){var t=Me,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Me=t}function vo(e){var t=Me;e.__c=e.__(),Me=t}function Wo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function ql(e,t){return typeof t=="function"?t(e):t}const N0=Object.freeze(Object.defineProperty({__proto__:null,useCallback:C0,useContext:M0,useDebugValue:k0,useEffect:E0,useErrorBoundary:x0,useId:I0,useImperativeHandle:R0,useLayoutEffect:zl,useMemo:Ho,useReducer:Vl,useRef:S0,useState:Wl},Symbol.toStringTag,{value:"Module"})),Gi=sn(N0);var Xr={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.CloseIcon=void 0;const Ga=lt;function B0(e){return(0,Ga.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ga.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Ji.CloseIcon=B0;var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.CoinbaseWalletRound=void 0;const oi=lt;function L0(e){return(0,oi.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,oi.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,oi.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,oi.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}Zi.CoinbaseWalletRound=L0;var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.QRCodeIcon=void 0;const gn=lt;function P0(e){return(0,gn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,gn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,gn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,gn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,gn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Ki.QRCodeIcon=P0;var Qi={};function Gl(e){this.mode=ft.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Gl.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Ot(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Ot.prototype={addData:function(e){var t=new Gl(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Ot.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=qe.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var a=s*i,o=0;o<this.modules[s].length;o++){var h=o*i,p=this.modules[s][o];p&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+i,a),n.lineTo(h+i,a+i),n.lineTo(h,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=qe.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var a=-2;a<=2;a++)s==-2||s==2||a==-2||a==2||s==0&&a==0?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}},setupTypeNumber:function(e){for(var t=qe.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=qe.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var o=0;o<2;o++)if(this.modules[n][a-o]==null){var h=!1;s<e.length&&(h=(e[s]>>>i&1)==1);var p=qe.getMask(t,n,a-o);p&&(h=!h),this.modules[n][a-o]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Ot.PAD0=236;Ot.PAD1=17;Ot.createData=function(e,t,r){for(var n=Lt.getRSBlocks(e,t),i=new Jl,s=0;s<r.length;s++){var a=r[s];i.put(a.mode,4),i.put(a.getLength(),qe.getLengthInBits(a.mode,e)),a.write(i)}for(var o=0,s=0;s<n.length;s++)o+=n[s].dataCount;if(i.getLengthInBits()>o*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(Ot.PAD0,8),i.getLengthInBits()>=o*8));)i.put(Ot.PAD1,8);return Ot.createBytes(i,n)};Ot.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),a=new Array(t.length),o=0;o<t.length;o++){var h=t[o].dataCount,p=t[o].totalCount-h;n=Math.max(n,h),i=Math.max(i,p),s[o]=new Array(h);for(var g=0;g<s[o].length;g++)s[o][g]=255&e.buffer[g+r];r+=h;var _=qe.getErrorCorrectPolynomial(p),w=new zr(s[o],_.getLength()-1),I=w.mod(_);a[o]=new Array(_.getLength()-1);for(var g=0;g<a[o].length;g++){var D=g+I.getLength()-a[o].length;a[o][g]=D>=0?I.get(D):0}}for(var F=0,g=0;g<t.length;g++)F+=t[g].totalCount;for(var O=new Array(F),k=0,g=0;g<n;g++)for(var o=0;o<t.length;o++)g<s[o].length&&(O[k++]=s[o][g]);for(var g=0;g<i;g++)for(var o=0;o<t.length;o++)g<a[o].length&&(O[k++]=a[o][g]);return O};var ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Jt={L:1,M:0,Q:3,H:2},zt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},qe={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15)>=0;)t^=qe.G15<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15);return(e<<10|t)^qe.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18)>=0;)t^=qe.G18<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return qe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case zt.PATTERN000:return(t+r)%2==0;case zt.PATTERN001:return t%2==0;case zt.PATTERN010:return r%3==0;case zt.PATTERN011:return(t+r)%3==0;case zt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case zt.PATTERN101:return t*r%2+t*r%3==0;case zt.PATTERN110:return(t*r%2+t*r%3)%2==0;case zt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new zr([1],0),r=0;r<e;r++)t=t.multiply(new zr([1,rt.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ft.MODE_NUMBER:return 10;case ft.MODE_ALPHA_NUM:return 9;case ft.MODE_8BIT_BYTE:return 8;case ft.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ft.MODE_NUMBER:return 12;case ft.MODE_ALPHA_NUM:return 11;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ft.MODE_NUMBER:return 14;case ft.MODE_ALPHA_NUM:return 13;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,a=e.isDark(n,i),o=-1;o<=1;o++)if(!(n+o<0||t<=n+o))for(var h=-1;h<=1;h++)i+h<0||t<=i+h||o==0&&h==0||a==e.isDark(n+o,i+h)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var p=0;e.isDark(n,i)&&p++,e.isDark(n+1,i)&&p++,e.isDark(n,i+1)&&p++,e.isDark(n+1,i+1)&&p++,(p==0||p==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var g=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&g++;var _=Math.abs(100*g/t/t-50)/5;return r+=_*10,r}},rt={glog:function(e){if(e<1)throw new Error("glog("+e+")");return rt.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return rt.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var it=0;it<8;it++)rt.EXP_TABLE[it]=1<<it;for(var it=8;it<256;it++)rt.EXP_TABLE[it]=rt.EXP_TABLE[it-4]^rt.EXP_TABLE[it-5]^rt.EXP_TABLE[it-6]^rt.EXP_TABLE[it-8];for(var it=0;it<255;it++)rt.LOG_TABLE[rt.EXP_TABLE[it]]=it;function zr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}zr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=rt.gexp(rt.glog(this.get(r))+rt.glog(e.get(n)));return new zr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=rt.glog(this.get(0))-rt.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=rt.gexp(rt.glog(e.get(n))+t);return new zr(r,0).mod(e)}};function Lt(e,t){this.totalCount=e,this.dataCount=t}Lt.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Lt.getRSBlocks=function(e,t){var r=Lt.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var a=r[s*3+0],o=r[s*3+1],h=r[s*3+2],p=0;p<a;p++)i.push(new Lt(o,h));return i};Lt.getRsBlockTable=function(e,t){switch(t){case Jt.L:return Lt.RS_BLOCK_TABLE[(e-1)*4+0];case Jt.M:return Lt.RS_BLOCK_TABLE[(e-1)*4+1];case Jt.Q:return Lt.RS_BLOCK_TABLE[(e-1)*4+2];case Jt.H:return Lt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Jl(){this.buffer=[],this.length=0}Jl.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Ps=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Zl(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Jt.L;case"M":return Jt.M;case"Q":return Jt.Q;case"H":return Jt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,p){for(var g=i(h),_=1,w=0,I=0,D=Ps.length;I<=D;I++){var F=Ps[I];if(!F)throw new Error("Content too long: expected "+w+" but got "+g);switch(p){case"L":w=F[0];break;case"M":w=F[1];break;case"Q":w=F[2];break;case"H":w=F[3];break;default:throw new Error("Unknwon error correction level: "+p)}if(g<=w)break;_++}if(_>Ps.length)throw new Error("Content too long");return _}function i(h){var p=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return p.length+(p.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),o=r(this.options.ecl);this.qrcode=new Ot(a,o),this.qrcode.addData(s),this.qrcode.make()}Zl.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r
|
|
7
|
+
`:"",a=t.width,o=t.height,h=r.length,p=a/(h+2*t.padding),g=o/(h+2*t.padding),_=typeof t.join<"u"?!!t.join:!1,w=typeof t.swap<"u"?!!t.swap:!1,I=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,D=typeof t.predefined<"u"?!!t.predefined:!1,F=D?i+'<defs><path id="qrmodule" d="M0 0 h'+g+" v"+p+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",O=i+'<rect x="0" y="0" width="'+a+'" height="'+o+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,k="",T="",L=0;L<h;L++)for(var W=0;W<h;W++){var $=r[W][L];if($){var z=W*p+t.padding*p,ee=L*g+t.padding*g;if(w){var Y=z;z=ee,ee=Y}if(_){var K=p+z,de=g+ee;z=Number.isInteger(z)?Number(z):z.toFixed(2),ee=Number.isInteger(ee)?Number(ee):ee.toFixed(2),K=Number.isInteger(K)?Number(K):K.toFixed(2),de=Number.isInteger(de)?Number(de):de.toFixed(2),T+="M"+z+","+ee+" V"+de+" H"+K+" V"+ee+" H"+z+" Z "}else D?k+=i+'<use x="'+z.toString()+'" y="'+ee.toString()+'" href="#qrmodule" />'+s:k+=i+'<rect x="'+z.toString()+'" y="'+ee.toString()+'" width="'+p+'" height="'+g+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}_&&(k=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+T+'" />');let re="";if(this.options.image!==void 0&&this.options.image.svg){const A=a*this.options.image.width/100,c=o*this.options.image.height/100,d=a/2-A/2,y=o/2-c/2;re+=`<svg x="${d}" y="${y}" width="${A}" height="${c}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,re+=this.options.image.svg+s,re+="</svg>"}var ce="";switch(e.container){case"svg":I&&(ce+='<?xml version="1.0" standalone="yes"?>'+s),ce+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+o+'">'+s,ce+=F+O+k,ce+=re,ce+="</svg>";break;case"svg-viewbox":I&&(ce+='<?xml version="1.0" standalone="yes"?>'+s),ce+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+o+'">'+s,ce+=F+O+k,ce+=re,ce+="</svg>";break;case"g":ce+='<g width="'+a+'" height="'+o+'">'+s,ce+=F+O+k,ce+=re,ce+="</g>";break;default:ce+=(F+O+k+re).replace(/^\s+/,"");break}return ce};var O0=Zl,F0=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.QRCode=void 0;const D0=lt,Ja=Gi,j0=F0(O0),U0=e=>{const[t,r]=(0,Ja.useState)("");return(0,Ja.useEffect)(()=>{var n,i;const s=new j0.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),a=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,D0.h)("img",{src:t,alt:"QR Code"}):null};Qi.QRCode=U0;var Yi={},Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var $0=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.Spinner=void 0;const ai=lt,H0=$0(Vo),W0=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,ai.h)("div",{class:"-cbwsdk-spinner"},(0,ai.h)("style",null,H0.default),(0,ai.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ai.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Yi.Spinner=W0;var zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var Kl=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CoinbaseWalletSteps=Xr.ConnectContent=void 0;const vr=Kl(Hn),me=lt,V0=X,z0=an,q0=Ji,G0=Zi,J0=Ki,Z0=Qi,K0=Yi,Q0=Kl(zo),Os={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Ql},Y0=e=>e==="light"?"#FFFFFF":"#0A0B0D";function X0(e){const{theme:t}=e,r=(0,V0.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Os.steps;return(0,me.h)("div",{"data-testid":"connect-content",className:(0,vr.default)("-cbwsdk-connect-content",t)},(0,me.h)("style",null,Q0.default),(0,me.h)("div",{className:"-cbwsdk-connect-content-header"},(0,me.h)("h2",{className:(0,vr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,me.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,me.h)(q0.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,me.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,me.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,me.h)(ep,{title:Os.title,description:Os.description,theme:t})),(0,me.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,me.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,me.h)(Z0.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,me.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:z0.LIB_VERSION}),(0,me.h)("input",{type:"hidden",value:r})),(0,me.h)(n,{theme:t}),!e.isConnected&&(0,me.h)("div",{"data-testid":"connecting-spinner",className:(0,vr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,me.h)(K0.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,me.h)("p",null,"Connecting...")))))}Xr.ConnectContent=X0;function ep({title:e,description:t,theme:r}){return(0,me.h)("div",{className:(0,vr.default)("-cbwsdk-connect-item",r)},(0,me.h)("div",null,(0,me.h)(G0.CoinbaseWalletRound,null)),(0,me.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,me.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,me.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Ql({theme:e}){return(0,me.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,me.h)("li",{className:(0,vr.default)("-cbwsdk-wallet-steps-item",e)},(0,me.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,me.h)("li",{className:(0,vr.default)("-cbwsdk-wallet-steps-item",e)},(0,me.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,me.h)("span",null,"Tap ",(0,me.h)("strong",null,"Scan")," "),(0,me.h)("span",{className:(0,vr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,me.h)(J0.QRCodeIcon,{fill:Y0(e)})))))}Xr.CoinbaseWalletSteps=Ql;var Xi={},es={};Object.defineProperty(es,"__esModule",{value:!0});es.ArrowLeftIcon=void 0;const Za=lt;function tp(e){return(0,Za.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Za.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}es.ArrowLeftIcon=tp;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.LaptopIcon=void 0;const Fs=lt;function rp(e){return(0,Fs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Fs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Fs.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}ts.LaptopIcon=rp;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});rs.SafeIcon=void 0;const Ka=lt;function np(e){return(0,Ka.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ka.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}rs.SafeIcon=np;var qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Yl=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.TryExtensionContent=void 0;const hr=Yl(Hn),Ke=lt,Ds=Gi,ip=es,sp=ts,op=rs,ap=Yl(qo);function cp({theme:e}){const[t,r]=(0,Ds.useState)(!1),n=(0,Ds.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ds.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Ke.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension",e)},(0,Ke.h)("style",null,ap.default),(0,Ke.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ke.h)("h3",{class:(0,hr.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Ke.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ke.h)("button",{class:(0,hr.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Ke.h)("div",null,!t&&(0,Ke.h)(ip.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Ke.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ke.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ke.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ke.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ke.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ke.h)(sp.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ke.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Ke.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ke.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ke.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ke.h)(op.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ke.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Xi.TryExtensionContent=cp;var Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Xl=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qi,"__esModule",{value:!0});qi.ConnectDialog=void 0;const js=Xl(Hn),fr=lt,Us=Gi,lp=Xr,up=Xi,hp=Xl(Go),fp=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,Us.useState)(!t),[s,a]=(0,Us.useState)(!t);(0,Us.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[t]);const o=r?"dark":"light";return(0,fr.h)("div",{class:(0,js.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,fr.h)("style",null,hp.default),(0,fr.h)("div",{class:(0,js.default)("-cbwsdk-connect-dialog-backdrop",o,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,fr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,fr.h)("div",{class:(0,js.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,fr.h)(lp.ConnectContent,{theme:o,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,fr.h)(up.TryExtensionContent,{theme:o}))))};qi.ConnectDialog=fp;Object.defineProperty(zi,"__esModule",{value:!0});zi.LinkFlow=void 0;const $s=lt,dp=qi;class pp{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,$s.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,$s.render)((0,$s.h)(dp.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}zi.LinkFlow=pp;var Jo={},Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=te&&te.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Hn),n=lt,i=Gi,s=t(Zo),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(w){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=w.darkMode}attach(w){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",w.appendChild(this.root),this.render()}presentItem(w){const I=this.nextItemKey++;return this.items.set(I,w),this.render(),()=>{this.items.delete(I),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([w,I])=>(0,n.h)(e.SnackbarInstance,Object.assign({},I,{key:w}))))),this.root)}}e.Snackbar=h;const p=_=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},_.children));e.SnackbarContainer=p;const g=({autoExpand:_,message:w,menuItems:I})=>{const[D,F]=(0,i.useState)(!0),[O,k]=(0,i.useState)(_??!1);(0,i.useEffect)(()=>{const L=[window.setTimeout(()=>{F(!1)},1),window.setTimeout(()=>{k(!0)},1e4)];return()=>{L.forEach(window.clearTimeout)}});const T=()=>{k(!O)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",D&&"-cbwsdk-snackbar-instance-hidden",O&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:T},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},w),(0,n.h)("div",{class:"-gear-container"},!O&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),I&&I.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},I.map((L,W)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:L.onClick,key:W},(0,n.h)("svg",{width:L.svgWidth,height:L.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":L.defaultFillRule,"clip-rule":L.defaultClipRule,d:L.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},L.info)))))};e.SnackbarInstance=g})(Jo);Object.defineProperty(Fn,"__esModule",{value:!0});Fn.WalletLinkRelayUI=void 0;const gp=Dn,_p=zi,mp=Jo;class yp{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new mp.Snackbar({darkMode:t.darkMode}),this.linkFlow=new _p.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,gp.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Fn.WalletLinkRelayUI=yp;Object.defineProperty(Tn,"__esModule",{value:!0});Tn.WalletLinkRelay=void 0;const Ur=Mn,wp=Ye,ze=X,dr=cn,Qa=wt,qt=ln,vp=Hi,pr=on,bp=Fn;class Ut extends Qa.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var o;this.isLinked=a;const h=this.storage.getItem(Qa.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const p=h.split(" "),g=this.storage.getItem("IsStandaloneSigning")==="true";if(p[0]!==""&&!a&&this.session.linked&&!g){this.isUnlinkedErrorState=!0;const _=this.getSessionIdHash();(o=this.diagnostic)===null||o===void 0||o.log(dr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:_})}}},this.metadataUpdated=(a,o)=>{this.storage.setItem(a,o)},this.chainUpdated=(a,o)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===o||(this.chainCallbackParams={chainId:a,jsonRpcUrl:o},this.chainCallback&&this.chainCallback(a,o))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Ut.accountRequestCallbackIds.size>0&&(Array.from(Ut.accountRequestCallbackIds.values()).forEach(o=>{const h={type:"WEB3_RESPONSE",id:o,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:o}))}),Ut.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=qt.Session.load(this.storage)||new qt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new vp.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,o=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:t});return i.connect(),{session:t,ui:o,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(dr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=qt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(dr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:qt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:o}=this.subscribe();this._session=s,this.connection=o,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(dr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,ze.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,ze.hexStringFromBuffer)(t,!0),signature:(0,ze.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ze.bigIntStringFromBN)(t.weiValue),data:(0,ze.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ze.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,ze.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,ze.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,ze.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ze.bigIntStringFromBN)(t.weiValue),data:(0,ze.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ze.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,ze.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,ze.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,ze.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,ze.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,ze.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,ze.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r==null||r()};return{promise:new Promise((a,o)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r==null||r(),(0,pr.isErrorResponse)(h))return o(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof bp.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=qt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(dr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?qt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var o;(o=this.diagnostic)===null||o===void 0||o.log(dr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?qt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(dr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ut.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Ut.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Ur.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,ze.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,o=>{if(this.ui.hideRequestEthereumAccounts(),(0,pr.isErrorResponse)(o))return a(new Error(o.errorMessage));s(o)}),this.ui.inlineAccountsResponse()){const o=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:o})}else{const o=Ur.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(o)})}Ut.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider"},n=(0,ze.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,o)=>{this.relayEventManager.callbacks.set(n,g=>{if((0,pr.isErrorResponse)(g))return o(new Error(g.errorMessage));a(g)});const h=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:wp.ProviderType.Unselected}})},p=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:g}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:p,onCancel:h,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,a){const o={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const p=(0,ze.randomBytesHex)(8),g=w=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,w),h==null||h()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload}));const _=new Promise((w,I)=>{this.relayEventManager.callbacks.set(p,O=>{if(h==null||h(),(0,pr.isErrorResponse)(O))return I(new Error(O.errorMessage));w(O)});const D=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"watchAsset",result:!1}})},F=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:F,onCancel:D,type:t,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(p,o)});return{cancel:g,promise:_}}addEthereumChain(t,r,n,i,s,a){const o={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const p=(0,ze.randomBytesHex)(8),g=w=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,o.method,w),h==null||h()};return this.ui.inlineAddEthereumChain(t)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload})),{promise:new Promise((w,I)=>{this.relayEventManager.callbacks.set(p,O=>{if(h==null||h(),(0,pr.isErrorResponse)(O))return I(new Error(O.errorMessage));w(O)});const D=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},F=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:O}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:D,onApprove:F,chainId:o.params.chainId,rpcUrls:o.params.rpcUrls,blockExplorerUrls:o.params.blockExplorerUrls,chainName:o.params.chainName,iconUrls:o.params.iconUrls,nativeCurrency:o.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(p,o)}),cancel:g}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,ze.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,o)};return{promise:new Promise((o,h)=>{this.relayEventManager.callbacks.set(i,_=>{if((0,pr.isErrorResponse)(_)&&_.errorCode)return h(Ur.standardErrors.provider.custom({code:_.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,pr.isErrorResponse)(_))return h(new Error(_.errorMessage));o(_)});const p=_=>{var w;if(_){const I=(w=(0,Ur.getErrorCode)(_))!==null&&w!==void 0?w:Ur.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",_ instanceof Error?_:Ur.standardErrors.provider.unsupportedChain(t),I)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},g=_=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:_}}})};this.ui.switchEthereumChain({onCancel:p,onApprove:g,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return qt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Tn.WalletLinkRelay=Ut;Ut.accountRequestCallbackIds=new Set;var Wn={},ns={},eu={};(function(e){var t=te&&te.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Jo,e)})(eu);var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var tu=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ns,"__esModule",{value:!0});ns.RedirectDialog=void 0;const Ep=tu(Hn),Nt=lt,Sp=Dn,Rp=eu,Cp=tu(Ko);class Mp{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,Sp.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Nt.render)(null,this.root),t&&(0,Nt.render)((0,Nt.h)(kp,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}ns.RedirectDialog=Mp;const kp=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Nt.h)(Rp.SnackbarContainer,{darkMode:r},(0,Nt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Nt.h)("style",null,Cp.default),(0,Nt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Nt.h)("div",{class:(0,Ep.default)("-cbwsdk-redirect-dialog-box",s)},(0,Nt.h)("p",null,e),(0,Nt.h)("button",{onClick:n},t))))};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.MobileRelayUI=void 0;const xp=ns;class Ip{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new xp.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Wn.MobileRelayUI=Ip;Object.defineProperty(An,"__esModule",{value:!0});An.MobileRelay=void 0;const Ap=X,Tp=Tn,Np=Wn;class Bp extends Tp.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,Ap.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof Np.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}An.MobileRelay=Bp;var bo={exports:{}},ru=Ii.EventEmitter,Hs,Ya;function Lp(){if(Ya)return Hs;Ya=1;function e(D,F){var O=Object.keys(D);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(D);F&&(k=k.filter(function(T){return Object.getOwnPropertyDescriptor(D,T).enumerable})),O.push.apply(O,k)}return O}function t(D){for(var F=1;F<arguments.length;F++){var O=arguments[F]!=null?arguments[F]:{};F%2?e(Object(O),!0).forEach(function(k){r(D,k,O[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach(function(k){Object.defineProperty(D,k,Object.getOwnPropertyDescriptor(O,k))})}return D}function r(D,F,O){return F=a(F),F in D?Object.defineProperty(D,F,{value:O,enumerable:!0,configurable:!0,writable:!0}):D[F]=O,D}function n(D,F){if(!(D instanceof F))throw new TypeError("Cannot call a class as a function")}function i(D,F){for(var O=0;O<F.length;O++){var k=F[O];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(D,a(k.key),k)}}function s(D,F,O){return F&&i(D.prototype,F),Object.defineProperty(D,"prototype",{writable:!1}),D}function a(D){var F=o(D,"string");return typeof F=="symbol"?F:String(F)}function o(D,F){if(typeof D!="object"||D===null)return D;var O=D[Symbol.toPrimitive];if(O!==void 0){var k=O.call(D,F);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(D)}var h=Nn,p=h.Buffer,g=Io,_=g.inspect,w=_&&_.custom||"inspect";function I(D,F,O){p.prototype.copy.call(D,F,O)}return Hs=function(){function D(){n(this,D),this.head=null,this.tail=null,this.length=0}return s(D,[{key:"push",value:function(O){var k={data:O,next:null};this.length>0?this.tail.next=k:this.head=k,this.tail=k,++this.length}},{key:"unshift",value:function(O){var k={data:O,next:this.head};this.length===0&&(this.tail=k),this.head=k,++this.length}},{key:"shift",value:function(){if(this.length!==0){var O=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,O}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(O){if(this.length===0)return"";for(var k=this.head,T=""+k.data;k=k.next;)T+=O+k.data;return T}},{key:"concat",value:function(O){if(this.length===0)return p.alloc(0);for(var k=p.allocUnsafe(O>>>0),T=this.head,L=0;T;)I(T.data,k,L),L+=T.data.length,T=T.next;return k}},{key:"consume",value:function(O,k){var T;return O<this.head.data.length?(T=this.head.data.slice(0,O),this.head.data=this.head.data.slice(O)):O===this.head.data.length?T=this.shift():T=k?this._getString(O):this._getBuffer(O),T}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(O){var k=this.head,T=1,L=k.data;for(O-=L.length;k=k.next;){var W=k.data,$=O>W.length?W.length:O;if($===W.length?L+=W:L+=W.slice(0,O),O-=$,O===0){$===W.length?(++T,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=W.slice($));break}++T}return this.length-=T,L}},{key:"_getBuffer",value:function(O){var k=p.allocUnsafe(O),T=this.head,L=1;for(T.data.copy(k),O-=T.data.length;T=T.next;){var W=T.data,$=O>W.length?W.length:O;if(W.copy(k,k.length-O,0,$),O-=$,O===0){$===W.length?(++L,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=W.slice($));break}++L}return this.length-=L,k}},{key:w,value:function(O,k){return _(this,t(t({},k),{},{depth:0,customInspect:!1}))}}]),D}(),Hs}function Pp(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Eo,this,e)):process.nextTick(Eo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(bi,r):(r._writableState.errorEmitted=!0,process.nextTick(Xa,r,s)):process.nextTick(Xa,r,s):t?(process.nextTick(bi,r),t(s)):process.nextTick(bi,r)}),this)}function Xa(e,t){Eo(e,t),bi(e)}function bi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Op(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Eo(e,t){e.emit("error",t)}function Fp(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var nu={destroy:Pp,undestroy:Op,errorOrDestroy:Fp},Cr={};function Dp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var iu={};function Et(e,t,r){r||(r=Error);function n(s,a,o){return typeof t=="string"?t:t(s,a,o)}var i=function(s){Dp(a,s);function a(o,h,p){return s.call(this,n(o,h,p))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,iu[e]=i}function ec(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function jp(e,t,r){return e.substr(0,t.length)===t}function Up(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function $p(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Et("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Et("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&jp(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Up(e," argument"))i="The ".concat(e," ").concat(n," ").concat(ec(t,"type"));else{var s=$p(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(ec(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Et("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Et("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Et("ERR_STREAM_PREMATURE_CLOSE","Premature close");Et("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Et("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Et("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Et("ERR_STREAM_WRITE_AFTER_END","write after end");Et("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Et("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Et("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Cr.codes=iu;var Hp=Cr.codes.ERR_INVALID_OPT_VALUE;function Wp(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Vp(e,t,r,n){var i=Wp(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Hp(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var su={getHighWaterMark:Vp},zp=qp;function qp(e,t){if(Ws("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Ws("throwDeprecation"))throw new Error(t);Ws("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Ws(e){try{if(!te.localStorage)return!1}catch{return!1}var t=te.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Vs,tc;function ou(){if(tc)return Vs;tc=1,Vs=Y;function e(N){var j=this;this.next=null,this.entry=null,this.finish=function(){J(j,N)}}var t;Y.WritableState=z;var r={deprecate:zp},n=ru,i=Nn.Buffer,s=(typeof te<"u"?te:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(N){return i.from(N)}function o(N){return i.isBuffer(N)||N instanceof s}var h=nu,p=su,g=p.getHighWaterMark,_=Cr.codes,w=_.ERR_INVALID_ARG_TYPE,I=_.ERR_METHOD_NOT_IMPLEMENTED,D=_.ERR_MULTIPLE_CALLBACK,F=_.ERR_STREAM_CANNOT_PIPE,O=_.ERR_STREAM_DESTROYED,k=_.ERR_STREAM_NULL_VALUES,T=_.ERR_STREAM_WRITE_AFTER_END,L=_.ERR_UNKNOWN_ENCODING,W=h.errorOrDestroy;Mt(Y,n);function $(){}function z(N,j,V){t=t||en(),N=N||{},typeof V!="boolean"&&(V=j instanceof t),this.objectMode=!!N.objectMode,V&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=g(this,N,"writableHighWaterMark",V),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Z=N.decodeStrings===!1;this.decodeStrings=!Z,this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ue){y(j,ue)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=N.emitClose!==!1,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}z.prototype.getBuffer=function(){for(var j=this.bufferedRequest,V=[];j;)V.push(j),j=j.next;return V},function(){try{Object.defineProperty(z.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ee;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ee=Function.prototype[Symbol.hasInstance],Object.defineProperty(Y,Symbol.hasInstance,{value:function(j){return ee.call(this,j)?!0:this!==Y?!1:j&&j._writableState instanceof z}})):ee=function(j){return j instanceof this};function Y(N){t=t||en();var j=this instanceof t;if(!j&&!ee.call(Y,this))return new Y(N);this._writableState=new z(N,this,j),this.writable=!0,N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final)),n.call(this)}Y.prototype.pipe=function(){W(this,new F)};function K(N,j){var V=new T;W(N,V),process.nextTick(j,V)}function de(N,j,V,Z){var ue;return V===null?ue=new k:typeof V!="string"&&!j.objectMode&&(ue=new w("chunk",["string","Buffer"],V)),ue?(W(N,ue),process.nextTick(Z,ue),!1):!0}Y.prototype.write=function(N,j,V){var Z=this._writableState,ue=!1,C=!Z.objectMode&&o(N);return C&&!i.isBuffer(N)&&(N=a(N)),typeof j=="function"&&(V=j,j=null),C?j="buffer":j||(j=Z.defaultEncoding),typeof V!="function"&&(V=$),Z.ending?K(this,V):(C||de(this,Z,N,V))&&(Z.pendingcb++,ue=ce(this,Z,C,N,j,V)),ue},Y.prototype.cork=function(){this._writableState.corked++},Y.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,!N.writing&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&x(this,N))},Y.prototype.setDefaultEncoding=function(j){if(typeof j=="string"&&(j=j.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((j+"").toLowerCase())>-1))throw new L(j);return this._writableState.defaultEncoding=j,this},Object.defineProperty(Y.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function re(N,j,V){return!N.objectMode&&N.decodeStrings!==!1&&typeof j=="string"&&(j=i.from(j,V)),j}Object.defineProperty(Y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ce(N,j,V,Z,ue,C){if(!V){var M=re(j,Z,ue);Z!==M&&(V=!0,ue="buffer",Z=M)}var q=j.objectMode?1:Z.length;j.length+=q;var G=j.length<j.highWaterMark;if(G||(j.needDrain=!0),j.writing||j.corked){var oe=j.lastBufferedRequest;j.lastBufferedRequest={chunk:Z,encoding:ue,isBuf:V,callback:C,next:null},oe?oe.next=j.lastBufferedRequest:j.bufferedRequest=j.lastBufferedRequest,j.bufferedRequestCount+=1}else A(N,j,!1,q,Z,ue,C);return G}function A(N,j,V,Z,ue,C,M){j.writelen=Z,j.writecb=M,j.writing=!0,j.sync=!0,j.destroyed?j.onwrite(new O("write")):V?N._writev(ue,j.onwrite):N._write(ue,C,j.onwrite),j.sync=!1}function c(N,j,V,Z,ue){--j.pendingcb,V?(process.nextTick(ue,Z),process.nextTick(R,N,j),N._writableState.errorEmitted=!0,W(N,Z)):(ue(Z),N._writableState.errorEmitted=!0,W(N,Z),R(N,j))}function d(N){N.writing=!1,N.writecb=null,N.length-=N.writelen,N.writelen=0}function y(N,j){var V=N._writableState,Z=V.sync,ue=V.writecb;if(typeof ue!="function")throw new D;if(d(V),j)c(N,V,Z,j,ue);else{var C=B(V)||N.destroyed;!C&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&x(N,V),Z?process.nextTick(v,N,V,C,ue):v(N,V,C,ue)}}function v(N,j,V,Z){V||S(N,j),j.pendingcb--,Z(),R(N,j)}function S(N,j){j.length===0&&j.needDrain&&(j.needDrain=!1,N.emit("drain"))}function x(N,j){j.bufferProcessing=!0;var V=j.bufferedRequest;if(N._writev&&V&&V.next){var Z=j.bufferedRequestCount,ue=new Array(Z),C=j.corkedRequestsFree;C.entry=V;for(var M=0,q=!0;V;)ue[M]=V,V.isBuf||(q=!1),V=V.next,M+=1;ue.allBuffers=q,A(N,j,!0,j.length,ue,"",C.finish),j.pendingcb++,j.lastBufferedRequest=null,C.next?(j.corkedRequestsFree=C.next,C.next=null):j.corkedRequestsFree=new e(j),j.bufferedRequestCount=0}else{for(;V;){var G=V.chunk,oe=V.encoding,he=V.callback,ne=j.objectMode?1:G.length;if(A(N,j,!1,ne,G,oe,he),V=V.next,j.bufferedRequestCount--,j.writing)break}V===null&&(j.lastBufferedRequest=null)}j.bufferedRequest=V,j.bufferProcessing=!1}Y.prototype._write=function(N,j,V){V(new I("_write()"))},Y.prototype._writev=null,Y.prototype.end=function(N,j,V){var Z=this._writableState;return typeof N=="function"?(V=N,N=null,j=null):typeof j=="function"&&(V=j,j=null),N!=null&&this.write(N,j),Z.corked&&(Z.corked=1,this.uncork()),Z.ending||Q(this,Z,V),this},Object.defineProperty(Y.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function B(N){return N.ending&&N.length===0&&N.bufferedRequest===null&&!N.finished&&!N.writing}function b(N,j){N._final(function(V){j.pendingcb--,V&&W(N,V),j.prefinished=!0,N.emit("prefinish"),R(N,j)})}function u(N,j){!j.prefinished&&!j.finalCalled&&(typeof N._final=="function"&&!j.destroyed?(j.pendingcb++,j.finalCalled=!0,process.nextTick(b,N,j)):(j.prefinished=!0,N.emit("prefinish")))}function R(N,j){var V=B(j);if(V&&(u(N,j),j.pendingcb===0&&(j.finished=!0,N.emit("finish"),j.autoDestroy))){var Z=N._readableState;(!Z||Z.autoDestroy&&Z.endEmitted)&&N.destroy()}return V}function Q(N,j,V){j.ending=!0,R(N,j),V&&(j.finished?process.nextTick(V):N.once("finish",V)),j.ended=!0,N.writable=!1}function J(N,j,V){var Z=N.entry;for(N.entry=null;Z;){var ue=Z.callback;j.pendingcb--,ue(V),Z=Z.next}j.corkedRequestsFree.next=N}return Object.defineProperty(Y.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(j){this._writableState&&(this._writableState.destroyed=j)}}),Y.prototype.destroy=h.destroy,Y.prototype._undestroy=h.undestroy,Y.prototype._destroy=function(N,j){j(N)},Vs}var zs,rc;function en(){if(rc)return zs;rc=1;var e=Object.keys||function(p){var g=[];for(var _ in p)g.push(_);return g};zs=a;var t=cu(),r=ou();Mt(a,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];a.prototype[s]||(a.prototype[s]=r.prototype[s])}function a(p){if(!(this instanceof a))return new a(p);t.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",o)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o(){this._writableState.ended||process.nextTick(h,this)}function h(p){p.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(g){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=g,this._writableState.destroyed=g)}}),zs}var qs={},nc;function ic(){if(nc)return qs;nc=1;var e=Vt.Buffer,t=e.isEncoding||function(k){switch(k=""+k,k&&k.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(k){if(!k)return"utf8";for(var T;;)switch(k){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return k;default:if(T)return;k=(""+k).toLowerCase(),T=!0}}function n(k){var T=r(k);if(typeof T!="string"&&(e.isEncoding===t||!t(k)))throw new Error("Unknown encoding: "+k);return T||k}qs.StringDecoder=i;function i(k){this.encoding=n(k);var T;switch(this.encoding){case"utf16le":this.text=_,this.end=w,T=4;break;case"utf8":this.fillLast=h,T=4;break;case"base64":this.text=I,this.end=D,T=3;break;default:this.write=F,this.end=O;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(T)}i.prototype.write=function(k){if(k.length===0)return"";var T,L;if(this.lastNeed){if(T=this.fillLast(k),T===void 0)return"";L=this.lastNeed,this.lastNeed=0}else L=0;return L<k.length?T?T+this.text(k,L):this.text(k,L):T||""},i.prototype.end=g,i.prototype.text=p,i.prototype.fillLast=function(k){if(this.lastNeed<=k.length)return k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,k.length),this.lastNeed-=k.length};function s(k){return k<=127?0:k>>5===6?2:k>>4===14?3:k>>3===30?4:k>>6===2?-1:-2}function a(k,T,L){var W=T.length-1;if(W<L)return 0;var $=s(T[W]);return $>=0?($>0&&(k.lastNeed=$-1),$):--W<L||$===-2?0:($=s(T[W]),$>=0?($>0&&(k.lastNeed=$-2),$):--W<L||$===-2?0:($=s(T[W]),$>=0?($>0&&($===2?$=0:k.lastNeed=$-3),$):0))}function o(k,T,L){if((T[0]&192)!==128)return k.lastNeed=0,"�";if(k.lastNeed>1&&T.length>1){if((T[1]&192)!==128)return k.lastNeed=1,"�";if(k.lastNeed>2&&T.length>2&&(T[2]&192)!==128)return k.lastNeed=2,"�"}}function h(k){var T=this.lastTotal-this.lastNeed,L=o(this,k);if(L!==void 0)return L;if(this.lastNeed<=k.length)return k.copy(this.lastChar,T,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,T,0,k.length),this.lastNeed-=k.length}function p(k,T){var L=a(this,k,T);if(!this.lastNeed)return k.toString("utf8",T);this.lastTotal=L;var W=k.length-(L-this.lastNeed);return k.copy(this.lastChar,0,W),k.toString("utf8",T,W)}function g(k){var T=k&&k.length?this.write(k):"";return this.lastNeed?T+"�":T}function _(k,T){if((k.length-T)%2===0){var L=k.toString("utf16le",T);if(L){var W=L.charCodeAt(L.length-1);if(W>=55296&&W<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1],L.slice(0,-1)}return L}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=k[k.length-1],k.toString("utf16le",T,k.length-1)}function w(k){var T=k&&k.length?this.write(k):"";if(this.lastNeed){var L=this.lastTotal-this.lastNeed;return T+this.lastChar.toString("utf16le",0,L)}return T}function I(k,T){var L=(k.length-T)%3;return L===0?k.toString("base64",T):(this.lastNeed=3-L,this.lastTotal=3,L===1?this.lastChar[0]=k[k.length-1]:(this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1]),k.toString("base64",T,k.length-L))}function D(k){var T=k&&k.length?this.write(k):"";return this.lastNeed?T+this.lastChar.toString("base64",0,3-this.lastNeed):T}function F(k){return k.toString(this.encoding)}function O(k){return k&&k.length?this.write(k):""}return qs}var sc=Cr.codes.ERR_STREAM_PREMATURE_CLOSE;function Gp(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function Jp(){}function Zp(e){return e.setHeader&&typeof e.abort=="function"}function au(e,t,r){if(typeof t=="function")return au(e,null,t);t||(t={}),r=Gp(r||Jp);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||o()},a=e._writableState&&e._writableState.finished,o=function(){i=!1,a=!0,n||r.call(e)},h=e._readableState&&e._readableState.endEmitted,p=function(){n=!1,h=!0,i||r.call(e)},g=function(D){r.call(e,D)},_=function(){var D;if(n&&!h)return(!e._readableState||!e._readableState.ended)&&(D=new sc),r.call(e,D);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(D=new sc),r.call(e,D)},w=function(){e.req.on("finish",o)};return Zp(e)?(e.on("complete",o),e.on("abort",_),e.req?w():e.on("request",w)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",p),e.on("finish",o),t.error!==!1&&e.on("error",g),e.on("close",_),function(){e.removeListener("complete",o),e.removeListener("abort",_),e.removeListener("request",w),e.req&&e.req.removeListener("finish",o),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",o),e.removeListener("end",p),e.removeListener("error",g),e.removeListener("close",_)}}var Qo=au,Gs,oc;function Kp(){if(oc)return Gs;oc=1;var e;function t(L,W,$){return W=r(W),W in L?Object.defineProperty(L,W,{value:$,enumerable:!0,configurable:!0,writable:!0}):L[W]=$,L}function r(L){var W=n(L,"string");return typeof W=="symbol"?W:String(W)}function n(L,W){if(typeof L!="object"||L===null)return L;var $=L[Symbol.toPrimitive];if($!==void 0){var z=$.call(L,W);if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(W==="string"?String:Number)(L)}var i=Qo,s=Symbol("lastResolve"),a=Symbol("lastReject"),o=Symbol("error"),h=Symbol("ended"),p=Symbol("lastPromise"),g=Symbol("handlePromise"),_=Symbol("stream");function w(L,W){return{value:L,done:W}}function I(L){var W=L[s];if(W!==null){var $=L[_].read();$!==null&&(L[p]=null,L[s]=null,L[a]=null,W(w($,!1)))}}function D(L){process.nextTick(I,L)}function F(L,W){return function($,z){L.then(function(){if(W[h]){$(w(void 0,!0));return}W[g]($,z)},z)}}var O=Object.getPrototypeOf(function(){}),k=Object.setPrototypeOf((e={get stream(){return this[_]},next:function(){var W=this,$=this[o];if($!==null)return Promise.reject($);if(this[h])return Promise.resolve(w(void 0,!0));if(this[_].destroyed)return new Promise(function(K,de){process.nextTick(function(){W[o]?de(W[o]):K(w(void 0,!0))})});var z=this[p],ee;if(z)ee=new Promise(F(z,this));else{var Y=this[_].read();if(Y!==null)return Promise.resolve(w(Y,!1));ee=new Promise(this[g])}return this[p]=ee,ee}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var W=this;return new Promise(function($,z){W[_].destroy(null,function(ee){if(ee){z(ee);return}$(w(void 0,!0))})})}),e),O),T=function(W){var $,z=Object.create(k,($={},t($,_,{value:W,writable:!0}),t($,s,{value:null,writable:!0}),t($,a,{value:null,writable:!0}),t($,o,{value:null,writable:!0}),t($,h,{value:W._readableState.endEmitted,writable:!0}),t($,g,{value:function(Y,K){var de=z[_].read();de?(z[p]=null,z[s]=null,z[a]=null,Y(w(de,!1))):(z[s]=Y,z[a]=K)},writable:!0}),$));return z[p]=null,i(W,function(ee){if(ee&&ee.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Y=z[a];Y!==null&&(z[p]=null,z[s]=null,z[a]=null,Y(ee)),z[o]=ee;return}var K=z[s];K!==null&&(z[p]=null,z[s]=null,z[a]=null,K(w(void 0,!0))),z[h]=!0}),W.on("readable",D.bind(null,z)),z};return Gs=T,Gs}var Js,ac;function Qp(){return ac||(ac=1,Js=function(){throw new Error("Readable.from is not available in the browser")}),Js}var Zs,cc;function cu(){if(cc)return Zs;cc=1,Zs=K;var e;K.ReadableState=Y,Ii.EventEmitter;var t=function(M,q){return M.listeners(q).length},r=ru,n=Nn.Buffer,i=(typeof te<"u"?te:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(C){return n.from(C)}function a(C){return n.isBuffer(C)||C instanceof i}var o=Io,h;o&&o.debuglog?h=o.debuglog("stream"):h=function(){};var p=Lp(),g=nu,_=su,w=_.getHighWaterMark,I=Cr.codes,D=I.ERR_INVALID_ARG_TYPE,F=I.ERR_STREAM_PUSH_AFTER_EOF,O=I.ERR_METHOD_NOT_IMPLEMENTED,k=I.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,T,L,W;Mt(K,r);var $=g.errorOrDestroy,z=["error","close","destroy","pause","resume"];function ee(C,M,q){if(typeof C.prependListener=="function")return C.prependListener(M,q);!C._events||!C._events[M]?C.on(M,q):Array.isArray(C._events[M])?C._events[M].unshift(q):C._events[M]=[q,C._events[M]]}function Y(C,M,q){e=e||en(),C=C||{},typeof q!="boolean"&&(q=M instanceof e),this.objectMode=!!C.objectMode,q&&(this.objectMode=this.objectMode||!!C.readableObjectMode),this.highWaterMark=w(this,C,"readableHighWaterMark",q),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=C.emitClose!==!1,this.autoDestroy=!!C.autoDestroy,this.destroyed=!1,this.defaultEncoding=C.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,C.encoding&&(T||(T=ic().StringDecoder),this.decoder=new T(C.encoding),this.encoding=C.encoding)}function K(C){if(e=e||en(),!(this instanceof K))return new K(C);var M=this instanceof e;this._readableState=new Y(C,this,M),this.readable=!0,C&&(typeof C.read=="function"&&(this._read=C.read),typeof C.destroy=="function"&&(this._destroy=C.destroy)),r.call(this)}Object.defineProperty(K.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(M){this._readableState&&(this._readableState.destroyed=M)}}),K.prototype.destroy=g.destroy,K.prototype._undestroy=g.undestroy,K.prototype._destroy=function(C,M){M(C)},K.prototype.push=function(C,M){var q=this._readableState,G;return q.objectMode?G=!0:typeof C=="string"&&(M=M||q.defaultEncoding,M!==q.encoding&&(C=n.from(C,M),M=""),G=!0),de(this,C,M,!1,G)},K.prototype.unshift=function(C){return de(this,C,null,!0,!1)};function de(C,M,q,G,oe){h("readableAddChunk",M);var he=C._readableState;if(M===null)he.reading=!1,y(C,he);else{var ne;if(oe||(ne=ce(he,M)),ne)$(C,ne);else if(he.objectMode||M&&M.length>0)if(typeof M!="string"&&!he.objectMode&&Object.getPrototypeOf(M)!==n.prototype&&(M=s(M)),G)he.endEmitted?$(C,new k):re(C,he,M,!0);else if(he.ended)$(C,new F);else{if(he.destroyed)return!1;he.reading=!1,he.decoder&&!q?(M=he.decoder.write(M),he.objectMode||M.length!==0?re(C,he,M,!1):x(C,he)):re(C,he,M,!1)}else G||(he.reading=!1,x(C,he))}return!he.ended&&(he.length<he.highWaterMark||he.length===0)}function re(C,M,q,G){M.flowing&&M.length===0&&!M.sync?(M.awaitDrain=0,C.emit("data",q)):(M.length+=M.objectMode?1:q.length,G?M.buffer.unshift(q):M.buffer.push(q),M.needReadable&&v(C)),x(C,M)}function ce(C,M){var q;return!a(M)&&typeof M!="string"&&M!==void 0&&!C.objectMode&&(q=new D("chunk",["string","Buffer","Uint8Array"],M)),q}K.prototype.isPaused=function(){return this._readableState.flowing===!1},K.prototype.setEncoding=function(C){T||(T=ic().StringDecoder);var M=new T(C);this._readableState.decoder=M,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,G="";q!==null;)G+=M.write(q.data),q=q.next;return this._readableState.buffer.clear(),G!==""&&this._readableState.buffer.push(G),this._readableState.length=G.length,this};var A=1073741824;function c(C){return C>=A?C=A:(C--,C|=C>>>1,C|=C>>>2,C|=C>>>4,C|=C>>>8,C|=C>>>16,C++),C}function d(C,M){return C<=0||M.length===0&&M.ended?0:M.objectMode?1:C!==C?M.flowing&&M.length?M.buffer.head.data.length:M.length:(C>M.highWaterMark&&(M.highWaterMark=c(C)),C<=M.length?C:M.ended?M.length:(M.needReadable=!0,0))}K.prototype.read=function(C){h("read",C),C=parseInt(C,10);var M=this._readableState,q=C;if(C!==0&&(M.emittedReadable=!1),C===0&&M.needReadable&&((M.highWaterMark!==0?M.length>=M.highWaterMark:M.length>0)||M.ended))return h("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?V(this):v(this),null;if(C=d(C,M),C===0&&M.ended)return M.length===0&&V(this),null;var G=M.needReadable;h("need readable",G),(M.length===0||M.length-C<M.highWaterMark)&&(G=!0,h("length less than watermark",G)),M.ended||M.reading?(G=!1,h("reading or ended",G)):G&&(h("do read"),M.reading=!0,M.sync=!0,M.length===0&&(M.needReadable=!0),this._read(M.highWaterMark),M.sync=!1,M.reading||(C=d(q,M)));var oe;return C>0?oe=j(C,M):oe=null,oe===null?(M.needReadable=M.length<=M.highWaterMark,C=0):(M.length-=C,M.awaitDrain=0),M.length===0&&(M.ended||(M.needReadable=!0),q!==C&&M.ended&&V(this)),oe!==null&&this.emit("data",oe),oe};function y(C,M){if(h("onEofChunk"),!M.ended){if(M.decoder){var q=M.decoder.end();q&&q.length&&(M.buffer.push(q),M.length+=M.objectMode?1:q.length)}M.ended=!0,M.sync?v(C):(M.needReadable=!1,M.emittedReadable||(M.emittedReadable=!0,S(C)))}}function v(C){var M=C._readableState;h("emitReadable",M.needReadable,M.emittedReadable),M.needReadable=!1,M.emittedReadable||(h("emitReadable",M.flowing),M.emittedReadable=!0,process.nextTick(S,C))}function S(C){var M=C._readableState;h("emitReadable_",M.destroyed,M.length,M.ended),!M.destroyed&&(M.length||M.ended)&&(C.emit("readable"),M.emittedReadable=!1),M.needReadable=!M.flowing&&!M.ended&&M.length<=M.highWaterMark,N(C)}function x(C,M){M.readingMore||(M.readingMore=!0,process.nextTick(B,C,M))}function B(C,M){for(;!M.reading&&!M.ended&&(M.length<M.highWaterMark||M.flowing&&M.length===0);){var q=M.length;if(h("maybeReadMore read 0"),C.read(0),q===M.length)break}M.readingMore=!1}K.prototype._read=function(C){$(this,new O("_read()"))},K.prototype.pipe=function(C,M){var q=this,G=this._readableState;switch(G.pipesCount){case 0:G.pipes=C;break;case 1:G.pipes=[G.pipes,C];break;default:G.pipes.push(C);break}G.pipesCount+=1,h("pipe count=%d opts=%j",G.pipesCount,M);var oe=(!M||M.end!==!1)&&C!==process.stdout&&C!==process.stderr,he=oe?we:be;G.endEmitted?process.nextTick(he):q.once("end",he),C.on("unpipe",ne);function ne(m,l){h("onunpipe"),m===q&&l&&l.hasUnpiped===!1&&(l.hasUnpiped=!0,Ee())}function we(){h("onend"),C.end()}var pt=b(q);C.on("drain",pt);var Se=!1;function Ee(){h("cleanup"),C.removeListener("close",Re),C.removeListener("finish",et),C.removeListener("drain",pt),C.removeListener("error",ve),C.removeListener("unpipe",ne),q.removeListener("end",we),q.removeListener("end",be),q.removeListener("data",Qe),Se=!0,G.awaitDrain&&(!C._writableState||C._writableState.needDrain)&&pt()}q.on("data",Qe);function Qe(m){h("ondata");var l=C.write(m);h("dest.write",l),l===!1&&((G.pipesCount===1&&G.pipes===C||G.pipesCount>1&&ue(G.pipes,C)!==-1)&&!Se&&(h("false write response, pause",G.awaitDrain),G.awaitDrain++),q.pause())}function ve(m){h("onerror",m),be(),C.removeListener("error",ve),t(C,"error")===0&&$(C,m)}ee(C,"error",ve);function Re(){C.removeListener("finish",et),be()}C.once("close",Re);function et(){h("onfinish"),C.removeListener("close",Re),be()}C.once("finish",et);function be(){h("unpipe"),q.unpipe(C)}return C.emit("pipe",q),G.flowing||(h("pipe resume"),q.resume()),C};function b(C){return function(){var q=C._readableState;h("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&t(C,"data")&&(q.flowing=!0,N(C))}}K.prototype.unpipe=function(C){var M=this._readableState,q={hasUnpiped:!1};if(M.pipesCount===0)return this;if(M.pipesCount===1)return C&&C!==M.pipes?this:(C||(C=M.pipes),M.pipes=null,M.pipesCount=0,M.flowing=!1,C&&C.emit("unpipe",this,q),this);if(!C){var G=M.pipes,oe=M.pipesCount;M.pipes=null,M.pipesCount=0,M.flowing=!1;for(var he=0;he<oe;he++)G[he].emit("unpipe",this,{hasUnpiped:!1});return this}var ne=ue(M.pipes,C);return ne===-1?this:(M.pipes.splice(ne,1),M.pipesCount-=1,M.pipesCount===1&&(M.pipes=M.pipes[0]),C.emit("unpipe",this,q),this)},K.prototype.on=function(C,M){var q=r.prototype.on.call(this,C,M),G=this._readableState;return C==="data"?(G.readableListening=this.listenerCount("readable")>0,G.flowing!==!1&&this.resume()):C==="readable"&&!G.endEmitted&&!G.readableListening&&(G.readableListening=G.needReadable=!0,G.flowing=!1,G.emittedReadable=!1,h("on readable",G.length,G.reading),G.length?v(this):G.reading||process.nextTick(R,this)),q},K.prototype.addListener=K.prototype.on,K.prototype.removeListener=function(C,M){var q=r.prototype.removeListener.call(this,C,M);return C==="readable"&&process.nextTick(u,this),q},K.prototype.removeAllListeners=function(C){var M=r.prototype.removeAllListeners.apply(this,arguments);return(C==="readable"||C===void 0)&&process.nextTick(u,this),M};function u(C){var M=C._readableState;M.readableListening=C.listenerCount("readable")>0,M.resumeScheduled&&!M.paused?M.flowing=!0:C.listenerCount("data")>0&&C.resume()}function R(C){h("readable nexttick read 0"),C.read(0)}K.prototype.resume=function(){var C=this._readableState;return C.flowing||(h("resume"),C.flowing=!C.readableListening,Q(this,C)),C.paused=!1,this};function Q(C,M){M.resumeScheduled||(M.resumeScheduled=!0,process.nextTick(J,C,M))}function J(C,M){h("resume",M.reading),M.reading||C.read(0),M.resumeScheduled=!1,C.emit("resume"),N(C),M.flowing&&!M.reading&&C.read(0)}K.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function N(C){var M=C._readableState;for(h("flow",M.flowing);M.flowing&&C.read()!==null;);}K.prototype.wrap=function(C){var M=this,q=this._readableState,G=!1;C.on("end",function(){if(h("wrapped end"),q.decoder&&!q.ended){var ne=q.decoder.end();ne&&ne.length&&M.push(ne)}M.push(null)}),C.on("data",function(ne){if(h("wrapped data"),q.decoder&&(ne=q.decoder.write(ne)),!(q.objectMode&&ne==null)&&!(!q.objectMode&&(!ne||!ne.length))){var we=M.push(ne);we||(G=!0,C.pause())}});for(var oe in C)this[oe]===void 0&&typeof C[oe]=="function"&&(this[oe]=function(we){return function(){return C[we].apply(C,arguments)}}(oe));for(var he=0;he<z.length;he++)C.on(z[he],this.emit.bind(this,z[he]));return this._read=function(ne){h("wrapped _read",ne),G&&(G=!1,C.resume())},this},typeof Symbol=="function"&&(K.prototype[Symbol.asyncIterator]=function(){return L===void 0&&(L=Kp()),L(this)}),Object.defineProperty(K.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(K.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(K.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(M){this._readableState&&(this._readableState.flowing=M)}}),K._fromList=j,Object.defineProperty(K.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function j(C,M){if(M.length===0)return null;var q;return M.objectMode?q=M.buffer.shift():!C||C>=M.length?(M.decoder?q=M.buffer.join(""):M.buffer.length===1?q=M.buffer.first():q=M.buffer.concat(M.length),M.buffer.clear()):q=M.buffer.consume(C,M.decoder),q}function V(C){var M=C._readableState;h("endReadable",M.endEmitted),M.endEmitted||(M.ended=!0,process.nextTick(Z,M,C))}function Z(C,M){if(h("endReadableNT",C.endEmitted,C.length),!C.endEmitted&&C.length===0&&(C.endEmitted=!0,M.readable=!1,M.emit("end"),C.autoDestroy)){var q=M._writableState;(!q||q.autoDestroy&&q.finished)&&M.destroy()}}typeof Symbol=="function"&&(K.from=function(C,M){return W===void 0&&(W=Qp()),W(K,C,M)});function ue(C,M){for(var q=0,G=C.length;q<G;q++)if(C[q]===M)return q;return-1}return Zs}var lu=Wt,is=Cr.codes,Yp=is.ERR_METHOD_NOT_IMPLEMENTED,Xp=is.ERR_MULTIPLE_CALLBACK,eg=is.ERR_TRANSFORM_ALREADY_TRANSFORMING,tg=is.ERR_TRANSFORM_WITH_LENGTH_0,ss=en();Mt(Wt,ss);function rg(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Xp);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Wt(e){if(!(this instanceof Wt))return new Wt(e);ss.call(this,e),this._transformState={afterTransform:rg.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",ng)}function ng(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){lc(e,t,r)}):lc(this,null,null)}Wt.prototype.push=function(e,t){return this._transformState.needTransform=!1,ss.prototype.push.call(this,e,t)};Wt.prototype._transform=function(e,t,r){r(new Yp("_transform()"))};Wt.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Wt.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Wt.prototype._destroy=function(e,t){ss.prototype._destroy.call(this,e,function(r){t(r)})};function lc(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new tg;if(e._transformState.transforming)throw new eg;return e.push(null)}var ig=Sn,uu=lu;Mt(Sn,uu);function Sn(e){if(!(this instanceof Sn))return new Sn(e);uu.call(this,e)}Sn.prototype._transform=function(e,t,r){r(null,e)};var Ks;function sg(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var hu=Cr.codes,og=hu.ERR_MISSING_ARGS,ag=hu.ERR_STREAM_DESTROYED;function uc(e){if(e)throw e}function cg(e){return e.setHeader&&typeof e.abort=="function"}function lg(e,t,r,n){n=sg(n);var i=!1;e.on("close",function(){i=!0}),Ks===void 0&&(Ks=Qo),Ks(e,{readable:t,writable:r},function(a){if(a)return n(a);i=!0,n()});var s=!1;return function(a){if(!i&&!s){if(s=!0,cg(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new ag("pipe"))}}}function hc(e){e()}function ug(e,t){return e.pipe(t)}function hg(e){return!e.length||typeof e[e.length-1]!="function"?uc:e.pop()}function fg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=hg(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new og("streams");var i,s=t.map(function(a,o){var h=o<t.length-1,p=o>0;return lg(a,h,p,function(g){i||(i=g),g&&s.forEach(hc),!h&&(s.forEach(hc),n(i))})});return t.reduce(ug)}var dg=fg;(function(e,t){t=e.exports=cu(),t.Stream=t,t.Readable=t,t.Writable=ou(),t.Duplex=en(),t.Transform=lu,t.PassThrough=ig,t.finished=Qo,t.pipeline=dg})(bo,bo.exports);var fu=bo.exports;const{Transform:pg}=fu;var gg=e=>class du extends pg{constructor(r,n,i,s,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new du(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:_g}=fu;var mg=e=>class pu extends _g{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new pu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const yg=gg,wg=mg;var vg=function(e){const t=yg(e),r=wg(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},gu={};const fc=[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];gu.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],o=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],p=e[7]^e[17]^e[27]^e[37]^e[47],g=e[8]^e[18]^e[28]^e[38]^e[48],_=e[9]^e[19]^e[29]^e[39]^e[49];let w=g^(i<<1|s>>>31),I=_^(s<<1|i>>>31);const D=e[0]^w,F=e[1]^I,O=e[10]^w,k=e[11]^I,T=e[20]^w,L=e[21]^I,W=e[30]^w,$=e[31]^I,z=e[40]^w,ee=e[41]^I;w=r^(a<<1|o>>>31),I=n^(o<<1|a>>>31);const Y=e[2]^w,K=e[3]^I,de=e[12]^w,re=e[13]^I,ce=e[22]^w,A=e[23]^I,c=e[32]^w,d=e[33]^I,y=e[42]^w,v=e[43]^I;w=i^(h<<1|p>>>31),I=s^(p<<1|h>>>31);const S=e[4]^w,x=e[5]^I,B=e[14]^w,b=e[15]^I,u=e[24]^w,R=e[25]^I,Q=e[34]^w,J=e[35]^I,N=e[44]^w,j=e[45]^I;w=a^(g<<1|_>>>31),I=o^(_<<1|g>>>31);const V=e[6]^w,Z=e[7]^I,ue=e[16]^w,C=e[17]^I,M=e[26]^w,q=e[27]^I,G=e[36]^w,oe=e[37]^I,he=e[46]^w,ne=e[47]^I;w=h^(r<<1|n>>>31),I=p^(n<<1|r>>>31);const we=e[8]^w,pt=e[9]^I,Se=e[18]^w,Ee=e[19]^I,Qe=e[28]^w,ve=e[29]^I,Re=e[38]^w,et=e[39]^I,be=e[48]^w,m=e[49]^I,l=D,f=F,E=k<<4|O>>>28,P=O<<4|k>>>28,U=T<<3|L>>>29,H=L<<3|T>>>29,fe=$<<9|W>>>23,ae=W<<9|$>>>23,se=z<<18|ee>>>14,Ce=ee<<18|z>>>14,ie=Y<<1|K>>>31,xe=K<<1|Y>>>31,xr=re<<12|de>>>20,Ie=de<<12|re>>>20,Ae=ce<<10|A>>>22,Ir=A<<10|ce>>>22,Te=d<<13|c>>>19,Ne=c<<13|d>>>19,Ar=y<<2|v>>>30,Be=v<<2|y>>>30,Le=x<<30|S>>>2,Tr=S<<30|x>>>2,Pe=B<<6|b>>>26,Oe=b<<6|B>>>26,Nr=R<<11|u>>>21,Fe=u<<11|R>>>21,De=Q<<15|J>>>17,Br=J<<15|Q>>>17,je=j<<29|N>>>3,Ue=N<<29|j>>>3,Lr=V<<28|Z>>>4,$e=Z<<28|V>>>4,He=C<<23|ue>>>9,Pr=ue<<23|C>>>9,We=M<<25|q>>>7,Ve=q<<25|M>>>7,Qt=G<<21|oe>>>11,Yt=oe<<21|G>>>11,Xt=ne<<24|he>>>8,er=he<<24|ne>>>8,tr=we<<27|pt>>>5,rr=pt<<27|we>>>5,nr=Se<<20|Ee>>>12,ir=Ee<<20|Se>>>12,sr=ve<<7|Qe>>>25,or=Qe<<7|ve>>>25,ar=Re<<8|et>>>24,cr=et<<8|Re>>>24,lr=be<<14|m>>>18,ur=m<<14|be>>>18;e[0]=l^~xr&Nr,e[1]=f^~Ie&Fe,e[10]=Lr^~nr&U,e[11]=$e^~ir&H,e[20]=ie^~Pe&We,e[21]=xe^~Oe&Ve,e[30]=tr^~E&Ae,e[31]=rr^~P&Ir,e[40]=Le^~He&sr,e[41]=Tr^~Pr&or,e[2]=xr^~Nr&Qt,e[3]=Ie^~Fe&Yt,e[12]=nr^~U&Te,e[13]=ir^~H&Ne,e[22]=Pe^~We&ar,e[23]=Oe^~Ve&cr,e[32]=E^~Ae&De,e[33]=P^~Ir&Br,e[42]=He^~sr&fe,e[43]=Pr^~or&ae,e[4]=Nr^~Qt&lr,e[5]=Fe^~Yt&ur,e[14]=U^~Te&je,e[15]=H^~Ne&Ue,e[24]=We^~ar&se,e[25]=Ve^~cr&Ce,e[34]=Ae^~De&Xt,e[35]=Ir^~Br&er,e[44]=sr^~fe&Ar,e[45]=or^~ae&Be,e[6]=Qt^~lr&l,e[7]=Yt^~ur&f,e[16]=Te^~je&Lr,e[17]=Ne^~Ue&$e,e[26]=ar^~se&ie,e[27]=cr^~Ce&xe,e[36]=De^~Xt&tr,e[37]=Br^~er&rr,e[46]=fe^~Ar&Le,e[47]=ae^~Be&Tr,e[8]=lr^~l&xr,e[9]=ur^~f&Ie,e[18]=je^~Lr&nr,e[19]=Ue^~$e&ir,e[28]=se^~ie&Pe,e[29]=Ce^~xe&Oe,e[38]=Xt^~tr&E,e[39]=er^~rr&P,e[48]=Ar^~Le&He,e[49]=Be^~Tr&Pr,e[0]^=fc[t*2],e[1]^=fc[t*2+1]}};const Mi=gu;function hn(){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}hn.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};hn.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Mi.p1600(this.state),this.count=0)};hn.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&Mi.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Mi.p1600(this.state),this.count=0,this.squeezing=!0};hn.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Mi.p1600(this.state),this.count=0);return t};hn.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var bg=hn,Eg=vg(bg);const Sg=Eg,Rg=Ni;function _u(e){return Buffer.allocUnsafe(e).fill(0)}function mu(e,t,r){const n=_u(t);return e=os(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Cg(e,t){return mu(e,t,!0)}function os(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")yu(e)?e=Buffer.from(xg(wu(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(Rg.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function Mg(e){return e=os(e),"0x"+e.toString("hex")}function kg(e,t){return e=os(e),t||(t=256),Sg("keccak"+t).update(e).digest()}function xg(e){return e.length%2?"0"+e:e}function yu(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function wu(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var vu={zeros:_u,setLength:mu,setLengthRight:Cg,isHexString:yu,stripHexPrefix:wu,toBuffer:os,bufferToHex:Mg,keccak:kg};const br=vu,yr=Ni;function bu(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function qr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function dc(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Eu(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function _r(e){var t=typeof e;if(t==="string")return br.isHexString(e)?new yr(br.stripHexPrefix(e),16):new yr(e,10);if(t==="number")return new yr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Tt(e,t){var r,n,i,s;if(e==="address")return Tt("uint160",_r(t));if(e==="bool")return Tt("uint8",t?1:0);if(e==="string")return Tt("bytes",new Buffer(t,"utf8"));if(Ag(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Eu(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(Tt(e,t[s]));if(r==="dynamic"){var a=Tt("uint256",t.length);i.unshift(a)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([Tt("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,br.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=qr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return br.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=qr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=_r(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=qr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=_r(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=dc(e),n=_r(t),n<0)throw new Error("Supplied ufixed is negative");return Tt("uint256",n.mul(new yr(2).pow(new yr(r[1]))))}else if(e.startsWith("fixed"))return r=dc(e),Tt("int256",_r(t).mul(new yr(2).pow(new yr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Ig(e){return e==="string"||e==="bytes"||Eu(e)==="dynamic"}function Ag(e){return e.lastIndexOf("]")===e.length-1}function Tg(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var a=bu(e[s]),o=t[s],h=Tt(a,o);Ig(a)?(r.push(Tt("uint256",i)),n.push(h),i+=h.length):r.push(h)}return Buffer.concat(r.concat(n))}function Su(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<e.length;s++){var a=bu(e[s]),o=t[s];if(a==="bytes")i.push(o);else if(a==="string")i.push(new Buffer(o,"utf8"));else if(a==="bool")i.push(new Buffer(o?"01":"00","hex"));else if(a==="address")i.push(br.setLength(o,20));else if(a.startsWith("bytes")){if(r=qr(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(br.setLengthRight(o,r))}else if(a.startsWith("uint")){if(r=qr(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=_r(o),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=qr(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=_r(o),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function Ng(e,t){return br.keccak(Su(e,t))}var Bg={rawEncode:Tg,solidityPack:Su,soliditySHA3:Ng};const Rt=vu,vn=Bg,Ru={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"]},Qs={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const a=(o,h,p)=>{if(r[h]!==void 0)return["bytes32",p==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Rt.keccak(this.encodeData(h,p,r,n))];if(p===void 0)throw new Error(`missing value for field ${o} of type ${h}`);if(h==="bytes")return["bytes32",Rt.keccak(p)];if(h==="string")return typeof p=="string"&&(p=Buffer.from(p,"utf8")),["bytes32",Rt.keccak(p)];if(h.lastIndexOf("]")===h.length-1){const g=h.slice(0,h.lastIndexOf("[")),_=p.map(w=>a(o,g,w));return["bytes32",Rt.keccak(vn.rawEncode(_.map(([w])=>w),_.map(([,w])=>w)))]}return[h,p]};for(const o of r[e]){const[h,p]=a(o.name,o.type,t[o.name]);i.push(h),s.push(p)}}else for(const a of r[e]){let o=t[a.name];if(o!==void 0)if(a.type==="bytes")i.push("bytes32"),o=Rt.keccak(o),s.push(o);else if(a.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=Rt.keccak(o),s.push(o);else if(r[a.type]!==void 0)i.push("bytes32"),o=Rt.keccak(this.encodeData(a.type,o,r,n)),s.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(o)}}return vn.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return Rt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Rt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Ru.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Rt.keccak(Buffer.concat(n))}};var Lg={TYPED_MESSAGE_SCHEMA:Ru,TypedDataUtils:Qs,hashForSignTypedDataLegacy:function(e){return Pg(e.data)},hashForSignTypedData_v3:function(e){return Qs.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Qs.hash(e.data)}};function Pg(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?Rt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return vn.soliditySHA3(["bytes32","bytes32"],[vn.soliditySHA3(new Array(e.length).fill("string"),i),vn.soliditySHA3(n,r)])}var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.filterFromParam=tn.FilterPolyfill=void 0;const Hr=Ye,at=X,Og=5*60*1e3,mr={jsonrpc:"2.0",id:0};class Fg{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Hr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Cu(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,at.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,at.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,at.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,at.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,at.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(ci())}async getFilterLogs(t){const r=(0,at.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[pc(n)]})):ci()}makeFilterId(){return(0,Hr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return ci();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return li();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[pc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const o=a.result.map(p=>(0,at.intNumberFromHexString)(p.blockNumber||"0x0")),h=Math.max(...o);if(h&&h>n){const p=(0,Hr.IntNumber)(h+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${p}`),this.cursors.set(t,p)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return ci();const n=await this.getCurrentBlockHeight();if(r>n)return li();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,at.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Hr.IntNumber)(a))))).filter(a=>!!a),s=(0,Hr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},mr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(li())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},Og);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_blockNumber",params:[]}));return(0,at.intNumberFromHexString)((0,at.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getBlockByNumber",params:[(0,at.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,at.ensureHexString)(r.result.hash):null}}tn.FilterPolyfill=Fg;function Cu(e){return{fromBlock:gc(e.fromBlock),toBlock:gc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}tn.filterFromParam=Cu;function pc(e){const t={fromBlock:_c(e.fromBlock),toBlock:_c(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function gc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Hr.IntNumber)(0);if((0,at.isHexString)(e))return(0,at.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function _c(e){return e==="latest"?e:(0,at.hexStringFromIntNumber)(e)}function ci(){return Object.assign(Object.assign({},mr),{error:{code:-32e3,message:"filter not found"}})}function li(){return Object.assign(Object.assign({},mr),{result:[]})}var as={},Mu={},cs={},Yo=Dg;function Dg(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const mc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(a,o){if(t.multiArgs){const h=new Array(arguments.length-1);for(let p=1;p<arguments.length;p++)h[p-1]=arguments[p];a?(h.unshift(a),s(h)):i(h)}else a?s(a):i(o)}):n.push(function(a){if(t.multiArgs){const o=new Array(arguments.length-1);for(let h=0;h<arguments.length;h++)o[h]=arguments[h];i(o)}else i(a)}),e.apply(this,n)})};var jg=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):mc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?mc(s,t):s}return n},Vn={},zn={};Object.defineProperty(zn,"__esModule",{value:!0});const Ug=Ii;function yc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function $g(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Hg=class extends Ug.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const o=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw o.context=a,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")yc(s,this,r);else{const a=s.length,o=$g(s);for(let h=0;h<a;h+=1)yc(o[h],this,r)}return!0}};zn.default=Hg;var Wg=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.BaseBlockTracker=void 0;const Vg=Wg(zn),zg=1e3,qg=(e,t)=>e+t,wc=["sync","latest"];class Gg extends Vg.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*zg,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){wc.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return wc.map(t=>this.listenerCount(t)).reduce(qg)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=vc(t),i=vc(r);return this._usePastBlocks&&n<i||n>i}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Vn.BaseBlockTracker=Gg;function vc(e){return Number.parseInt(e,16)}var ku={},xu={},st={};class Iu extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:o}=t,h=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Jg(e){return bt(e)&&typeof e[Symbol.iterator]=="function"}function bt(e){return typeof e=="object"&&e!=null}function bc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Xe(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Zg(e){const{done:t,value:r}=e.next();return t?void 0:r}function Kg(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:o,message:h=`Expected a value of type \`${a}\`${o?` with refinement \`${o}\``:""}, but received: \`${Xe(n)}\``}=e;return{value:n,type:a,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:h}}function*So(e,t,r,n){Jg(e)||(e=[e]);for(const i of e){const s=Kg(i,t,r,n);s&&(yield s)}}function*Xo(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),a&&t.type!=="type"&&bt(t.schema)&&bt(e)&&!Array.isArray(e)))for(const p in e)t.schema[p]===void 0&&delete e[p];let h="valid";for(const p of t.validator(e,o))p.explanation=r.message,h="not_valid",yield[p,void 0];for(let[p,g,_]of t.entries(e,o)){const w=Xo(g,_,{path:p===void 0?n:[...n,p],branch:p===void 0?i:[...i,g],coerce:s,mask:a,message:r.message});for(const I of w)I[0]?(h=I[0].refinement!=null?"not_refined":"not_valid",yield[I[0],void 0]):s&&(g=I[1],p===void 0?e=g:e instanceof Map?e.set(p,g):e instanceof Set?e.add(g):bt(e)&&(g!==void 0||p in e)&&(e[p]=g))}if(h!=="not_valid")for(const p of t.refiner(e,o))p.explanation=r.message,h="not_refined",yield[p,void 0];h==="valid"&&(yield[void 0,e])}class Ze{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=a,i?this.validator=(h,p)=>{const g=i(h,p);return So(g,p,this,h)}:this.validator=()=>[],s?this.refiner=(h,p)=>{const g=s(h,p);return So(g,p,this,h)}:this.refiner=()=>[]}assert(t,r){return Au(t,this,r)}create(t,r){return Tu(t,this,r)}is(t){return ea(t,this)}mask(t,r){return Nu(t,this,r)}validate(t,r={}){return fn(t,this,r)}}function Au(e,t,r){const n=fn(e,t,{message:r});if(n[0])throw n[0]}function Tu(e,t,r){const n=fn(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Nu(e,t,r){const n=fn(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ea(e,t){return!fn(e,t)[0]}function fn(e,t,r={}){const n=Xo(e,t,r),i=Zg(n);return i[0]?[new Iu(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function Qg(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Gn(n):qn(n)}function ut(e,t){return new Ze({type:e,schema:null,validator:t})}function Yg(e,t){return new Ze({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function Xg(e){return new Ze({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function e1(e){let t;return new Ze({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function t1(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Gn(n);default:return qn(n)}}function r1(e){const t=e instanceof Ze,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Bu(r[n]);return t&&e.type==="type"?Gn(r):qn(r)}function n1(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Gn(n);default:return qn(n)}}function i1(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ut(e,t)}function s1(){return ut("any",()=>!0)}function o1(e){return new Ze({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Xe(t)}`}})}function a1(){return ut("bigint",e=>typeof e=="bigint")}function c1(){return ut("boolean",e=>typeof e=="boolean")}function l1(){return ut("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Xe(e)}`)}function u1(e){const t={},r=e.map(n=>Xe(n)).join();for(const n of e)t[n]=n;return new Ze({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Xe(n)}`}})}function h1(){return ut("func",e=>typeof e=="function"||`Expected a function, but received: ${Xe(e)}`)}function f1(e){return ut("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Xe(t)}`)}function d1(){return ut("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Xe(e)}`)}function p1(e){return new Ze({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function g1(e){const t=Xe(e),r=typeof e;return new Ze({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Xe(n)}`}})}function _1(e,t){return new Ze({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Xe(r)}`}})}function ta(){return ut("never",()=>!1)}function m1(e){return new Ze({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function y1(){return ut("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Xe(e)}`)}function qn(e){const t=e?Object.keys(e):[],r=ta();return new Ze({type:"object",schema:e||null,*entries(n){if(e&&bt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return bt(n)||`Expected an object, but received: ${Xe(n)}`},coercer(n){return bt(n)?{...n}:n}})}function Bu(e){return new Ze({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function w1(e,t){return new Ze({type:"record",schema:null,*entries(r){if(bt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return bt(r)||`Expected an object, but received: ${Xe(r)}`}})}function v1(){return ut("regexp",e=>e instanceof RegExp)}function b1(e){return new Ze({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Xe(t)}`}})}function Lu(){return ut("string",e=>typeof e=="string"||`Expected a string, but received: ${Xe(e)}`)}function E1(e){const t=ta();return new Ze({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${Xe(r)}`}})}function Gn(e){const t=Object.keys(e);return new Ze({type:"type",schema:e,*entries(r){if(bt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return bt(r)||`Expected an object, but received: ${Xe(r)}`},coercer(r){return bt(r)?{...r}:r}})}function S1(e){const t=e.map(r=>r.type).join(" | ");return new Ze({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=Xo(r,s,n),[o]=a;if(o[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Xe(r)}`,...i]}})}function Pu(){return ut("unknown",()=>!0)}function ra(e,t,r){return new Ze({...e,coercer:(n,i)=>ea(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function R1(e,t,r={}){return ra(e,Pu(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&bc(n)&&bc(i)){const s={...n};let a=!1;for(const o in i)s[o]===void 0&&(s[o]=i[o],a=!0);if(a)return s}return n})}function C1(e){return ra(e,Lu(),t=>t.trim())}function M1(e){return Mr(e,"empty",t=>{const r=Ou(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Ou(e){return e instanceof Map||e instanceof Set?e.size:e.length}function k1(e,t,r={}){const{exclusive:n}=r;return Mr(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function x1(e,t,r={}){const{exclusive:n}=r;return Mr(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function I1(e){return Mr(e,"nonempty",t=>Ou(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function A1(e,t){return Mr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function T1(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Mr(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return t<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return t<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function Mr(e,t,r){return new Ze({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),a=So(s,i,e,n);for(const o of a)yield{...o,refinement:t}}})}const N1=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ze,StructError:Iu,any:s1,array:o1,assert:Au,assign:Qg,bigint:a1,boolean:c1,coerce:ra,create:Tu,date:l1,defaulted:R1,define:ut,deprecated:Yg,dynamic:Xg,empty:M1,enums:u1,func:h1,instance:f1,integer:d1,intersection:p1,is:ea,lazy:e1,literal:g1,map:_1,mask:Nu,max:k1,min:x1,never:ta,nonempty:I1,nullable:m1,number:y1,object:qn,omit:t1,optional:Bu,partial:r1,pattern:A1,pick:n1,record:w1,refine:Mr,regexp:v1,set:b1,size:T1,string:Lu,struct:i1,trimmed:C1,tuple:E1,type:Gn,union:S1,unknown:Pu,validate:fn},Symbol.toStringTag,{value:"Module"})),kr=sn(N1);Object.defineProperty(st,"__esModule",{value:!0});st.assertExhaustive=st.assertStruct=st.assert=st.AssertionError=void 0;const B1=kr;function L1(e){return typeof e=="object"&&e!==null&&"message"in e}function P1(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function O1(e){const t=L1(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Fu(e,t){return P1(e)?new e({message:t}):e({message:t})}class na extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}st.AssertionError=na;function F1(e,t="Assertion failed.",r=na){if(!e)throw t instanceof Error?t:Fu(r,t)}st.assert=F1;function D1(e,t,r="Assertion failed",n=na){try{(0,B1.assert)(e,t)}catch(i){throw Fu(n,`${r}: ${O1(i)}.`)}}st.assertStruct=D1;function j1(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}st.assertExhaustive=j1;var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.base64=void 0;const U1=kr,$1=st,H1=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,$1.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let o;return i?o=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):o=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,U1.pattern)(e,o)};Jn.base64=H1;var ye={},Zn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=kr,r=st;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(p){return(0,t.is)(p,e.HexStruct)}e.isHexString=n;function i(p){return(0,t.is)(p,e.StrictHexStruct)}e.isStrictHexString=i;function s(p){(0,r.assert)(n(p),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function a(p){(0,r.assert)(i(p),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function o(p){return p.startsWith("0x")?p:p.startsWith("0X")?`0x${p.substring(2)}`:`0x${p}`}e.add0x=o;function h(p){return p.startsWith("0x")||p.startsWith("0X")?p.substring(2):p}e.remove0x=h})(Zn);Object.defineProperty(ye,"__esModule",{value:!0});ye.createDataView=ye.concatBytes=ye.valueToBytes=ye.stringToBytes=ye.numberToBytes=ye.signedBigIntToBytes=ye.bigIntToBytes=ye.hexToBytes=ye.bytesToString=ye.bytesToNumber=ye.bytesToSignedBigInt=ye.bytesToBigInt=ye.bytesToHex=ye.assertIsBytes=ye.isBytes=void 0;const dt=st,Ro=Zn,Ec=48,Sc=58,Rc=87;function W1(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const V1=W1();function ia(e){return e instanceof Uint8Array}ye.isBytes=ia;function dn(e){(0,dt.assert)(ia(e),"Value must be a Uint8Array.")}ye.assertIsBytes=dn;function Du(e){if(dn(e),e.length===0)return"0x";const t=V1(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Ro.add0x)(r.join(""))}ye.bytesToHex=Du;function ju(e){dn(e);const t=Du(e);return BigInt(t)}ye.bytesToBigInt=ju;function z1(e){dn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}ye.bytesToSignedBigInt=z1;function q1(e){dn(e);const t=ju(e);return(0,dt.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}ye.bytesToNumber=q1;function G1(e){return dn(e),new TextDecoder().decode(e)}ye.bytesToString=G1;function ls(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Ro.assertIsHexString)(e);const r=(0,Ro.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const a=n.charCodeAt(s*2),o=n.charCodeAt(s*2+1),h=a-(a<Sc?Ec:Rc),p=o-(o<Sc?Ec:Rc);i[s]=h*16+p}return i}ye.hexToBytes=ls;function Uu(e){(0,dt.assert)(typeof e=="bigint","Value must be a bigint."),(0,dt.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return ls(t)}ye.bigIntToBytes=Uu;function J1(e,t){(0,dt.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Z1(e,t){(0,dt.assert)(typeof e=="bigint","Value must be a bigint."),(0,dt.assert)(typeof t=="number","Byte length must be a number."),(0,dt.assert)(t>0,"Byte length must be greater than 0."),(0,dt.assert)(J1(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}ye.signedBigIntToBytes=Z1;function $u(e){(0,dt.assert)(typeof e=="number","Value must be a number."),(0,dt.assert)(e>=0,"Value must be a non-negative number."),(0,dt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return ls(t)}ye.numberToBytes=$u;function Hu(e){return(0,dt.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ye.stringToBytes=Hu;function Wu(e){if(typeof e=="bigint")return Uu(e);if(typeof e=="number")return $u(e);if(typeof e=="string")return e.startsWith("0x")?ls(e):Hu(e);if(ia(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ye.valueToBytes=Wu;function K1(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=Wu(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}ye.concatBytes=K1;function Q1(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}ye.createDataView=Q1;var us={};Object.defineProperty(us,"__esModule",{value:!0});us.ChecksumStruct=void 0;const Cc=kr,Y1=Jn;us.ChecksumStruct=(0,Cc.size)((0,Y1.base64)((0,Cc.string)(),{paddingRequired:!0}),44,44);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.createHex=Ft.createBytes=Ft.createBigInt=Ft.createNumber=void 0;const Je=kr,X1=st,Vu=ye,hs=Zn,zu=(0,Je.union)([(0,Je.number)(),(0,Je.bigint)(),(0,Je.string)(),hs.StrictHexStruct]),e_=(0,Je.coerce)((0,Je.number)(),zu,Number),t_=(0,Je.coerce)((0,Je.bigint)(),zu,BigInt);(0,Je.union)([hs.StrictHexStruct,(0,Je.instance)(Uint8Array)]);const r_=(0,Je.coerce)((0,Je.instance)(Uint8Array),(0,Je.union)([hs.StrictHexStruct]),Vu.hexToBytes),n_=(0,Je.coerce)(hs.StrictHexStruct,(0,Je.instance)(Uint8Array),Vu.bytesToHex);function i_(e){try{const t=(0,Je.create)(e,e_);return(0,X1.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Je.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Ft.createNumber=i_;function s_(e){try{return(0,Je.create)(e,t_)}catch(t){throw t instanceof Je.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Ft.createBigInt=s_;function o_(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Je.create)(e,r_)}catch(t){throw t instanceof Je.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Ft.createBytes=o_;function a_(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Je.create)(e,n_)}catch(t){throw t instanceof Je.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Ft.createHex=a_;var rn={},qu=te&&te.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},ct=te&&te.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},St,It;Object.defineProperty(rn,"__esModule",{value:!0});rn.FrozenSet=rn.FrozenMap=void 0;class sa{constructor(t){St.set(this,void 0),qu(this,St,new Map(t),"f"),Object.freeze(this)}get size(){return ct(this,St,"f").size}[(St=new WeakMap,Symbol.iterator)](){return ct(this,St,"f")[Symbol.iterator]()}entries(){return ct(this,St,"f").entries()}forEach(t,r){return ct(this,St,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return ct(this,St,"f").get(t)}has(t){return ct(this,St,"f").has(t)}keys(){return ct(this,St,"f").keys()}values(){return ct(this,St,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}rn.FrozenMap=sa;class oa{constructor(t){It.set(this,void 0),qu(this,It,new Set(t),"f"),Object.freeze(this)}get size(){return ct(this,It,"f").size}[(It=new WeakMap,Symbol.iterator)](){return ct(this,It,"f")[Symbol.iterator]()}entries(){return ct(this,It,"f").entries()}forEach(t,r){return ct(this,It,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return ct(this,It,"f").has(t)}keys(){return ct(this,It,"f").keys()}values(){return ct(this,It,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}rn.FrozenSet=oa;Object.freeze(sa);Object.freeze(sa.prototype);Object.freeze(oa);Object.freeze(oa.prototype);var Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});var Ju={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=kr,r=st,n=()=>(0,t.define)("finite number",$=>(0,t.is)($,(0,t.number)())&&Number.isFinite($));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",($,z)=>{function ee(Y,K){const re=[...K.validator(Y,z)];return re.length>0?re:!0}try{const Y=ee($,e.UnsafeJsonStruct);return Y!==!0?Y:ee(JSON.parse(JSON.stringify($)),e.UnsafeJsonStruct)}catch(Y){return Y instanceof RangeError?"Circular reference detected":!1}});function i($){return(0,t.is)($,e.JsonStruct)}e.isValidJson=i;function s($){(0,r.assertStruct)($,e.JsonStruct,"Invalid JSON value");const z=JSON.stringify($);return new TextEncoder().encode(z).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function a($){return(0,t.is)($,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function o($,z){(0,r.assertStruct)($,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",z)}e.assertIsJsonRpcNotification=o;function h($){return(0,t.is)($,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function p($,z){(0,r.assertStruct)($,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",z)}e.assertIsJsonRpcRequest=p,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function g($){return(0,t.is)($,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=g;function _($,z){(0,r.assertStruct)($,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",z)}e.assertIsPendingJsonRpcResponse=_;function w($){return(0,t.is)($,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=w;function I($,z){(0,r.assertStruct)($,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",z)}e.assertIsJsonRpcResponse=I;function D($){return(0,t.is)($,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=D;function F($,z){(0,r.assertStruct)($,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",z)}e.assertIsJsonRpcSuccess=F;function O($){return(0,t.is)($,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=O;function k($,z){(0,r.assertStruct)($,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",z)}e.assertIsJsonRpcFailure=k;function T($){return(0,t.is)($,e.JsonRpcErrorStruct)}e.isJsonRpcError=T;function L($,z){(0,r.assertStruct)($,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",z)}e.assertIsJsonRpcError=L;function W($){const{permitEmptyString:z,permitFractions:ee,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},$);return de=>!!(typeof de=="number"&&(ee||Number.isInteger(de))||typeof de=="string"&&(z||de.length>0)||Y&&de===null)}e.getJsonRpcIdValidator=W})(Ju);var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});var nn={},Co={exports:{}},Ys,Mc;function c_(){if(Mc)return Ys;Mc=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;Ys=function(g,_){_=_||{};var w=typeof g;if(w==="string"&&g.length>0)return a(g);if(w==="number"&&isFinite(g))return _.long?h(g):o(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function a(g){if(g=String(g),!(g.length>100)){var _=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(_){var w=parseFloat(_[1]),I=(_[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return w*s;case"weeks":case"week":case"w":return w*i;case"days":case"day":case"d":return w*n;case"hours":case"hour":case"hrs":case"hr":case"h":return w*r;case"minutes":case"minute":case"mins":case"min":case"m":return w*t;case"seconds":case"second":case"secs":case"sec":case"s":return w*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function o(g){var _=Math.abs(g);return _>=n?Math.round(g/n)+"d":_>=r?Math.round(g/r)+"h":_>=t?Math.round(g/t)+"m":_>=e?Math.round(g/e)+"s":g+"ms"}function h(g){var _=Math.abs(g);return _>=n?p(g,_,n,"day"):_>=r?p(g,_,r,"hour"):_>=t?p(g,_,t,"minute"):_>=e?p(g,_,e,"second"):g+" ms"}function p(g,_,w,I){var D=_>=w*1.5;return Math.round(g/w)+" "+I+(D?"s":"")}return Ys}function l_(e){r.debug=r,r.default=r,r.coerce=h,r.disable=a,r.enable=i,r.enabled=o,r.humanize=c_(),r.destroy=p,Object.keys(e).forEach(g=>{r[g]=e[g]}),r.names=[],r.skips=[],r.formatters={};function t(g){let _=0;for(let w=0;w<g.length;w++)_=(_<<5)-_+g.charCodeAt(w),_|=0;return r.colors[Math.abs(_)%r.colors.length]}r.selectColor=t;function r(g){let _,w=null,I,D;function F(...O){if(!F.enabled)return;const k=F,T=Number(new Date),L=T-(_||T);k.diff=L,k.prev=_,k.curr=T,_=T,O[0]=r.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let W=0;O[0]=O[0].replace(/%([a-zA-Z%])/g,(z,ee)=>{if(z==="%%")return"%";W++;const Y=r.formatters[ee];if(typeof Y=="function"){const K=O[W];z=Y.call(k,K),O.splice(W,1),W--}return z}),r.formatArgs.call(k,O),(k.log||r.log).apply(k,O)}return F.namespace=g,F.useColors=r.useColors(),F.color=r.selectColor(g),F.extend=n,F.destroy=r.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(I!==r.namespaces&&(I=r.namespaces,D=r.enabled(g)),D),set:O=>{w=O}}),typeof r.init=="function"&&r.init(F),F}function n(g,_){const w=r(this.namespace+(typeof _>"u"?":":_)+g);return w.log=this.log,w}function i(g){r.save(g),r.namespaces=g,r.names=[],r.skips=[];const _=(typeof g=="string"?g:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const w of _)w[0]==="-"?r.skips.push(w.slice(1)):r.names.push(w)}function s(g,_){let w=0,I=0,D=-1,F=0;for(;w<g.length;)if(I<_.length&&(_[I]===g[w]||_[I]==="*"))_[I]==="*"?(D=I,F=w,I++):(w++,I++);else if(D!==-1)I=D+1,F++,w=F;else return!1;for(;I<_.length&&_[I]==="*";)I++;return I===_.length}function a(){const g=[...r.names,...r.skips.map(_=>"-"+_)].join(",");return r.enable(""),g}function o(g){for(const _ of r.skips)if(s(g,_))return!1;for(const _ of r.names)if(s(g,_))return!0;return!1}function h(g){return g instanceof Error?g.stack||g.message:g}function p(){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 r.enable(r.load()),r}var u_=l_;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=a,t.useColors=n,t.storage=o(),t.destroy=(()=>{let p=!1;return()=>{p||(p=!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`."))}})(),t.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(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let p;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(p=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(p[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(p){if(p[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+p[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const g="color: "+this.color;p.splice(1,0,g,"color: inherit");let _=0,w=0;p[0].replace(/%[a-zA-Z%]/g,I=>{I!=="%%"&&(_++,I==="%c"&&(w=_))}),p.splice(w,0,g)}t.log=console.debug||console.log||(()=>{});function s(p){try{p?t.storage.setItem("debug",p):t.storage.removeItem("debug")}catch{}}function a(){let p;try{p=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!p&&typeof process<"u"&&"env"in process&&(p=r.DEBUG),p}function o(){try{return localStorage}catch{}}e.exports=u_(t);const{formatters:h}=e.exports;h.j=function(p){try{return JSON.stringify(p)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}})(Co,Co.exports);var h_=Co.exports,f_=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nn,"__esModule",{value:!0});nn.createModuleLogger=nn.createProjectLogger=void 0;const d_=f_(h_),p_=(0,d_.default)("metamask");function g_(e){return p_.extend(e)}nn.createProjectLogger=g_;function __(e,t){return e.extend(t)}nn.createModuleLogger=__;var Ku={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(p){return Array.isArray(p)&&p.length>0}e.isNonEmptyArray=t;function r(p){return p==null}e.isNullOrUndefined=r;function n(p){return!!p&&typeof p=="object"&&!Array.isArray(p)}e.isObject=n;const i=(p,g)=>Object.hasOwnProperty.call(p,g);e.hasProperty=i,function(p){p[p.Null=4]="Null",p[p.Comma=1]="Comma",p[p.Wrapper=1]="Wrapper",p[p.True=4]="True",p[p.False=5]="False",p[p.Quote=1]="Quote",p[p.Colon=1]="Colon",p[p.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(p){if(typeof p!="object"||p===null)return!1;try{let g=p;for(;Object.getPrototypeOf(g)!==null;)g=Object.getPrototypeOf(g);return Object.getPrototypeOf(p)===g}catch{return!1}}e.isPlainObject=s;function a(p){return p.charCodeAt(0)<=127}e.isASCII=a;function o(p){var g;return p.split("").reduce((w,I)=>a(I)?w+1:w+2,0)+((g=p.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&g!==void 0?g:[]).length}e.calculateStringSize=o;function h(p){return p.toString().length}e.calculateNumberSize=h})(Ku);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.hexToBigInt=Dt.hexToNumber=Dt.bigIntToHex=Dt.numberToHex=void 0;const Gr=st,Rn=Zn,m_=e=>((0,Gr.assert)(typeof e=="number","Value must be a number."),(0,Gr.assert)(e>=0,"Value must be a non-negative number."),(0,Gr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Rn.add0x)(e.toString(16)));Dt.numberToHex=m_;const y_=e=>((0,Gr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Gr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Rn.add0x)(e.toString(16)));Dt.bigIntToHex=y_;const w_=e=>{(0,Rn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Gr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Dt.hexToNumber=w_;const v_=e=>((0,Rn.assertIsHexString)(e),BigInt((0,Rn.add0x)(e)));Dt.hexToBigInt=v_;var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0});var Yu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!t(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(Yu);var Xu={};Object.defineProperty(Xu,"__esModule",{value:!0});var eh={},Mo={exports:{}};const b_="2.0.0",th=256,E_=Number.MAX_SAFE_INTEGER||9007199254740991,S_=16,R_=th-6,C_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var fs={MAX_LENGTH:th,MAX_SAFE_COMPONENT_LENGTH:S_,MAX_SAFE_BUILD_LENGTH:R_,MAX_SAFE_INTEGER:E_,RELEASE_TYPES:C_,SEMVER_SPEC_VERSION:b_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Xs={};const M_=typeof process=="object"&&Xs&&Xs.NODE_DEBUG&&/\bsemver\b/i.test(Xs.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var ds=M_;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=fs,s=ds;t=e.exports={};const a=t.re=[],o=t.safeRe=[],h=t.src=[],p=t.safeSrc=[],g=t.t={};let _=0;const w="[a-zA-Z0-9-]",I=[["\\s",1],["\\d",i],[w,n]],D=O=>{for(const[k,T]of I)O=O.split(`${k}*`).join(`${k}{0,${T}}`).split(`${k}+`).join(`${k}{1,${T}}`);return O},F=(O,k,T)=>{const L=D(k),W=_++;s(O,W,k),g[O]=W,h[W]=k,p[W]=L,a[W]=new RegExp(k,T?"g":void 0),o[W]=new RegExp(L,T?"g":void 0)};F("NUMERICIDENTIFIER","0|[1-9]\\d*"),F("NUMERICIDENTIFIERLOOSE","\\d+"),F("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w}*`),F("MAINVERSION",`(${h[g.NUMERICIDENTIFIER]})\\.(${h[g.NUMERICIDENTIFIER]})\\.(${h[g.NUMERICIDENTIFIER]})`),F("MAINVERSIONLOOSE",`(${h[g.NUMERICIDENTIFIERLOOSE]})\\.(${h[g.NUMERICIDENTIFIERLOOSE]})\\.(${h[g.NUMERICIDENTIFIERLOOSE]})`),F("PRERELEASEIDENTIFIER",`(?:${h[g.NONNUMERICIDENTIFIER]}|${h[g.NUMERICIDENTIFIER]})`),F("PRERELEASEIDENTIFIERLOOSE",`(?:${h[g.NONNUMERICIDENTIFIER]}|${h[g.NUMERICIDENTIFIERLOOSE]})`),F("PRERELEASE",`(?:-(${h[g.PRERELEASEIDENTIFIER]}(?:\\.${h[g.PRERELEASEIDENTIFIER]})*))`),F("PRERELEASELOOSE",`(?:-?(${h[g.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[g.PRERELEASEIDENTIFIERLOOSE]})*))`),F("BUILDIDENTIFIER",`${w}+`),F("BUILD",`(?:\\+(${h[g.BUILDIDENTIFIER]}(?:\\.${h[g.BUILDIDENTIFIER]})*))`),F("FULLPLAIN",`v?${h[g.MAINVERSION]}${h[g.PRERELEASE]}?${h[g.BUILD]}?`),F("FULL",`^${h[g.FULLPLAIN]}$`),F("LOOSEPLAIN",`[v=\\s]*${h[g.MAINVERSIONLOOSE]}${h[g.PRERELEASELOOSE]}?${h[g.BUILD]}?`),F("LOOSE",`^${h[g.LOOSEPLAIN]}$`),F("GTLT","((?:<|>)?=?)"),F("XRANGEIDENTIFIERLOOSE",`${h[g.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),F("XRANGEIDENTIFIER",`${h[g.NUMERICIDENTIFIER]}|x|X|\\*`),F("XRANGEPLAIN",`[v=\\s]*(${h[g.XRANGEIDENTIFIER]})(?:\\.(${h[g.XRANGEIDENTIFIER]})(?:\\.(${h[g.XRANGEIDENTIFIER]})(?:${h[g.PRERELEASE]})?${h[g.BUILD]}?)?)?`),F("XRANGEPLAINLOOSE",`[v=\\s]*(${h[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[g.XRANGEIDENTIFIERLOOSE]})(?:${h[g.PRERELEASELOOSE]})?${h[g.BUILD]}?)?)?`),F("XRANGE",`^${h[g.GTLT]}\\s*${h[g.XRANGEPLAIN]}$`),F("XRANGELOOSE",`^${h[g.GTLT]}\\s*${h[g.XRANGEPLAINLOOSE]}$`),F("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),F("COERCE",`${h[g.COERCEPLAIN]}(?:$|[^\\d])`),F("COERCEFULL",h[g.COERCEPLAIN]+`(?:${h[g.PRERELEASE]})?(?:${h[g.BUILD]})?(?:$|[^\\d])`),F("COERCERTL",h[g.COERCE],!0),F("COERCERTLFULL",h[g.COERCEFULL],!0),F("LONETILDE","(?:~>?)"),F("TILDETRIM",`(\\s*)${h[g.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",F("TILDE",`^${h[g.LONETILDE]}${h[g.XRANGEPLAIN]}$`),F("TILDELOOSE",`^${h[g.LONETILDE]}${h[g.XRANGEPLAINLOOSE]}$`),F("LONECARET","(?:\\^)"),F("CARETTRIM",`(\\s*)${h[g.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",F("CARET",`^${h[g.LONECARET]}${h[g.XRANGEPLAIN]}$`),F("CARETLOOSE",`^${h[g.LONECARET]}${h[g.XRANGEPLAINLOOSE]}$`),F("COMPARATORLOOSE",`^${h[g.GTLT]}\\s*(${h[g.LOOSEPLAIN]})$|^$`),F("COMPARATOR",`^${h[g.GTLT]}\\s*(${h[g.FULLPLAIN]})$|^$`),F("COMPARATORTRIM",`(\\s*)${h[g.GTLT]}\\s*(${h[g.LOOSEPLAIN]}|${h[g.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",F("HYPHENRANGE",`^\\s*(${h[g.XRANGEPLAIN]})\\s+-\\s+(${h[g.XRANGEPLAIN]})\\s*$`),F("HYPHENRANGELOOSE",`^\\s*(${h[g.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[g.XRANGEPLAINLOOSE]})\\s*$`),F("STAR","(<|>)?=?\\s*\\*"),F("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),F("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Mo,Mo.exports);var Kn=Mo.exports;const k_=Object.freeze({loose:!0}),x_=Object.freeze({}),I_=e=>e?typeof e!="object"?k_:e:x_;var aa=I_;const kc=/^[0-9]+$/,rh=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=kc.test(e),n=kc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},A_=(e,t)=>rh(t,e);var nh={compareIdentifiers:rh,rcompareIdentifiers:A_};const ui=ds,{MAX_LENGTH:xc,MAX_SAFE_INTEGER:hi}=fs,{safeRe:fi,t:di}=Kn,T_=aa,{compareIdentifiers:eo}=nh;let N_=class At{constructor(t,r){if(r=T_(r),t instanceof At){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>xc)throw new TypeError(`version is longer than ${xc} characters`);ui("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?fi[di.LOOSE]:fi[di.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>hi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hi||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<hi)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(ui("SemVer.compare",this.version,this.options,t),!(t instanceof At)){if(typeof t=="string"&&t===this.version)return 0;t=new At(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof At||(t=new At(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof At||(t=new At(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(ui("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return eo(n,i)}while(++r)}compareBuild(t){t instanceof At||(t=new At(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(ui("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return eo(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const i=`-${r}`.match(this.options.loose?fi[di.PRERELEASELOOSE]:fi[di.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),eo(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Qn=N_;const Ic=Qn,B_=(e,t,r=!1)=>{if(e instanceof Ic)return e;try{return new Ic(e,t)}catch(n){if(!r)return null;throw n}};var L_=B_;const P_=L_,O_=(e,t)=>{const r=P_(e,t);return r?r.version:null};var F_=O_;const Ac=Qn,D_=(e,t,r)=>new Ac(e,r).compare(new Ac(t,r));var pn=D_;const j_=pn,U_=(e,t,r)=>j_(e,t,r)>0;var ca=U_;const $_=pn,H_=(e,t,r)=>$_(e,t,r)<0;var ih=H_;const W_=pn,V_=(e,t,r)=>W_(e,t,r)===0;var z_=V_;const q_=pn,G_=(e,t,r)=>q_(e,t,r)!==0;var J_=G_;const Z_=pn,K_=(e,t,r)=>Z_(e,t,r)>=0;var sh=K_;const Q_=pn,Y_=(e,t,r)=>Q_(e,t,r)<=0;var oh=Y_;const X_=z_,em=J_,tm=ca,rm=sh,nm=ih,im=oh,sm=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return X_(e,r,n);case"!=":return em(e,r,n);case">":return tm(e,r,n);case">=":return rm(e,r,n);case"<":return nm(e,r,n);case"<=":return im(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var om=sm;const{safeRe:Hw,t:Ww}=Kn;class am{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var cm=am,to,Tc;function kt(){if(Tc)return to;Tc=1;const e=/\s+/g;class t{constructor(d,y){if(y=i(y),d instanceof t)return d.loose===!!y.loose&&d.includePrerelease===!!y.includePrerelease?d:new t(d.raw,y);if(d instanceof s)return this.raw=d.value,this.set=[[d]],this.formatted=void 0,this;if(this.options=y,this.loose=!!y.loose,this.includePrerelease=!!y.includePrerelease,this.raw=d.trim().replace(e," "),this.set=this.raw.split("||").map(v=>this.parseRange(v.trim())).filter(v=>v.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const v=this.set[0];if(this.set=this.set.filter(S=>!F(S[0])),this.set.length===0)this.set=[v];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&O(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let d=0;d<this.set.length;d++){d>0&&(this.formatted+="||");const y=this.set[d];for(let v=0;v<y.length;v++)v>0&&(this.formatted+=" "),this.formatted+=y[v].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(d){const v=((this.options.includePrerelease&&I)|(this.options.loose&&D))+":"+d,S=n.get(v);if(S)return S;const x=this.options.loose,B=x?h[p.HYPHENRANGELOOSE]:h[p.HYPHENRANGE];d=d.replace(B,ce(this.options.includePrerelease)),a("hyphen replace",d),d=d.replace(h[p.COMPARATORTRIM],g),a("comparator trim",d),d=d.replace(h[p.TILDETRIM],_),a("tilde trim",d),d=d.replace(h[p.CARETTRIM],w),a("caret trim",d);let b=d.split(" ").map(J=>T(J,this.options)).join(" ").split(/\s+/).map(J=>re(J,this.options));x&&(b=b.filter(J=>(a("loose invalid filter",J,this.options),!!J.match(h[p.COMPARATORLOOSE])))),a("range list",b);const u=new Map,R=b.map(J=>new s(J,this.options));for(const J of R){if(F(J))return[J];u.set(J.value,J)}u.size>1&&u.has("")&&u.delete("");const Q=[...u.values()];return n.set(v,Q),Q}intersects(d,y){if(!(d instanceof t))throw new TypeError("a Range is required");return this.set.some(v=>k(v,y)&&d.set.some(S=>k(S,y)&&v.every(x=>S.every(B=>x.intersects(B,y)))))}test(d){if(!d)return!1;if(typeof d=="string")try{d=new o(d,this.options)}catch{return!1}for(let y=0;y<this.set.length;y++)if(A(this.set[y],d,this.options))return!0;return!1}}to=t;const r=cm,n=new r,i=aa,s=ps(),a=ds,o=Qn,{safeRe:h,t:p,comparatorTrimReplace:g,tildeTrimReplace:_,caretTrimReplace:w}=Kn,{FLAG_INCLUDE_PRERELEASE:I,FLAG_LOOSE:D}=fs,F=c=>c.value==="<0.0.0-0",O=c=>c.value==="",k=(c,d)=>{let y=!0;const v=c.slice();let S=v.pop();for(;y&&v.length;)y=v.every(x=>S.intersects(x,d)),S=v.pop();return y},T=(c,d)=>(c=c.replace(h[p.BUILD],""),a("comp",c,d),c=z(c,d),a("caret",c),c=W(c,d),a("tildes",c),c=Y(c,d),a("xrange",c),c=de(c,d),a("stars",c),c),L=c=>!c||c.toLowerCase()==="x"||c==="*",W=(c,d)=>c.trim().split(/\s+/).map(y=>$(y,d)).join(" "),$=(c,d)=>{const y=d.loose?h[p.TILDELOOSE]:h[p.TILDE];return c.replace(y,(v,S,x,B,b)=>{a("tilde",c,v,S,x,B,b);let u;return L(S)?u="":L(x)?u=`>=${S}.0.0 <${+S+1}.0.0-0`:L(B)?u=`>=${S}.${x}.0 <${S}.${+x+1}.0-0`:b?(a("replaceTilde pr",b),u=`>=${S}.${x}.${B}-${b} <${S}.${+x+1}.0-0`):u=`>=${S}.${x}.${B} <${S}.${+x+1}.0-0`,a("tilde return",u),u})},z=(c,d)=>c.trim().split(/\s+/).map(y=>ee(y,d)).join(" "),ee=(c,d)=>{a("caret",c,d);const y=d.loose?h[p.CARETLOOSE]:h[p.CARET],v=d.includePrerelease?"-0":"";return c.replace(y,(S,x,B,b,u)=>{a("caret",c,S,x,B,b,u);let R;return L(x)?R="":L(B)?R=`>=${x}.0.0${v} <${+x+1}.0.0-0`:L(b)?x==="0"?R=`>=${x}.${B}.0${v} <${x}.${+B+1}.0-0`:R=`>=${x}.${B}.0${v} <${+x+1}.0.0-0`:u?(a("replaceCaret pr",u),x==="0"?B==="0"?R=`>=${x}.${B}.${b}-${u} <${x}.${B}.${+b+1}-0`:R=`>=${x}.${B}.${b}-${u} <${x}.${+B+1}.0-0`:R=`>=${x}.${B}.${b}-${u} <${+x+1}.0.0-0`):(a("no pr"),x==="0"?B==="0"?R=`>=${x}.${B}.${b}${v} <${x}.${B}.${+b+1}-0`:R=`>=${x}.${B}.${b}${v} <${x}.${+B+1}.0-0`:R=`>=${x}.${B}.${b} <${+x+1}.0.0-0`),a("caret return",R),R})},Y=(c,d)=>(a("replaceXRanges",c,d),c.split(/\s+/).map(y=>K(y,d)).join(" ")),K=(c,d)=>{c=c.trim();const y=d.loose?h[p.XRANGELOOSE]:h[p.XRANGE];return c.replace(y,(v,S,x,B,b,u)=>{a("xRange",c,v,S,x,B,b,u);const R=L(x),Q=R||L(B),J=Q||L(b),N=J;return S==="="&&N&&(S=""),u=d.includePrerelease?"-0":"",R?S===">"||S==="<"?v="<0.0.0-0":v="*":S&&N?(Q&&(B=0),b=0,S===">"?(S=">=",Q?(x=+x+1,B=0,b=0):(B=+B+1,b=0)):S==="<="&&(S="<",Q?x=+x+1:B=+B+1),S==="<"&&(u="-0"),v=`${S+x}.${B}.${b}${u}`):Q?v=`>=${x}.0.0${u} <${+x+1}.0.0-0`:J&&(v=`>=${x}.${B}.0${u} <${x}.${+B+1}.0-0`),a("xRange return",v),v})},de=(c,d)=>(a("replaceStars",c,d),c.trim().replace(h[p.STAR],"")),re=(c,d)=>(a("replaceGTE0",c,d),c.trim().replace(h[d.includePrerelease?p.GTE0PRE:p.GTE0],"")),ce=c=>(d,y,v,S,x,B,b,u,R,Q,J,N)=>(L(v)?y="":L(S)?y=`>=${v}.0.0${c?"-0":""}`:L(x)?y=`>=${v}.${S}.0${c?"-0":""}`:B?y=`>=${y}`:y=`>=${y}${c?"-0":""}`,L(R)?u="":L(Q)?u=`<${+R+1}.0.0-0`:L(J)?u=`<${R}.${+Q+1}.0-0`:N?u=`<=${R}.${Q}.${J}-${N}`:c?u=`<${R}.${Q}.${+J+1}-0`:u=`<=${u}`,`${y} ${u}`.trim()),A=(c,d,y)=>{for(let v=0;v<c.length;v++)if(!c[v].test(d))return!1;if(d.prerelease.length&&!y.includePrerelease){for(let v=0;v<c.length;v++)if(a(c[v].semver),c[v].semver!==s.ANY&&c[v].semver.prerelease.length>0){const S=c[v].semver;if(S.major===d.major&&S.minor===d.minor&&S.patch===d.patch)return!0}return!1}return!0};return to}var ro,Nc;function ps(){if(Nc)return ro;Nc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(g,_){if(_=r(_),g instanceof t){if(g.loose===!!_.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),a("comparator",g,_),this.options=_,this.loose=!!_.loose,this.parse(g),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(g){const _=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],w=g.match(_);if(!w)throw new TypeError(`Invalid comparator: ${g}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new o(w[2],this.options.loose):this.semver=e}toString(){return this.value}test(g){if(a("Comparator.test",g,this.options.loose),this.semver===e||g===e)return!0;if(typeof g=="string")try{g=new o(g,this.options)}catch{return!1}return s(g,this.operator,this.semver,this.options)}intersects(g,_){if(!(g instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(g.value,_).test(this.value):g.operator===""?g.value===""?!0:new h(this.value,_).test(g.semver):(_=r(_),_.includePrerelease&&(this.value==="<0.0.0-0"||g.value==="<0.0.0-0")||!_.includePrerelease&&(this.value.startsWith("<0.0.0")||g.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&g.operator.startsWith(">")||this.operator.startsWith("<")&&g.operator.startsWith("<")||this.semver.version===g.semver.version&&this.operator.includes("=")&&g.operator.includes("=")||s(this.semver,"<",g.semver,_)&&this.operator.startsWith(">")&&g.operator.startsWith("<")||s(this.semver,">",g.semver,_)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}ro=t;const r=aa,{safeRe:n,t:i}=Kn,s=om,a=ds,o=Qn,h=kt();return ro}const lm=kt(),um=(e,t,r)=>{try{t=new lm(t,r)}catch{return!1}return t.test(e)};var ah=um;kt();kt();kt();kt();const hm=kt(),fm=(e,t)=>{try{return new hm(e,t).range||"*"}catch{return null}};var dm=fm;const pm=Qn,ch=ps(),{ANY:gm}=ch,_m=kt(),mm=ah,Bc=ca,Lc=ih,ym=oh,wm=sh,vm=(e,t,r,n)=>{e=new pm(e,n),t=new _m(t,n);let i,s,a,o,h;switch(r){case">":i=Bc,s=ym,a=Lc,o=">",h=">=";break;case"<":i=Lc,s=wm,a=Bc,o="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(mm(e,t,n))return!1;for(let p=0;p<t.set.length;++p){const g=t.set[p];let _=null,w=null;if(g.forEach(I=>{I.semver===gm&&(I=new ch(">=0.0.0")),_=_||I,w=w||I,i(I.semver,_.semver,n)?_=I:a(I.semver,w.semver,n)&&(w=I)}),_.operator===o||_.operator===h||(!w.operator||w.operator===o)&&s(e,w.semver))return!1;if(w.operator===h&&a(e,w.semver))return!1}return!0};var bm=vm;const Em=bm,Sm=(e,t,r)=>Em(e,t,">",r);var Rm=Sm;kt();kt();const la=ps(),{ANY:Vw}=la;new la(">=0.0.0-0");new la(">=0.0.0");const no=Kn,Pc=fs,Oc=nh,Cm=F_,Mm=ca;ps();kt();const km=ah,xm=dm,Im=Rm;var Am={valid:Cm,gt:Mm,satisfies:km,validRange:xm,gtr:Im,re:no.re,src:no.src,tokens:no.t,SEMVER_SPEC_VERSION:Pc.SEMVER_SPEC_VERSION,RELEASE_TYPES:Pc.RELEASE_TYPES,compareIdentifiers:Oc.compareIdentifiers,rcompareIdentifiers:Oc.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=Am,r=kr,n=st;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",_=>(0,t.valid)(_)===null?`Expected SemVer version, got "${_}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",_=>(0,t.validRange)(_)===null?`Expected SemVer range, got "${_}"`:!0);function i(_){return(0,r.is)(_,e.VersionStruct)}e.isValidSemVerVersion=i;function s(_){return(0,r.is)(_,e.VersionRangeStruct)}e.isValidSemVerRange=s;function a(_){(0,n.assertStruct)(_,e.VersionStruct)}e.assertIsSemVerVersion=a;function o(_){(0,n.assertStruct)(_,e.VersionRangeStruct)}e.assertIsSemVerRange=o;function h(_,w){return(0,t.gt)(_,w)}e.gtVersion=h;function p(_,w){return(0,t.gtr)(_,w)}e.gtRange=p;function g(_,w){return(0,t.satisfies)(_,w,{includePrerelease:!0})}e.satisfiesVersionRange=g})(eh);(function(e){var t=te&&te.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(st,e),r(Jn,e),r(ye,e),r(us,e),r(Ft,e),r(rn,e),r(Gu,e),r(Zn,e),r(Ju,e),r(Zu,e),r(nn,e),r(Ku,e),r(Dt,e),r(Qu,e),r(Yu,e),r(Xu,e),r(eh,e)})(xu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=xu;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(ku);var lh=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.PollingBlockTracker=void 0;const Tm=lh(Yo),Nm=lh(jg),Bm=Vn,Fc=ku,Dc=(0,Fc.createModuleLogger)(Fc.projectLogger,"polling-block-tracker"),Lm=(0,Tm.default)(),Pm=1e3;class Om extends Bm.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Pm,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=jc(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
8
|
+
${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=jc(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Lm(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Dc("Making request",t);const r=await(0,Nm.default)(n=>this._provider.sendAsync(t,n))();if(Dc("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
9
|
+
${r.error.message}`);return r.result}}cs.PollingBlockTracker=Om;function jc(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var gs={},Fm=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gs,"__esModule",{value:!0});gs.SubscribeBlockTracker=void 0;const Dm=Fm(Yo),jm=Vn,Um=(0,Dm.default)();class $m extends jm.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:Um(),method:t,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}gs.SubscribeBlockTracker=$m;(function(e){var t=te&&te.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(cs,e),r(gs,e)})(Mu);var ua={},_s={},Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getUniqueId=void 0;const uh=4294967295;let io=Math.floor(Math.random()*uh);function Hm(){return io=(io+1)%uh,io}Yn.getUniqueId=Hm;Object.defineProperty(_s,"__esModule",{value:!0});_s.createIdRemapMiddleware=void 0;const Wm=Yn;function Vm(){return(e,t,r,n)=>{const i=e.id,s=Wm.getUniqueId();e.id=s,t.id=s,r(a=>{e.id=i,t.id=i,a()})}}_s.createIdRemapMiddleware=Vm;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.createAsyncMiddleware=void 0;function zm(e){return async(t,r,n,i)=>{let s;const a=new Promise(g=>{s=g});let o=null,h=!1;const p=async()=>{h=!0,n(g=>{o=g,s()}),await a};try{await e(t,r,p),h?(await a,o(null)):i(null)}catch(g){o?o(g):i(g)}}}ms.createAsyncMiddleware=zm;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.createScaffoldMiddleware=void 0;function qm(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}ys.createScaffoldMiddleware=qm;var Xn={},ha={};Object.defineProperty(ha,"__esModule",{value:!0});const Gm=Ii;function Uc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Jm(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Zm=class extends Gm.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const o=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw o.context=a,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Uc(s,this,r);else{const a=s.length,o=Jm(s);for(let h=0;h<a;h+=1)Uc(o[h],this,r)}return!0}};ha.default=Zm;var hh={},Zt={},Km=Cn;Cn.default=Cn;Cn.stable=ph;Cn.stableStringify=ph;var ki="[...]",fh="[Circular]",Er=[],wr=[];function dh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Cn(e,t,r,n){typeof n>"u"&&(n=dh()),ko(e,"",0,[],void 0,0,n);var i;try{wr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,gh(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Er.length!==0;){var s=Er.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Jr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Er.push([n,r,t,i])):wr.push([t,r,e]):(n[r]=e,Er.push([n,r,t]))}function ko(e,t,r,n,i,s,a){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){Jr(fh,e,t,i);return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){Jr(ki,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Jr(ki,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)ko(e[o],o,o,n,e,s,a);else{var h=Object.keys(e);for(o=0;o<h.length;o++){var p=h[o];ko(e[p],p,o,n,e,s,a)}}n.pop()}}function Qm(e,t){return e<t?-1:e>t?1:0}function ph(e,t,r,n){typeof n>"u"&&(n=dh());var i=xo(e,"",0,[],void 0,0,n)||e,s;try{wr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,gh(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Er.length!==0;){var a=Er.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function xo(e,t,r,n,i,s,a){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){Jr(fh,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){Jr(ki,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Jr(ki,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)xo(e[o],o,o,n,e,s,a);else{var h={},p=Object.keys(e).sort(Qm);for(o=0;o<p.length;o++){var g=p[o];xo(e[g],g,o,n,e,s,a),h[g]=e[g]}if(typeof i<"u")Er.push([i,t,e]),i[t]=h;else return h}n.pop()}}function gh(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(wr.length>0)for(var n=0;n<wr.length;n++){var i=wr[n];if(i[1]===t&&i[0]===r){r=i[2],wr.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Zt,"__esModule",{value:!0});Zt.EthereumProviderError=Zt.EthereumRpcError=void 0;const Ym=Km;class _h extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Ym.default(this.serialize(),ty,2)}}Zt.EthereumRpcError=_h;class Xm extends _h{constructor(t,r,n){if(!ey(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Zt.EthereumProviderError=Xm;function ey(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function ty(e,t){if(t!=="[Circular]")return t}var fa={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.errorValues=Kt.errorCodes=void 0;Kt.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}};Kt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Kt,r=Zt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(w,I=i){if(Number.isInteger(w)){const D=w.toString();if(_(t.errorValues,D))return t.errorValues[D].message;if(p(w))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return I}e.getMessageFromCode=a;function o(w){if(!Number.isInteger(w))return!1;const I=w.toString();return!!(t.errorValues[I]||p(w))}e.isValidCode=o;function h(w,{fallbackError:I=s,shouldIncludeStack:D=!1}={}){var F,O;if(!I||!Number.isInteger(I.code)||typeof I.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(w instanceof r.EthereumRpcError)return w.serialize();const k={};if(w&&typeof w=="object"&&!Array.isArray(w)&&_(w,"code")&&o(w.code)){const L=w;k.code=L.code,L.message&&typeof L.message=="string"?(k.message=L.message,_(L,"data")&&(k.data=L.data)):(k.message=a(k.code),k.data={originalError:g(w)})}else{k.code=I.code;const L=(F=w)===null||F===void 0?void 0:F.message;k.message=L&&typeof L=="string"?L:I.message,k.data={originalError:g(w)}}const T=(O=w)===null||O===void 0?void 0:O.stack;return D&&w&&T&&typeof T=="string"&&(k.stack=T),k}e.serializeError=h;function p(w){return w>=-32099&&w<=-32e3}function g(w){return w&&typeof w=="object"&&!Array.isArray(w)?Object.assign({},w):w}function _(w,I){return Object.prototype.hasOwnProperty.call(w,I)}})(fa);var ws={};Object.defineProperty(ws,"__esModule",{value:!0});ws.ethErrors=void 0;const da=Zt,mh=fa,ot=Kt;ws.ethErrors={rpc:{parse:e=>_t(ot.errorCodes.rpc.parse,e),invalidRequest:e=>_t(ot.errorCodes.rpc.invalidRequest,e),invalidParams:e=>_t(ot.errorCodes.rpc.invalidParams,e),methodNotFound:e=>_t(ot.errorCodes.rpc.methodNotFound,e),internal:e=>_t(ot.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return _t(t,e)},invalidInput:e=>_t(ot.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>_t(ot.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>_t(ot.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>_t(ot.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>_t(ot.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>_t(ot.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>_n(ot.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>_n(ot.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>_n(ot.errorCodes.provider.unsupportedMethod,e),disconnected:e=>_n(ot.errorCodes.provider.disconnected,e),chainDisconnected:e=>_n(ot.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new da.EthereumProviderError(t,r,n)}}};function _t(e,t){const[r,n]=yh(t);return new da.EthereumRpcError(e,r||mh.getMessageFromCode(e),n)}function _n(e,t){const[r,n]=yh(t);return new da.EthereumProviderError(e,r||mh.getMessageFromCode(e),n)}function yh(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Zt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=fa;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=ws;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Kt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(hh);var ry=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.JsonRpcEngine=void 0;const ny=ry(ha),mt=hh;class jt extends ny.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,a,o]=await jt._runAllMiddleware(t,r,this._middleware);return a?(await jt._runReturnHandlers(o),i(s)):n(async h=>{try{await jt._runReturnHandlers(o)}catch(p){return h(p)}return h()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const a=new mt.EthereumRpcError(mt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){const a=new mt.EthereumRpcError(mt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=mt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await jt._runAllMiddleware(t,r,this._middleware);if(jt._checkForCompletion(t,r,i),await jt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,a=!1;for(const o of n)if([s,a]=await jt._runMiddleware(t,r,o,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const a=h=>{const p=h||r.error;p&&(r.error=mt.serializeError(p)),s([p,!0])},o=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new mt.EthereumRpcError(mt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request:
|
|
10
|
+
${so(t)}`,{request:t})),i.push(h)),s([null,!1]))};try{n(t,r,o,a)}catch(h){a(h)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new mt.EthereumRpcError(mt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
11
|
+
${so(t)}`,{request:t});if(!n)throw new mt.EthereumRpcError(mt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
12
|
+
${so(t)}`,{request:t})}}Xn.JsonRpcEngine=jt;function so(e){return JSON.stringify(e,null,2)}var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.mergeMiddleware=void 0;const iy=Xn;function sy(e){const t=new iy.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}vs.mergeMiddleware=sy;(function(e){var t=te&&te.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(_s,e),r(ms,e),r(ys,e),r(Yn,e),r(Xn,e),r(vs,e)})(ua);var wh={},pa={};const ga=sn(Ah);var bs={};Object.defineProperty(bs,"__esModule",{value:!0});var $c=ga,oy=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return $c.__awaiter(this,void 0,void 0,function(){var r,n,i;return $c.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();bs.default=oy;Object.defineProperty(pa,"__esModule",{value:!0});var Hc=ga,ay=bs,cy=function(){function e(){this._semaphore=new ay.default(1)}return e.prototype.acquire=function(){return Hc.__awaiter(this,void 0,void 0,function(){var t,r;return Hc.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();pa.default=cy;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.withTimeout=void 0;var pi=ga;function ly(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return pi.__awaiter(n,void 0,void 0,function(){var a,o,h;return pi.__generator(this,function(p){switch(p.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},t),[4,e.acquire()];case 1:return o=p.sent(),a?(h=Array.isArray(o)?o[1]:o,h()):i(o),[2]}})})})},runExclusive:function(i){return pi.__awaiter(this,void 0,void 0,function(){var s,a;return pi.__generator(this,function(o){switch(o.label){case 0:s=function(){},o.label=1;case 1:return o.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=o.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,o.sent()];case 4:return s=a,[4,i()];case 5:return[2,o.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Es.withTimeout=ly;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=pa;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=bs;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Es;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(wh);var uy=fy,hy=Object.prototype.hasOwnProperty;function fy(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)hy.call(r,n)&&(e[n]=r[n])}return e}const dy=uy,py=Yo();var gy=le;function le(e){const t=this;t.currentProvider=e}le.prototype.getBalance=ei(2,"eth_getBalance");le.prototype.getCode=ei(2,"eth_getCode");le.prototype.getTransactionCount=ei(2,"eth_getTransactionCount");le.prototype.getStorageAt=ei(3,"eth_getStorageAt");le.prototype.call=ei(2,"eth_call");le.prototype.protocolVersion=ge("eth_protocolVersion");le.prototype.syncing=ge("eth_syncing");le.prototype.coinbase=ge("eth_coinbase");le.prototype.mining=ge("eth_mining");le.prototype.hashrate=ge("eth_hashrate");le.prototype.gasPrice=ge("eth_gasPrice");le.prototype.accounts=ge("eth_accounts");le.prototype.blockNumber=ge("eth_blockNumber");le.prototype.getBlockTransactionCountByHash=ge("eth_getBlockTransactionCountByHash");le.prototype.getBlockTransactionCountByNumber=ge("eth_getBlockTransactionCountByNumber");le.prototype.getUncleCountByBlockHash=ge("eth_getUncleCountByBlockHash");le.prototype.getUncleCountByBlockNumber=ge("eth_getUncleCountByBlockNumber");le.prototype.sign=ge("eth_sign");le.prototype.sendTransaction=ge("eth_sendTransaction");le.prototype.sendRawTransaction=ge("eth_sendRawTransaction");le.prototype.estimateGas=ge("eth_estimateGas");le.prototype.getBlockByHash=ge("eth_getBlockByHash");le.prototype.getBlockByNumber=ge("eth_getBlockByNumber");le.prototype.getTransactionByHash=ge("eth_getTransactionByHash");le.prototype.getTransactionByBlockHashAndIndex=ge("eth_getTransactionByBlockHashAndIndex");le.prototype.getTransactionByBlockNumberAndIndex=ge("eth_getTransactionByBlockNumberAndIndex");le.prototype.getTransactionReceipt=ge("eth_getTransactionReceipt");le.prototype.getUncleByBlockHashAndIndex=ge("eth_getUncleByBlockHashAndIndex");le.prototype.getUncleByBlockNumberAndIndex=ge("eth_getUncleByBlockNumberAndIndex");le.prototype.getCompilers=ge("eth_getCompilers");le.prototype.compileLLL=ge("eth_compileLLL");le.prototype.compileSolidity=ge("eth_compileSolidity");le.prototype.compileSerpent=ge("eth_compileSerpent");le.prototype.newFilter=ge("eth_newFilter");le.prototype.newBlockFilter=ge("eth_newBlockFilter");le.prototype.newPendingTransactionFilter=ge("eth_newPendingTransactionFilter");le.prototype.uninstallFilter=ge("eth_uninstallFilter");le.prototype.getFilterChanges=ge("eth_getFilterChanges");le.prototype.getFilterLogs=ge("eth_getFilterLogs");le.prototype.getLogs=ge("eth_getLogs");le.prototype.getWork=ge("eth_getWork");le.prototype.submitWork=ge("eth_submitWork");le.prototype.submitHashrate=ge("eth_submitHashrate");le.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(_y(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function ge(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function ei(e,t){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function _y(e){return dy({id:py(),jsonrpc:"2.0",params:[]},e)}const Wc=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((a,o)=>{t.multiArgs?i.push((...p)=>{t.errorFirst?p[0]?o(p):(p.shift(),a(p)):a(p)}):t.errorFirst?i.push((p,g)=>{p?o(p):a(g)}):i.push(a),Reflect.apply(e,this===r?n:this,i)})},Vc=new WeakMap;var my=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(a,o)=>{let h=Vc.get(a);if(h||(h={},Vc.set(a,h)),o in h)return h[o];const p=D=>typeof D=="string"||typeof o=="symbol"?o===D:D.test(o),g=Reflect.getOwnPropertyDescriptor(a,o),_=g===void 0||g.writable||g.configurable,I=(t.include?t.include.some(p):!t.exclude.some(p))&&_;return h[o]=I,I},i=new WeakMap,s=new Proxy(e,{apply(a,o,h){const p=i.get(a);if(p)return Reflect.apply(p,o,h);const g=t.excludeMain?a:Wc(a,t,s,a);return i.set(a,g),Reflect.apply(g,o,h)},get(a,o){const h=a[o];if(!n(a,o)||h===Function.prototype[o])return h;const p=i.get(h);if(p)return p;if(typeof h=="function"){const g=Wc(h,t,s,a);return i.set(h,g),g}return h}});return s};const yy=zn.default;let wy=class extends yy{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var _a=wy;const vy=_a;let by=class extends vy{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var Ey=by,ti={minBlockRef:Sy,bnToHex:Cy,blockRefIsNumber:My,hexToInt:xi,incrementHexInt:ky,intToHex:vh,unsafeRandomBytes:xy};function Sy(...e){return Ry(e)[0]}function Ry(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:xi(t)-xi(r))}function Cy(e){return"0x"+e.toString(16)}function My(e){return e&&!["earliest","latest","pending"].includes(e)}function xi(e){return e==null?e:Number.parseInt(e,16)}function ky(e){if(e==null)return e;const t=xi(e);return vh(t+1)}function vh(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function xy(e){let t="0x";for(let r=0;r<e;r++)t+=zc(),t+=zc();return t}function zc(){return Math.floor(Math.random()*16).toString(16)}const Iy=gy,Ay=my,Ty=Ey,{bnToHex:Jw,hexToInt:gi,incrementHexInt:Ny,minBlockRef:By,blockRefIsNumber:Ly}=ti;let Py=class extends Ty{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new Iy(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=By(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=Ny(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),o=(await this._fetchLogs(s)).filter(h=>this.matchLog(h));this.addResults(o)}async _fetchLogs(t){return await Ay(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(gi(this.params.fromBlock)>=gi(t.blockNumber)||Ly(this.params.toBlock)&&gi(this.params.toBlock)<=gi(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let a=t.topics[s];if(!a)return!1;a=a.toLowerCase();let o=Array.isArray(i)?i:[i];return o.includes(null)?!0:(o=o.map(g=>g.toLowerCase()),o.includes(a))})}};var Oy=Py,ma=Fy;async function Fy({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=qc(t),s=qc(r)-n+1,a=Array(s).fill().map((h,p)=>n+p).map(Dy);let o=await Promise.all(a.map(h=>Uy(e,"eth_getBlockByNumber",[h,!1])));return o=o.filter(h=>h!==null),o}function qc(e){return e==null?e:Number.parseInt(e,16)}function Dy(e){return e==null?e:"0x"+e.toString(16)}function jy(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function Uy(e,t,r){for(let n=0;n<3;n++)try{return await jy(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const $y=_a,Hy=ma,{incrementHexInt:Wy}=ti;let Vy=class extends $y{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=Wy(t),a=(await Hy({provider:this.provider,fromBlock:i,toBlock:n})).map(o=>o.hash);this.addResults(a)}};var zy=Vy;const qy=_a,Gy=ma,{incrementHexInt:Jy}=ti;let Zy=class extends qy{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=Jy(t),i=await Gy({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var Ky=Zy;const Qy=wh.Mutex,{createAsyncMiddleware:Yy,createScaffoldMiddleware:Xy}=ua,ew=Oy,tw=zy,rw=Ky,{intToHex:bh,hexToInt:oo}=ti;var nw=iw;function iw({blockTracker:e,provider:t}){let r=0,n={};const i=new Qy,s=sw({mutex:i}),a=Xy({eth_newFilter:s(ao(h)),eth_newBlockFilter:s(ao(p)),eth_newPendingTransactionFilter:s(ao(g)),eth_uninstallFilter:s(Ei(I)),eth_getFilterChanges:s(Ei(_)),eth_getFilterLogs:s(Ei(w))}),o=async({oldBlock:T,newBlock:L})=>{if(n.length===0)return;const W=await i.acquire();try{await Promise.all($r(n).map(async $=>{try{await $.update({oldBlock:T,newBlock:L})}catch(z){console.error(z)}}))}catch($){console.error($)}W()};return a.newLogFilter=h,a.newBlockFilter=p,a.newPendingTransactionFilter=g,a.uninstallFilter=I,a.getFilterChanges=_,a.getFilterLogs=w,a.destroy=()=>{O()},a;async function h(T){const L=new ew({provider:t,params:T});return await D(L),L}async function p(){const T=new tw({provider:t});return await D(T),T}async function g(){const T=new rw({provider:t});return await D(T),T}async function _(T){const L=oo(T),W=n[L];if(!W)throw new Error(`No filter for index "${L}"`);return W.getChangesAndClear()}async function w(T){const L=oo(T),W=n[L];if(!W)throw new Error(`No filter for index "${L}"`);let $=[];return W.type==="log"&&($=W.getAllResults()),$}async function I(T){const L=oo(T),$=!!n[L];return $&&await F(L),$}async function D(T){const L=$r(n).length,W=await e.getLatestBlock();await T.initialize({currentBlock:W}),r++,n[r]=T,T.id=r,T.idHex=bh(r);const $=$r(n).length;return k({prevFilterCount:L,newFilterCount:$}),r}async function F(T){const L=$r(n).length;delete n[T];const W=$r(n).length;k({prevFilterCount:L,newFilterCount:W})}async function O(){const T=$r(n).length;n={},k({prevFilterCount:T,newFilterCount:0})}function k({prevFilterCount:T,newFilterCount:L}){if(T===0&&L>0){e.on("sync",o);return}if(T>0&&L===0){e.removeListener("sync",o);return}}}function ao(e){return Ei(async(...t)=>{const r=await e(...t);return bh(r.id)})}function Ei(e){return Yy(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function sw({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function $r(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const ow=zn.default,{createAsyncMiddleware:Gc,createScaffoldMiddleware:aw}=ua,cw=nw,{unsafeRandomBytes:lw,incrementHexInt:uw}=ti,hw=ma;var fw=dw;function dw({blockTracker:e,provider:t}){const r={},n=cw({blockTracker:e,provider:t});let i=!1;const s=new ow,a=aw({eth_subscribe:Gc(o),eth_unsubscribe:Gc(h)});return a.destroy=g,{events:s,middleware:a};async function o(_,w){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const I=_.params[0],D=lw(16);let F;switch(I){case"newHeads":F=O({subId:D});break;case"logs":const T=_.params[1],L=await n.newLogFilter(T);F=k({subId:D,filter:L});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${I}"`)}r[D]=F,w.result=D;return;function O({subId:T}){const L={type:I,destroy:async()=>{e.removeListener("sync",L.update)},update:async({oldBlock:W,newBlock:$})=>{const z=$,ee=uw(W);(await hw({provider:t,fromBlock:ee,toBlock:z})).map(pw).filter(de=>de!==null).forEach(de=>{p(T,de)})}};return e.on("sync",L.update),L}function k({subId:T,filter:L}){return L.on("update",$=>p(T,$)),{type:I,destroy:async()=>await n.uninstallFilter(L.idHex)}}}async function h(_,w){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const I=_.params[0],D=r[I];if(!D){w.result=!1;return}delete r[I],await D.destroy(),w.result=!0}function p(_,w){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:_,result:w}})}function g(){s.removeAllListeners();for(const _ in r)r[_].destroy(),delete r[_];i=!0}}function pw(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(as,"__esModule",{value:!0});as.SubscriptionManager=void 0;const gw=Mu,_w=fw,Jc=()=>{};class mw{constructor(t){const r=new gw.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=_w({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Jc,Jc),r}destroy(){this.subscriptionMiddleware.destroy()}}as.SubscriptionManager=mw;var Eh=te&&te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.CoinbaseWalletProvider=void 0;const yw=Eh(Ni),ww=jf,_e=Mn,pe=X,vw=An,Zc=wt,_i=ln,ht=on,co=Eh(Lg),mn=cn,bw=tn,Ew=as,Kc="DefaultChainId",Qc="DefaultJsonRpcUrl";class Sw extends ww.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new bw.FilterPolyfill(this),this._subscriptionManager=new Ew.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,pe.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(Zc.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const o=a.split(" ");o[0]!==""&&(this._addresses=o.map(h=>(0,pe.ensureAddressString)(h)),this.emit("accountsChanged",o))}this._subscriptionManager.events.on("notification",o=>{this.emit("message",{type:o.method,data:o.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",o=>{var h;if(!(o.origin!==location.origin||o.source!==window)&&o.data.type==="walletLinkMessage"&&o.data.data.action==="dappChainSwitched"){const p=o.data.data.chainId,g=(h=o.data.data.jsonRpcUrl)!==null&&h!==void 0?h:this.jsonRpcUrl;this.updateProviderInfo(g,Number(p))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,pe.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(Qc))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Qc,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(Kc,r.toString(10)),((0,pe.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,a){const h=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,a==null?void 0:a.toString()).promise;return(0,ht.isErrorResponse)(h)?!1:!!h.result}async addEthereumChain(t,r,n,i,s,a){var o,h;if((0,pe.ensureIntNumber)(t)===this.getChainId())return!1;const p=await this.initializeRelay(),g=p.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!g&&await p.requestEthereumAccounts().promise;const _=await p.addEthereumChain(t.toString(),r,s,n,i,a).promise;return(0,ht.isErrorResponse)(_)?!1:(((o=_.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(r[0],t),((h=_.result)===null||h===void 0?void 0:h.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,ht.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===_e.standardErrorCodes.provider.unsupportedChain?_e.standardErrors.provider.unsupportedChain():_e.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(mn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?_i.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,_e.serializeError)(i,t)})}catch(n){throw(0,_e.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(o=>o.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,_e.serializeError)(n,t)})}catch(n){return Promise.reject((0,_e.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,_e.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,_e.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw _e.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw _e.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw _e.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,pe.ensureRegExpString)(t)).promise;if((0,ht.isErrorResponse)(n))throw(0,_e.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,_e.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,ht.isErrorResponse)(i))throw(0,_e.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,_e.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(mn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?_i.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof vw.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ht.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?_e.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,ht.isErrorResponse)(n))throw(0,_e.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,_e.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,pe.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Zc.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(o=>r(Object.assign(Object.assign({},o),{id:t.id}))).catch(o=>n(o));return}const a=this._handleSubscriptionMethods(t);if(a!==void 0){a.then(o=>r({jsonrpc:"2.0",id:t.id,result:o.result})).catch(o=>n(o));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var a;throw(s.code===_e.standardErrorCodes.rpc.methodNotFound||s.code===_e.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log(mn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?_i.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,pe.ensureAddressString)(t);return this._addresses.map(i=>(0,pe.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(mn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,pe.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,pe.ensureAddressString)(t.to):null,i=t.value!=null?(0,pe.ensureBN)(t.value):new yw.default(0),s=t.data?(0,pe.ensureBuffer)(t.data):Buffer.alloc(0),a=t.nonce!=null?(0,pe.ensureIntNumber)(t.nonce):null,o=t.gasPrice!=null?(0,pe.ensureBN)(t.gasPrice):null,h=t.maxFeePerGas!=null?(0,pe.ensureBN)(t.maxFeePerGas):null,p=t.maxPriorityFeePerGas!=null?(0,pe.ensureBN)(t.maxPriorityFeePerGas):null,g=t.gas!=null?(0,pe.ensureBN)(t.gas):null,_=t.chainId?(0,pe.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:o,maxFeePerGas:h,maxPriorityFeePerGas:p,gasLimit:g,chainId:_}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw _e.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw _e.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,ht.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?_e.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,ht.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,pe.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Kc);if(!t)return(0,pe.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,pe.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(mn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?_i.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,ht.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?_e.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,pe.ensureAddressString)(t[0]),n=(0,pe.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,pe.ensureBuffer)(t[0]),n=(0,pe.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,pe.ensureBuffer)(t[0]),n=(0,pe.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,pe.ensureBuffer)(t[0]),n=(0,pe.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?_e.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,pe.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?_e.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,pe.ensureParsedJSONObject)(t[0]),n=(0,pe.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=co.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,pe.ensureAddressString)(t[0]),n=(0,pe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=co.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,pe.ensureAddressString)(t[0]),n=(0,pe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=co.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const a=t[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw _e.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw _e.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw _e.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw _e.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw _e.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw _e.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,o,a,n)}}_eth_uninstallFilter(t){const r=(0,pe.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,pe.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,pe.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Zr.CoinbaseWalletProvider=Sw;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.RelayEventManager=void 0;const Rw=X;class Cw{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,Rw.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Ss.RelayEventManager=Cw;Object.defineProperty(bn,"__esModule",{value:!0});bn.CoinbaseWalletSDK=void 0;const Mw=Ai,kw=Ti,Yc=X,xw=Fi,Iw=Zr,Aw=An,Tw=Wn,Nw=Ss,Bw=Fn,Lw=Tn,Sh=an;class Rs{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||kw.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),o=`${a.protocol}//${a.host}`;if(this._storage=new xw.ScopedLocalStorage(`-walletlink:${o}`),this._storage.setItem("version",Rs.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new Nw.RelayEventManager;const h=(0,Yc.isMobileWeb)(),p=t.uiConstructor||(_=>h?new Tw.MobileRelayUI(_):new Bw.WalletLinkRelayUI(_)),g={linkAPIUrl:s,version:Sh.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:p,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=h?new Aw.MobileRelay(g):new Lw.WalletLinkRelay(g),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new Iw.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,Yc.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,Mw.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}bn.CoinbaseWalletSDK=Rs;Rs.VERSION=Sh.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=bn,r=Zr;var n=bn;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Zr;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(No);const Pw=Ih(No),Yw=Th({__proto__:null,default:Pw},[No]);export{Yw as i};
|