@dcl/auth-site 4.11.9 → 4.11.10-22674067433.commit-ec9ee87
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/{ConstantsUtil-BAOMwrjB.js → ConstantsUtil-ESae-Z7-.js} +1 -1
- package/assets/{ContentfulRichText-BVJInl_X.js → ContentfulRichText-BtJfWm5x.js} +1 -1
- package/assets/{ExchangeController-CE1-qDFM.js → ExchangeController-IT3Dhd87.js} +1 -1
- package/assets/{HelpersUtil-p_2TOprz.js → HelpersUtil-DSNS5n-9.js} +1 -1
- package/assets/{NetworkUtil-ALrBtqvF.js → NetworkUtil-BCvAceLL.js} +1 -1
- package/assets/{SwapController-BmfRgnRE.js → SwapController-yDy01m5V.js} +1 -1
- package/assets/{biconomy-ZuBpxB_Z.js → biconomy-B599Ur_0.js} +1 -1
- package/assets/{ccip-zer9BVQd.js → ccip-_ZVU0YUG.js} +1 -1
- package/assets/{data-capture-DXFbD_2X.js → data-capture-CzsW3pB7.js} +1 -1
- package/assets/{email-CZZgeDwu.js → email-DWs9f9tH.js} +1 -1
- package/assets/{embedded-wallet-DhhuHH_S.js → embedded-wallet-P7U24FrG.js} +1 -1
- package/assets/{engine-ML4Qg8j7.js → engine-DAuziGro.js} +1 -1
- package/assets/{extractIPFS-6rL7YbLD.js → extractIPFS-DgGO_4eF.js} +1 -1
- package/assets/{features-oA675acZ.js → features--CaJUF7o.js} +1 -1
- package/assets/{fortmatic-D9QgSvQy.js → fortmatic-BouPZqQI.js} +1 -1
- package/assets/{getInstalledModules-u4tfyC0o.js → getInstalledModules-Bdsr8t_C.js} +1 -1
- package/assets/{if-defined-DEgQ1z7T.js → if-defined-2xQLKahR.js} +1 -1
- package/assets/{in-app-wallet-calls-3yC4gf2W.js → in-app-wallet-calls-D8l_xpYN.js} +1 -1
- package/assets/{index-BWB9yu1D.js → index-B9z9f635.js} +1 -1
- package/assets/{index-DiQ5FwKy.js → index-BIUEtDdG.js} +1 -1
- package/assets/{index-BQep68a1.js → index-BQsAkTBu.js} +1 -1
- package/assets/{index-BlSibOdP.js → index-BsWozatx.js} +1 -1
- package/assets/{index-B-NFA50q.js → index-Bv3VmA8e.js} +1 -1
- package/assets/{index-CJclPiJ6.js → index-C0hHgKRI.js} +1 -1
- package/assets/index-CA6Zy4Du.js +7 -0
- package/assets/{index-CN9hvq_d.js → index-CO5QKdxX.js} +1 -1
- package/assets/{index-9g7rK-S6.js → index-CPXKpbtw.js} +1 -1
- package/assets/{index-1Iyc_zW4.js → index-CQzRvO-C.js} +1 -1
- package/assets/{index-NeSzI640.js → index-CRA7VI9s.js} +1 -1
- package/assets/{index-BlHvjgXX.js → index-CRvDhax9.js} +1 -1
- package/assets/{index-BvpsDGXr.js → index-CUEaPFt-.js} +1 -1
- package/assets/{index-J7JPwLFu.js → index-CzHm4Ry3.js} +1 -1
- package/assets/{index-BYIDeuBS.js → index-CziCm94K.js} +1 -1
- package/assets/{index-DNU17x7j.js → index-D0cHggih.js} +1 -1
- package/assets/{index-d8qb3Bh1.js → index-D8AVDivV.js} +2 -2
- package/assets/{index-BIJ1HLK-.js → index-D9rT-G2z.js} +1 -1
- package/assets/{index-BkcXrz6w.js → index-DAoSp5q5.js} +1 -1
- package/assets/{index-CQfPnCB_.js → index-DIWcFA1F.js} +1 -1
- package/assets/{index-BXROPBR7.js → index-DJO0bodJ.js} +1 -1
- package/assets/{index-BeesMvem.js → index-DPpJj3DF.js} +1 -1
- package/assets/{index-WrFUPUVy.js → index-DRQzckTJ.js} +1 -1
- package/assets/{index-SRfS2tv8.js → index-DUoxxqna.js} +1 -1
- package/assets/{index-B2ekOHvY.js → index-DdCktyEF.js} +1 -1
- package/assets/{index-DNjjhYA1.js → index-Dl7iro_s.js} +1 -1
- package/assets/{index-CKuTxBMO.js → index-DvSlA4j0.js} +1 -1
- package/assets/index-DvuTX_1c.css +1 -0
- package/assets/{index-CHQeOazc.js → index-EfYw_r-L.js} +1 -1
- package/assets/{index-Ctooc5wh.js → index-HAgxNzWE.js} +1 -1
- package/assets/{index-De3fN9bR.js → index-JH3zlM2a.js} +3 -3
- package/assets/{index-DUab044w.js → index-JRJx2NpU.js} +1 -1
- package/assets/{index-DmnoYEjg.js → index-L_5Cs_kx.js} +1 -1
- package/assets/{index-D-htLeKo.js → index-MkZbQyDw.js} +4 -4
- package/assets/{index-WSsT16vn.js → index-MubCrWiB.js} +1 -1
- package/assets/{index-C5PmOkdY.js → index-UvGAZXmw.js} +1 -1
- package/assets/{index-IqSw10Sq.js → index-VsMuUpAO.js} +1 -1
- package/assets/{index-DUps-fXR.js → index-fG1WBhYz.js} +75 -75
- package/assets/{index-BjSGFaos.js → index-gcHRu1bF.js} +1 -1
- package/assets/{index-CDnwRYv4.js → index-jq6mMx3J.js} +1 -1
- package/assets/{index-CnUxTVea.js → index-ppPPH70g.js} +1 -1
- package/assets/{index-DCbuXsQl.js → index-vWAYjUUv.js} +1 -1
- package/assets/{index-Bh39Rbc1.js → index-xFdcXlRb.js} +1 -1
- package/assets/{networks-4rOVWxZC.js → networks-ZUADr5kB.js} +1 -1
- package/assets/{onramp-B98BEEIV.js → onramp-WAW9ejhZ.js} +1 -1
- package/assets/{openzeppelin-C09JYzFS.js → openzeppelin-DV82z7lJ.js} +1 -1
- package/assets/{parse-typed-data-Dy_RpQ65.js → parse-typed-data-8DIRR0Kb.js} +1 -1
- package/assets/{passkeys-CNW9UJaY.js → passkeys-BOJeUfAK.js} +1 -1
- package/assets/{pay-with-exchange-BGiQrnrX.js → pay-with-exchange-CNJhpLnE.js} +1 -1
- package/assets/{receive-Di7H3bRQ.js → receive-ss1HRI3I.js} +1 -1
- package/assets/{ref-Cs6aE0Nw.js → ref-CoyvS0l-.js} +1 -1
- package/assets/{resolveImplementation-BfuFbByz.js → resolveImplementation-C5lycJfC.js} +1 -1
- package/assets/{secp256k1-DTiizT7F.js → secp256k1-DW9CEMKa.js} +1 -1
- package/assets/{send-DGqbyS5L.js → send-C4Og1BUJ.js} +1 -1
- package/assets/{send-eip712-transaction-QgwzVlIl.js → send-eip712-transaction-C2PvhNcm.js} +1 -1
- package/assets/{send-gasless-transaction-DuSgxy0D.js → send-gasless-transaction-DIQuGEL1.js} +2 -2
- package/assets/{socials-BUpY92PE.js → socials-C7aTr6Px.js} +1 -1
- package/assets/{swaps-CwZrlZRn.js → swaps-BDatuUE1.js} +1 -1
- package/assets/{thirdweb-3rz-wQc6.js → thirdweb-juEAwwxR.js} +3 -3
- package/assets/{transactions-VHmPOc8T.js → transactions-Do481Xcb.js} +1 -1
- package/assets/ui-BsoeejM4.js +762 -0
- package/assets/{vendor-BlWFaBbX.js → vendor-C-guZ9WP.js} +1 -1
- package/assets/{w3m-modal-Daox802n.js → w3m-modal-Cj2A1qC_.js} +1 -1
- package/assets/{web-connector-BzT9ZilO.js → web-connector-DIFP2_dO.js} +3 -3
- package/index.html +5 -5
- package/package.json +3 -3
- package/assets/index-BIOPw-dr.css +0 -1
- package/assets/index-DiDUF14O.js +0 -21
- package/assets/ui-BRI7cdA1.js +0 -741
package/assets/index-DiDUF14O.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{a as dn,p as me,c as tr,ao as Kl,g as Ql}from"./thirdweb-3rz-wQc6.js";import{a as ge,b as sl,e as ol,f as Yl,h as Xl,i as eh,l as th,m as rh,n as nh}from"./ui-BRI7cdA1.js";import{eq as ih,er as sh,es as oh,et as pn,eu as Vs}from"./index-DUps-fXR.js";function ah(e,r){for(var n=0;n<r.length;n++){const t=r[n];if(typeof t!="string"&&!Array.isArray(t)){for(const d in t)if(d!=="default"&&!(d in e)){const i=Object.getOwnPropertyDescriptor(t,d);i&&Object.defineProperty(e,d,i.get?i:{enumerable:!0,get:()=>t[d]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Zr={exports:{}},go;function Xe(){return go||(go=1,typeof Object.create=="function"?Zr.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Zr.exports=function(r,n){if(n){r.super_=n;var t=function(){};t.prototype=n.prototype,r.prototype=new t,r.prototype.constructor=r}}),Zr.exports}var xn={},ar={},cr={},mo;function ch(){if(mo)return cr;mo=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.walletLogo=void 0;const e=(r,n)=>{let t;switch(r){case"standard":return t=n,`data:image/svg+xml,%3Csvg width='${n}' height='${t}' 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 t=n,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${n}' height='${t}' 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 t=(.1*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' 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 t=(.25*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' 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 t=(.1*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' 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 t=(.25*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' height='${t}' 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 t=n,`data:image/svg+xml,%3Csvg width='${n}' height='${t}' 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 `}};return cr.walletLogo=e,cr}var ur={},yo;function uh(){return yo||(yo=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.LINK_API_URL=void 0,ur.LINK_API_URL="https://www.walletlink.org"),ur}var oe={},fn={exports:{}},Tn={},wo;function Wr(){return wo||(wo=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var r={},n={};n.byteLength=g,n.toByteArray=c,n.fromByteArray=_;for(var t=[],d=[],i=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,f=u.length;p<f;++p)t[p]=u[p],d[u.charCodeAt(p)]=p;d[45]=62,d[95]=63;function h(E){var S=E.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=E.indexOf("=");I===-1&&(I=S);var T=I===S?0:4-I%4;return[I,T]}function g(E){var S=h(E),I=S[0],T=S[1];return(I+T)*3/4-T}function s(E,S,I){return(S+I)*3/4-I}function c(E){var S,I=h(E),T=I[0],q=I[1],N=new i(s(E,T,q)),H=0,K=q>0?T-4:T,X;for(X=0;X<K;X+=4)S=d[E.charCodeAt(X)]<<18|d[E.charCodeAt(X+1)]<<12|d[E.charCodeAt(X+2)]<<6|d[E.charCodeAt(X+3)],N[H++]=S>>16&255,N[H++]=S>>8&255,N[H++]=S&255;return q===2&&(S=d[E.charCodeAt(X)]<<2|d[E.charCodeAt(X+1)]>>4,N[H++]=S&255),q===1&&(S=d[E.charCodeAt(X)]<<10|d[E.charCodeAt(X+1)]<<4|d[E.charCodeAt(X+2)]>>2,N[H++]=S>>8&255,N[H++]=S&255),N}function o(E){return t[E>>18&63]+t[E>>12&63]+t[E>>6&63]+t[E&63]}function m(E,S,I){for(var T,q=[],N=S;N<I;N+=3)T=(E[N]<<16&16711680)+(E[N+1]<<8&65280)+(E[N+2]&255),q.push(o(T));return q.join("")}function _(E){for(var S,I=E.length,T=I%3,q=[],N=16383,H=0,K=I-T;H<K;H+=N)q.push(m(E,H,H+N>K?K:H+N));return T===1?(S=E[I-1],q.push(t[S>>2]+t[S<<4&63]+"==")):T===2&&(S=(E[I-2]<<8)+E[I-1],q.push(t[S>>10]+t[S>>4&63]+t[S<<2&63]+"=")),q.join("")}var w={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */w.read=function(E,S,I,T,q){var N,H,K=q*8-T-1,X=(1<<K)-1,re=X>>1,W=-7,D=I?q-1:0,l=I?-1:1,b=E[S+D];for(D+=l,N=b&(1<<-W)-1,b>>=-W,W+=K;W>0;N=N*256+E[S+D],D+=l,W-=8);for(H=N&(1<<-W)-1,N>>=-W,W+=T;W>0;H=H*256+E[S+D],D+=l,W-=8);if(N===0)N=1-re;else{if(N===X)return H?NaN:(b?-1:1)*(1/0);H=H+Math.pow(2,T),N=N-re}return(b?-1:1)*H*Math.pow(2,N-T)},w.write=function(E,S,I,T,q,N){var H,K,X,re=N*8-q-1,W=(1<<re)-1,D=W>>1,l=q===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=T?0:N-1,C=T?1:-1,k=S<0||S===0&&1/S<0?1:0;for(S=Math.abs(S),isNaN(S)||S===1/0?(K=isNaN(S)?1:0,H=W):(H=Math.floor(Math.log(S)/Math.LN2),S*(X=Math.pow(2,-H))<1&&(H--,X*=2),H+D>=1?S+=l/X:S+=l*Math.pow(2,1-D),S*X>=2&&(H++,X/=2),H+D>=W?(K=0,H=W):H+D>=1?(K=(S*X-1)*Math.pow(2,q),H=H+D):(K=S*Math.pow(2,D-1)*Math.pow(2,q),H=0));q>=8;E[I+b]=K&255,b+=C,K/=256,q-=8);for(H=H<<q|K,re+=q;re>0;E[I+b]=H&255,b+=C,H/=256,re-=8);E[I+b-C]|=k*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 S=n,I=w,T=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;E.Buffer=W,E.SlowBuffer=M,E.INSPECT_MAX_BYTES=50;const q=2147483647;E.kMaxLength=q;const{Uint8Array:N,ArrayBuffer:H,SharedArrayBuffer:K}=globalThis;W.TYPED_ARRAY_SUPPORT=X(),!W.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 X(){try{const A=new N(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,N.prototype),Object.setPrototypeOf(A,y),A.foo()===42}catch{return!1}}Object.defineProperty(W.prototype,"parent",{enumerable:!0,get:function(){if(W.isBuffer(this))return this.buffer}}),Object.defineProperty(W.prototype,"offset",{enumerable:!0,get:function(){if(W.isBuffer(this))return this.byteOffset}});function re(A){if(A>q)throw new RangeError('The value "'+A+'" is invalid for option "size"');const y=new N(A);return Object.setPrototypeOf(y,W.prototype),y}function W(A,y,R){if(typeof A=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(A)}return D(A,y,R)}W.poolSize=8192;function D(A,y,R){if(typeof A=="string")return k(A,y);if(H.isView(A))return O(A);if(A==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);if(We(A,H)||A&&We(A.buffer,H)||typeof K<"u"&&(We(A,K)||A&&We(A.buffer,K)))return U(A,y,R);if(typeof A=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const P=A.valueOf&&A.valueOf();if(P!=null&&P!==A)return W.from(P,y,R);const z=L(A);if(z)return z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof A[Symbol.toPrimitive]=="function")return W.from(A[Symbol.toPrimitive]("string"),y,R);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A)}W.from=function(A,y,R){return D(A,y,R)},Object.setPrototypeOf(W.prototype,N.prototype),Object.setPrototypeOf(W,N);function l(A){if(typeof A!="number")throw new TypeError('"size" argument must be of type number');if(A<0)throw new RangeError('The value "'+A+'" is invalid for option "size"')}function b(A,y,R){return l(A),A<=0?re(A):y!==void 0?typeof R=="string"?re(A).fill(y,R):re(A).fill(y):re(A)}W.alloc=function(A,y,R){return b(A,y,R)};function C(A){return l(A),re(A<0?0:v(A)|0)}W.allocUnsafe=function(A){return C(A)},W.allocUnsafeSlow=function(A){return C(A)};function k(A,y){if((typeof y!="string"||y==="")&&(y="utf8"),!W.isEncoding(y))throw new TypeError("Unknown encoding: "+y);const R=G(A,y)|0;let P=re(R);const z=P.write(A,y);return z!==R&&(P=P.slice(0,z)),P}function x(A){const y=A.length<0?0:v(A.length)|0,R=re(y);for(let P=0;P<y;P+=1)R[P]=A[P]&255;return R}function O(A){if(We(A,N)){const y=new N(A);return U(y.buffer,y.byteOffset,y.byteLength)}return x(A)}function U(A,y,R){if(y<0||A.byteLength<y)throw new RangeError('"offset" is outside of buffer bounds');if(A.byteLength<y+(R||0))throw new RangeError('"length" is outside of buffer bounds');let P;return y===void 0&&R===void 0?P=new N(A):R===void 0?P=new N(A,y):P=new N(A,y,R),Object.setPrototypeOf(P,W.prototype),P}function L(A){if(W.isBuffer(A)){const y=v(A.length)|0,R=re(y);return R.length===0||A.copy(R,0,0,y),R}if(A.length!==void 0)return typeof A.length!="number"||xe(A.length)?re(0):x(A);if(A.type==="Buffer"&&Array.isArray(A.data))return x(A.data)}function v(A){if(A>=q)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+q.toString(16)+" bytes");return A|0}function M(A){return+A!=A&&(A=0),W.alloc(+A)}W.isBuffer=function(y){return y!=null&&y._isBuffer===!0&&y!==W.prototype},W.compare=function(y,R){if(We(y,N)&&(y=W.from(y,y.offset,y.byteLength)),We(R,N)&&(R=W.from(R,R.offset,R.byteLength)),!W.isBuffer(y)||!W.isBuffer(R))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(y===R)return 0;let P=y.length,z=R.length;for(let $=0,Q=Math.min(P,z);$<Q;++$)if(y[$]!==R[$]){P=y[$],z=R[$];break}return P<z?-1:z<P?1:0},W.isEncoding=function(y){switch(String(y).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}},W.concat=function(y,R){if(!Array.isArray(y))throw new TypeError('"list" argument must be an Array of Buffers');if(y.length===0)return W.alloc(0);let P;if(R===void 0)for(R=0,P=0;P<y.length;++P)R+=y[P].length;const z=W.allocUnsafe(R);let $=0;for(P=0;P<y.length;++P){let Q=y[P];if(We(Q,N))$+Q.length>z.length?(W.isBuffer(Q)||(Q=W.from(Q)),Q.copy(z,$)):N.prototype.set.call(z,Q,$);else if(W.isBuffer(Q))Q.copy(z,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=Q.length}return z};function G(A,y){if(W.isBuffer(A))return A.length;if(H.isView(A)||We(A,H))return A.byteLength;if(typeof A!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof A);const R=A.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&R===0)return 0;let z=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return R;case"utf8":case"utf-8":return Ae(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R*2;case"hex":return R>>>1;case"base64":return Be(A).length;default:if(z)return P?-1:Ae(A).length;y=(""+y).toLowerCase(),z=!0}}W.byteLength=G;function J(A,y,R){let P=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((R===void 0||R>this.length)&&(R=this.length),R<=0)||(R>>>=0,y>>>=0,R<=y))return"";for(A||(A="utf8");;)switch(A){case"hex":return ve(this,y,R);case"utf8":case"utf-8":return se(this,y,R);case"ascii":return ye(this,y,R);case"latin1":case"binary":return ee(this,y,R);case"base64":return ne(this,y,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,y,R);default:if(P)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),P=!0}}W.prototype._isBuffer=!0;function j(A,y,R){const P=A[y];A[y]=A[R],A[R]=P}W.prototype.swap16=function(){const y=this.length;if(y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let R=0;R<y;R+=2)j(this,R,R+1);return this},W.prototype.swap32=function(){const y=this.length;if(y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let R=0;R<y;R+=4)j(this,R,R+3),j(this,R+1,R+2);return this},W.prototype.swap64=function(){const y=this.length;if(y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let R=0;R<y;R+=8)j(this,R,R+7),j(this,R+1,R+6),j(this,R+2,R+5),j(this,R+3,R+4);return this},W.prototype.toString=function(){const y=this.length;return y===0?"":arguments.length===0?se(this,0,y):J.apply(this,arguments)},W.prototype.toLocaleString=W.prototype.toString,W.prototype.equals=function(y){if(!W.isBuffer(y))throw new TypeError("Argument must be a Buffer");return this===y?!0:W.compare(this,y)===0},W.prototype.inspect=function(){let y="";const R=E.INSPECT_MAX_BYTES;return y=this.toString("hex",0,R).replace(/(.{2})/g,"$1 ").trim(),this.length>R&&(y+=" ... "),"<Buffer "+y+">"},T&&(W.prototype[T]=W.prototype.inspect),W.prototype.compare=function(y,R,P,z,$){if(We(y,N)&&(y=W.from(y,y.offset,y.byteLength)),!W.isBuffer(y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof y);if(R===void 0&&(R=0),P===void 0&&(P=y?y.length:0),z===void 0&&(z=0),$===void 0&&($=this.length),R<0||P>y.length||z<0||$>this.length)throw new RangeError("out of range index");if(z>=$&&R>=P)return 0;if(z>=$)return-1;if(R>=P)return 1;if(R>>>=0,P>>>=0,z>>>=0,$>>>=0,this===y)return 0;let Q=$-z,de=P-R;const he=Math.min(Q,de),le=this.slice(z,$),ke=y.slice(R,P);for(let ue=0;ue<he;++ue)if(le[ue]!==ke[ue]){Q=le[ue],de=ke[ue];break}return Q<de?-1:de<Q?1:0};function V(A,y,R,P,z){if(A.length===0)return-1;if(typeof R=="string"?(P=R,R=0):R>2147483647?R=2147483647:R<-2147483648&&(R=-2147483648),R=+R,xe(R)&&(R=z?0:A.length-1),R<0&&(R=A.length+R),R>=A.length){if(z)return-1;R=A.length-1}else if(R<0)if(z)R=0;else return-1;if(typeof y=="string"&&(y=W.from(y,P)),W.isBuffer(y))return y.length===0?-1:Z(A,y,R,P,z);if(typeof y=="number")return y=y&255,typeof N.prototype.indexOf=="function"?z?N.prototype.indexOf.call(A,y,R):N.prototype.lastIndexOf.call(A,y,R):Z(A,[y],R,P,z);throw new TypeError("val must be string, number or Buffer")}function Z(A,y,R,P,z){let $=1,Q=A.length,de=y.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(A.length<2||y.length<2)return-1;$=2,Q/=2,de/=2,R/=2}function he(ke,ue){return $===1?ke[ue]:ke.readUInt16BE(ue*$)}let le;if(z){let ke=-1;for(le=R;le<Q;le++)if(he(A,le)===he(y,ke===-1?0:le-ke)){if(ke===-1&&(ke=le),le-ke+1===de)return ke*$}else ke!==-1&&(le-=le-ke),ke=-1}else for(R+de>Q&&(R=Q-de),le=R;le>=0;le--){let ke=!0;for(let ue=0;ue<de;ue++)if(he(A,le+ue)!==he(y,ue)){ke=!1;break}if(ke)return le}return-1}W.prototype.includes=function(y,R,P){return this.indexOf(y,R,P)!==-1},W.prototype.indexOf=function(y,R,P){return V(this,y,R,P,!0)},W.prototype.lastIndexOf=function(y,R,P){return V(this,y,R,P,!1)};function Y(A,y,R,P){R=Number(R)||0;const z=A.length-R;P?(P=Number(P),P>z&&(P=z)):P=z;const $=y.length;P>$/2&&(P=$/2);let Q;for(Q=0;Q<P;++Q){const de=parseInt(y.substr(Q*2,2),16);if(xe(de))return Q;A[R+Q]=de}return Q}function ie(A,y,R,P){return Me(Ae(y,A.length-R),A,R,P)}function B(A,y,R,P){return Me(Oe(y),A,R,P)}function F(A,y,R,P){return Me(Be(y),A,R,P)}function te(A,y,R,P){return Me(dt(y,A.length-R),A,R,P)}W.prototype.write=function(y,R,P,z){if(R===void 0)z="utf8",P=this.length,R=0;else if(P===void 0&&typeof R=="string")z=R,P=this.length,R=0;else if(isFinite(R))R=R>>>0,isFinite(P)?(P=P>>>0,z===void 0&&(z="utf8")):(z=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $=this.length-R;if((P===void 0||P>$)&&(P=$),y.length>0&&(P<0||R<0)||R>this.length)throw new RangeError("Attempt to write outside buffer bounds");z||(z="utf8");let Q=!1;for(;;)switch(z){case"hex":return Y(this,y,R,P);case"utf8":case"utf-8":return ie(this,y,R,P);case"ascii":case"latin1":case"binary":return B(this,y,R,P);case"base64":return F(this,y,R,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,y,R,P);default:if(Q)throw new TypeError("Unknown encoding: "+z);z=(""+z).toLowerCase(),Q=!0}},W.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(A,y,R){return y===0&&R===A.length?S.fromByteArray(A):S.fromByteArray(A.slice(y,R))}function se(A,y,R){R=Math.min(A.length,R);const P=[];let z=y;for(;z<R;){const $=A[z];let Q=null,de=$>239?4:$>223?3:$>191?2:1;if(z+de<=R){let he,le,ke,ue;switch(de){case 1:$<128&&(Q=$);break;case 2:he=A[z+1],(he&192)===128&&(ue=($&31)<<6|he&63,ue>127&&(Q=ue));break;case 3:he=A[z+1],le=A[z+2],(he&192)===128&&(le&192)===128&&(ue=($&15)<<12|(he&63)<<6|le&63,ue>2047&&(ue<55296||ue>57343)&&(Q=ue));break;case 4:he=A[z+1],le=A[z+2],ke=A[z+3],(he&192)===128&&(le&192)===128&&(ke&192)===128&&(ue=($&15)<<18|(he&63)<<12|(le&63)<<6|ke&63,ue>65535&&ue<1114112&&(Q=ue))}}Q===null?(Q=65533,de=1):Q>65535&&(Q-=65536,P.push(Q>>>10&1023|55296),Q=56320|Q&1023),P.push(Q),z+=de}return ae(P)}const ce=4096;function ae(A){const y=A.length;if(y<=ce)return String.fromCharCode.apply(String,A);let R="",P=0;for(;P<y;)R+=String.fromCharCode.apply(String,A.slice(P,P+=ce));return R}function ye(A,y,R){let P="";R=Math.min(A.length,R);for(let z=y;z<R;++z)P+=String.fromCharCode(A[z]&127);return P}function ee(A,y,R){let P="";R=Math.min(A.length,R);for(let z=y;z<R;++z)P+=String.fromCharCode(A[z]);return P}function ve(A,y,R){const P=A.length;(!y||y<0)&&(y=0),(!R||R<0||R>P)&&(R=P);let z="";for(let $=y;$<R;++$)z+=Pe[A[$]];return z}function pe(A,y,R){const P=A.slice(y,R);let z="";for(let $=0;$<P.length-1;$+=2)z+=String.fromCharCode(P[$]+P[$+1]*256);return z}W.prototype.slice=function(y,R){const P=this.length;y=~~y,R=R===void 0?P:~~R,y<0?(y+=P,y<0&&(y=0)):y>P&&(y=P),R<0?(R+=P,R<0&&(R=0)):R>P&&(R=P),R<y&&(R=y);const z=this.subarray(y,R);return Object.setPrototypeOf(z,W.prototype),z};function we(A,y,R){if(A%1!==0||A<0)throw new RangeError("offset is not uint");if(A+y>R)throw new RangeError("Trying to access beyond buffer length")}W.prototype.readUintLE=W.prototype.readUIntLE=function(y,R,P){y=y>>>0,R=R>>>0,P||we(y,R,this.length);let z=this[y],$=1,Q=0;for(;++Q<R&&($*=256);)z+=this[y+Q]*$;return z},W.prototype.readUintBE=W.prototype.readUIntBE=function(y,R,P){y=y>>>0,R=R>>>0,P||we(y,R,this.length);let z=this[y+--R],$=1;for(;R>0&&($*=256);)z+=this[y+--R]*$;return z},W.prototype.readUint8=W.prototype.readUInt8=function(y,R){return y=y>>>0,R||we(y,1,this.length),this[y]},W.prototype.readUint16LE=W.prototype.readUInt16LE=function(y,R){return y=y>>>0,R||we(y,2,this.length),this[y]|this[y+1]<<8},W.prototype.readUint16BE=W.prototype.readUInt16BE=function(y,R){return y=y>>>0,R||we(y,2,this.length),this[y]<<8|this[y+1]},W.prototype.readUint32LE=W.prototype.readUInt32LE=function(y,R){return y=y>>>0,R||we(y,4,this.length),(this[y]|this[y+1]<<8|this[y+2]<<16)+this[y+3]*16777216},W.prototype.readUint32BE=W.prototype.readUInt32BE=function(y,R){return y=y>>>0,R||we(y,4,this.length),this[y]*16777216+(this[y+1]<<16|this[y+2]<<8|this[y+3])},W.prototype.readBigUInt64LE=Ge(function(y){y=y>>>0,Ke(y,"offset");const R=this[y],P=this[y+7];(R===void 0||P===void 0)&&Ce(y,this.length-8);const z=R+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24,$=this[++y]+this[++y]*2**8+this[++y]*2**16+P*2**24;return BigInt(z)+(BigInt($)<<BigInt(32))}),W.prototype.readBigUInt64BE=Ge(function(y){y=y>>>0,Ke(y,"offset");const R=this[y],P=this[y+7];(R===void 0||P===void 0)&&Ce(y,this.length-8);const z=R*2**24+this[++y]*2**16+this[++y]*2**8+this[++y],$=this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+P;return(BigInt(z)<<BigInt(32))+BigInt($)}),W.prototype.readIntLE=function(y,R,P){y=y>>>0,R=R>>>0,P||we(y,R,this.length);let z=this[y],$=1,Q=0;for(;++Q<R&&($*=256);)z+=this[y+Q]*$;return $*=128,z>=$&&(z-=Math.pow(2,8*R)),z},W.prototype.readIntBE=function(y,R,P){y=y>>>0,R=R>>>0,P||we(y,R,this.length);let z=R,$=1,Q=this[y+--z];for(;z>0&&($*=256);)Q+=this[y+--z]*$;return $*=128,Q>=$&&(Q-=Math.pow(2,8*R)),Q},W.prototype.readInt8=function(y,R){return y=y>>>0,R||we(y,1,this.length),this[y]&128?(255-this[y]+1)*-1:this[y]},W.prototype.readInt16LE=function(y,R){y=y>>>0,R||we(y,2,this.length);const P=this[y]|this[y+1]<<8;return P&32768?P|4294901760:P},W.prototype.readInt16BE=function(y,R){y=y>>>0,R||we(y,2,this.length);const P=this[y+1]|this[y]<<8;return P&32768?P|4294901760:P},W.prototype.readInt32LE=function(y,R){return y=y>>>0,R||we(y,4,this.length),this[y]|this[y+1]<<8|this[y+2]<<16|this[y+3]<<24},W.prototype.readInt32BE=function(y,R){return y=y>>>0,R||we(y,4,this.length),this[y]<<24|this[y+1]<<16|this[y+2]<<8|this[y+3]},W.prototype.readBigInt64LE=Ge(function(y){y=y>>>0,Ke(y,"offset");const R=this[y],P=this[y+7];(R===void 0||P===void 0)&&Ce(y,this.length-8);const z=this[y+4]+this[y+5]*2**8+this[y+6]*2**16+(P<<24);return(BigInt(z)<<BigInt(32))+BigInt(R+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24)}),W.prototype.readBigInt64BE=Ge(function(y){y=y>>>0,Ke(y,"offset");const R=this[y],P=this[y+7];(R===void 0||P===void 0)&&Ce(y,this.length-8);const z=(R<<24)+this[++y]*2**16+this[++y]*2**8+this[++y];return(BigInt(z)<<BigInt(32))+BigInt(this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+P)}),W.prototype.readFloatLE=function(y,R){return y=y>>>0,R||we(y,4,this.length),I.read(this,y,!0,23,4)},W.prototype.readFloatBE=function(y,R){return y=y>>>0,R||we(y,4,this.length),I.read(this,y,!1,23,4)},W.prototype.readDoubleLE=function(y,R){return y=y>>>0,R||we(y,8,this.length),I.read(this,y,!0,52,8)},W.prototype.readDoubleBE=function(y,R){return y=y>>>0,R||we(y,8,this.length),I.read(this,y,!1,52,8)};function fe(A,y,R,P,z,$){if(!W.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>z||y<$)throw new RangeError('"value" argument is out of bounds');if(R+P>A.length)throw new RangeError("Index out of range")}W.prototype.writeUintLE=W.prototype.writeUIntLE=function(y,R,P,z){if(y=+y,R=R>>>0,P=P>>>0,!z){const de=Math.pow(2,8*P)-1;fe(this,y,R,P,de,0)}let $=1,Q=0;for(this[R]=y&255;++Q<P&&($*=256);)this[R+Q]=y/$&255;return R+P},W.prototype.writeUintBE=W.prototype.writeUIntBE=function(y,R,P,z){if(y=+y,R=R>>>0,P=P>>>0,!z){const de=Math.pow(2,8*P)-1;fe(this,y,R,P,de,0)}let $=P-1,Q=1;for(this[R+$]=y&255;--$>=0&&(Q*=256);)this[R+$]=y/Q&255;return R+P},W.prototype.writeUint8=W.prototype.writeUInt8=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,1,255,0),this[R]=y&255,R+1},W.prototype.writeUint16LE=W.prototype.writeUInt16LE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,2,65535,0),this[R]=y&255,this[R+1]=y>>>8,R+2},W.prototype.writeUint16BE=W.prototype.writeUInt16BE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,2,65535,0),this[R]=y>>>8,this[R+1]=y&255,R+2},W.prototype.writeUint32LE=W.prototype.writeUInt32LE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,4,4294967295,0),this[R+3]=y>>>24,this[R+2]=y>>>16,this[R+1]=y>>>8,this[R]=y&255,R+4},W.prototype.writeUint32BE=W.prototype.writeUInt32BE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,4,4294967295,0),this[R]=y>>>24,this[R+1]=y>>>16,this[R+2]=y>>>8,this[R+3]=y&255,R+4};function Ee(A,y,R,P,z){Te(y,P,z,A,R,7);let $=Number(y&BigInt(4294967295));A[R++]=$,$=$>>8,A[R++]=$,$=$>>8,A[R++]=$,$=$>>8,A[R++]=$;let Q=Number(y>>BigInt(32)&BigInt(4294967295));return A[R++]=Q,Q=Q>>8,A[R++]=Q,Q=Q>>8,A[R++]=Q,Q=Q>>8,A[R++]=Q,R}function Qe(A,y,R,P,z){Te(y,P,z,A,R,7);let $=Number(y&BigInt(4294967295));A[R+7]=$,$=$>>8,A[R+6]=$,$=$>>8,A[R+5]=$,$=$>>8,A[R+4]=$;let Q=Number(y>>BigInt(32)&BigInt(4294967295));return A[R+3]=Q,Q=Q>>8,A[R+2]=Q,Q=Q>>8,A[R+1]=Q,Q=Q>>8,A[R]=Q,R+8}W.prototype.writeBigUInt64LE=Ge(function(y,R=0){return Ee(this,y,R,BigInt(0),BigInt("0xffffffffffffffff"))}),W.prototype.writeBigUInt64BE=Ge(function(y,R=0){return Qe(this,y,R,BigInt(0),BigInt("0xffffffffffffffff"))}),W.prototype.writeIntLE=function(y,R,P,z){if(y=+y,R=R>>>0,!z){const he=Math.pow(2,8*P-1);fe(this,y,R,P,he-1,-he)}let $=0,Q=1,de=0;for(this[R]=y&255;++$<P&&(Q*=256);)y<0&&de===0&&this[R+$-1]!==0&&(de=1),this[R+$]=(y/Q>>0)-de&255;return R+P},W.prototype.writeIntBE=function(y,R,P,z){if(y=+y,R=R>>>0,!z){const he=Math.pow(2,8*P-1);fe(this,y,R,P,he-1,-he)}let $=P-1,Q=1,de=0;for(this[R+$]=y&255;--$>=0&&(Q*=256);)y<0&&de===0&&this[R+$+1]!==0&&(de=1),this[R+$]=(y/Q>>0)-de&255;return R+P},W.prototype.writeInt8=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,1,127,-128),y<0&&(y=255+y+1),this[R]=y&255,R+1},W.prototype.writeInt16LE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,2,32767,-32768),this[R]=y&255,this[R+1]=y>>>8,R+2},W.prototype.writeInt16BE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,2,32767,-32768),this[R]=y>>>8,this[R+1]=y&255,R+2},W.prototype.writeInt32LE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,4,2147483647,-2147483648),this[R]=y&255,this[R+1]=y>>>8,this[R+2]=y>>>16,this[R+3]=y>>>24,R+4},W.prototype.writeInt32BE=function(y,R,P){return y=+y,R=R>>>0,P||fe(this,y,R,4,2147483647,-2147483648),y<0&&(y=4294967295+y+1),this[R]=y>>>24,this[R+1]=y>>>16,this[R+2]=y>>>8,this[R+3]=y&255,R+4},W.prototype.writeBigInt64LE=Ge(function(y,R=0){return Ee(this,y,R,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),W.prototype.writeBigInt64BE=Ge(function(y,R=0){return Qe(this,y,R,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Se(A,y,R,P,z,$){if(R+P>A.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("Index out of range")}function be(A,y,R,P,z){return y=+y,R=R>>>0,z||Se(A,y,R,4),I.write(A,y,R,P,23,4),R+4}W.prototype.writeFloatLE=function(y,R,P){return be(this,y,R,!0,P)},W.prototype.writeFloatBE=function(y,R,P){return be(this,y,R,!1,P)};function ze(A,y,R,P,z){return y=+y,R=R>>>0,z||Se(A,y,R,8),I.write(A,y,R,P,52,8),R+8}W.prototype.writeDoubleLE=function(y,R,P){return ze(this,y,R,!0,P)},W.prototype.writeDoubleBE=function(y,R,P){return ze(this,y,R,!1,P)},W.prototype.copy=function(y,R,P,z){if(!W.isBuffer(y))throw new TypeError("argument should be a Buffer");if(P||(P=0),!z&&z!==0&&(z=this.length),R>=y.length&&(R=y.length),R||(R=0),z>0&&z<P&&(z=P),z===P||y.length===0||this.length===0)return 0;if(R<0)throw new RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("sourceEnd out of bounds");z>this.length&&(z=this.length),y.length-R<z-P&&(z=y.length-R+P);const $=z-P;return this===y&&typeof N.prototype.copyWithin=="function"?this.copyWithin(R,P,z):N.prototype.set.call(y,this.subarray(P,z),R),$},W.prototype.fill=function(y,R,P,z){if(typeof y=="string"){if(typeof R=="string"?(z=R,R=0,P=this.length):typeof P=="string"&&(z=P,P=this.length),z!==void 0&&typeof z!="string")throw new TypeError("encoding must be a string");if(typeof z=="string"&&!W.isEncoding(z))throw new TypeError("Unknown encoding: "+z);if(y.length===1){const Q=y.charCodeAt(0);(z==="utf8"&&Q<128||z==="latin1")&&(y=Q)}}else typeof y=="number"?y=y&255:typeof y=="boolean"&&(y=Number(y));if(R<0||this.length<R||this.length<P)throw new RangeError("Out of range index");if(P<=R)return this;R=R>>>0,P=P===void 0?this.length:P>>>0,y||(y=0);let $;if(typeof y=="number")for($=R;$<P;++$)this[$]=y;else{const Q=W.isBuffer(y)?y:W.from(y,z),de=Q.length;if(de===0)throw new TypeError('The value "'+y+'" is invalid for argument "value"');for($=0;$<P-R;++$)this[$+R]=Q[$%de]}return this};const Re={};function Ie(A,y,R){Re[A]=class extends R{constructor(){super(),Object.defineProperty(this,"message",{value:y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${A}]`,this.stack,delete this.name}get code(){return A}set code(z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:z,writable:!0})}toString(){return`${this.name} [${A}]: ${this.message}`}}}Ie("ERR_BUFFER_OUT_OF_BOUNDS",function(A){return A?`${A} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ie("ERR_INVALID_ARG_TYPE",function(A,y){return`The "${A}" argument must be of type number. Received type ${typeof y}`},TypeError),Ie("ERR_OUT_OF_RANGE",function(A,y,R){let P=`The value of "${A}" is out of range.`,z=R;return Number.isInteger(R)&&Math.abs(R)>2**32?z=at(String(R)):typeof R=="bigint"&&(z=String(R),(R>BigInt(2)**BigInt(32)||R<-(BigInt(2)**BigInt(32)))&&(z=at(z)),z+="n"),P+=` It must be ${y}. Received ${z}`,P},RangeError);function at(A){let y="",R=A.length;const P=A[0]==="-"?1:0;for(;R>=P+4;R-=3)y=`_${A.slice(R-3,R)}${y}`;return`${A.slice(0,R)}${y}`}function Le(A,y,R){Ke(y,"offset"),(A[y]===void 0||A[y+R]===void 0)&&Ce(y,A.length-(R+1))}function Te(A,y,R,P,z,$){if(A>R||A<y){const Q=typeof y=="bigint"?"n":"";let de;throw y===0||y===BigInt(0)?de=`>= 0${Q} and < 2${Q} ** ${($+1)*8}${Q}`:de=`>= -(2${Q} ** ${($+1)*8-1}${Q}) and < 2 ** ${($+1)*8-1}${Q}`,new Re.ERR_OUT_OF_RANGE("value",de,A)}Le(P,z,$)}function Ke(A,y){if(typeof A!="number")throw new Re.ERR_INVALID_ARG_TYPE(y,"number",A)}function Ce(A,y,R){throw Math.floor(A)!==A?(Ke(A,R),new Re.ERR_OUT_OF_RANGE("offset","an integer",A)):y<0?new Re.ERR_BUFFER_OUT_OF_BOUNDS:new Re.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,A)}const Ne=/[^+/0-9A-Za-z-_]/g;function ft(A){if(A=A.split("=")[0],A=A.trim().replace(Ne,""),A.length<2)return"";for(;A.length%4!==0;)A=A+"=";return A}function Ae(A,y){y=y||1/0;let R;const P=A.length;let z=null;const $=[];for(let Q=0;Q<P;++Q){if(R=A.charCodeAt(Q),R>55295&&R<57344){if(!z){if(R>56319){(y-=3)>-1&&$.push(239,191,189);continue}else if(Q+1===P){(y-=3)>-1&&$.push(239,191,189);continue}z=R;continue}if(R<56320){(y-=3)>-1&&$.push(239,191,189),z=R;continue}R=(z-55296<<10|R-56320)+65536}else z&&(y-=3)>-1&&$.push(239,191,189);if(z=null,R<128){if((y-=1)<0)break;$.push(R)}else if(R<2048){if((y-=2)<0)break;$.push(R>>6|192,R&63|128)}else if(R<65536){if((y-=3)<0)break;$.push(R>>12|224,R>>6&63|128,R&63|128)}else if(R<1114112){if((y-=4)<0)break;$.push(R>>18|240,R>>12&63|128,R>>6&63|128,R&63|128)}else throw new Error("Invalid code point")}return $}function Oe(A){const y=[];for(let R=0;R<A.length;++R)y.push(A.charCodeAt(R)&255);return y}function dt(A,y){let R,P,z;const $=[];for(let Q=0;Q<A.length&&!((y-=2)<0);++Q)R=A.charCodeAt(Q),P=R>>8,z=R%256,$.push(z),$.push(P);return $}function Be(A){return S.toByteArray(ft(A))}function Me(A,y,R,P){let z;for(z=0;z<P&&!(z+R>=y.length||z>=A.length);++z)y[z+R]=A[z];return z}function We(A,y){return A instanceof y||A!=null&&A.constructor!=null&&A.constructor.name!=null&&A.constructor.name===y.name}function xe(A){return A!==A}const Pe=function(){const A="0123456789abcdef",y=new Array(256);for(let R=0;R<16;++R){const P=R*16;for(let z=0;z<16;++z)y[P+z]=A[R]+A[z]}return y}();function Ge(A){return typeof BigInt>"u"?Fe:A}function Fe(){throw new Error("BigInt not supported")}})(r);const a=r.Buffer;e.Blob=r.Blob,e.BlobOptions=r.BlobOptions,e.Buffer=r.Buffer,e.File=r.File,e.FileOptions=r.FileOptions,e.INSPECT_MAX_BYTES=r.INSPECT_MAX_BYTES,e.SlowBuffer=r.SlowBuffer,e.TranscodeEncoding=r.TranscodeEncoding,e.atob=r.atob,e.btoa=r.btoa,e.constants=r.constants,e.default=a,e.isAscii=r.isAscii,e.isUtf8=r.isUtf8,e.kMaxLength=r.kMaxLength,e.kStringMaxLength=r.kStringMaxLength,e.resolveObjectURL=r.resolveObjectURL,e.transcode=r.transcode}(Tn)),Tn}var lh=fn.exports,vo;function gn(){return vo||(vo=1,function(e){(function(r,n){function t(D,l){if(!D)throw new Error(l||"Assertion failed")}function d(D,l){D.super_=l;var b=function(){};b.prototype=l.prototype,D.prototype=new b,D.prototype.constructor=D}function i(D,l,b){if(i.isBN(D))return D;this.negative=0,this.words=null,this.length=0,this.red=null,D!==null&&((l==="le"||l==="be")&&(b=l,l=10),this._init(D||0,l||10,b||"be"))}typeof r=="object"?r.exports=i:n.BN=i,i.BN=i,i.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=Wr().Buffer}catch{}i.isBN=function(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},i.max=function(l,b){return l.cmp(b)>0?l:b},i.min=function(l,b){return l.cmp(b)<0?l:b},i.prototype._init=function(l,b,C){if(typeof l=="number")return this._initNumber(l,b,C);if(typeof l=="object")return this._initArray(l,b,C);b==="hex"&&(b=16),t(b===(b|0)&&b>=2&&b<=36),l=l.toString().replace(/\s+/g,"");var k=0;l[0]==="-"&&(k++,this.negative=1),k<l.length&&(b===16?this._parseHex(l,k,C):(this._parseBase(l,b,k),C==="le"&&this._initArray(this.toArray(),b,C)))},i.prototype._initNumber=function(l,b,C){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),C==="le"&&this._initArray(this.toArray(),b,C)},i.prototype._initArray=function(l,b,C){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var k=0;k<this.length;k++)this.words[k]=0;var x,O,U=0;if(C==="be")for(k=l.length-1,x=0;k>=0;k-=3)O=l[k]|l[k-1]<<8|l[k-2]<<16,this.words[x]|=O<<U&67108863,this.words[x+1]=O>>>26-U&67108863,U+=24,U>=26&&(U-=26,x++);else if(C==="le")for(k=0,x=0;k<l.length;k+=3)O=l[k]|l[k+1]<<8|l[k+2]<<16,this.words[x]|=O<<U&67108863,this.words[x+1]=O>>>26-U&67108863,U+=24,U>=26&&(U-=26,x++);return this._strip()};function p(D,l){var b=D.charCodeAt(l);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;t(!1,"Invalid character in "+D)}function f(D,l,b){var C=p(D,b);return b-1>=l&&(C|=p(D,b-1)<<4),C}i.prototype._parseHex=function(l,b,C){this.length=Math.ceil((l.length-b)/6),this.words=new Array(this.length);for(var k=0;k<this.length;k++)this.words[k]=0;var x=0,O=0,U;if(C==="be")for(k=l.length-1;k>=b;k-=2)U=f(l,b,k)<<x,this.words[O]|=U&67108863,x>=18?(x-=18,O+=1,this.words[O]|=U>>>26):x+=8;else{var L=l.length-b;for(k=L%2===0?b+1:b;k<l.length;k+=2)U=f(l,b,k)<<x,this.words[O]|=U&67108863,x>=18?(x-=18,O+=1,this.words[O]|=U>>>26):x+=8}this._strip()};function h(D,l,b,C){for(var k=0,x=0,O=Math.min(D.length,b),U=l;U<O;U++){var L=D.charCodeAt(U)-48;k*=C,L>=49?x=L-49+10:L>=17?x=L-17+10:x=L,t(L>=0&&x<C,"Invalid character"),k+=x}return k}i.prototype._parseBase=function(l,b,C){this.words=[0],this.length=1;for(var k=0,x=1;x<=67108863;x*=b)k++;k--,x=x/b|0;for(var O=l.length-C,U=O%k,L=Math.min(O,O-U)+C,v=0,M=C;M<L;M+=k)v=h(l,M,M+k,b),this.imuln(x),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(U!==0){var G=1;for(v=h(l,M,l.length,b),M=0;M<U;M++)G*=b;this.imuln(G),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},i.prototype.copy=function(l){l.words=new Array(this.length);for(var b=0;b<this.length;b++)l.words[b]=this.words[b];l.length=this.length,l.negative=this.negative,l.red=this.red};function g(D,l){D.words=l.words,D.length=l.length,D.negative=l.negative,D.red=l.red}if(i.prototype._move=function(l){g(l,this)},i.prototype.clone=function(){var l=new i(null);return this.copy(l),l},i.prototype._expand=function(l){for(;this.length<l;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch{i.prototype.inspect=s}else i.prototype.inspect=s;function s(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c=["","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"],o=[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],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(l,b){l=l||10,b=b|0||1;var C;if(l===16||l==="hex"){C="";for(var k=0,x=0,O=0;O<this.length;O++){var U=this.words[O],L=((U<<k|x)&16777215).toString(16);x=U>>>24-k&16777215,k+=2,k>=26&&(k-=26,O--),x!==0||O!==this.length-1?C=c[6-L.length]+L+C:C=L+C}for(x!==0&&(C=x.toString(16)+C);C.length%b!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}if(l===(l|0)&&l>=2&&l<=36){var v=o[l],M=m[l];C="";var G=this.clone();for(G.negative=0;!G.isZero();){var J=G.modrn(M).toString(l);G=G.idivn(M),G.isZero()?C=J+C:C=c[v-J.length]+J+C}for(this.isZero()&&(C="0"+C);C.length%b!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16,2)},u&&(i.prototype.toBuffer=function(l,b){return this.toArrayLike(u,l,b)}),i.prototype.toArray=function(l,b){return this.toArrayLike(Array,l,b)};var _=function(l,b){return l.allocUnsafe?l.allocUnsafe(b):new l(b)};i.prototype.toArrayLike=function(l,b,C){this._strip();var k=this.byteLength(),x=C||Math.max(1,k);t(k<=x,"byte array longer than desired length"),t(x>0,"Requested array length <= 0");var O=_(l,x),U=b==="le"?"LE":"BE";return this["_toArrayLike"+U](O,k),O},i.prototype._toArrayLikeLE=function(l,b){for(var C=0,k=0,x=0,O=0;x<this.length;x++){var U=this.words[x]<<O|k;l[C++]=U&255,C<l.length&&(l[C++]=U>>8&255),C<l.length&&(l[C++]=U>>16&255),O===6?(C<l.length&&(l[C++]=U>>24&255),k=0,O=0):(k=U>>>24,O+=2)}if(C<l.length)for(l[C++]=k;C<l.length;)l[C++]=0},i.prototype._toArrayLikeBE=function(l,b){for(var C=l.length-1,k=0,x=0,O=0;x<this.length;x++){var U=this.words[x]<<O|k;l[C--]=U&255,C>=0&&(l[C--]=U>>8&255),C>=0&&(l[C--]=U>>16&255),O===6?(C>=0&&(l[C--]=U>>24&255),k=0,O=0):(k=U>>>24,O+=2)}if(C>=0)for(l[C--]=k;C>=0;)l[C--]=0},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var b=l,C=0;return b>=4096&&(C+=13,b>>>=13),b>=64&&(C+=7,b>>>=7),b>=8&&(C+=4,b>>>=4),b>=2&&(C+=2,b>>>=2),C+b},i.prototype._zeroBits=function(l){if(l===0)return 26;var b=l,C=0;return b&8191||(C+=13,b>>>=13),b&127||(C+=7,b>>>=7),b&15||(C+=4,b>>>=4),b&3||(C+=2,b>>>=2),b&1||C++,C},i.prototype.bitLength=function(){var l=this.words[this.length-1],b=this._countBits(l);return(this.length-1)*26+b};function w(D){for(var l=new Array(D.bitLength()),b=0;b<l.length;b++){var C=b/26|0,k=b%26;l[b]=D.words[C]>>>k&1}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,b=0;b<this.length;b++){var C=this._zeroBits(this.words[b]);if(l+=C,C!==26)break}return l},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},i.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var b=0;b<l.length;b++)this.words[b]=this.words[b]|l.words[b];return this._strip()},i.prototype.ior=function(l){return t((this.negative|l.negative)===0),this.iuor(l)},i.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var b;this.length>l.length?b=l:b=this;for(var C=0;C<b.length;C++)this.words[C]=this.words[C]&l.words[C];return this.length=b.length,this._strip()},i.prototype.iand=function(l){return t((this.negative|l.negative)===0),this.iuand(l)},i.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var b,C;this.length>l.length?(b=this,C=l):(b=l,C=this);for(var k=0;k<C.length;k++)this.words[k]=b.words[k]^C.words[k];if(this!==b)for(;k<b.length;k++)this.words[k]=b.words[k];return this.length=b.length,this._strip()},i.prototype.ixor=function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},i.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){t(typeof l=="number"&&l>=0);var b=Math.ceil(l/26)|0,C=l%26;this._expand(b),C>0&&b--;for(var k=0;k<b;k++)this.words[k]=~this.words[k]&67108863;return C>0&&(this.words[k]=~this.words[k]&67108863>>26-C),this._strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,b){t(typeof l=="number"&&l>=0);var C=l/26|0,k=l%26;return this._expand(C+1),b?this.words[C]=this.words[C]|1<<k:this.words[C]=this.words[C]&~(1<<k),this._strip()},i.prototype.iadd=function(l){var b;if(this.negative!==0&&l.negative===0)return this.negative=0,b=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,b=this.isub(l),l.negative=1,b._normSign();var C,k;this.length>l.length?(C=this,k=l):(C=l,k=this);for(var x=0,O=0;O<k.length;O++)b=(C.words[O]|0)+(k.words[O]|0)+x,this.words[O]=b&67108863,x=b>>>26;for(;x!==0&&O<C.length;O++)b=(C.words[O]|0)+x,this.words[O]=b&67108863,x=b>>>26;if(this.length=C.length,x!==0)this.words[this.length]=x,this.length++;else if(C!==this)for(;O<C.length;O++)this.words[O]=C.words[O];return this},i.prototype.add=function(l){var b;return l.negative!==0&&this.negative===0?(l.negative=0,b=this.sub(l),l.negative^=1,b):l.negative===0&&this.negative!==0?(this.negative=0,b=l.sub(this),this.negative=1,b):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var b=this.iadd(l);return l.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var C=this.cmp(l);if(C===0)return this.negative=0,this.length=1,this.words[0]=0,this;var k,x;C>0?(k=this,x=l):(k=l,x=this);for(var O=0,U=0;U<x.length;U++)b=(k.words[U]|0)-(x.words[U]|0)+O,O=b>>26,this.words[U]=b&67108863;for(;O!==0&&U<k.length;U++)b=(k.words[U]|0)+O,O=b>>26,this.words[U]=b&67108863;if(O===0&&U<k.length&&k!==this)for(;U<k.length;U++)this.words[U]=k.words[U];return this.length=Math.max(this.length,U),k!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(l){return this.clone().isub(l)};function a(D,l,b){b.negative=l.negative^D.negative;var C=D.length+l.length|0;b.length=C,C=C-1|0;var k=D.words[0]|0,x=l.words[0]|0,O=k*x,U=O&67108863,L=O/67108864|0;b.words[0]=U;for(var v=1;v<C;v++){for(var M=L>>>26,G=L&67108863,J=Math.min(v,l.length-1),j=Math.max(0,v-D.length+1);j<=J;j++){var V=v-j|0;k=D.words[V]|0,x=l.words[j]|0,O=k*x+G,M+=O/67108864|0,G=O&67108863}b.words[v]=G|0,L=M|0}return L!==0?b.words[v]=L|0:b.length--,b._strip()}var E=function(l,b,C){var k=l.words,x=b.words,O=C.words,U=0,L,v,M,G=k[0]|0,J=G&8191,j=G>>>13,V=k[1]|0,Z=V&8191,Y=V>>>13,ie=k[2]|0,B=ie&8191,F=ie>>>13,te=k[3]|0,ne=te&8191,se=te>>>13,ce=k[4]|0,ae=ce&8191,ye=ce>>>13,ee=k[5]|0,ve=ee&8191,pe=ee>>>13,we=k[6]|0,fe=we&8191,Ee=we>>>13,Qe=k[7]|0,Se=Qe&8191,be=Qe>>>13,ze=k[8]|0,Re=ze&8191,Ie=ze>>>13,at=k[9]|0,Le=at&8191,Te=at>>>13,Ke=x[0]|0,Ce=Ke&8191,Ne=Ke>>>13,ft=x[1]|0,Ae=ft&8191,Oe=ft>>>13,dt=x[2]|0,Be=dt&8191,Me=dt>>>13,We=x[3]|0,xe=We&8191,Pe=We>>>13,Ge=x[4]|0,Fe=Ge&8191,A=Ge>>>13,y=x[5]|0,R=y&8191,P=y>>>13,z=x[6]|0,$=z&8191,Q=z>>>13,de=x[7]|0,he=de&8191,le=de>>>13,ke=x[8]|0,ue=ke&8191,De=ke>>>13,er=x[9]|0,qe=er&8191,je=er>>>13;C.negative=l.negative^b.negative,C.length=19,L=Math.imul(J,Ce),v=Math.imul(J,Ne),v=v+Math.imul(j,Ce)|0,M=Math.imul(j,Ne);var mt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(mt>>>26)|0,mt&=67108863,L=Math.imul(Z,Ce),v=Math.imul(Z,Ne),v=v+Math.imul(Y,Ce)|0,M=Math.imul(Y,Ne),L=L+Math.imul(J,Ae)|0,v=v+Math.imul(J,Oe)|0,v=v+Math.imul(j,Ae)|0,M=M+Math.imul(j,Oe)|0;var yt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(yt>>>26)|0,yt&=67108863,L=Math.imul(B,Ce),v=Math.imul(B,Ne),v=v+Math.imul(F,Ce)|0,M=Math.imul(F,Ne),L=L+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,Oe)|0,v=v+Math.imul(Y,Ae)|0,M=M+Math.imul(Y,Oe)|0,L=L+Math.imul(J,Be)|0,v=v+Math.imul(J,Me)|0,v=v+Math.imul(j,Be)|0,M=M+Math.imul(j,Me)|0;var wt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(wt>>>26)|0,wt&=67108863,L=Math.imul(ne,Ce),v=Math.imul(ne,Ne),v=v+Math.imul(se,Ce)|0,M=Math.imul(se,Ne),L=L+Math.imul(B,Ae)|0,v=v+Math.imul(B,Oe)|0,v=v+Math.imul(F,Ae)|0,M=M+Math.imul(F,Oe)|0,L=L+Math.imul(Z,Be)|0,v=v+Math.imul(Z,Me)|0,v=v+Math.imul(Y,Be)|0,M=M+Math.imul(Y,Me)|0,L=L+Math.imul(J,xe)|0,v=v+Math.imul(J,Pe)|0,v=v+Math.imul(j,xe)|0,M=M+Math.imul(j,Pe)|0;var vt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(vt>>>26)|0,vt&=67108863,L=Math.imul(ae,Ce),v=Math.imul(ae,Ne),v=v+Math.imul(ye,Ce)|0,M=Math.imul(ye,Ne),L=L+Math.imul(ne,Ae)|0,v=v+Math.imul(ne,Oe)|0,v=v+Math.imul(se,Ae)|0,M=M+Math.imul(se,Oe)|0,L=L+Math.imul(B,Be)|0,v=v+Math.imul(B,Me)|0,v=v+Math.imul(F,Be)|0,M=M+Math.imul(F,Me)|0,L=L+Math.imul(Z,xe)|0,v=v+Math.imul(Z,Pe)|0,v=v+Math.imul(Y,xe)|0,M=M+Math.imul(Y,Pe)|0,L=L+Math.imul(J,Fe)|0,v=v+Math.imul(J,A)|0,v=v+Math.imul(j,Fe)|0,M=M+Math.imul(j,A)|0;var bt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(bt>>>26)|0,bt&=67108863,L=Math.imul(ve,Ce),v=Math.imul(ve,Ne),v=v+Math.imul(pe,Ce)|0,M=Math.imul(pe,Ne),L=L+Math.imul(ae,Ae)|0,v=v+Math.imul(ae,Oe)|0,v=v+Math.imul(ye,Ae)|0,M=M+Math.imul(ye,Oe)|0,L=L+Math.imul(ne,Be)|0,v=v+Math.imul(ne,Me)|0,v=v+Math.imul(se,Be)|0,M=M+Math.imul(se,Me)|0,L=L+Math.imul(B,xe)|0,v=v+Math.imul(B,Pe)|0,v=v+Math.imul(F,xe)|0,M=M+Math.imul(F,Pe)|0,L=L+Math.imul(Z,Fe)|0,v=v+Math.imul(Z,A)|0,v=v+Math.imul(Y,Fe)|0,M=M+Math.imul(Y,A)|0,L=L+Math.imul(J,R)|0,v=v+Math.imul(J,P)|0,v=v+Math.imul(j,R)|0,M=M+Math.imul(j,P)|0;var _t=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(_t>>>26)|0,_t&=67108863,L=Math.imul(fe,Ce),v=Math.imul(fe,Ne),v=v+Math.imul(Ee,Ce)|0,M=Math.imul(Ee,Ne),L=L+Math.imul(ve,Ae)|0,v=v+Math.imul(ve,Oe)|0,v=v+Math.imul(pe,Ae)|0,M=M+Math.imul(pe,Oe)|0,L=L+Math.imul(ae,Be)|0,v=v+Math.imul(ae,Me)|0,v=v+Math.imul(ye,Be)|0,M=M+Math.imul(ye,Me)|0,L=L+Math.imul(ne,xe)|0,v=v+Math.imul(ne,Pe)|0,v=v+Math.imul(se,xe)|0,M=M+Math.imul(se,Pe)|0,L=L+Math.imul(B,Fe)|0,v=v+Math.imul(B,A)|0,v=v+Math.imul(F,Fe)|0,M=M+Math.imul(F,A)|0,L=L+Math.imul(Z,R)|0,v=v+Math.imul(Z,P)|0,v=v+Math.imul(Y,R)|0,M=M+Math.imul(Y,P)|0,L=L+Math.imul(J,$)|0,v=v+Math.imul(J,Q)|0,v=v+Math.imul(j,$)|0,M=M+Math.imul(j,Q)|0;var Et=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(Et>>>26)|0,Et&=67108863,L=Math.imul(Se,Ce),v=Math.imul(Se,Ne),v=v+Math.imul(be,Ce)|0,M=Math.imul(be,Ne),L=L+Math.imul(fe,Ae)|0,v=v+Math.imul(fe,Oe)|0,v=v+Math.imul(Ee,Ae)|0,M=M+Math.imul(Ee,Oe)|0,L=L+Math.imul(ve,Be)|0,v=v+Math.imul(ve,Me)|0,v=v+Math.imul(pe,Be)|0,M=M+Math.imul(pe,Me)|0,L=L+Math.imul(ae,xe)|0,v=v+Math.imul(ae,Pe)|0,v=v+Math.imul(ye,xe)|0,M=M+Math.imul(ye,Pe)|0,L=L+Math.imul(ne,Fe)|0,v=v+Math.imul(ne,A)|0,v=v+Math.imul(se,Fe)|0,M=M+Math.imul(se,A)|0,L=L+Math.imul(B,R)|0,v=v+Math.imul(B,P)|0,v=v+Math.imul(F,R)|0,M=M+Math.imul(F,P)|0,L=L+Math.imul(Z,$)|0,v=v+Math.imul(Z,Q)|0,v=v+Math.imul(Y,$)|0,M=M+Math.imul(Y,Q)|0,L=L+Math.imul(J,he)|0,v=v+Math.imul(J,le)|0,v=v+Math.imul(j,he)|0,M=M+Math.imul(j,le)|0;var St=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(St>>>26)|0,St&=67108863,L=Math.imul(Re,Ce),v=Math.imul(Re,Ne),v=v+Math.imul(Ie,Ce)|0,M=Math.imul(Ie,Ne),L=L+Math.imul(Se,Ae)|0,v=v+Math.imul(Se,Oe)|0,v=v+Math.imul(be,Ae)|0,M=M+Math.imul(be,Oe)|0,L=L+Math.imul(fe,Be)|0,v=v+Math.imul(fe,Me)|0,v=v+Math.imul(Ee,Be)|0,M=M+Math.imul(Ee,Me)|0,L=L+Math.imul(ve,xe)|0,v=v+Math.imul(ve,Pe)|0,v=v+Math.imul(pe,xe)|0,M=M+Math.imul(pe,Pe)|0,L=L+Math.imul(ae,Fe)|0,v=v+Math.imul(ae,A)|0,v=v+Math.imul(ye,Fe)|0,M=M+Math.imul(ye,A)|0,L=L+Math.imul(ne,R)|0,v=v+Math.imul(ne,P)|0,v=v+Math.imul(se,R)|0,M=M+Math.imul(se,P)|0,L=L+Math.imul(B,$)|0,v=v+Math.imul(B,Q)|0,v=v+Math.imul(F,$)|0,M=M+Math.imul(F,Q)|0,L=L+Math.imul(Z,he)|0,v=v+Math.imul(Z,le)|0,v=v+Math.imul(Y,he)|0,M=M+Math.imul(Y,le)|0,L=L+Math.imul(J,ue)|0,v=v+Math.imul(J,De)|0,v=v+Math.imul(j,ue)|0,M=M+Math.imul(j,De)|0;var Rt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,L=Math.imul(Le,Ce),v=Math.imul(Le,Ne),v=v+Math.imul(Te,Ce)|0,M=Math.imul(Te,Ne),L=L+Math.imul(Re,Ae)|0,v=v+Math.imul(Re,Oe)|0,v=v+Math.imul(Ie,Ae)|0,M=M+Math.imul(Ie,Oe)|0,L=L+Math.imul(Se,Be)|0,v=v+Math.imul(Se,Me)|0,v=v+Math.imul(be,Be)|0,M=M+Math.imul(be,Me)|0,L=L+Math.imul(fe,xe)|0,v=v+Math.imul(fe,Pe)|0,v=v+Math.imul(Ee,xe)|0,M=M+Math.imul(Ee,Pe)|0,L=L+Math.imul(ve,Fe)|0,v=v+Math.imul(ve,A)|0,v=v+Math.imul(pe,Fe)|0,M=M+Math.imul(pe,A)|0,L=L+Math.imul(ae,R)|0,v=v+Math.imul(ae,P)|0,v=v+Math.imul(ye,R)|0,M=M+Math.imul(ye,P)|0,L=L+Math.imul(ne,$)|0,v=v+Math.imul(ne,Q)|0,v=v+Math.imul(se,$)|0,M=M+Math.imul(se,Q)|0,L=L+Math.imul(B,he)|0,v=v+Math.imul(B,le)|0,v=v+Math.imul(F,he)|0,M=M+Math.imul(F,le)|0,L=L+Math.imul(Z,ue)|0,v=v+Math.imul(Z,De)|0,v=v+Math.imul(Y,ue)|0,M=M+Math.imul(Y,De)|0,L=L+Math.imul(J,qe)|0,v=v+Math.imul(J,je)|0,v=v+Math.imul(j,qe)|0,M=M+Math.imul(j,je)|0;var Ct=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,L=Math.imul(Le,Ae),v=Math.imul(Le,Oe),v=v+Math.imul(Te,Ae)|0,M=Math.imul(Te,Oe),L=L+Math.imul(Re,Be)|0,v=v+Math.imul(Re,Me)|0,v=v+Math.imul(Ie,Be)|0,M=M+Math.imul(Ie,Me)|0,L=L+Math.imul(Se,xe)|0,v=v+Math.imul(Se,Pe)|0,v=v+Math.imul(be,xe)|0,M=M+Math.imul(be,Pe)|0,L=L+Math.imul(fe,Fe)|0,v=v+Math.imul(fe,A)|0,v=v+Math.imul(Ee,Fe)|0,M=M+Math.imul(Ee,A)|0,L=L+Math.imul(ve,R)|0,v=v+Math.imul(ve,P)|0,v=v+Math.imul(pe,R)|0,M=M+Math.imul(pe,P)|0,L=L+Math.imul(ae,$)|0,v=v+Math.imul(ae,Q)|0,v=v+Math.imul(ye,$)|0,M=M+Math.imul(ye,Q)|0,L=L+Math.imul(ne,he)|0,v=v+Math.imul(ne,le)|0,v=v+Math.imul(se,he)|0,M=M+Math.imul(se,le)|0,L=L+Math.imul(B,ue)|0,v=v+Math.imul(B,De)|0,v=v+Math.imul(F,ue)|0,M=M+Math.imul(F,De)|0,L=L+Math.imul(Z,qe)|0,v=v+Math.imul(Z,je)|0,v=v+Math.imul(Y,qe)|0,M=M+Math.imul(Y,je)|0;var Mt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,L=Math.imul(Le,Be),v=Math.imul(Le,Me),v=v+Math.imul(Te,Be)|0,M=Math.imul(Te,Me),L=L+Math.imul(Re,xe)|0,v=v+Math.imul(Re,Pe)|0,v=v+Math.imul(Ie,xe)|0,M=M+Math.imul(Ie,Pe)|0,L=L+Math.imul(Se,Fe)|0,v=v+Math.imul(Se,A)|0,v=v+Math.imul(be,Fe)|0,M=M+Math.imul(be,A)|0,L=L+Math.imul(fe,R)|0,v=v+Math.imul(fe,P)|0,v=v+Math.imul(Ee,R)|0,M=M+Math.imul(Ee,P)|0,L=L+Math.imul(ve,$)|0,v=v+Math.imul(ve,Q)|0,v=v+Math.imul(pe,$)|0,M=M+Math.imul(pe,Q)|0,L=L+Math.imul(ae,he)|0,v=v+Math.imul(ae,le)|0,v=v+Math.imul(ye,he)|0,M=M+Math.imul(ye,le)|0,L=L+Math.imul(ne,ue)|0,v=v+Math.imul(ne,De)|0,v=v+Math.imul(se,ue)|0,M=M+Math.imul(se,De)|0,L=L+Math.imul(B,qe)|0,v=v+Math.imul(B,je)|0,v=v+Math.imul(F,qe)|0,M=M+Math.imul(F,je)|0;var kt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(kt>>>26)|0,kt&=67108863,L=Math.imul(Le,xe),v=Math.imul(Le,Pe),v=v+Math.imul(Te,xe)|0,M=Math.imul(Te,Pe),L=L+Math.imul(Re,Fe)|0,v=v+Math.imul(Re,A)|0,v=v+Math.imul(Ie,Fe)|0,M=M+Math.imul(Ie,A)|0,L=L+Math.imul(Se,R)|0,v=v+Math.imul(Se,P)|0,v=v+Math.imul(be,R)|0,M=M+Math.imul(be,P)|0,L=L+Math.imul(fe,$)|0,v=v+Math.imul(fe,Q)|0,v=v+Math.imul(Ee,$)|0,M=M+Math.imul(Ee,Q)|0,L=L+Math.imul(ve,he)|0,v=v+Math.imul(ve,le)|0,v=v+Math.imul(pe,he)|0,M=M+Math.imul(pe,le)|0,L=L+Math.imul(ae,ue)|0,v=v+Math.imul(ae,De)|0,v=v+Math.imul(ye,ue)|0,M=M+Math.imul(ye,De)|0,L=L+Math.imul(ne,qe)|0,v=v+Math.imul(ne,je)|0,v=v+Math.imul(se,qe)|0,M=M+Math.imul(se,je)|0;var It=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(It>>>26)|0,It&=67108863,L=Math.imul(Le,Fe),v=Math.imul(Le,A),v=v+Math.imul(Te,Fe)|0,M=Math.imul(Te,A),L=L+Math.imul(Re,R)|0,v=v+Math.imul(Re,P)|0,v=v+Math.imul(Ie,R)|0,M=M+Math.imul(Ie,P)|0,L=L+Math.imul(Se,$)|0,v=v+Math.imul(Se,Q)|0,v=v+Math.imul(be,$)|0,M=M+Math.imul(be,Q)|0,L=L+Math.imul(fe,he)|0,v=v+Math.imul(fe,le)|0,v=v+Math.imul(Ee,he)|0,M=M+Math.imul(Ee,le)|0,L=L+Math.imul(ve,ue)|0,v=v+Math.imul(ve,De)|0,v=v+Math.imul(pe,ue)|0,M=M+Math.imul(pe,De)|0,L=L+Math.imul(ae,qe)|0,v=v+Math.imul(ae,je)|0,v=v+Math.imul(ye,qe)|0,M=M+Math.imul(ye,je)|0;var At=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(At>>>26)|0,At&=67108863,L=Math.imul(Le,R),v=Math.imul(Le,P),v=v+Math.imul(Te,R)|0,M=Math.imul(Te,P),L=L+Math.imul(Re,$)|0,v=v+Math.imul(Re,Q)|0,v=v+Math.imul(Ie,$)|0,M=M+Math.imul(Ie,Q)|0,L=L+Math.imul(Se,he)|0,v=v+Math.imul(Se,le)|0,v=v+Math.imul(be,he)|0,M=M+Math.imul(be,le)|0,L=L+Math.imul(fe,ue)|0,v=v+Math.imul(fe,De)|0,v=v+Math.imul(Ee,ue)|0,M=M+Math.imul(Ee,De)|0,L=L+Math.imul(ve,qe)|0,v=v+Math.imul(ve,je)|0,v=v+Math.imul(pe,qe)|0,M=M+Math.imul(pe,je)|0;var xt=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(xt>>>26)|0,xt&=67108863,L=Math.imul(Le,$),v=Math.imul(Le,Q),v=v+Math.imul(Te,$)|0,M=Math.imul(Te,Q),L=L+Math.imul(Re,he)|0,v=v+Math.imul(Re,le)|0,v=v+Math.imul(Ie,he)|0,M=M+Math.imul(Ie,le)|0,L=L+Math.imul(Se,ue)|0,v=v+Math.imul(Se,De)|0,v=v+Math.imul(be,ue)|0,M=M+Math.imul(be,De)|0,L=L+Math.imul(fe,qe)|0,v=v+Math.imul(fe,je)|0,v=v+Math.imul(Ee,qe)|0,M=M+Math.imul(Ee,je)|0;var Mn=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,L=Math.imul(Le,he),v=Math.imul(Le,le),v=v+Math.imul(Te,he)|0,M=Math.imul(Te,le),L=L+Math.imul(Re,ue)|0,v=v+Math.imul(Re,De)|0,v=v+Math.imul(Ie,ue)|0,M=M+Math.imul(Ie,De)|0,L=L+Math.imul(Se,qe)|0,v=v+Math.imul(Se,je)|0,v=v+Math.imul(be,qe)|0,M=M+Math.imul(be,je)|0;var kn=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(kn>>>26)|0,kn&=67108863,L=Math.imul(Le,ue),v=Math.imul(Le,De),v=v+Math.imul(Te,ue)|0,M=Math.imul(Te,De),L=L+Math.imul(Re,qe)|0,v=v+Math.imul(Re,je)|0,v=v+Math.imul(Ie,qe)|0,M=M+Math.imul(Ie,je)|0;var In=(U+L|0)+((v&8191)<<13)|0;U=(M+(v>>>13)|0)+(In>>>26)|0,In&=67108863,L=Math.imul(Le,qe),v=Math.imul(Le,je),v=v+Math.imul(Te,qe)|0,M=Math.imul(Te,je);var An=(U+L|0)+((v&8191)<<13)|0;return U=(M+(v>>>13)|0)+(An>>>26)|0,An&=67108863,O[0]=mt,O[1]=yt,O[2]=wt,O[3]=vt,O[4]=bt,O[5]=_t,O[6]=Et,O[7]=St,O[8]=Rt,O[9]=Ct,O[10]=Mt,O[11]=kt,O[12]=It,O[13]=At,O[14]=xt,O[15]=Mn,O[16]=kn,O[17]=In,O[18]=An,U!==0&&(O[19]=U,C.length++),C};Math.imul||(E=a);function S(D,l,b){b.negative=l.negative^D.negative,b.length=D.length+l.length;for(var C=0,k=0,x=0;x<b.length-1;x++){var O=k;k=0;for(var U=C&67108863,L=Math.min(x,l.length-1),v=Math.max(0,x-D.length+1);v<=L;v++){var M=x-v,G=D.words[M]|0,J=l.words[v]|0,j=G*J,V=j&67108863;O=O+(j/67108864|0)|0,V=V+U|0,U=V&67108863,O=O+(V>>>26)|0,k+=O>>>26,O&=67108863}b.words[x]=U,C=O,O=k}return C!==0?b.words[x]=C:b.length--,b._strip()}function I(D,l,b){return S(D,l,b)}i.prototype.mulTo=function(l,b){var C,k=this.length+l.length;return this.length===10&&l.length===10?C=E(this,l,b):k<63?C=a(this,l,b):k<1024?C=S(this,l,b):C=I(this,l,b),C},i.prototype.mul=function(l){var b=new i(null);return b.words=new Array(this.length+l.length),this.mulTo(l,b)},i.prototype.mulf=function(l){var b=new i(null);return b.words=new Array(this.length+l.length),I(this,l,b)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){var b=l<0;b&&(l=-l),t(typeof l=="number"),t(l<67108864);for(var C=0,k=0;k<this.length;k++){var x=(this.words[k]|0)*l,O=(x&67108863)+(C&67108863);C>>=26,C+=x/67108864|0,C+=O>>>26,this.words[k]=O&67108863}return C!==0&&(this.words[k]=C,this.length++),this.length=l===0?1:this.length,b?this.ineg():this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var b=w(l);if(b.length===0)return new i(1);for(var C=this,k=0;k<b.length&&b[k]===0;k++,C=C.sqr());if(++k<b.length)for(var x=C.sqr();k<b.length;k++,x=x.sqr())b[k]!==0&&(C=C.mul(x));return C},i.prototype.iushln=function(l){t(typeof l=="number"&&l>=0);var b=l%26,C=(l-b)/26,k=67108863>>>26-b<<26-b,x;if(b!==0){var O=0;for(x=0;x<this.length;x++){var U=this.words[x]&k,L=(this.words[x]|0)-U<<b;this.words[x]=L|O,O=U>>>26-b}O&&(this.words[x]=O,this.length++)}if(C!==0){for(x=this.length-1;x>=0;x--)this.words[x+C]=this.words[x];for(x=0;x<C;x++)this.words[x]=0;this.length+=C}return this._strip()},i.prototype.ishln=function(l){return t(this.negative===0),this.iushln(l)},i.prototype.iushrn=function(l,b,C){t(typeof l=="number"&&l>=0);var k;b?k=(b-b%26)/26:k=0;var x=l%26,O=Math.min((l-x)/26,this.length),U=67108863^67108863>>>x<<x,L=C;if(k-=O,k=Math.max(0,k),L){for(var v=0;v<O;v++)L.words[v]=this.words[v];L.length=O}if(O!==0)if(this.length>O)for(this.length-=O,v=0;v<this.length;v++)this.words[v]=this.words[v+O];else this.words[0]=0,this.length=1;var M=0;for(v=this.length-1;v>=0&&(M!==0||v>=k);v--){var G=this.words[v]|0;this.words[v]=M<<26-x|G>>>x,M=G&U}return L&&M!==0&&(L.words[L.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(l,b,C){return t(this.negative===0),this.iushrn(l,b,C)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){t(typeof l=="number"&&l>=0);var b=l%26,C=(l-b)/26,k=1<<b;if(this.length<=C)return!1;var x=this.words[C];return!!(x&k)},i.prototype.imaskn=function(l){t(typeof l=="number"&&l>=0);var b=l%26,C=(l-b)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=C)return this;if(b!==0&&C++,this.length=Math.min(C,this.length),b!==0){var k=67108863^67108863>>>b<<b;this.words[this.length-1]&=k}return this._strip()},i.prototype.maskn=function(l){return this.clone().imaskn(l)},i.prototype.iaddn=function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<=l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},i.prototype._iaddn=function(l){this.words[0]+=l;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},i.prototype.isubn=function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this._strip()},i.prototype.addn=function(l){return this.clone().iaddn(l)},i.prototype.subn=function(l){return this.clone().isubn(l)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(l,b,C){var k=l.length+C,x;this._expand(k);var O,U=0;for(x=0;x<l.length;x++){O=(this.words[x+C]|0)+U;var L=(l.words[x]|0)*b;O-=L&67108863,U=(O>>26)-(L/67108864|0),this.words[x+C]=O&67108863}for(;x<this.length-C;x++)O=(this.words[x+C]|0)+U,U=O>>26,this.words[x+C]=O&67108863;if(U===0)return this._strip();for(t(U===-1),U=0,x=0;x<this.length;x++)O=-(this.words[x]|0)+U,U=O>>26,this.words[x]=O&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(l,b){var C=this.length-l.length,k=this.clone(),x=l,O=x.words[x.length-1]|0,U=this._countBits(O);C=26-U,C!==0&&(x=x.ushln(C),k.iushln(C),O=x.words[x.length-1]|0);var L=k.length-x.length,v;if(b!=="mod"){v=new i(null),v.length=L+1,v.words=new Array(v.length);for(var M=0;M<v.length;M++)v.words[M]=0}var G=k.clone()._ishlnsubmul(x,1,L);G.negative===0&&(k=G,v&&(v.words[L]=1));for(var J=L-1;J>=0;J--){var j=(k.words[x.length+J]|0)*67108864+(k.words[x.length+J-1]|0);for(j=Math.min(j/O|0,67108863),k._ishlnsubmul(x,j,J);k.negative!==0;)j--,k.negative=0,k._ishlnsubmul(x,1,J),k.isZero()||(k.negative^=1);v&&(v.words[J]=j)}return v&&v._strip(),k._strip(),b!=="div"&&C!==0&&k.iushrn(C),{div:v||null,mod:k}},i.prototype.divmod=function(l,b,C){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var k,x,O;return this.negative!==0&&l.negative===0?(O=this.neg().divmod(l,b),b!=="mod"&&(k=O.div.neg()),b!=="div"&&(x=O.mod.neg(),C&&x.negative!==0&&x.iadd(l)),{div:k,mod:x}):this.negative===0&&l.negative!==0?(O=this.divmod(l.neg(),b),b!=="mod"&&(k=O.div.neg()),{div:k,mod:O.mod}):this.negative&l.negative?(O=this.neg().divmod(l.neg(),b),b!=="div"&&(x=O.mod.neg(),C&&x.negative!==0&&x.isub(l)),{div:O.div,mod:x}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?b==="div"?{div:this.divn(l.words[0]),mod:null}:b==="mod"?{div:null,mod:new i(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modrn(l.words[0]))}:this._wordDiv(l,b)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var b=this.divmod(l);if(b.mod.isZero())return b.div;var C=b.div.negative!==0?b.mod.isub(l):b.mod,k=l.ushrn(1),x=l.andln(1),O=C.cmp(k);return O<0||x===1&&O===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},i.prototype.modrn=function(l){var b=l<0;b&&(l=-l),t(l<=67108863);for(var C=(1<<26)%l,k=0,x=this.length-1;x>=0;x--)k=(C*k+(this.words[x]|0))%l;return b?-k:k},i.prototype.modn=function(l){return this.modrn(l)},i.prototype.idivn=function(l){var b=l<0;b&&(l=-l),t(l<=67108863);for(var C=0,k=this.length-1;k>=0;k--){var x=(this.words[k]|0)+C*67108864;this.words[k]=x/l|0,C=x%l}return this._strip(),b?this.ineg():this},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){t(l.negative===0),t(!l.isZero());var b=this,C=l.clone();b.negative!==0?b=b.umod(l):b=b.clone();for(var k=new i(1),x=new i(0),O=new i(0),U=new i(1),L=0;b.isEven()&&C.isEven();)b.iushrn(1),C.iushrn(1),++L;for(var v=C.clone(),M=b.clone();!b.isZero();){for(var G=0,J=1;!(b.words[0]&J)&&G<26;++G,J<<=1);if(G>0)for(b.iushrn(G);G-- >0;)(k.isOdd()||x.isOdd())&&(k.iadd(v),x.isub(M)),k.iushrn(1),x.iushrn(1);for(var j=0,V=1;!(C.words[0]&V)&&j<26;++j,V<<=1);if(j>0)for(C.iushrn(j);j-- >0;)(O.isOdd()||U.isOdd())&&(O.iadd(v),U.isub(M)),O.iushrn(1),U.iushrn(1);b.cmp(C)>=0?(b.isub(C),k.isub(O),x.isub(U)):(C.isub(b),O.isub(k),U.isub(x))}return{a:O,b:U,gcd:C.iushln(L)}},i.prototype._invmp=function(l){t(l.negative===0),t(!l.isZero());var b=this,C=l.clone();b.negative!==0?b=b.umod(l):b=b.clone();for(var k=new i(1),x=new i(0),O=C.clone();b.cmpn(1)>0&&C.cmpn(1)>0;){for(var U=0,L=1;!(b.words[0]&L)&&U<26;++U,L<<=1);if(U>0)for(b.iushrn(U);U-- >0;)k.isOdd()&&k.iadd(O),k.iushrn(1);for(var v=0,M=1;!(C.words[0]&M)&&v<26;++v,M<<=1);if(v>0)for(C.iushrn(v);v-- >0;)x.isOdd()&&x.iadd(O),x.iushrn(1);b.cmp(C)>=0?(b.isub(C),k.isub(x)):(C.isub(b),x.isub(k))}var G;return b.cmpn(1)===0?G=k:G=x,G.cmpn(0)<0&&G.iadd(l),G},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var b=this.clone(),C=l.clone();b.negative=0,C.negative=0;for(var k=0;b.isEven()&&C.isEven();k++)b.iushrn(1),C.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;C.isEven();)C.iushrn(1);var x=b.cmp(C);if(x<0){var O=b;b=C,C=O}else if(x===0||C.cmpn(1)===0)break;b.isub(C)}while(!0);return C.iushln(k)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){t(typeof l=="number");var b=l%26,C=(l-b)/26,k=1<<b;if(this.length<=C)return this._expand(C+1),this.words[C]|=k,this;for(var x=k,O=C;x!==0&&O<this.length;O++){var U=this.words[O]|0;U+=x,x=U>>>26,U&=67108863,this.words[O]=U}return x!==0&&(this.words[O]=x,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var b=l<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var C;if(this.length>1)C=1;else{b&&(l=-l),t(l<=67108863,"Number is too big");var k=this.words[0]|0;C=k===l?0:k<l?-1:1}return this.negative!==0?-C|0:C},i.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var b=this.ucmp(l);return this.negative!==0?-b|0:b},i.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var b=0,C=this.length-1;C>=0;C--){var k=this.words[C]|0,x=l.words[C]|0;if(k!==x){k<x?b=-1:k>x&&(b=1);break}}return b},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new re(l)},i.prototype.toRed=function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var T={k256:null,p224:null,p192:null,p25519:null};function q(D,l){this.name=D,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},q.prototype.ireduce=function(l){var b=l,C;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),C=b.bitLength();while(C>this.n);var k=C<this.n?-1:b.ucmp(this.p);return k===0?(b.words[0]=0,b.length=1):k>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},q.prototype.split=function(l,b){l.iushrn(this.n,0,b)},q.prototype.imulK=function(l){return l.imul(this.k)};function N(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(N,q),N.prototype.split=function(l,b){for(var C=4194303,k=Math.min(l.length,9),x=0;x<k;x++)b.words[x]=l.words[x];if(b.length=k,l.length<=9){l.words[0]=0,l.length=1;return}var O=l.words[9];for(b.words[b.length++]=O&C,x=10;x<l.length;x++){var U=l.words[x]|0;l.words[x-10]=(U&C)<<4|O>>>22,O=U}O>>>=22,l.words[x-10]=O,O===0&&l.length>10?l.length-=10:l.length-=9},N.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var b=0,C=0;C<l.length;C++){var k=l.words[C]|0;b+=k*977,l.words[C]=b&67108863,b=k*64+(b/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function H(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(H,q);function K(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(K,q);function X(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(X,q),X.prototype.imulK=function(l){for(var b=0,C=0;C<l.length;C++){var k=(l.words[C]|0)*19+b,x=k&67108863;k>>>=26,l.words[C]=x,b=k}return b!==0&&(l.words[l.length++]=b),l},i._prime=function(l){if(T[l])return T[l];var b;if(l==="k256")b=new N;else if(l==="p224")b=new H;else if(l==="p192")b=new K;else if(l==="p25519")b=new X;else throw new Error("Unknown prime "+l);return T[l]=b,b};function re(D){if(typeof D=="string"){var l=i._prime(D);this.m=l.p,this.prime=l}else t(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}re.prototype._verify1=function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},re.prototype._verify2=function(l,b){t((l.negative|b.negative)===0,"red works only with positives"),t(l.red&&l.red===b.red,"red works only with red numbers")},re.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(g(l,l.umod(this.m)._forceRed(this)),l)},re.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},re.prototype.add=function(l,b){this._verify2(l,b);var C=l.add(b);return C.cmp(this.m)>=0&&C.isub(this.m),C._forceRed(this)},re.prototype.iadd=function(l,b){this._verify2(l,b);var C=l.iadd(b);return C.cmp(this.m)>=0&&C.isub(this.m),C},re.prototype.sub=function(l,b){this._verify2(l,b);var C=l.sub(b);return C.cmpn(0)<0&&C.iadd(this.m),C._forceRed(this)},re.prototype.isub=function(l,b){this._verify2(l,b);var C=l.isub(b);return C.cmpn(0)<0&&C.iadd(this.m),C},re.prototype.shl=function(l,b){return this._verify1(l),this.imod(l.ushln(b))},re.prototype.imul=function(l,b){return this._verify2(l,b),this.imod(l.imul(b))},re.prototype.mul=function(l,b){return this._verify2(l,b),this.imod(l.mul(b))},re.prototype.isqr=function(l){return this.imul(l,l.clone())},re.prototype.sqr=function(l){return this.mul(l,l)},re.prototype.sqrt=function(l){if(l.isZero())return l.clone();var b=this.m.andln(3);if(t(b%2===1),b===3){var C=this.m.add(new i(1)).iushrn(2);return this.pow(l,C)}for(var k=this.m.subn(1),x=0;!k.isZero()&&k.andln(1)===0;)x++,k.iushrn(1);t(!k.isZero());var O=new i(1).toRed(this),U=O.redNeg(),L=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new i(2*v*v).toRed(this);this.pow(v,L).cmp(U)!==0;)v.redIAdd(U);for(var M=this.pow(v,k),G=this.pow(l,k.addn(1).iushrn(1)),J=this.pow(l,k),j=x;J.cmp(O)!==0;){for(var V=J,Z=0;V.cmp(O)!==0;Z++)V=V.redSqr();t(Z<j);var Y=this.pow(M,new i(1).iushln(j-Z-1));G=G.redMul(Y),M=Y.redSqr(),J=J.redMul(M),j=Z}return G},re.prototype.invm=function(l){var b=l._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},re.prototype.pow=function(l,b){if(b.isZero())return new i(1).toRed(this);if(b.cmpn(1)===0)return l.clone();var C=4,k=new Array(1<<C);k[0]=new i(1).toRed(this),k[1]=l;for(var x=2;x<k.length;x++)k[x]=this.mul(k[x-1],l);var O=k[0],U=0,L=0,v=b.bitLength()%26;for(v===0&&(v=26),x=b.length-1;x>=0;x--){for(var M=b.words[x],G=v-1;G>=0;G--){var J=M>>G&1;if(O!==k[0]&&(O=this.sqr(O)),J===0&&U===0){L=0;continue}U<<=1,U|=J,L++,!(L!==C&&(x!==0||G!==0))&&(O=this.mul(O,k[U]),L=0,U=0)}v=26}return O},re.prototype.convertTo=function(l){var b=l.umod(this.m);return b===l?b.clone():b},re.prototype.convertFrom=function(l){var b=l.clone();return b.red=null,b},i.mont=function(l){return new W(l)};function W(D){re.call(this,D),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}d(W,re),W.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},W.prototype.convertFrom=function(l){var b=this.imod(l.mul(this.rinv));return b.red=null,b},W.prototype.imul=function(l,b){if(l.isZero()||b.isZero())return l.words[0]=0,l.length=1,l;var C=l.imul(b),k=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=C.isub(k).iushrn(this.shift),O=x;return x.cmp(this.m)>=0?O=x.isub(this.m):x.cmpn(0)<0&&(O=x.iadd(this.m)),O._forceRed(this)},W.prototype.mul=function(l,b){if(l.isZero()||b.isZero())return new i(0)._forceRed(this);var C=l.mul(b),k=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=C.isub(k).iushrn(this.shift),O=x;return x.cmp(this.m)>=0?O=x.isub(this.m):x.cmpn(0)<0&&(O=x.iadd(this.m)),O._forceRed(this)},W.prototype.invm=function(l){var b=this.imod(l._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(e,lh)}(fn)),fn.exports}var Bn={},Tt={},bo;function mn(){return bo||(bo=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.errorValues=Tt.standardErrorCodes=void 0,Tt.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}},Tt.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."}}),Tt}var lr={},Ln={},_o;function zs(){return _o||(_o=1,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 r=mn(),n="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(c,o=n){if(c&&Number.isInteger(c)){const m=c.toString();if(g(r.errorValues,m))return r.errorValues[m].message;if(f(c))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return o}e.getMessageFromCode=t;function d(c){if(!Number.isInteger(c))return!1;const o=c.toString();return!!(r.errorValues[o]||f(c))}e.isValidCode=d;function i(c){var o;if(typeof c=="number")return c;if(u(c))return(o=c.code)!==null&&o!==void 0?o:c.errorCode}e.getErrorCode=i;function u(c){return typeof c=="object"&&c!==null&&(typeof c.code=="number"||typeof c.errorCode=="number")}function p(c,{shouldIncludeStack:o=!1}={}){const m={};if(c&&typeof c=="object"&&!Array.isArray(c)&&g(c,"code")&&d(c.code)){const _=c;m.code=_.code,_.message&&typeof _.message=="string"?(m.message=_.message,g(_,"data")&&(m.data=_.data)):(m.message=t(m.code),m.data={originalError:h(c)})}else m.code=r.standardErrorCodes.rpc.internal,m.message=s(c,"message")?c.message:n,m.data={originalError:h(c)};return o&&(m.stack=s(c,"stack")?c.stack:void 0),m}e.serialize=p;function f(c){return c>=-32099&&c<=-32e3}function h(c){return c&&typeof c=="object"&&!Array.isArray(c)?Object.assign({},c):c}function g(c,o){return Object.prototype.hasOwnProperty.call(c,o)}function s(c,o){return typeof c=="object"&&c!==null&&o in c&&typeof c[o]=="string"}}(Ln)),Ln}var Eo;function hh(){if(Eo)return lr;Eo=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.standardErrors=void 0;const e=mn(),r=zs();lr.standardErrors={rpc:{parse:f=>n(e.standardErrorCodes.rpc.parse,f),invalidRequest:f=>n(e.standardErrorCodes.rpc.invalidRequest,f),invalidParams:f=>n(e.standardErrorCodes.rpc.invalidParams,f),methodNotFound:f=>n(e.standardErrorCodes.rpc.methodNotFound,f),internal:f=>n(e.standardErrorCodes.rpc.internal,f),server:f=>{if(!f||typeof f!="object"||Array.isArray(f))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:h}=f;if(!Number.isInteger(h)||h>-32005||h<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(h,f)},invalidInput:f=>n(e.standardErrorCodes.rpc.invalidInput,f),resourceNotFound:f=>n(e.standardErrorCodes.rpc.resourceNotFound,f),resourceUnavailable:f=>n(e.standardErrorCodes.rpc.resourceUnavailable,f),transactionRejected:f=>n(e.standardErrorCodes.rpc.transactionRejected,f),methodNotSupported:f=>n(e.standardErrorCodes.rpc.methodNotSupported,f),limitExceeded:f=>n(e.standardErrorCodes.rpc.limitExceeded,f)},provider:{userRejectedRequest:f=>t(e.standardErrorCodes.provider.userRejectedRequest,f),unauthorized:f=>t(e.standardErrorCodes.provider.unauthorized,f),unsupportedMethod:f=>t(e.standardErrorCodes.provider.unsupportedMethod,f),disconnected:f=>t(e.standardErrorCodes.provider.disconnected,f),chainDisconnected:f=>t(e.standardErrorCodes.provider.chainDisconnected,f),unsupportedChain:f=>t(e.standardErrorCodes.provider.unsupportedChain,f),custom:f=>{if(!f||typeof f!="object"||Array.isArray(f))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:h,message:g,data:s}=f;if(!g||typeof g!="string")throw new Error('"message" must be a nonempty string');return new u(h,g,s)}}};function n(f,h){const[g,s]=d(h);return new i(f,g||(0,r.getMessageFromCode)(f),s)}function t(f,h){const[g,s]=d(h);return new u(f,g||(0,r.getMessageFromCode)(f),s)}function d(f){if(f){if(typeof f=="string")return[f];if(typeof f=="object"&&!Array.isArray(f)){const{message:h,data:g}=f;if(h&&typeof h!="string")throw new Error("Must specify string message.");return[h||void 0,g]}}return[]}class i extends Error{constructor(h,g,s){if(!Number.isInteger(h))throw new Error('"code" must be an integer.');if(!g||typeof g!="string")throw new Error('"message" must be a nonempty string.');super(g),this.code=h,s!==void 0&&(this.data=s)}}class u extends i{constructor(h,g,s){if(!p(h))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(h,g,s)}}function p(f){return Number.isInteger(f)&&f>=1e3&&f<=4999}return lr}var hr={},fr={},So;function Gs(){if(So)return fr;So=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.isErrorResponse=void 0;function e(r){return r.errorMessage!==void 0}return fr.isErrorResponse=e,fr}var dr={},Ro;function Js(){return Ro||(Ro=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.LIB_VERSION=void 0,dr.LIB_VERSION="3.9.3"),dr}var Co;function fh(){if(Co)return hr;Co=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.serializeError=void 0;const e=Gs(),r=Js(),n=mn(),t=zs();function d(p,f){const h=(0,t.serialize)(i(p),{shouldIncludeStack:!0}),g=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");g.searchParams.set("version",r.LIB_VERSION),g.searchParams.set("code",h.code.toString());const s=u(h.data,f);return s&&g.searchParams.set("method",s),g.searchParams.set("message",h.message),Object.assign(Object.assign({},h),{docUrl:g.href})}hr.serializeError=d;function i(p){return typeof p=="string"?{message:p,code:n.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(p)?Object.assign(Object.assign({},p),{message:p.errorMessage,code:p.errorCode,data:{method:p.method}}):p}function u(p,f){const h=p==null?void 0:p.method;if(h)return h;if(f!==void 0){if(typeof f=="string")return f;if(Array.isArray(f)){if(f.length>0)return f[0].method}else return f.method}}return hr}var Mo;function yn(){return Mo||(Mo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const r=mn();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return r.standardErrorCodes}});const n=hh();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return n.standardErrors}});const t=fh();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const d=zs();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return d.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return d.getMessageFromCode}})}(Bn)),Bn}var Ve={},ko;function wn(){if(ko)return Ve;ko=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.ProviderType=Ve.RegExpString=Ve.IntNumber=Ve.BigIntString=Ve.AddressString=Ve.HexString=Ve.OpaqueType=void 0;function e(){return t=>t}Ve.OpaqueType=e,Ve.HexString=e(),Ve.AddressString=e(),Ve.BigIntString=e();function r(t){return Math.floor(t)}Ve.IntNumber=r,Ve.RegExpString=e();var n;return function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""}(n||(Ve.ProviderType=n={})),Ve}var Io;function lt(){if(Io)return oe;Io=1;var e=oe&&oe.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(oe,"__esModule",{value:!0}),oe.isMobileWeb=oe.getLocation=oe.isInIFrame=oe.createQrUrl=oe.getFavicon=oe.range=oe.isBigNumber=oe.ensureParsedJSONObject=oe.ensureBN=oe.ensureRegExpString=oe.ensureIntNumber=oe.ensureBuffer=oe.ensureAddressString=oe.ensureEvenLengthHexString=oe.ensureHexString=oe.isHexString=oe.prepend0x=oe.strip0x=oe.has0xPrefix=oe.hexStringFromIntNumber=oe.intNumberFromHexString=oe.bigIntStringFromBN=oe.hexStringFromBuffer=oe.hexStringToUint8Array=oe.uint8ArrayToHex=oe.randomBytesHex=void 0;const r=e(gn()),n=yn(),t=wn(),d=/^[0-9]*$/,i=/^[a-f0-9]*$/;function u(C){return p(crypto.getRandomValues(new Uint8Array(C)))}oe.randomBytesHex=u;function p(C){return[...C].map(k=>k.toString(16).padStart(2,"0")).join("")}oe.uint8ArrayToHex=p;function f(C){return new Uint8Array(C.match(/.{1,2}/g).map(k=>parseInt(k,16)))}oe.hexStringToUint8Array=f;function h(C,k=!1){const x=C.toString("hex");return(0,t.HexString)(k?`0x${x}`:x)}oe.hexStringFromBuffer=h;function g(C){return(0,t.BigIntString)(C.toString(10))}oe.bigIntStringFromBN=g;function s(C){return(0,t.IntNumber)(new r.default(E(C,!1),16).toNumber())}oe.intNumberFromHexString=s;function c(C){return(0,t.HexString)(`0x${new r.default(C).toString(16)}`)}oe.hexStringFromIntNumber=c;function o(C){return C.startsWith("0x")||C.startsWith("0X")}oe.has0xPrefix=o;function m(C){return o(C)?C.slice(2):C}oe.strip0x=m;function _(C){return o(C)?`0x${C.slice(2)}`:`0x${C}`}oe.prepend0x=_;function w(C){if(typeof C!="string")return!1;const k=m(C).toLowerCase();return i.test(k)}oe.isHexString=w;function a(C,k=!1){if(typeof C=="string"){const x=m(C).toLowerCase();if(i.test(x))return(0,t.HexString)(k?`0x${x}`:x)}throw n.standardErrors.rpc.invalidParams(`"${String(C)}" is not a hexadecimal string`)}oe.ensureHexString=a;function E(C,k=!1){let x=a(C,!1);return x.length%2===1&&(x=(0,t.HexString)(`0${x}`)),k?(0,t.HexString)(`0x${x}`):x}oe.ensureEvenLengthHexString=E;function S(C){if(typeof C=="string"){const k=m(C).toLowerCase();if(w(k)&&k.length===40)return(0,t.AddressString)(_(k))}throw n.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(C)}`)}oe.ensureAddressString=S;function I(C){if(ge.isBuffer(C))return C;if(typeof C=="string"){if(w(C)){const k=E(C,!1);return ge.from(k,"hex")}return ge.from(C,"utf8")}throw n.standardErrors.rpc.invalidParams(`Not binary data: ${String(C)}`)}oe.ensureBuffer=I;function T(C){if(typeof C=="number"&&Number.isInteger(C))return(0,t.IntNumber)(C);if(typeof C=="string"){if(d.test(C))return(0,t.IntNumber)(Number(C));if(w(C))return(0,t.IntNumber)(new r.default(E(C,!1),16).toNumber())}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(C)}`)}oe.ensureIntNumber=T;function q(C){if(C instanceof RegExp)return(0,t.RegExpString)(C.toString());throw n.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(C)}`)}oe.ensureRegExpString=q;function N(C){if(C!==null&&(r.default.isBN(C)||K(C)))return new r.default(C.toString(10),10);if(typeof C=="number")return new r.default(T(C));if(typeof C=="string"){if(d.test(C))return new r.default(C,10);if(w(C))return new r.default(E(C,!1),16)}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(C)}`)}oe.ensureBN=N;function H(C){if(typeof C=="string")return JSON.parse(C);if(typeof C=="object")return C;throw n.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(C)}`)}oe.ensureParsedJSONObject=H;function K(C){if(C==null||typeof C.constructor!="function")return!1;const{constructor:k}=C;return typeof k.config=="function"&&typeof k.EUCLID=="number"}oe.isBigNumber=K;function X(C,k){return Array.from({length:k-C},(x,O)=>C+O)}oe.range=X;function re(){const C=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:k,host:x}=document.location,O=C?C.getAttribute("href"):null;return!O||O.startsWith("javascript:")||O.startsWith("vbscript:")?null:O.startsWith("http://")||O.startsWith("https://")||O.startsWith("data:")?O:O.startsWith("//")?k+O:`${k}//${x}${O}`}oe.getFavicon=re;function W(C,k,x,O,U,L){const v=O?"parent-id":"id",M=new URLSearchParams({[v]:C,secret:k,server:x,v:U,chainId:L.toString()}).toString();return`${x}/#/link?${M}`}oe.createQrUrl=W;function D(){try{return window.frameElement!==null}catch{return!1}}oe.isInIFrame=D;function l(){try{return D()&&window.top?window.top.location:window.location}catch{return window.location}}oe.getLocation=l;function b(){var C;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((C=window==null?void 0:window.navigator)===null||C===void 0?void 0:C.userAgent)}return oe.isMobileWeb=b,oe}var pr={},Ao;function dh(){if(Ao)return pr;Ao=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.ScopedLocalStorage=void 0;let e=class{constructor(n){this.scope=n}setItem(n,t){localStorage.setItem(this.scopedKey(n),t)}getItem(n){return localStorage.getItem(this.scopedKey(n))}removeItem(n){localStorage.removeItem(this.scopedKey(n))}clear(){const n=this.scopedKey(""),t=[];for(let d=0;d<localStorage.length;d++){const i=localStorage.key(d);typeof i=="string"&&i.startsWith(n)&&t.push(i)}t.forEach(d=>localStorage.removeItem(d))}scopedKey(n){return`${this.scope}:${n}`}};return pr.ScopedLocalStorage=e,pr}var Bt={},gr={},mr={},yr={},xo;function $s(){return xo||(xo=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.EVENTS=void 0,yr.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"}),yr}var et={},To;function Zs(){if(To)return et;To=1,Object.defineProperty(et,"__esModule",{value:!0}),et.RelayAbstract=et.APP_VERSION_KEY=et.LOCAL_STORAGE_ADDRESSES_KEY=et.WALLET_USER_NAME_KEY=void 0;const e=yn();et.WALLET_USER_NAME_KEY="walletUsername",et.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",et.APP_VERSION_KEY="AppVersion";let r=class{async makeEthereumJSONRPCRequest(t,d){if(!d)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(d,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(i=>i.json()).then(i=>{if(!i)throw e.standardErrors.rpc.parse({});const u=i,{error:p}=u;if(p)throw(0,e.serializeError)(p,t.method);return u})}};return et.RelayAbstract=r,et}var wr={},Nn={exports:{}},Kr={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Bo;function ht(){return Bo||(Bo=1,function(e,r){var n=Wr(),t=n.Buffer;function d(u,p){for(var f in u)p[f]=u[f]}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?e.exports=n:(d(n,r),r.Buffer=i);function i(u,p,f){return t(u,p,f)}i.prototype=Object.create(t.prototype),d(t,i),i.from=function(u,p,f){if(typeof u=="number")throw new TypeError("Argument must not be a number");return t(u,p,f)},i.alloc=function(u,p,f){if(typeof u!="number")throw new TypeError("Argument must be a number");var h=t(u);return p!==void 0?typeof f=="string"?h.fill(p,f):h.fill(p):h.fill(0),h},i.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t(u)},i.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(u)}}(Kr,Kr.exports)),Kr.exports}var On,Lo;function al(){if(Lo)return On;Lo=1;var e=sl();return On=function(n){return!!e(n)},On}var Pn,No;function ph(){if(No)return Pn;No=1;var e=Yl(),r=ol(),n=r("TypedArray.prototype.buffer",!0),t=al();return Pn=n||function(i){if(!t(i))throw new e("Not a Typed Array");return i.buffer},Pn}var Fn,Oo;function gh(){if(Oo)return Fn;Oo=1;var e=ht().Buffer,r=Xl(),n=ph(),t=ArrayBuffer.isView||function(f){try{return n(f),!0}catch{return!1}},d=typeof Uint8Array<"u",i=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u=i&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return Fn=function(f,h){if(e.isBuffer(f))return f.constructor&&!("isBuffer"in f)?e.from(f):f;if(typeof f=="string")return e.from(f,h);if(i&&t(f)){if(f.byteLength===0)return e.alloc(0);if(u){var g=e.from(f.buffer,f.byteOffset,f.byteLength);if(g.byteLength===f.byteLength)return g}var s=f instanceof Uint8Array?f:new Uint8Array(f.buffer,f.byteOffset,f.byteLength),c=e.from(s);if(c.length===f.byteLength)return c}if(d&&f instanceof Uint8Array)return e.from(f);var o=r(f);if(o)for(var m=0;m<f.length;m+=1){var _=f[m];if(typeof _!="number"||_<0||_>255||~~_!==_)throw new RangeError("Array items must be numbers in the range 0-255.")}if(o||e.isBuffer(f)&&f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f))return e.from(f);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Fn}var Dn,Po;function nr(){if(Po)return Dn;Po=1;var e=ht().Buffer,r=gh();function n(t,d){this._block=e.alloc(t),this._finalSize=d,this._blockSize=t,this._len=0}return n.prototype.update=function(t,d){t=r(t,d||"utf8");for(var i=this._block,u=this._blockSize,p=t.length,f=this._len,h=0;h<p;){for(var g=f%u,s=Math.min(p-h,u-g),c=0;c<s;c++)i[g+c]=t[h+c];f+=s,h+=s,f%u===0&&this._update(i)}return this._len+=p,this},n.prototype.digest=function(t){var d=this._len%this._blockSize;this._block[d]=128,this._block.fill(0,d+1),d>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=this._len*8;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var u=(i&4294967295)>>>0,p=(i-u)/4294967296;this._block.writeUInt32BE(p,this._blockSize-8),this._block.writeUInt32BE(u,this._blockSize-4)}this._update(this._block);var f=this._hash();return t?f.toString(t):f},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},Dn=n,Dn}var qn,Fo;function mh(){if(Fo)return qn;Fo=1;var e=Xe(),r=nr(),n=ht().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);function i(){this.init(),this._w=d,r.call(this,64,56)}e(i,r),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(h){return h<<5|h>>>27}function p(h){return h<<30|h>>>2}function f(h,g,s,c){return h===0?g&s|~g&c:h===2?g&s|g&c|s&c:g^s^c}return i.prototype._update=function(h){for(var g=this._w,s=this._a|0,c=this._b|0,o=this._c|0,m=this._d|0,_=this._e|0,w=0;w<16;++w)g[w]=h.readInt32BE(w*4);for(;w<80;++w)g[w]=g[w-3]^g[w-8]^g[w-14]^g[w-16];for(var a=0;a<80;++a){var E=~~(a/20),S=u(s)+f(E,c,o,m)+_+g[a]+t[E]|0;_=m,m=o,o=p(c),c=s,s=S}this._a=s+this._a|0,this._b=c+this._b|0,this._c=o+this._c|0,this._d=m+this._d|0,this._e=_+this._e|0},i.prototype._hash=function(){var h=n.allocUnsafe(20);return h.writeInt32BE(this._a|0,0),h.writeInt32BE(this._b|0,4),h.writeInt32BE(this._c|0,8),h.writeInt32BE(this._d|0,12),h.writeInt32BE(this._e|0,16),h},qn=i,qn}var jn,Do;function yh(){if(Do)return jn;Do=1;var e=Xe(),r=nr(),n=ht().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);function i(){this.init(),this._w=d,r.call(this,64,56)}e(i,r),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(g){return g<<1|g>>>31}function p(g){return g<<5|g>>>27}function f(g){return g<<30|g>>>2}function h(g,s,c,o){return g===0?s&c|~s&o:g===2?s&c|s&o|c&o:s^c^o}return i.prototype._update=function(g){for(var s=this._w,c=this._a|0,o=this._b|0,m=this._c|0,_=this._d|0,w=this._e|0,a=0;a<16;++a)s[a]=g.readInt32BE(a*4);for(;a<80;++a)s[a]=u(s[a-3]^s[a-8]^s[a-14]^s[a-16]);for(var E=0;E<80;++E){var S=~~(E/20),I=p(c)+h(S,o,m,_)+w+s[E]+t[S]|0;w=_,_=m,m=f(o),o=c,c=I}this._a=c+this._a|0,this._b=o+this._b|0,this._c=m+this._c|0,this._d=_+this._d|0,this._e=w+this._e|0},i.prototype._hash=function(){var g=n.allocUnsafe(20);return g.writeInt32BE(this._a|0,0),g.writeInt32BE(this._b|0,4),g.writeInt32BE(this._c|0,8),g.writeInt32BE(this._d|0,12),g.writeInt32BE(this._e|0,16),g},jn=i,jn}var Un,qo;function cl(){if(qo)return Un;qo=1;var e=Xe(),r=nr(),n=ht().Buffer,t=[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],d=new Array(64);function i(){this.init(),this._w=d,r.call(this,64,56)}e(i,r),i.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 u(c,o,m){return m^c&(o^m)}function p(c,o,m){return c&o|m&(c|o)}function f(c){return(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10)}function h(c){return(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7)}function g(c){return(c>>>7|c<<25)^(c>>>18|c<<14)^c>>>3}function s(c){return(c>>>17|c<<15)^(c>>>19|c<<13)^c>>>10}return i.prototype._update=function(c){for(var o=this._w,m=this._a|0,_=this._b|0,w=this._c|0,a=this._d|0,E=this._e|0,S=this._f|0,I=this._g|0,T=this._h|0,q=0;q<16;++q)o[q]=c.readInt32BE(q*4);for(;q<64;++q)o[q]=s(o[q-2])+o[q-7]+g(o[q-15])+o[q-16]|0;for(var N=0;N<64;++N){var H=T+h(E)+u(E,S,I)+t[N]+o[N]|0,K=f(m)+p(m,_,w)|0;T=I,I=S,S=E,E=a+H|0,a=w,w=_,_=m,m=H+K|0}this._a=m+this._a|0,this._b=_+this._b|0,this._c=w+this._c|0,this._d=a+this._d|0,this._e=E+this._e|0,this._f=S+this._f|0,this._g=I+this._g|0,this._h=T+this._h|0},i.prototype._hash=function(){var c=n.allocUnsafe(32);return c.writeInt32BE(this._a,0),c.writeInt32BE(this._b,4),c.writeInt32BE(this._c,8),c.writeInt32BE(this._d,12),c.writeInt32BE(this._e,16),c.writeInt32BE(this._f,20),c.writeInt32BE(this._g,24),c.writeInt32BE(this._h,28),c},Un=i,Un}var Hn,jo;function wh(){if(jo)return Hn;jo=1;var e=Xe(),r=cl(),n=nr(),t=ht().Buffer,d=new Array(64);function i(){this.init(),this._w=d,n.call(this,64,56)}return e(i,r),i.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},i.prototype._hash=function(){var u=t.allocUnsafe(28);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u},Hn=i,Hn}var Wn,Uo;function ul(){if(Uo)return Wn;Uo=1;var e=Xe(),r=nr(),n=ht().Buffer,t=[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],d=new Array(160);function i(){this.init(),this._w=d,r.call(this,128,112)}e(i,r),i.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 u(_,w,a){return a^_&(w^a)}function p(_,w,a){return _&w|a&(_|w)}function f(_,w){return(_>>>28|w<<4)^(w>>>2|_<<30)^(w>>>7|_<<25)}function h(_,w){return(_>>>14|w<<18)^(_>>>18|w<<14)^(w>>>9|_<<23)}function g(_,w){return(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7}function s(_,w){return(_>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)}function c(_,w){return(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6}function o(_,w){return(_>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26)}function m(_,w){return _>>>0<w>>>0?1:0}return i.prototype._update=function(_){for(var w=this._w,a=this._ah|0,E=this._bh|0,S=this._ch|0,I=this._dh|0,T=this._eh|0,q=this._fh|0,N=this._gh|0,H=this._hh|0,K=this._al|0,X=this._bl|0,re=this._cl|0,W=this._dl|0,D=this._el|0,l=this._fl|0,b=this._gl|0,C=this._hl|0,k=0;k<32;k+=2)w[k]=_.readInt32BE(k*4),w[k+1]=_.readInt32BE(k*4+4);for(;k<160;k+=2){var x=w[k-30],O=w[k-15*2+1],U=g(x,O),L=s(O,x);x=w[k-2*2],O=w[k-2*2+1];var v=c(x,O),M=o(O,x),G=w[k-7*2],J=w[k-7*2+1],j=w[k-16*2],V=w[k-16*2+1],Z=L+J|0,Y=U+G+m(Z,L)|0;Z=Z+M|0,Y=Y+v+m(Z,M)|0,Z=Z+V|0,Y=Y+j+m(Z,V)|0,w[k]=Y,w[k+1]=Z}for(var ie=0;ie<160;ie+=2){Y=w[ie],Z=w[ie+1];var B=p(a,E,S),F=p(K,X,re),te=f(a,K),ne=f(K,a),se=h(T,D),ce=h(D,T),ae=t[ie],ye=t[ie+1],ee=u(T,q,N),ve=u(D,l,b),pe=C+ce|0,we=H+se+m(pe,C)|0;pe=pe+ve|0,we=we+ee+m(pe,ve)|0,pe=pe+ye|0,we=we+ae+m(pe,ye)|0,pe=pe+Z|0,we=we+Y+m(pe,Z)|0;var fe=ne+F|0,Ee=te+B+m(fe,ne)|0;H=N,C=b,N=q,b=l,q=T,l=D,D=W+pe|0,T=I+we+m(D,W)|0,I=S,W=re,S=E,re=X,E=a,X=K,K=pe+fe|0,a=we+Ee+m(K,pe)|0}this._al=this._al+K|0,this._bl=this._bl+X|0,this._cl=this._cl+re|0,this._dl=this._dl+W|0,this._el=this._el+D|0,this._fl=this._fl+l|0,this._gl=this._gl+b|0,this._hl=this._hl+C|0,this._ah=this._ah+a+m(this._al,K)|0,this._bh=this._bh+E+m(this._bl,X)|0,this._ch=this._ch+S+m(this._cl,re)|0,this._dh=this._dh+I+m(this._dl,W)|0,this._eh=this._eh+T+m(this._el,D)|0,this._fh=this._fh+q+m(this._fl,l)|0,this._gh=this._gh+N+m(this._gl,b)|0,this._hh=this._hh+H+m(this._hl,C)|0},i.prototype._hash=function(){var _=n.allocUnsafe(64);function w(a,E,S){_.writeInt32BE(a,S),_.writeInt32BE(E,S+4)}return w(this._ah,this._al,0),w(this._bh,this._bl,8),w(this._ch,this._cl,16),w(this._dh,this._dl,24),w(this._eh,this._el,32),w(this._fh,this._fl,40),w(this._gh,this._gl,48),w(this._hh,this._hl,56),_},Wn=i,Wn}var Vn,Ho;function vh(){if(Ho)return Vn;Ho=1;var e=Xe(),r=ul(),n=nr(),t=ht().Buffer,d=new Array(160);function i(){this.init(),this._w=d,n.call(this,128,112)}return e(i,r),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 u=t.allocUnsafe(48);function p(f,h,g){u.writeInt32BE(f,g),u.writeInt32BE(h,g+4)}return p(this._ah,this._al,0),p(this._bh,this._bl,8),p(this._ch,this._cl,16),p(this._dh,this._dl,24),p(this._eh,this._el,32),p(this._fh,this._fl,40),u},Vn=i,Vn}var Wo;function bh(){return Wo||(Wo=1,function(e){e.exports=function(n){var t=n.toLowerCase(),d=e.exports[t];if(!d)throw new Error(t+" is not supported (we accept pull requests)");return new d},e.exports.sha=mh(),e.exports.sha1=yh(),e.exports.sha224=wh(),e.exports.sha256=cl(),e.exports.sha384=vh(),e.exports.sha512=ul()}(Nn)),Nn.exports}var Vo;function Ks(){if(Vo)return wr;Vo=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.Session=void 0;const e=bh(),r=lt(),n="session:id",t="session:secret",d="session:linked";let i=class ll{constructor(p,f,h,g){this._storage=p,this._id=f||(0,r.randomBytesHex)(16),this._secret=h||(0,r.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!g}static load(p){const f=p.getItem(n),h=p.getItem(d),g=p.getItem(t);return f&&g?new ll(p,f,g,h==="1"):null}static hash(p){return new e.sha256().update(p).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(p){this._linked=p,this.persistLinked()}save(){return this._storage.setItem(n,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(d,this._linked?"1":"0")}};return wr.Session=i,wr}var vr={},br={},zo;function _h(){if(zo)return br;zo=1,Object.defineProperty(br,"__esModule",{value:!0}),br.Cipher=void 0;const e=lt();let r=class{constructor(t){this.secret=t}async encrypt(t){const d=this.secret;if(d.length!==64)throw Error("secret must be 256 bits");const i=crypto.getRandomValues(new Uint8Array(12)),u=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(d),{name:"aes-gcm"},!1,["encrypt","decrypt"]),p=new TextEncoder,f=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},u,p.encode(t)),h=16,g=f.slice(f.byteLength-h),s=f.slice(0,f.byteLength-h),c=new Uint8Array(g),o=new Uint8Array(s),m=new Uint8Array([...i,...c,...o]);return(0,e.uint8ArrayToHex)(m)}async decrypt(t){const d=this.secret;if(d.length!==64)throw Error("secret must be 256 bits");return new Promise((i,u)=>{(async function(){const p=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(d),{name:"aes-gcm"},!1,["encrypt","decrypt"]),f=(0,e.hexStringToUint8Array)(t),h=f.slice(0,12),g=f.slice(12,28),s=f.slice(28),c=new Uint8Array([...s,...g]),o={name:"AES-GCM",iv:new Uint8Array(h)};try{const m=await window.crypto.subtle.decrypt(o,p,c),_=new TextDecoder;i(_.decode(m))}catch(m){u(m)}})()})}};return br.Cipher=r,br}var _r={},Go;function Eh(){if(Go)return _r;Go=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.WalletLinkHTTP=void 0;let e=class{constructor(n,t,d){this.linkAPIUrl=n,this.sessionId=t;const i=`${t}:${d}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(n){return Promise.all(n.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var n;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:d,error:i}=await t.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const u=(n=d==null?void 0:d.filter(p=>p.event==="Web3Response").map(p=>({type:"Event",sessionId:this.sessionId,eventId:p.id,event:p.event,data:p.data})))!==null&&n!==void 0?n:[];return this.markUnseenEventsAsSeen(u),u}throw new Error(`Check unseen events failed: ${t.status}`)}};return _r.WalletLinkHTTP=e,_r}var Lt={},Jo;function Sh(){if(Jo)return Lt;Jo=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.WalletLinkWebSocket=Lt.ConnectionState=void 0;var e;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED"})(e||(Lt.ConnectionState=e={}));let r=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,d=WebSocket){this.WebSocketClass=d,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,d)=>{var i;let u;try{this.webSocket=u=new this.WebSocketClass(this.url)}catch(p){d(p);return}(i=this.connectionStateListener)===null||i===void 0||i.call(this,e.CONNECTING),u.onclose=p=>{var f;this.clearWebSocket(),d(new Error(`websocket error ${p.code}: ${p.reason}`)),(f=this.connectionStateListener)===null||f===void 0||f.call(this,e.DISCONNECTED)},u.onopen=p=>{var f;t(),(f=this.connectionStateListener)===null||f===void 0||f.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(g=>this.sendData(g)),this.pendingData=[])},u.onmessage=p=>{var f,h;if(p.data==="h")(f=this.incomingDataListener)===null||f===void 0||f.call(this,{type:"Heartbeat"});else try{const g=JSON.parse(p.data);(h=this.incomingDataListener)===null||h===void 0||h.call(this,g)}catch{}}})}disconnect(){var t;const{webSocket:d}=this;if(d){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{d.close()}catch{}}}sendData(t){const{webSocket:d}=this;if(!d){this.pendingData.push(t),this.connect();return}d.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return Lt.WalletLinkWebSocket=r,Lt}var $o;function Rh(){if($o)return vr;$o=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.WalletLinkConnection=void 0;const e=wn(),r=_h(),n=$s(),t=Zs(),d=Ks(),i=Eh(),u=Sh(),p=1e4,f=6e4;let h=class{constructor({session:s,linkAPIUrl:c,listener:o,diagnostic:m,WebSocketClass:_=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",S=>a.JsonRpcUrl&&this.handleChainUpdated(S,a.JsonRpcUrl)]]).forEach((S,I)=>{const T=a[I];T!==void 0&&S(T)})},this.handleDestroyed=a=>{var E,S;a==="1"&&((E=this.listener)===null||E===void 0||E.resetAndReload(),(S=this.diagnostic)===null||S===void 0||S.log(n.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:d.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var E,S;try{const I=await this.cipher.decrypt(a);(E=this.listener)===null||E===void 0||E.accountUpdated(I)}catch{(S=this.diagnostic)===null||S===void 0||S.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,E)=>{var S,I;try{const T=await this.cipher.decrypt(E);(S=this.listener)===null||S===void 0||S.metadataUpdated(a,T)}catch{(I=this.diagnostic)===null||I===void 0||I.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,E)=>{var S,I;try{const T=await this.cipher.decrypt(a),q=await this.cipher.decrypt(E);(S=this.listener)===null||S===void 0||S.chainUpdated(T,q)}catch{(I=this.diagnostic)===null||I===void 0||I.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=s,this.cipher=new r.Cipher(s.secret),this.diagnostic=m,this.listener=o;const w=new u.WalletLinkWebSocket(`${c}/rpc`,_);w.setConnectionStateListener(async a=>{var E;(E=this.diagnostic)===null||E===void 0||E.log(n.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:d.Session.hash(s.id)});let S=!1;switch(a){case u.ConnectionState.DISCONNECTED:if(!this.destroyed){const I=async()=>{await new Promise(T=>setTimeout(T,5e3)),this.destroyed||w.connect().catch(()=>{I()})};I()}break;case u.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),S=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},p),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case u.ConnectionState.CONNECTING:break}this.connected!==S&&(this.connected=S)}),w.setIncomingDataListener(a=>{var E,S,I;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const T=a.type==="IsLinkedOK"?a.linked:void 0;(E=this.diagnostic)===null||E===void 0||E.log(n.EVENTS.LINKED,{sessionIdHash:d.Session.hash(s.id),linked:T,type:a.type,onlineGuests:a.onlineGuests}),this.linked=T||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(S=this.diagnostic)===null||S===void 0||S.log(n.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:d.Session.hash(s.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((I=this.requestResolutions.get(a.id))===null||I===void 0||I(a))}),this.ws=w,this.http=new i.WalletLinkHTTP(c,s.id,s.key)}connect(){var s;if(this.destroyed)throw new Error("instance is destroyed");(s=this.diagnostic)===null||s===void 0||s.log(n.EVENTS.STARTED_CONNECTING,{sessionIdHash:d.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var s;this.destroyed=!0,this.ws.disconnect(),(s=this.diagnostic)===null||s===void 0||s.log(n.EVENTS.DISCONNECTED,{sessionIdHash:d.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(s){var c,o;this._connected=s,s&&((c=this.onceConnected)===null||c===void 0||c.call(this)),(o=this.listener)===null||o===void 0||o.connectedUpdated(s)}setOnceConnected(s){return new Promise(c=>{this.connected?s().then(c):this.onceConnected=()=>{s().then(c),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(s){var c,o;this._linked=s,s&&((c=this.onceLinked)===null||c===void 0||c.call(this)),(o=this.listener)===null||o===void 0||o.linkedUpdated(s)}setOnceLinked(s){return new Promise(c=>{this.linked?s().then(c):this.onceLinked=()=>{s().then(c),this.onceLinked=void 0}})}async handleIncomingEvent(s){var c,o;if(!(s.type!=="Event"||s.event!=="Web3Response"))try{const m=await this.cipher.decrypt(s.data),_=JSON.parse(m);if(_.type!=="WEB3_RESPONSE")return;(c=this.listener)===null||c===void 0||c.handleWeb3ResponseMessage(_)}catch{(o=this.diagnostic)===null||o===void 0||o.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(s=>setTimeout(s,250));try{await this.fetchUnseenEventsAPI()}catch(s){console.error("Unable to check for unseen events",s)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(c=>this.handleIncomingEvent(c))}async setSessionMetadata(s,c){const o={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[s]:c}};return this.setOnceConnected(async()=>{const m=await this.makeRequest(o);if(m.type==="Fail")throw new Error(m.error||"failed to set session metadata")})}async publishEvent(s,c,o=!1){const m=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},c),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),_={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:s,data:m,callWebhook:o};return this.setOnceLinked(async()=>{const w=await this.makeRequest(_);if(w.type==="Fail")throw new Error(w.error||"failed to publish event");return w.eventId})}sendData(s){this.ws.sendData(JSON.stringify(s))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>p*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(s,c=f){const o=s.id;this.sendData(s);let m;return Promise.race([new Promise((_,w)=>{m=window.setTimeout(()=>{w(new Error(`request ${o} timed out`))},c)}),new Promise(_=>{this.requestResolutions.set(o,w=>{clearTimeout(m),_(w),this.requestResolutions.delete(o)})})])}async authenticate(){const s={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},c=await this.makeRequest(s);if(c.type==="Fail")throw new Error(c.error||"failed to authentcate")}sendIsLinked(){const s={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}sendGetSessionConfig(){const s={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}};return vr.WalletLinkConnection=h,vr}var Er={},Nt={},Qr={},Zo;function Ch(){return Zo||(Zo=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.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}'),Qr}var Ko;function hl(){if(Ko)return Nt;Ko=1;var e=Nt&&Nt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.injectCssReset=void 0;const r=e(Ch());function n(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(r.default)),document.documentElement.appendChild(t)}return Nt.injectCssReset=n,Nt}var Sr={};const $e=dn(ih);var Ot={};const Vr=dn(sh),vn=dn(oh);var ct={},Rr={},Qo;function Mh(){if(Qo)return Rr;Qo=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.CloseIcon=void 0;const e=$e;function r(n){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.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"}))}return Rr.CloseIcon=r,Rr}var Cr={},Yo;function kh(){if(Yo)return Cr;Yo=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.CoinbaseWalletRound=void 0;const e=$e;function r(n){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.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,e.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"}))}return Cr.CoinbaseWalletRound=r,Cr}var Mr={},Xo;function Ih(){if(Xo)return Mr;Xo=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.QRCodeIcon=void 0;const e=$e;function r(n){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return Mr.QRCodeIcon=r,Mr}var Pt={},zn,ea;function Ah(){if(ea)return zn;ea=1;function e(o){this.mode=n.MODE_8BIT_BYTE,this.data=o,this.parsedData=[];for(var m=0,_=this.data.length;m<_;m++){var w=[],a=this.data.charCodeAt(m);a>65536?(w[0]=240|(a&1835008)>>>18,w[1]=128|(a&258048)>>>12,w[2]=128|(a&4032)>>>6,w[3]=128|a&63):a>2048?(w[0]=224|(a&61440)>>>12,w[1]=128|(a&4032)>>>6,w[2]=128|a&63):a>128?(w[0]=192|(a&1984)>>>6,w[1]=128|a&63):w[0]=a,this.parsedData.push(w)}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))}e.prototype={getLength:function(o){return this.parsedData.length},write:function(o){for(var m=0,_=this.parsedData.length;m<_;m++)o.put(this.parsedData[m],8)}};function r(o,m){this.typeNumber=o,this.errorCorrectLevel=m,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}r.prototype={addData:function(o){var m=new e(o);this.dataList.push(m),this.dataCache=null},isDark:function(o,m){if(o<0||this.moduleCount<=o||m<0||this.moduleCount<=m)throw new Error(o+","+m);return this.modules[o][m]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(o,m){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var _=0;_<this.moduleCount;_++){this.modules[_]=new Array(this.moduleCount);for(var w=0;w<this.moduleCount;w++)this.modules[_][w]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(o,m),this.typeNumber>=7&&this.setupTypeNumber(o),this.dataCache==null&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,m)},setupPositionProbePattern:function(o,m){for(var _=-1;_<=7;_++)if(!(o+_<=-1||this.moduleCount<=o+_))for(var w=-1;w<=7;w++)m+w<=-1||this.moduleCount<=m+w||(0<=_&&_<=6&&(w==0||w==6)||0<=w&&w<=6&&(_==0||_==6)||2<=_&&_<=4&&2<=w&&w<=4?this.modules[o+_][m+w]=!0:this.modules[o+_][m+w]=!1)},getBestMaskPattern:function(){for(var o=0,m=0,_=0;_<8;_++){this.makeImpl(!0,_);var w=i.getLostPoint(this);(_==0||o>w)&&(o=w,m=_)}return m},createMovieClip:function(o,m,_){var w=o.createEmptyMovieClip(m,_),a=1;this.make();for(var E=0;E<this.modules.length;E++)for(var S=E*a,I=0;I<this.modules[E].length;I++){var T=I*a,q=this.modules[E][I];q&&(w.beginFill(0,100),w.moveTo(T,S),w.lineTo(T+a,S),w.lineTo(T+a,S+a),w.lineTo(T,S+a),w.endFill())}return w},setupTimingPattern:function(){for(var o=8;o<this.moduleCount-8;o++)this.modules[o][6]==null&&(this.modules[o][6]=o%2==0);for(var m=8;m<this.moduleCount-8;m++)this.modules[6][m]==null&&(this.modules[6][m]=m%2==0)},setupPositionAdjustPattern:function(){for(var o=i.getPatternPosition(this.typeNumber),m=0;m<o.length;m++)for(var _=0;_<o.length;_++){var w=o[m],a=o[_];if(this.modules[w][a]==null)for(var E=-2;E<=2;E++)for(var S=-2;S<=2;S++)E==-2||E==2||S==-2||S==2||E==0&&S==0?this.modules[w+E][a+S]=!0:this.modules[w+E][a+S]=!1}},setupTypeNumber:function(o){for(var m=i.getBCHTypeNumber(this.typeNumber),_=0;_<18;_++){var w=!o&&(m>>_&1)==1;this.modules[Math.floor(_/3)][_%3+this.moduleCount-8-3]=w}for(var _=0;_<18;_++){var w=!o&&(m>>_&1)==1;this.modules[_%3+this.moduleCount-8-3][Math.floor(_/3)]=w}},setupTypeInfo:function(o,m){for(var _=this.errorCorrectLevel<<3|m,w=i.getBCHTypeInfo(_),a=0;a<15;a++){var E=!o&&(w>>a&1)==1;a<6?this.modules[a][8]=E:a<8?this.modules[a+1][8]=E:this.modules[this.moduleCount-15+a][8]=E}for(var a=0;a<15;a++){var E=!o&&(w>>a&1)==1;a<8?this.modules[8][this.moduleCount-a-1]=E:a<9?this.modules[8][15-a-1+1]=E:this.modules[8][15-a-1]=E}this.modules[this.moduleCount-8][8]=!o},mapData:function(o,m){for(var _=-1,w=this.moduleCount-1,a=7,E=0,S=this.moduleCount-1;S>0;S-=2)for(S==6&&S--;;){for(var I=0;I<2;I++)if(this.modules[w][S-I]==null){var T=!1;E<o.length&&(T=(o[E]>>>a&1)==1);var q=i.getMask(m,w,S-I);q&&(T=!T),this.modules[w][S-I]=T,a--,a==-1&&(E++,a=7)}if(w+=_,w<0||this.moduleCount<=w){w-=_,_=-_;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(o,m,_){for(var w=h.getRSBlocks(o,m),a=new g,E=0;E<_.length;E++){var S=_[E];a.put(S.mode,4),a.put(S.getLength(),i.getLengthInBits(S.mode,o)),S.write(a)}for(var I=0,E=0;E<w.length;E++)I+=w[E].dataCount;if(a.getLengthInBits()>I*8)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+I*8+")");for(a.getLengthInBits()+4<=I*8&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=I*8||(a.put(r.PAD0,8),a.getLengthInBits()>=I*8));)a.put(r.PAD1,8);return r.createBytes(a,w)},r.createBytes=function(o,m){for(var _=0,w=0,a=0,E=new Array(m.length),S=new Array(m.length),I=0;I<m.length;I++){var T=m[I].dataCount,q=m[I].totalCount-T;w=Math.max(w,T),a=Math.max(a,q),E[I]=new Array(T);for(var N=0;N<E[I].length;N++)E[I][N]=255&o.buffer[N+_];_+=T;var H=i.getErrorCorrectPolynomial(q),K=new f(E[I],H.getLength()-1),X=K.mod(H);S[I]=new Array(H.getLength()-1);for(var N=0;N<S[I].length;N++){var re=N+X.getLength()-S[I].length;S[I][N]=re>=0?X.get(re):0}}for(var W=0,N=0;N<m.length;N++)W+=m[N].totalCount;for(var D=new Array(W),l=0,N=0;N<w;N++)for(var I=0;I<m.length;I++)N<E[I].length&&(D[l++]=E[I][N]);for(var N=0;N<a;N++)for(var I=0;I<m.length;I++)N<S[I].length&&(D[l++]=S[I][N]);return D};for(var n={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},d={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i={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(o){for(var m=o<<10;i.getBCHDigit(m)-i.getBCHDigit(i.G15)>=0;)m^=i.G15<<i.getBCHDigit(m)-i.getBCHDigit(i.G15);return(o<<10|m)^i.G15_MASK},getBCHTypeNumber:function(o){for(var m=o<<12;i.getBCHDigit(m)-i.getBCHDigit(i.G18)>=0;)m^=i.G18<<i.getBCHDigit(m)-i.getBCHDigit(i.G18);return o<<12|m},getBCHDigit:function(o){for(var m=0;o!=0;)m++,o>>>=1;return m},getPatternPosition:function(o){return i.PATTERN_POSITION_TABLE[o-1]},getMask:function(o,m,_){switch(o){case d.PATTERN000:return(m+_)%2==0;case d.PATTERN001:return m%2==0;case d.PATTERN010:return _%3==0;case d.PATTERN011:return(m+_)%3==0;case d.PATTERN100:return(Math.floor(m/2)+Math.floor(_/3))%2==0;case d.PATTERN101:return m*_%2+m*_%3==0;case d.PATTERN110:return(m*_%2+m*_%3)%2==0;case d.PATTERN111:return(m*_%3+(m+_)%2)%2==0;default:throw new Error("bad maskPattern:"+o)}},getErrorCorrectPolynomial:function(o){for(var m=new f([1],0),_=0;_<o;_++)m=m.multiply(new f([1,u.gexp(_)],0));return m},getLengthInBits:function(o,m){if(1<=m&&m<10)switch(o){case n.MODE_NUMBER:return 10;case n.MODE_ALPHA_NUM:return 9;case n.MODE_8BIT_BYTE:return 8;case n.MODE_KANJI:return 8;default:throw new Error("mode:"+o)}else if(m<27)switch(o){case n.MODE_NUMBER:return 12;case n.MODE_ALPHA_NUM:return 11;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 10;default:throw new Error("mode:"+o)}else if(m<41)switch(o){case n.MODE_NUMBER:return 14;case n.MODE_ALPHA_NUM:return 13;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 12;default:throw new Error("mode:"+o)}else throw new Error("type:"+m)},getLostPoint:function(o){for(var m=o.getModuleCount(),_=0,w=0;w<m;w++)for(var a=0;a<m;a++){for(var E=0,S=o.isDark(w,a),I=-1;I<=1;I++)if(!(w+I<0||m<=w+I))for(var T=-1;T<=1;T++)a+T<0||m<=a+T||I==0&&T==0||S==o.isDark(w+I,a+T)&&E++;E>5&&(_+=3+E-5)}for(var w=0;w<m-1;w++)for(var a=0;a<m-1;a++){var q=0;o.isDark(w,a)&&q++,o.isDark(w+1,a)&&q++,o.isDark(w,a+1)&&q++,o.isDark(w+1,a+1)&&q++,(q==0||q==4)&&(_+=3)}for(var w=0;w<m;w++)for(var a=0;a<m-6;a++)o.isDark(w,a)&&!o.isDark(w,a+1)&&o.isDark(w,a+2)&&o.isDark(w,a+3)&&o.isDark(w,a+4)&&!o.isDark(w,a+5)&&o.isDark(w,a+6)&&(_+=40);for(var a=0;a<m;a++)for(var w=0;w<m-6;w++)o.isDark(w,a)&&!o.isDark(w+1,a)&&o.isDark(w+2,a)&&o.isDark(w+3,a)&&o.isDark(w+4,a)&&!o.isDark(w+5,a)&&o.isDark(w+6,a)&&(_+=40);for(var N=0,a=0;a<m;a++)for(var w=0;w<m;w++)o.isDark(w,a)&&N++;var H=Math.abs(100*N/m/m-50)/5;return _+=H*10,_}},u={glog:function(o){if(o<1)throw new Error("glog("+o+")");return u.LOG_TABLE[o]},gexp:function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return u.EXP_TABLE[o]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},p=0;p<8;p++)u.EXP_TABLE[p]=1<<p;for(var p=8;p<256;p++)u.EXP_TABLE[p]=u.EXP_TABLE[p-4]^u.EXP_TABLE[p-5]^u.EXP_TABLE[p-6]^u.EXP_TABLE[p-8];for(var p=0;p<255;p++)u.LOG_TABLE[u.EXP_TABLE[p]]=p;function f(o,m){if(o.length==null)throw new Error(o.length+"/"+m);for(var _=0;_<o.length&&o[_]==0;)_++;this.num=new Array(o.length-_+m);for(var w=0;w<o.length-_;w++)this.num[w]=o[w+_]}f.prototype={get:function(o){return this.num[o]},getLength:function(){return this.num.length},multiply:function(o){for(var m=new Array(this.getLength()+o.getLength()-1),_=0;_<this.getLength();_++)for(var w=0;w<o.getLength();w++)m[_+w]^=u.gexp(u.glog(this.get(_))+u.glog(o.get(w)));return new f(m,0)},mod:function(o){if(this.getLength()-o.getLength()<0)return this;for(var m=u.glog(this.get(0))-u.glog(o.get(0)),_=new Array(this.getLength()),w=0;w<this.getLength();w++)_[w]=this.get(w);for(var w=0;w<o.getLength();w++)_[w]^=u.gexp(u.glog(o.get(w))+m);return new f(_,0).mod(o)}};function h(o,m){this.totalCount=o,this.dataCount=m}h.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]],h.getRSBlocks=function(o,m){var _=h.getRsBlockTable(o,m);if(_==null)throw new Error("bad rs block @ typeNumber:"+o+"/errorCorrectLevel:"+m);for(var w=_.length/3,a=[],E=0;E<w;E++)for(var S=_[E*3+0],I=_[E*3+1],T=_[E*3+2],q=0;q<S;q++)a.push(new h(I,T));return a},h.getRsBlockTable=function(o,m){switch(m){case t.L:return h.RS_BLOCK_TABLE[(o-1)*4+0];case t.M:return h.RS_BLOCK_TABLE[(o-1)*4+1];case t.Q:return h.RS_BLOCK_TABLE[(o-1)*4+2];case t.H:return h.RS_BLOCK_TABLE[(o-1)*4+3];default:return}};function g(){this.buffer=[],this.length=0}g.prototype={get:function(o){var m=Math.floor(o/8);return(this.buffer[m]>>>7-o%8&1)==1},put:function(o,m){for(var _=0;_<m;_++)this.putBit((o>>>m-_-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(o){var m=Math.floor(this.length/8);this.buffer.length<=m&&this.buffer.push(0),o&&(this.buffer[m]|=128>>>this.length%8),this.length++}};var s=[[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 c(o){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof o=="string"&&(o={content:o}),o)for(var m in o)this.options[m]=o[m];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 _(T){switch(T){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Error("Unknwon error correction level: "+T)}}function w(T,q){for(var N=a(T),H=1,K=0,X=0,re=s.length;X<=re;X++){var W=s[X];if(!W)throw new Error("Content too long: expected "+K+" but got "+N);switch(q){case"L":K=W[0];break;case"M":K=W[1];break;case"Q":K=W[2];break;case"H":K=W[3];break;default:throw new Error("Unknwon error correction level: "+q)}if(N<=K)break;H++}if(H>s.length)throw new Error("Content too long");return H}function a(T){var q=encodeURI(T).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return q.length+(q.length!=T?3:0)}var E=this.options.content,S=w(E,this.options.ecl),I=_(this.options.ecl);this.qrcode=new r(S,I),this.qrcode.addData(E),this.qrcode.make()}return c.prototype.svg=function(o){var m=this.options||{},_=this.qrcode.modules;typeof o>"u"&&(o={container:m.container||"svg"});for(var w=typeof m.pretty<"u"?!!m.pretty:!0,a=w?" ":"",E=w?`\r
|
|
7
|
-
`:"",S=m.width,I=m.height,T=_.length,q=S/(T+2*m.padding),N=I/(T+2*m.padding),H=typeof m.join<"u"?!!m.join:!1,K=typeof m.swap<"u"?!!m.swap:!1,X=typeof m.xmlDeclaration<"u"?!!m.xmlDeclaration:!0,re=typeof m.predefined<"u"?!!m.predefined:!1,W=re?a+'<defs><path id="qrmodule" d="M0 0 h'+N+" v"+q+' H0 z" style="fill:'+m.color+';shape-rendering:crispEdges;" /></defs>'+E:"",D=a+'<rect x="0" y="0" width="'+S+'" height="'+I+'" style="fill:'+m.background+';shape-rendering:crispEdges;"/>'+E,l="",b="",C=0;C<T;C++)for(var k=0;k<T;k++){var x=_[k][C];if(x){var O=k*q+m.padding*q,U=C*N+m.padding*N;if(K){var L=O;O=U,U=L}if(H){var v=q+O,M=N+U;O=Number.isInteger(O)?Number(O):O.toFixed(2),U=Number.isInteger(U)?Number(U):U.toFixed(2),v=Number.isInteger(v)?Number(v):v.toFixed(2),M=Number.isInteger(M)?Number(M):M.toFixed(2),b+="M"+O+","+U+" V"+M+" H"+v+" V"+U+" H"+O+" Z "}else re?l+=a+'<use x="'+O.toString()+'" y="'+U.toString()+'" href="#qrmodule" />'+E:l+=a+'<rect x="'+O.toString()+'" y="'+U.toString()+'" width="'+q+'" height="'+N+'" style="fill:'+m.color+';shape-rendering:crispEdges;"/>'+E}}H&&(l=a+'<path x="0" y="0" style="fill:'+m.color+';shape-rendering:crispEdges;" d="'+b+'" />');let G="";if(this.options.image!==void 0&&this.options.image.svg){const j=S*this.options.image.width/100,V=I*this.options.image.height/100,Z=S/2-j/2,Y=I/2-V/2;G+=`<svg x="${Z}" y="${Y}" width="${j}" height="${V}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,G+=this.options.image.svg+E,G+="</svg>"}var J="";switch(o.container){case"svg":X&&(J+='<?xml version="1.0" standalone="yes"?>'+E),J+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+S+'" height="'+I+'">'+E,J+=W+D+l,J+=G,J+="</svg>";break;case"svg-viewbox":X&&(J+='<?xml version="1.0" standalone="yes"?>'+E),J+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+S+" "+I+'">'+E,J+=W+D+l,J+=G,J+="</svg>";break;case"g":J+='<g width="'+S+'" height="'+I+'">'+E,J+=W+D+l,J+=G,J+="</g>";break;default:J+=(W+D+l+G).replace(/^\s+/,"");break}return J},zn=c,zn}var ta;function xh(){if(ta)return Pt;ta=1;var e=Pt&&Pt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.QRCode=void 0;const r=$e,n=vn,t=e(Ah()),d=i=>{const[u,p]=(0,n.useState)("");return(0,n.useEffect)(()=>{var f,h;const g=new t.default({content:i.content,background:i.bgColor||"#ffffff",color:i.fgColor||"#000000",container:"svg",ecl:"M",width:(f=i.width)!==null&&f!==void 0?f:256,height:(h=i.height)!==null&&h!==void 0?h:256,padding:0,image:i.image}),s=ge.from(g.svg(),"utf8").toString("base64");p(`data:image/svg+xml;base64,${s}`)},[i.bgColor,i.content,i.fgColor,i.height,i.image,i.width]),u?(0,r.h)("img",{src:u,alt:"QR Code"}):null};return Pt.QRCode=d,Pt}var Ft={},Yr={},ra;function Th(){return ra||(ra=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.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)}}"),Yr}var na;function Bh(){if(na)return Ft;na=1;var e=Ft&&Ft.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Spinner=void 0;const r=$e,n=e(Th()),t=d=>{var i;const u=(i=d.size)!==null&&i!==void 0?i:64,p=d.color||"#000";return(0,r.h)("div",{class:"-cbwsdk-spinner"},(0,r.h)("style",null,n.default),(0,r.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:u,height:u}},(0,r.h)("circle",{style:{cx:50,cy:50,r:45,stroke:p}})))};return Ft.Spinner=t,Ft}var Xr={},ia;function Lh(){return ia||(ia=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.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}"),Xr}var sa;function Nh(){if(sa)return ct;sa=1;var e=ct&&ct.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(ct,"__esModule",{value:!0}),ct.CoinbaseWalletSteps=ct.ConnectContent=void 0;const r=e(Vr),n=$e,t=lt(),d=Js(),i=Mh(),u=kh(),p=Ih(),f=xh(),h=Bh(),g=e(Lh()),s={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:_},c=w=>w==="light"?"#FFFFFF":"#0A0B0D";function o(w){const{theme:a}=w,E=(0,t.createQrUrl)(w.sessionId,w.sessionSecret,w.linkAPIUrl,w.isParentConnection,w.version,w.chainId),S=s.steps;return(0,n.h)("div",{"data-testid":"connect-content",className:(0,r.default)("-cbwsdk-connect-content",a)},(0,n.h)("style",null,g.default),(0,n.h)("div",{className:"-cbwsdk-connect-content-header"},(0,n.h)("h2",{className:(0,r.default)("-cbwsdk-connect-content-heading",a)},"Scan to connect with our mobile app"),w.onCancel&&(0,n.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:w.onCancel},(0,n.h)(i.CloseIcon,{fill:a==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,n.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,n.h)(m,{title:s.title,description:s.description,theme:a})),(0,n.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,n.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,n.h)(f.QRCode,{content:E,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,n.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:d.LIB_VERSION}),(0,n.h)("input",{type:"hidden",value:E})),(0,n.h)(S,{theme:a}),!w.isConnected&&(0,n.h)("div",{"data-testid":"connecting-spinner",className:(0,r.default)("-cbwsdk-connect-content-qr-connecting",a)},(0,n.h)(h.Spinner,{size:36,color:a==="dark"?"#FFF":"#000"}),(0,n.h)("p",null,"Connecting...")))))}ct.ConnectContent=o;function m({title:w,description:a,theme:E}){return(0,n.h)("div",{className:(0,r.default)("-cbwsdk-connect-item",E)},(0,n.h)("div",null,(0,n.h)(u.CoinbaseWalletRound,null)),(0,n.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,n.h)("h3",{className:"-cbwsdk-connect-item-title"},w),(0,n.h)("p",{className:"-cbwsdk-connect-item-description"},a)))}function _({theme:w}){return(0,n.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,n.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",w)},(0,n.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,n.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",w)},(0,n.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,n.h)("span",null,"Tap ",(0,n.h)("strong",null,"Scan")," "),(0,n.h)("span",{className:(0,r.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",w)},(0,n.h)(p.QRCodeIcon,{fill:c(w)})))))}return ct.CoinbaseWalletSteps=_,ct}var Dt={},kr={},oa;function Oh(){if(oa)return kr;oa=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.ArrowLeftIcon=void 0;const e=$e;function r(n){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.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"}))}return kr.ArrowLeftIcon=r,kr}var Ir={},aa;function Ph(){if(aa)return Ir;aa=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.LaptopIcon=void 0;const e=$e;function r(n){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,e.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"}))}return Ir.LaptopIcon=r,Ir}var Ar={},ca;function Fh(){if(ca)return Ar;ca=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.SafeIcon=void 0;const e=$e;function r(n){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},n),(0,e.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"}))}return Ar.SafeIcon=r,Ar}var en={},ua;function Dh(){return ua||(ua=1,Object.defineProperty(en,"__esModule",{value:!0}),en.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}"),en}var la;function qh(){if(la)return Dt;la=1;var e=Dt&&Dt.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.TryExtensionContent=void 0;const r=e(Vr),n=$e,t=vn,d=Oh(),i=Ph(),u=Fh(),p=e(Dh());function f({theme:h}){const[g,s]=(0,t.useState)(!1),c=(0,t.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),o=(0,t.useCallback)(()=>{g?window.location.reload():(c(),s(!0))},[c,g]);return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension",h)},(0,n.h)("style",null,p.default),(0,n.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,n.h)("h3",{class:(0,r.default)("-cbwsdk-try-extension-heading",h)},"Or try the Coinbase Wallet browser extension"),(0,n.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,n.h)("button",{class:(0,r.default)("-cbwsdk-try-extension-cta",h),onClick:o},g?"Refresh":"Install"),(0,n.h)("div",null,!g&&(0,n.h)(d.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:h==="light"?"#0052FF":"#588AF5"})))),(0,n.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,n.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,n.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,n.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,n.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",h)},(0,n.h)(i.LaptopIcon,{fill:h==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",h)},"Connect with dapps with just one click on your desktop browser")),(0,n.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,n.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,n.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",h)},(0,n.h)(u.SafeIcon,{fill:h==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",h)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}return Dt.TryExtensionContent=f,Dt}var tn={},ha;function jh(){return ha||(ha=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.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}"),tn}var fa;function Uh(){if(fa)return Ot;fa=1;var e=Ot&&Ot.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.ConnectDialog=void 0;const r=e(Vr),n=$e,t=vn,d=Nh(),i=qh(),u=e(jh()),p=f=>{const{isOpen:h,darkMode:g}=f,[s,c]=(0,t.useState)(!h),[o,m]=(0,t.useState)(!h);(0,t.useEffect)(()=>{const w=[window.setTimeout(()=>{m(!h)},10)];return h?c(!1):w.push(window.setTimeout(()=>{c(!0)},360)),()=>{w.forEach(window.clearTimeout)}},[h]);const _=g?"dark":"light";return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-container",s&&"-cbwsdk-connect-dialog-container-hidden")},(0,n.h)("style",null,u.default),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-backdrop",_,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,n.h)("div",{class:"-cbwsdk-connect-dialog"},(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},f.connectDisabled?null:(0,n.h)(d.ConnectContent,{theme:_,version:f.version,sessionId:f.sessionId,sessionSecret:f.sessionSecret,linkAPIUrl:f.linkAPIUrl,isConnected:f.isConnected,isParentConnection:f.isParentConnection,chainId:f.chainId,onCancel:f.onCancel}),(0,n.h)(i.TryExtensionContent,{theme:_}))))};return Ot.ConnectDialog=p,Ot}var da;function Hh(){if(da)return Sr;da=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.LinkFlow=void 0;const e=$e,r=Uh();let n=class{constructor(d){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=d.darkMode,this.version=d.version,this.sessionId=d.sessionId,this.sessionSecret=d.sessionSecret,this.linkAPIUrl=d.linkAPIUrl,this.isParentConnection=d.isParentConnection}attach(d){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",d.appendChild(this.root),this.render()}setConnected(d){this.connected!==d&&(this.connected=d,this.render())}setChainId(d){this.chainId!==d&&(this.chainId=d,this.render())}detach(){var d;this.root&&((0,e.render)(null,this.root),(d=this.root.parentElement)===null||d===void 0||d.removeChild(this.root))}setConnectDisabled(d){this.connectDisabled=d}open(d){this.isOpen=!0,this.onCancel=d.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(r.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)}};return Sr.LinkFlow=n,Sr}var xr={},rn={},pa;function Wh(){return pa||(pa=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.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}"),rn}var ga;function fl(){return ga||(ga=1,function(e){var r=xr&&xr.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const n=r(Vr),t=$e,d=vn,i=r(Wh()),u="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",p="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class f{constructor(c){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=c.darkMode}attach(c){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",c.appendChild(this.root),this.render()}presentItem(c){const o=this.nextItemKey++;return this.items.set(o,c),this.render(),()=>{this.items.delete(o),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,t.render)((0,t.h)("div",null,(0,t.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([c,o])=>(0,t.h)(e.SnackbarInstance,Object.assign({},o,{key:c}))))),this.root)}}e.Snackbar=f;const h=s=>(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,t.h)("style",null,i.default),(0,t.h)("div",{class:"-cbwsdk-snackbar"},s.children));e.SnackbarContainer=h;const g=({autoExpand:s,message:c,menuItems:o})=>{const[m,_]=(0,d.useState)(!0),[w,a]=(0,d.useState)(s??!1);(0,d.useEffect)(()=>{const S=[window.setTimeout(()=>{_(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{S.forEach(window.clearTimeout)}});const E=()=>{a(!w)};return(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",m&&"-cbwsdk-snackbar-instance-hidden",w&&"-cbwsdk-snackbar-instance-expanded")},(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:E},(0,t.h)("img",{src:u,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},c),(0,t.h)("div",{class:"-gear-container"},!w&&(0,t.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,t.h)("img",{src:p,class:"-gear-icon",title:"Expand"}))),o&&o.length>0&&(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},o.map((S,I)=>(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:S.onClick,key:I},(0,t.h)("svg",{width:S.svgWidth,height:S.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("path",{"fill-rule":S.defaultFillRule,"clip-rule":S.defaultClipRule,d:S.path,fill:"#AAAAAA"})),(0,t.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},S.info)))))};e.SnackbarInstance=g}(xr)),xr}var ma;function dl(){if(ma)return Er;ma=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.WalletLinkRelayUI=void 0;const e=hl(),r=Hh(),n=fl();let t=class{constructor(i){this.standalone=null,this.attached=!1,this.snackbar=new n.Snackbar({darkMode:i.darkMode}),this.linkFlow=new r.LinkFlow({darkMode:i.darkMode,version:i.version,sessionId:i.session.id,sessionSecret:i.session.secret,linkAPIUrl:i.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const i=document.documentElement,u=document.createElement("div");u.className="-cbwsdk-css-reset",i.appendChild(u),this.linkFlow.attach(u),this.snackbar.attach(u),this.attached=!0,(0,e.injectCssReset)()}setConnected(i){this.linkFlow.setConnected(i)}setChainId(i){this.linkFlow.setChainId(i)}setConnectDisabled(i){this.linkFlow.setConnectDisabled(i)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(i){this.linkFlow.open({onCancel:i.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(i){let u;return i.isUnlinkedErrorState?u={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:i.onResetConnection}]}:u={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:i.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:i.onResetConnection}]},this.snackbar.presentItem(u)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(i){this.standalone=i}isStandalone(){var i;return(i=this.standalone)!==null&&i!==void 0?i:!1}};return Er.WalletLinkRelayUI=t,Er}var ya;function pl(){if(ya)return mr;ya=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.WalletLinkRelay=void 0;const e=yn(),r=wn(),n=lt(),t=$s(),d=Zs(),i=Ks(),u=Rh(),p=Gs(),f=dl();let h=class Qt extends d.RelayAbstract{constructor(s){var c;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=w=>{var a;this.isLinked=w;const E=this.storage.getItem(d.LOCAL_STORAGE_ADDRESSES_KEY);if(w&&(this.session.linked=w),this.isUnlinkedErrorState=!1,E){const S=E.split(" "),I=this.storage.getItem("IsStandaloneSigning")==="true";if(S[0]!==""&&!w&&this.session.linked&&!I){this.isUnlinkedErrorState=!0;const T=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(t.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:T})}}},this.metadataUpdated=(w,a)=>{this.storage.setItem(w,a)},this.chainUpdated=(w,a)=>{this.chainCallbackParams.chainId===w&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:w,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(w,a))},this.accountUpdated=w=>{this.accountsCallback&&this.accountsCallback([w]),Qt.accountRequestCallbackIds.size>0&&(Array.from(Qt.accountRequestCallbackIds.values()).forEach(a=>{const E={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[w]}};this.invokeCallback(Object.assign(Object.assign({},E),{id:a}))}),Qt.accountRequestCallbackIds.clear())},this.connectedUpdated=w=>{this.ui.setConnected(w)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=s.linkAPIUrl,this.storage=s.storage,this.options=s;const{session:o,ui:m,connection:_}=this.subscribe();this._session=o,this.connection=_,this.relayEventManager=s.relayEventManager,this.diagnostic=s.diagnosticLogger,this._reloadOnDisconnect=(c=s.reloadOnDisconnect)!==null&&c!==void 0?c:!0,this.ui=m}subscribe(){const s=i.Session.load(this.storage)||new i.Session(this.storage).save(),{linkAPIUrl:c,diagnostic:o}=this,m=new u.WalletLinkConnection({session:s,linkAPIUrl:c,diagnostic:o,listener:this}),{version:_,darkMode:w}=this.options,a=this.options.uiConstructor({linkAPIUrl:c,version:_,darkMode:w,session:s});return m.connect(),{session:s,ui:a,connection:m}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(s=>setTimeout(()=>s(null),1e3))]).then(()=>{var s,c;const o=this.ui.isStandalone();(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const m=i.Session.load(this.storage);if((m==null?void 0:m.id)===this._session.id?this.storage.clear():m&&((c=this.diagnostic)===null||c===void 0||c.log(t.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i.Session.hash(m.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:_,ui:w,connection:a}=this.subscribe();this._session=_,this.connection=a,this.ui=w,o&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(s=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(t.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${s}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(s,c){this.appName=s,this.appLogoUrl=c}getStorageItem(s){return this.storage.getItem(s)}get session(){return this._session}setStorageItem(s,c){this.storage.setItem(s,c)}signEthereumMessage(s,c,o,m){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,n.hexStringFromBuffer)(s,!0),address:c,addPrefix:o,typedDataJson:m||null}})}ethereumAddressFromSignedMessage(s,c,o){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,n.hexStringFromBuffer)(s,!0),signature:(0,n.hexStringFromBuffer)(c,!0),addPrefix:o}})}signEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,n.bigIntStringFromBN)(s.weiValue),data:(0,n.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,n.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.gasPriceInWei?(0,n.bigIntStringFromBN)(s.gasPriceInWei):null,maxPriorityFeePerGas:s.gasPriceInWei?(0,n.bigIntStringFromBN)(s.gasPriceInWei):null,gasLimit:s.gasLimit?(0,n.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,n.bigIntStringFromBN)(s.weiValue),data:(0,n.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,n.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.maxFeePerGas?(0,n.bigIntStringFromBN)(s.maxFeePerGas):null,maxPriorityFeePerGas:s.maxPriorityFeePerGas?(0,n.bigIntStringFromBN)(s.maxPriorityFeePerGas):null,gasLimit:s.gasLimit?(0,n.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!0}})}submitEthereumTransaction(s,c){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,n.hexStringFromBuffer)(s,!0),chainId:c}})}scanQRCode(s){return this.sendRequest({method:"scanQRCode",params:{regExp:s}})}getQRCodeUrl(){return(0,n.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(s,c){return this.sendRequest({method:"generic",params:{action:c,data:s}})}sendGenericMessage(s){return this.sendRequest(s)}sendRequest(s){let c=null;const o=(0,n.randomBytesHex)(8),m=w=>{this.publishWeb3RequestCanceledEvent(o),this.handleErrorResponse(o,s.method,w),c==null||c()};return{promise:new Promise((w,a)=>{this.ui.isStandalone()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:m,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(o,E=>{if(c==null||c(),(0,p.isErrorResponse)(E))return a(new Error(E.errorMessage));w(E)}),this.ui.isStandalone()?this.sendRequestStandalone(o,s):this.publishWeb3RequestEvent(o,s)}),cancel:m}}setConnectDisabled(s){this.ui.setConnectDisabled(s)}setAccountsCallback(s){this.accountsCallback=s}setChainCallback(s){this.chainCallback=s}setDappDefaultChainCallback(s){this.dappDefaultChain=s,this.ui instanceof f.WalletLinkRelayUI&&this.ui.setChainId(s)}publishWeb3RequestEvent(s,c){var o;const m={type:"WEB3_REQUEST",id:s,request:c},_=i.Session.load(this.storage);(o=this.diagnostic)===null||o===void 0||o.log(t.EVENTS.WEB3_REQUEST,{eventId:m.id,method:`relay::${c.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:_?i.Session.hash(_.id):"",isSessionMismatched:((_==null?void 0:_.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",m,!0).then(w=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(t.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:m.id,method:`relay::${c.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:_?i.Session.hash(_.id):"",isSessionMismatched:((_==null?void 0:_.id)!==this._session.id).toString()})}).catch(w=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:m.id,response:{method:c.method,errorMessage:w.message}})})}publishWeb3RequestCanceledEvent(s){const c={type:"WEB3_REQUEST_CANCELED",id:s};this.publishEvent("Web3RequestCanceled",c,!1).then()}publishEvent(s,c,o){return this.connection.publishEvent(s,c,o)}handleWeb3ResponseMessage(s){var c;const{response:o}=s;if((c=this.diagnostic)===null||c===void 0||c.log(t.EVENTS.WEB3_RESPONSE,{eventId:s.id,method:`relay::${o.method}`,sessionIdHash:this.getSessionIdHash()}),o.method==="requestEthereumAccounts"){Qt.accountRequestCallbackIds.forEach(m=>this.invokeCallback(Object.assign(Object.assign({},s),{id:m}))),Qt.accountRequestCallbackIds.clear();return}this.invokeCallback(s)}handleErrorResponse(s,c,o,m){var _;const w=(_=o==null?void 0:o.message)!==null&&_!==void 0?_:(0,e.getMessageFromCode)(m);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:c,errorMessage:w,errorCode:m}})}invokeCallback(s){const c=this.relayEventManager.callbacks.get(s.id);c&&(c(s.response),this.relayEventManager.callbacks.delete(s.id))}requestEthereumAccounts(){const s={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},c=(0,n.randomBytesHex)(8),o=_=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,s.method,_)};return{promise:new Promise((_,w)=>{if(this.relayEventManager.callbacks.set(c,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,p.isErrorResponse)(a))return w(new Error(a.errorMessage));_(a)}),this.ui.inlineAccountsResponse()){const a=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:E}})};this.ui.requestEthereumAccounts({onCancel:o,onAccounts:a})}else{const a=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>o(a)})}Qt.accountRequestCallbackIds.add(c),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(c,s)}),cancel:o}}selectProvider(s){const c={method:"selectProvider"},o=(0,n.randomBytesHex)(8),m=w=>{this.publishWeb3RequestCanceledEvent(o),this.handleErrorResponse(o,c.method,w)},_=new Promise((w,a)=>{this.relayEventManager.callbacks.set(o,I=>{if((0,p.isErrorResponse)(I))return a(new Error(I.errorMessage));w(I)});const E=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:o,response:{method:"selectProvider",result:r.ProviderType.Unselected}})},S=I=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:o,response:{method:"selectProvider",result:I}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:S,onCancel:E,providerOptions:s})});return{cancel:m,promise:_}}watchAsset(s,c,o,m,_,w){const a={method:"watchAsset",params:{type:s,options:{address:c,symbol:o,decimals:m,image:_},chainId:w}};let E=null;const S=(0,n.randomBytesHex)(8),I=q=>{this.publishWeb3RequestCanceledEvent(S),this.handleErrorResponse(S,a.method,q),E==null||E()};this.ui.inlineWatchAsset()||(E=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:I,onResetConnection:this.resetAndReload}));const T=new Promise((q,N)=>{this.relayEventManager.callbacks.set(S,X=>{if(E==null||E(),(0,p.isErrorResponse)(X))return N(new Error(X.errorMessage));q(X)});const H=X=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"watchAsset",result:!1}})},K=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:K,onCancel:H,type:s,address:c,symbol:o,decimals:m,image:_,chainId:w}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(S,a)});return{cancel:I,promise:T}}addEthereumChain(s,c,o,m,_,w){const a={method:"addEthereumChain",params:{chainId:s,rpcUrls:c,blockExplorerUrls:m,chainName:_,iconUrls:o,nativeCurrency:w}};let E=null;const S=(0,n.randomBytesHex)(8),I=q=>{this.publishWeb3RequestCanceledEvent(S),this.handleErrorResponse(S,a.method,q),E==null||E()};return this.ui.inlineAddEthereumChain(s)||(E=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:I,onResetConnection:this.resetAndReload})),{promise:new Promise((q,N)=>{this.relayEventManager.callbacks.set(S,X=>{if(E==null||E(),(0,p.isErrorResponse)(X))return N(new Error(X.errorMessage));q(X)});const H=X=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},K=X=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:S,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:X}}})};this.ui.inlineAddEthereumChain(s)&&this.ui.addEthereumChain({onCancel:H,onApprove:K,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(s)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(S,a)}),cancel:I}}switchEthereumChain(s,c){const o={method:"switchEthereumChain",params:Object.assign({chainId:s},{address:c})},m=(0,n.randomBytesHex)(8),_=a=>{this.publishWeb3RequestCanceledEvent(m),this.handleErrorResponse(m,o.method,a)};return{promise:new Promise((a,E)=>{this.relayEventManager.callbacks.set(m,T=>{if((0,p.isErrorResponse)(T)&&T.errorCode)return E(e.standardErrors.provider.custom({code:T.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,p.isErrorResponse)(T))return E(new Error(T.errorMessage));a(T)});const S=T=>{var q;if(T){const N=(q=(0,e.getErrorCode)(T))!==null&&q!==void 0?q:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(m,"switchEthereumChain",T instanceof Error?T:e.standardErrors.provider.unsupportedChain(s),N)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:m,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},I=T=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:m,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:T}}})};this.ui.switchEthereumChain({onCancel:S,onApprove:I,chainId:o.params.chainId,address:o.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(m,o)}),cancel:_}}inlineAddEthereumChain(s){return this.ui.inlineAddEthereumChain(s)}getSessionIdHash(){return i.Session.hash(this._session.id)}sendRequestStandalone(s,c){const o=_=>{this.handleErrorResponse(s,c.method,_)},m=_=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:_})};switch(c.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:c,onSuccess:m,onCancel:o});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:c,onSuccess:m,onCancel:o});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:c,onSuccess:m,onCancel:o});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:c,onSuccess:m});break;default:o();break}}};return mr.WalletLinkRelay=h,h.accountRequestCallbackIds=new Set,mr}var Tr={},qt={},jt={},wa;function Vh(){return wa||(wa=1,function(e){var r=jt&&jt.__createBinding||(Object.create?function(t,d,i,u){u===void 0&&(u=i);var p=Object.getOwnPropertyDescriptor(d,i);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[i]}}),Object.defineProperty(t,u,p)}:function(t,d,i,u){u===void 0&&(u=i),t[u]=d[i]}),n=jt&&jt.__exportStar||function(t,d){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(d,i)&&r(d,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(fl(),e)}(jt)),jt}var nn={},va;function zh(){return va||(va=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.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}"),nn}var ba;function Gh(){if(ba)return qt;ba=1;var e=qt&&qt.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(qt,"__esModule",{value:!0}),qt.RedirectDialog=void 0;const r=e(Vr),n=$e,t=hl(),d=Vh(),i=e(zh());let u=class{constructor(){this.root=null}attach(){const h=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",h.appendChild(this.root),(0,t.injectCssReset)()}present(h){this.render(h)}clear(){this.render(null)}render(h){this.root&&((0,n.render)(null,this.root),h&&(0,n.render)((0,n.h)(p,Object.assign({},h,{onDismiss:()=>{this.clear()}})),this.root))}};qt.RedirectDialog=u;const p=({title:f,buttonText:h,darkMode:g,onButtonClick:s,onDismiss:c})=>{const o=g?"dark":"light";return(0,n.h)(d.SnackbarContainer,{darkMode:g},(0,n.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:c}),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-redirect-dialog-box",o)},(0,n.h)("p",null,f),(0,n.h)("button",{onClick:s},h))))};return qt}var _a;function gl(){if(_a)return Tr;_a=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.MobileRelayUI=void 0;const e=Gh();let r=class{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new e.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 d=new URL("https://go.cb-w.com/walletlink");d.searchParams.append("redirect_url",window.location.href),t&&d.searchParams.append("wl_url",t);const i=document.createElement("a");i.target="cbw-opener",i.href=d.href,i.rel="noreferrer noopener",i.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}};return Tr.MobileRelayUI=r,Tr}var Ea;function ml(){if(Ea)return gr;Ea=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.MobileRelay=void 0;const e=lt(),r=pl(),n=gl();let t=class extends r.WalletLinkRelay{constructor(i){var u;super(i),this._enableMobileWalletLink=(u=i.enableMobileWalletLink)!==null&&u!==void 0?u:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const i=(0,e.getLocation)();i.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(i.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(i,u){if(super.publishWeb3RequestEvent(i,u),!(this._enableMobileWalletLink&&this.ui instanceof n.MobileRelayUI))return;let p=!1;switch(u.method){case"requestEthereumAccounts":case"connectAndSignIn":p=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:p=!0,this.ui.openCoinbaseWalletDeeplink();break}p&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(i){super.handleWeb3ResponseMessage(i)}connectAndSignIn(i){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:i.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:i.statement,resources:i.resources}})}};return gr.MobileRelay=t,gr}var sn={exports:{}},Gn,Sa;function yl(){return Sa||(Sa=1,Gn=pn().EventEmitter),Gn}var Jn={},$n={},Zn,Ra;function Jh(){if(Ra)return Zn;Ra=1;const e=(function*(){}).constructor;return Zn=()=>e,Zn}var Kn,Ca;function $h(){if(Ca)return Kn;Ca=1;var e=ol(),r=eh(),n=r(/^\s*(?:function)?\*/),t=th()(),d=rh(),i=e("Object.prototype.toString"),u=e("Function.prototype.toString"),p=Jh();return Kn=function(h){if(typeof h!="function")return!1;if(n(u(h)))return!0;if(!t){var g=i(h);return g==="[object GeneratorFunction]"}if(!d)return!1;var s=p();return s&&d(h)===s.prototype},Kn}var Ma;function Zh(){return Ma||(Ma=1,function(e){var r=nh(),n=$h(),t=sl(),d=al();function i(ee){return ee.call.bind(ee)}var u=typeof BigInt<"u",p=typeof Symbol<"u",f=i(Object.prototype.toString),h=i(Number.prototype.valueOf),g=i(String.prototype.valueOf),s=i(Boolean.prototype.valueOf);if(u)var c=i(BigInt.prototype.valueOf);if(p)var o=i(Symbol.prototype.valueOf);function m(ee,ve){if(typeof ee!="object")return!1;try{return ve(ee),!0}catch{return!1}}e.isArgumentsObject=r,e.isGeneratorFunction=n,e.isTypedArray=d;function _(ee){return typeof Promise<"u"&&ee instanceof Promise||ee!==null&&typeof ee=="object"&&typeof ee.then=="function"&&typeof ee.catch=="function"}e.isPromise=_;function w(ee){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ee):d(ee)||M(ee)}e.isArrayBufferView=w;function a(ee){return t(ee)==="Uint8Array"}e.isUint8Array=a;function E(ee){return t(ee)==="Uint8ClampedArray"}e.isUint8ClampedArray=E;function S(ee){return t(ee)==="Uint16Array"}e.isUint16Array=S;function I(ee){return t(ee)==="Uint32Array"}e.isUint32Array=I;function T(ee){return t(ee)==="Int8Array"}e.isInt8Array=T;function q(ee){return t(ee)==="Int16Array"}e.isInt16Array=q;function N(ee){return t(ee)==="Int32Array"}e.isInt32Array=N;function H(ee){return t(ee)==="Float32Array"}e.isFloat32Array=H;function K(ee){return t(ee)==="Float64Array"}e.isFloat64Array=K;function X(ee){return t(ee)==="BigInt64Array"}e.isBigInt64Array=X;function re(ee){return t(ee)==="BigUint64Array"}e.isBigUint64Array=re;function W(ee){return f(ee)==="[object Map]"}W.working=typeof Map<"u"&&W(new Map);function D(ee){return typeof Map>"u"?!1:W.working?W(ee):ee instanceof Map}e.isMap=D;function l(ee){return f(ee)==="[object Set]"}l.working=typeof Set<"u"&&l(new Set);function b(ee){return typeof Set>"u"?!1:l.working?l(ee):ee instanceof Set}e.isSet=b;function C(ee){return f(ee)==="[object WeakMap]"}C.working=typeof WeakMap<"u"&&C(new WeakMap);function k(ee){return typeof WeakMap>"u"?!1:C.working?C(ee):ee instanceof WeakMap}e.isWeakMap=k;function x(ee){return f(ee)==="[object WeakSet]"}x.working=typeof WeakSet<"u"&&x(new WeakSet);function O(ee){return x(ee)}e.isWeakSet=O;function U(ee){return f(ee)==="[object ArrayBuffer]"}U.working=typeof ArrayBuffer<"u"&&U(new ArrayBuffer);function L(ee){return typeof ArrayBuffer>"u"?!1:U.working?U(ee):ee instanceof ArrayBuffer}e.isArrayBuffer=L;function v(ee){return f(ee)==="[object DataView]"}v.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&v(new DataView(new ArrayBuffer(1),0,1));function M(ee){return typeof DataView>"u"?!1:v.working?v(ee):ee instanceof DataView}e.isDataView=M;var G=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function J(ee){return f(ee)==="[object SharedArrayBuffer]"}function j(ee){return typeof G>"u"?!1:(typeof J.working>"u"&&(J.working=J(new G)),J.working?J(ee):ee instanceof G)}e.isSharedArrayBuffer=j;function V(ee){return f(ee)==="[object AsyncFunction]"}e.isAsyncFunction=V;function Z(ee){return f(ee)==="[object Map Iterator]"}e.isMapIterator=Z;function Y(ee){return f(ee)==="[object Set Iterator]"}e.isSetIterator=Y;function ie(ee){return f(ee)==="[object Generator]"}e.isGeneratorObject=ie;function B(ee){return f(ee)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=B;function F(ee){return m(ee,h)}e.isNumberObject=F;function te(ee){return m(ee,g)}e.isStringObject=te;function ne(ee){return m(ee,s)}e.isBooleanObject=ne;function se(ee){return u&&m(ee,c)}e.isBigIntObject=se;function ce(ee){return p&&m(ee,o)}e.isSymbolObject=ce;function ae(ee){return F(ee)||te(ee)||ne(ee)||se(ee)||ce(ee)}e.isBoxedPrimitive=ae;function ye(ee){return typeof Uint8Array<"u"&&(L(ee)||j(ee))}e.isAnyArrayBuffer=ye,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ee){Object.defineProperty(e,ee,{enumerable:!1,value:function(){throw new Error(ee+" is not supported in userland")}})})}($n)),$n}var Qn,ka;function Kh(){return ka||(ka=1,Qn=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"}),Qn}var Ia;function wl(){return Ia||(Ia=1,function(e){var r={},n=Object.getOwnPropertyDescriptors||function(G){for(var J=Object.keys(G),j={},V=0;V<J.length;V++)j[J[V]]=Object.getOwnPropertyDescriptor(G,J[V]);return j},t=/%[sdj%]/g;e.format=function(M){if(!q(M)){for(var G=[],J=0;J<arguments.length;J++)G.push(p(arguments[J]));return G.join(" ")}for(var J=1,j=arguments,V=j.length,Z=String(M).replace(t,function(ie){if(ie==="%%")return"%";if(J>=V)return ie;switch(ie){case"%s":return String(j[J++]);case"%d":return Number(j[J++]);case"%j":try{return JSON.stringify(j[J++])}catch{return"[Circular]"}default:return ie}}),Y=j[J];J<V;Y=j[++J])S(Y)||!X(Y)?Z+=" "+Y:Z+=" "+p(Y);return Z},e.deprecate=function(M,G){if(typeof me<"u"&&me.noDeprecation===!0)return M;if(typeof me>"u")return function(){return e.deprecate(M,G).apply(this,arguments)};var J=!1;function j(){if(!J){if(me.throwDeprecation)throw new Error(G);me.traceDeprecation?console.trace(G):console.error(G),J=!0}return M.apply(this,arguments)}return j};var d={},i=/^$/;if(r.NODE_DEBUG){var u=r.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+u+"$","i")}e.debuglog=function(M){if(M=M.toUpperCase(),!d[M])if(i.test(M)){var G=me.pid;d[M]=function(){var J=e.format.apply(e,arguments);console.error("%s %d: %s",M,G,J)}}else d[M]=function(){};return d[M]};function p(M,G){var J={seen:[],stylize:h};return arguments.length>=3&&(J.depth=arguments[2]),arguments.length>=4&&(J.colors=arguments[3]),E(G)?J.showHidden=G:G&&e._extend(J,G),H(J.showHidden)&&(J.showHidden=!1),H(J.depth)&&(J.depth=2),H(J.colors)&&(J.colors=!1),H(J.customInspect)&&(J.customInspect=!0),J.colors&&(J.stylize=f),s(J,M,J.depth)}e.inspect=p,p.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},p.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function f(M,G){var J=p.styles[G];return J?"\x1B["+p.colors[J][0]+"m"+M+"\x1B["+p.colors[J][1]+"m":M}function h(M,G){return M}function g(M){var G={};return M.forEach(function(J,j){G[J]=!0}),G}function s(M,G,J){if(M.customInspect&&G&&D(G.inspect)&&G.inspect!==e.inspect&&!(G.constructor&&G.constructor.prototype===G)){var j=G.inspect(J,M);return q(j)||(j=s(M,j,J)),j}var V=c(M,G);if(V)return V;var Z=Object.keys(G),Y=g(Z);if(M.showHidden&&(Z=Object.getOwnPropertyNames(G)),W(G)&&(Z.indexOf("message")>=0||Z.indexOf("description")>=0))return o(G);if(Z.length===0){if(D(G)){var ie=G.name?": "+G.name:"";return M.stylize("[Function"+ie+"]","special")}if(K(G))return M.stylize(RegExp.prototype.toString.call(G),"regexp");if(re(G))return M.stylize(Date.prototype.toString.call(G),"date");if(W(G))return o(G)}var B="",F=!1,te=["{","}"];if(a(G)&&(F=!0,te=["[","]"]),D(G)){var ne=G.name?": "+G.name:"";B=" [Function"+ne+"]"}if(K(G)&&(B=" "+RegExp.prototype.toString.call(G)),re(G)&&(B=" "+Date.prototype.toUTCString.call(G)),W(G)&&(B=" "+o(G)),Z.length===0&&(!F||G.length==0))return te[0]+B+te[1];if(J<0)return K(G)?M.stylize(RegExp.prototype.toString.call(G),"regexp"):M.stylize("[Object]","special");M.seen.push(G);var se;return F?se=m(M,G,J,Y,Z):se=Z.map(function(ce){return _(M,G,J,Y,ce,F)}),M.seen.pop(),w(se,B,te)}function c(M,G){if(H(G))return M.stylize("undefined","undefined");if(q(G)){var J="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return M.stylize(J,"string")}if(T(G))return M.stylize(""+G,"number");if(E(G))return M.stylize(""+G,"boolean");if(S(G))return M.stylize("null","null")}function o(M){return"["+Error.prototype.toString.call(M)+"]"}function m(M,G,J,j,V){for(var Z=[],Y=0,ie=G.length;Y<ie;++Y)O(G,String(Y))?Z.push(_(M,G,J,j,String(Y),!0)):Z.push("");return V.forEach(function(B){B.match(/^\d+$/)||Z.push(_(M,G,J,j,B,!0))}),Z}function _(M,G,J,j,V,Z){var Y,ie,B;if(B=Object.getOwnPropertyDescriptor(G,V)||{value:G[V]},B.get?B.set?ie=M.stylize("[Getter/Setter]","special"):ie=M.stylize("[Getter]","special"):B.set&&(ie=M.stylize("[Setter]","special")),O(j,V)||(Y="["+V+"]"),ie||(M.seen.indexOf(B.value)<0?(S(J)?ie=s(M,B.value,null):ie=s(M,B.value,J-1),ie.indexOf(`
|
|
8
|
-
`)>-1&&(Z?ie=ie.split(`
|
|
9
|
-
`).map(function(F){return" "+F}).join(`
|
|
10
|
-
`).slice(2):ie=`
|
|
11
|
-
`+ie.split(`
|
|
12
|
-
`).map(function(F){return" "+F}).join(`
|
|
13
|
-
`))):ie=M.stylize("[Circular]","special")),H(Y)){if(Z&&V.match(/^\d+$/))return ie;Y=JSON.stringify(""+V),Y.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Y=Y.slice(1,-1),Y=M.stylize(Y,"name")):(Y=Y.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Y=M.stylize(Y,"string"))}return Y+": "+ie}function w(M,G,J){var j=M.reduce(function(V,Z){return Z.indexOf(`
|
|
14
|
-
`)>=0,V+Z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return j>60?J[0]+(G===""?"":G+`
|
|
15
|
-
`)+" "+M.join(`,
|
|
16
|
-
`)+" "+J[1]:J[0]+G+" "+M.join(", ")+" "+J[1]}e.types=Zh();function a(M){return Array.isArray(M)}e.isArray=a;function E(M){return typeof M=="boolean"}e.isBoolean=E;function S(M){return M===null}e.isNull=S;function I(M){return M==null}e.isNullOrUndefined=I;function T(M){return typeof M=="number"}e.isNumber=T;function q(M){return typeof M=="string"}e.isString=q;function N(M){return typeof M=="symbol"}e.isSymbol=N;function H(M){return M===void 0}e.isUndefined=H;function K(M){return X(M)&&b(M)==="[object RegExp]"}e.isRegExp=K,e.types.isRegExp=K;function X(M){return typeof M=="object"&&M!==null}e.isObject=X;function re(M){return X(M)&&b(M)==="[object Date]"}e.isDate=re,e.types.isDate=re;function W(M){return X(M)&&(b(M)==="[object Error]"||M instanceof Error)}e.isError=W,e.types.isNativeError=W;function D(M){return typeof M=="function"}e.isFunction=D;function l(M){return M===null||typeof M=="boolean"||typeof M=="number"||typeof M=="string"||typeof M=="symbol"||typeof M>"u"}e.isPrimitive=l,e.isBuffer=Kh();function b(M){return Object.prototype.toString.call(M)}function C(M){return M<10?"0"+M.toString(10):M.toString(10)}var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var M=new Date,G=[C(M.getHours()),C(M.getMinutes()),C(M.getSeconds())].join(":");return[M.getDate(),k[M.getMonth()],G].join(" ")}e.log=function(){console.log("%s - %s",x(),e.format.apply(e,arguments))},e.inherits=Xe(),e._extend=function(M,G){if(!G||!X(G))return M;for(var J=Object.keys(G),j=J.length;j--;)M[J[j]]=G[J[j]];return M};function O(M,G){return Object.prototype.hasOwnProperty.call(M,G)}var U=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(U&&G[U]){var J=G[U];if(typeof J!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(J,U,{value:J,enumerable:!1,writable:!1,configurable:!0}),J}function J(){for(var j,V,Z=new Promise(function(B,F){j=B,V=F}),Y=[],ie=0;ie<arguments.length;ie++)Y.push(arguments[ie]);Y.push(function(B,F){B?V(B):j(F)});try{G.apply(this,Y)}catch(B){V(B)}return Z}return Object.setPrototypeOf(J,Object.getPrototypeOf(G)),U&&Object.defineProperty(J,U,{value:J,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(J,n(G))},e.promisify.custom=U;function L(M,G){if(!M){var J=new Error("Promise was rejected with a falsy value");J.reason=M,M=J}return G(M)}function v(M){if(typeof M!="function")throw new TypeError('The "original" argument must be of type Function');function G(){for(var J=[],j=0;j<arguments.length;j++)J.push(arguments[j]);var V=J.pop();if(typeof V!="function")throw new TypeError("The last argument must be of type Function");var Z=this,Y=function(){return V.apply(Z,arguments)};M.apply(this,J).then(function(ie){me.nextTick(Y.bind(null,null,ie))},function(ie){me.nextTick(L.bind(null,ie,Y))})}return Object.setPrototypeOf(G,Object.getPrototypeOf(M)),Object.defineProperties(G,n(M)),G}e.callbackify=v}(Jn)),Jn}var Yn,Aa;function Qh(){if(Aa)return Yn;Aa=1;function e(m,_){var w=Object.keys(m);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(m);_&&(a=a.filter(function(E){return Object.getOwnPropertyDescriptor(m,E).enumerable})),w.push.apply(w,a)}return w}function r(m){for(var _=1;_<arguments.length;_++){var w=arguments[_]!=null?arguments[_]:{};_%2?e(Object(w),!0).forEach(function(a){n(m,a,w[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(w)):e(Object(w)).forEach(function(a){Object.defineProperty(m,a,Object.getOwnPropertyDescriptor(w,a))})}return m}function n(m,_,w){return _=u(_),_ in m?Object.defineProperty(m,_,{value:w,enumerable:!0,configurable:!0,writable:!0}):m[_]=w,m}function t(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function d(m,_){for(var w=0;w<_.length;w++){var a=_[w];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(m,u(a.key),a)}}function i(m,_,w){return _&&d(m.prototype,_),Object.defineProperty(m,"prototype",{writable:!1}),m}function u(m){var _=p(m,"string");return typeof _=="symbol"?_:String(_)}function p(m,_){if(typeof m!="object"||m===null)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var a=w.call(m,_);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)}var f=Wr(),h=f.Buffer,g=wl(),s=g.inspect,c=s&&s.custom||"inspect";function o(m,_,w){h.prototype.copy.call(m,_,w)}return Yn=function(){function m(){t(this,m),this.head=null,this.tail=null,this.length=0}return i(m,[{key:"push",value:function(w){var a={data:w,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(w){var a={data:w,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var w=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,w}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(w){if(this.length===0)return"";for(var a=this.head,E=""+a.data;a=a.next;)E+=w+a.data;return E}},{key:"concat",value:function(w){if(this.length===0)return h.alloc(0);for(var a=h.allocUnsafe(w>>>0),E=this.head,S=0;E;)o(E.data,a,S),S+=E.data.length,E=E.next;return a}},{key:"consume",value:function(w,a){var E;return w<this.head.data.length?(E=this.head.data.slice(0,w),this.head.data=this.head.data.slice(w)):w===this.head.data.length?E=this.shift():E=a?this._getString(w):this._getBuffer(w),E}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(w){var a=this.head,E=1,S=a.data;for(w-=S.length;a=a.next;){var I=a.data,T=w>I.length?I.length:w;if(T===I.length?S+=I:S+=I.slice(0,w),w-=T,w===0){T===I.length?(++E,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=I.slice(T));break}++E}return this.length-=E,S}},{key:"_getBuffer",value:function(w){var a=h.allocUnsafe(w),E=this.head,S=1;for(E.data.copy(a),w-=E.data.length;E=E.next;){var I=E.data,T=w>I.length?I.length:w;if(I.copy(a,a.length-w,0,T),w-=T,w===0){T===I.length?(++S,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=I.slice(T));break}++S}return this.length-=S,a}},{key:c,value:function(w,a){return s(this,r(r({},a),{},{depth:0,customInspect:!1}))}}]),m}(),Yn}var Xn,xa;function vl(){if(xa)return Xn;xa=1;function e(u,p){var f=this,h=this._readableState&&this._readableState.destroyed,g=this._writableState&&this._writableState.destroyed;return h||g?(p?p(u):u&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,me.nextTick(d,this,u)):me.nextTick(d,this,u)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(s){!p&&s?f._writableState?f._writableState.errorEmitted?me.nextTick(n,f):(f._writableState.errorEmitted=!0,me.nextTick(r,f,s)):me.nextTick(r,f,s):p?(me.nextTick(n,f),p(s)):me.nextTick(n,f)}),this)}function r(u,p){d(u,p),n(u)}function n(u){u._writableState&&!u._writableState.emitClose||u._readableState&&!u._readableState.emitClose||u.emit("close")}function t(){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 d(u,p){u.emit("error",p)}function i(u,p){var f=u._readableState,h=u._writableState;f&&f.autoDestroy||h&&h.autoDestroy?u.destroy(p):u.emit("error",p)}return Xn={destroy:e,undestroy:t,errorOrDestroy:i},Xn}var ei={},Ta;function ir(){if(Ta)return ei;Ta=1;function e(p,f){p.prototype=Object.create(f.prototype),p.prototype.constructor=p,p.__proto__=f}var r={};function n(p,f,h){h||(h=Error);function g(c,o,m){return typeof f=="string"?f:f(c,o,m)}var s=function(c){e(o,c);function o(m,_,w){return c.call(this,g(m,_,w))||this}return o}(h);s.prototype.name=h.name,s.prototype.code=p,r[p]=s}function t(p,f){if(Array.isArray(p)){var h=p.length;return p=p.map(function(g){return String(g)}),h>2?"one of ".concat(f," ").concat(p.slice(0,h-1).join(", "),", or ")+p[h-1]:h===2?"one of ".concat(f," ").concat(p[0]," or ").concat(p[1]):"of ".concat(f," ").concat(p[0])}else return"of ".concat(f," ").concat(String(p))}function d(p,f,h){return p.substr(0,f.length)===f}function i(p,f,h){return(h===void 0||h>p.length)&&(h=p.length),p.substring(h-f.length,h)===f}function u(p,f,h){return typeof h!="number"&&(h=0),h+f.length>p.length?!1:p.indexOf(f,h)!==-1}return n("ERR_INVALID_OPT_VALUE",function(p,f){return'The value "'+f+'" is invalid for option "'+p+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(p,f,h){var g;typeof f=="string"&&d(f,"not ")?(g="must not be",f=f.replace(/^not /,"")):g="must be";var s;if(i(p," argument"))s="The ".concat(p," ").concat(g," ").concat(t(f,"type"));else{var c=u(p,".")?"property":"argument";s='The "'.concat(p,'" ').concat(c," ").concat(g," ").concat(t(f,"type"))}return s+=". Received type ".concat(typeof h),s},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(p){return"The "+p+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(p){return"Cannot call "+p+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(p){return"Unknown encoding: "+p},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),ei.codes=r,ei}var ti,Ba;function bl(){if(Ba)return ti;Ba=1;var e=ir().codes.ERR_INVALID_OPT_VALUE;function r(t,d,i){return t.highWaterMark!=null?t.highWaterMark:d?t[i]:null}function n(t,d,i,u){var p=r(d,u,i);if(p!=null){if(!(isFinite(p)&&Math.floor(p)===p)||p<0){var f=u?i:"highWaterMark";throw new e(f,p)}return Math.floor(p)}return t.objectMode?16:16*1024}return ti={getHighWaterMark:n},ti}var ri,La;function Yh(){if(La)return ri;La=1,ri=e;function e(n,t){if(r("noDeprecation"))return n;var d=!1;function i(){if(!d){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),d=!0}return n.apply(this,arguments)}return i}function r(n){try{if(!tr.localStorage)return!1}catch{return!1}var t=tr.localStorage[n];return t==null?!1:String(t).toLowerCase()==="true"}return ri}var ni,Na;function _l(){if(Na)return ni;Na=1,ni=H;function e(j){var V=this;this.next=null,this.entry=null,this.finish=function(){J(V,j)}}var r;H.WritableState=q;var n={deprecate:Yh()},t=yl(),d=Wr().Buffer,i=(typeof tr<"u"?tr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(j){return d.from(j)}function p(j){return d.isBuffer(j)||j instanceof i}var f=vl(),h=bl(),g=h.getHighWaterMark,s=ir().codes,c=s.ERR_INVALID_ARG_TYPE,o=s.ERR_METHOD_NOT_IMPLEMENTED,m=s.ERR_MULTIPLE_CALLBACK,_=s.ERR_STREAM_CANNOT_PIPE,w=s.ERR_STREAM_DESTROYED,a=s.ERR_STREAM_NULL_VALUES,E=s.ERR_STREAM_WRITE_AFTER_END,S=s.ERR_UNKNOWN_ENCODING,I=f.errorOrDestroy;Xe()(H,t);function T(){}function q(j,V,Z){r=r||rr(),j=j||{},typeof Z!="boolean"&&(Z=V instanceof r),this.objectMode=!!j.objectMode,Z&&(this.objectMode=this.objectMode||!!j.writableObjectMode),this.highWaterMark=g(this,j,"writableHighWaterMark",Z),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Y=j.decodeStrings===!1;this.decodeStrings=!Y,this.defaultEncoding=j.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ie){C(V,ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}q.prototype.getBuffer=function(){for(var V=this.bufferedRequest,Z=[];V;)Z.push(V),V=V.next;return Z},function(){try{Object.defineProperty(q.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var N;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(N=Function.prototype[Symbol.hasInstance],Object.defineProperty(H,Symbol.hasInstance,{value:function(V){return N.call(this,V)?!0:this!==H?!1:V&&V._writableState instanceof q}})):N=function(V){return V instanceof this};function H(j){r=r||rr();var V=this instanceof r;if(!V&&!N.call(H,this))return new H(j);this._writableState=new q(j,this,V),this.writable=!0,j&&(typeof j.write=="function"&&(this._write=j.write),typeof j.writev=="function"&&(this._writev=j.writev),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.final=="function"&&(this._final=j.final)),t.call(this)}H.prototype.pipe=function(){I(this,new _)};function K(j,V){var Z=new E;I(j,Z),me.nextTick(V,Z)}function X(j,V,Z,Y){var ie;return Z===null?ie=new a:typeof Z!="string"&&!V.objectMode&&(ie=new c("chunk",["string","Buffer"],Z)),ie?(I(j,ie),me.nextTick(Y,ie),!1):!0}H.prototype.write=function(j,V,Z){var Y=this._writableState,ie=!1,B=!Y.objectMode&&p(j);return B&&!d.isBuffer(j)&&(j=u(j)),typeof V=="function"&&(Z=V,V=null),B?V="buffer":V||(V=Y.defaultEncoding),typeof Z!="function"&&(Z=T),Y.ending?K(this,Z):(B||X(this,Y,j,Z))&&(Y.pendingcb++,ie=W(this,Y,B,j,V,Z)),ie},H.prototype.cork=function(){this._writableState.corked++},H.prototype.uncork=function(){var j=this._writableState;j.corked&&(j.corked--,!j.writing&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&O(this,j))},H.prototype.setDefaultEncoding=function(V){if(typeof V=="string"&&(V=V.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((V+"").toLowerCase())>-1))throw new S(V);return this._writableState.defaultEncoding=V,this},Object.defineProperty(H.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function re(j,V,Z){return!j.objectMode&&j.decodeStrings!==!1&&typeof V=="string"&&(V=d.from(V,Z)),V}Object.defineProperty(H.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function W(j,V,Z,Y,ie,B){if(!Z){var F=re(V,Y,ie);Y!==F&&(Z=!0,ie="buffer",Y=F)}var te=V.objectMode?1:Y.length;V.length+=te;var ne=V.length<V.highWaterMark;if(ne||(V.needDrain=!0),V.writing||V.corked){var se=V.lastBufferedRequest;V.lastBufferedRequest={chunk:Y,encoding:ie,isBuf:Z,callback:B,next:null},se?se.next=V.lastBufferedRequest:V.bufferedRequest=V.lastBufferedRequest,V.bufferedRequestCount+=1}else D(j,V,!1,te,Y,ie,B);return ne}function D(j,V,Z,Y,ie,B,F){V.writelen=Y,V.writecb=F,V.writing=!0,V.sync=!0,V.destroyed?V.onwrite(new w("write")):Z?j._writev(ie,V.onwrite):j._write(ie,B,V.onwrite),V.sync=!1}function l(j,V,Z,Y,ie){--V.pendingcb,Z?(me.nextTick(ie,Y),me.nextTick(M,j,V),j._writableState.errorEmitted=!0,I(j,Y)):(ie(Y),j._writableState.errorEmitted=!0,I(j,Y),M(j,V))}function b(j){j.writing=!1,j.writecb=null,j.length-=j.writelen,j.writelen=0}function C(j,V){var Z=j._writableState,Y=Z.sync,ie=Z.writecb;if(typeof ie!="function")throw new m;if(b(Z),V)l(j,Z,Y,V,ie);else{var B=U(Z)||j.destroyed;!B&&!Z.corked&&!Z.bufferProcessing&&Z.bufferedRequest&&O(j,Z),Y?me.nextTick(k,j,Z,B,ie):k(j,Z,B,ie)}}function k(j,V,Z,Y){Z||x(j,V),V.pendingcb--,Y(),M(j,V)}function x(j,V){V.length===0&&V.needDrain&&(V.needDrain=!1,j.emit("drain"))}function O(j,V){V.bufferProcessing=!0;var Z=V.bufferedRequest;if(j._writev&&Z&&Z.next){var Y=V.bufferedRequestCount,ie=new Array(Y),B=V.corkedRequestsFree;B.entry=Z;for(var F=0,te=!0;Z;)ie[F]=Z,Z.isBuf||(te=!1),Z=Z.next,F+=1;ie.allBuffers=te,D(j,V,!0,V.length,ie,"",B.finish),V.pendingcb++,V.lastBufferedRequest=null,B.next?(V.corkedRequestsFree=B.next,B.next=null):V.corkedRequestsFree=new e(V),V.bufferedRequestCount=0}else{for(;Z;){var ne=Z.chunk,se=Z.encoding,ce=Z.callback,ae=V.objectMode?1:ne.length;if(D(j,V,!1,ae,ne,se,ce),Z=Z.next,V.bufferedRequestCount--,V.writing)break}Z===null&&(V.lastBufferedRequest=null)}V.bufferedRequest=Z,V.bufferProcessing=!1}H.prototype._write=function(j,V,Z){Z(new o("_write()"))},H.prototype._writev=null,H.prototype.end=function(j,V,Z){var Y=this._writableState;return typeof j=="function"?(Z=j,j=null,V=null):typeof V=="function"&&(Z=V,V=null),j!=null&&this.write(j,V),Y.corked&&(Y.corked=1,this.uncork()),Y.ending||G(this,Y,Z),this},Object.defineProperty(H.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function U(j){return j.ending&&j.length===0&&j.bufferedRequest===null&&!j.finished&&!j.writing}function L(j,V){j._final(function(Z){V.pendingcb--,Z&&I(j,Z),V.prefinished=!0,j.emit("prefinish"),M(j,V)})}function v(j,V){!V.prefinished&&!V.finalCalled&&(typeof j._final=="function"&&!V.destroyed?(V.pendingcb++,V.finalCalled=!0,me.nextTick(L,j,V)):(V.prefinished=!0,j.emit("prefinish")))}function M(j,V){var Z=U(V);if(Z&&(v(j,V),V.pendingcb===0&&(V.finished=!0,j.emit("finish"),V.autoDestroy))){var Y=j._readableState;(!Y||Y.autoDestroy&&Y.endEmitted)&&j.destroy()}return Z}function G(j,V,Z){V.ending=!0,M(j,V),Z&&(V.finished?me.nextTick(Z):j.once("finish",Z)),V.ended=!0,j.writable=!1}function J(j,V,Z){var Y=j.entry;for(j.entry=null;Y;){var ie=Y.callback;V.pendingcb--,ie(Z),Y=Y.next}V.corkedRequestsFree.next=j}return Object.defineProperty(H.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(V){this._writableState&&(this._writableState.destroyed=V)}}),H.prototype.destroy=f.destroy,H.prototype._undestroy=f.undestroy,H.prototype._destroy=function(j,V){V(j)},ni}var ii,Oa;function rr(){if(Oa)return ii;Oa=1;var e=Object.keys||function(h){var g=[];for(var s in h)g.push(s);return g};ii=u;var r=El(),n=_l();Xe()(u,r);for(var t=e(n.prototype),d=0;d<t.length;d++){var i=t[d];u.prototype[i]||(u.prototype[i]=n.prototype[i])}function u(h){if(!(this instanceof u))return new u(h);r.call(this,h),n.call(this,h),this.allowHalfOpen=!0,h&&(h.readable===!1&&(this.readable=!1),h.writable===!1&&(this.writable=!1),h.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",p)))}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function p(){this._writableState.ended||me.nextTick(f,this)}function f(h){h.end()}return Object.defineProperty(u.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)}}),ii}var si={},Pa;function Fa(){if(Pa)return si;Pa=1;var e=ht().Buffer,r=e.isEncoding||function(a){switch(a=""+a,a&&a.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 n(a){if(!a)return"utf8";for(var E;;)switch(a){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 a;default:if(E)return;a=(""+a).toLowerCase(),E=!0}}function t(a){var E=n(a);if(typeof E!="string"&&(e.isEncoding===r||!r(a)))throw new Error("Unknown encoding: "+a);return E||a}si.StringDecoder=d;function d(a){this.encoding=t(a);var E;switch(this.encoding){case"utf16le":this.text=s,this.end=c,E=4;break;case"utf8":this.fillLast=f,E=4;break;case"base64":this.text=o,this.end=m,E=3;break;default:this.write=_,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(E)}d.prototype.write=function(a){if(a.length===0)return"";var E,S;if(this.lastNeed){if(E=this.fillLast(a),E===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<a.length?E?E+this.text(a,S):this.text(a,S):E||""},d.prototype.end=g,d.prototype.text=h,d.prototype.fillLast=function(a){if(this.lastNeed<=a.length)return a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,a.length),this.lastNeed-=a.length};function i(a){return a<=127?0:a>>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function u(a,E,S){var I=E.length-1;if(I<S)return 0;var T=i(E[I]);return T>=0?(T>0&&(a.lastNeed=T-1),T):--I<S||T===-2?0:(T=i(E[I]),T>=0?(T>0&&(a.lastNeed=T-2),T):--I<S||T===-2?0:(T=i(E[I]),T>=0?(T>0&&(T===2?T=0:a.lastNeed=T-3),T):0))}function p(a,E,S){if((E[0]&192)!==128)return a.lastNeed=0,"�";if(a.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return a.lastNeed=1,"�";if(a.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return a.lastNeed=2,"�"}}function f(a){var E=this.lastTotal-this.lastNeed,S=p(this,a);if(S!==void 0)return S;if(this.lastNeed<=a.length)return a.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,E,0,a.length),this.lastNeed-=a.length}function h(a,E){var S=u(this,a,E);if(!this.lastNeed)return a.toString("utf8",E);this.lastTotal=S;var I=a.length-(S-this.lastNeed);return a.copy(this.lastChar,0,I),a.toString("utf8",E,I)}function g(a){var E=a&&a.length?this.write(a):"";return this.lastNeed?E+"�":E}function s(a,E){if((a.length-E)%2===0){var S=a.toString("utf16le",E);if(S){var I=S.charCodeAt(S.length-1);if(I>=55296&&I<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",E,a.length-1)}function c(a){var E=a&&a.length?this.write(a):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,S)}return E}function o(a,E){var S=(a.length-E)%3;return S===0?a.toString("base64",E):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",E,a.length-S))}function m(a){var E=a&&a.length?this.write(a):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function _(a){return a.toString(this.encoding)}function w(a){return a&&a.length?this.write(a):""}return si}var oi,Da;function Qs(){if(Da)return oi;Da=1;var e=ir().codes.ERR_STREAM_PREMATURE_CLOSE;function r(i){var u=!1;return function(){if(!u){u=!0;for(var p=arguments.length,f=new Array(p),h=0;h<p;h++)f[h]=arguments[h];i.apply(this,f)}}}function n(){}function t(i){return i.setHeader&&typeof i.abort=="function"}function d(i,u,p){if(typeof u=="function")return d(i,null,u);u||(u={}),p=r(p||n);var f=u.readable||u.readable!==!1&&i.readable,h=u.writable||u.writable!==!1&&i.writable,g=function(){i.writable||c()},s=i._writableState&&i._writableState.finished,c=function(){h=!1,s=!0,f||p.call(i)},o=i._readableState&&i._readableState.endEmitted,m=function(){f=!1,o=!0,h||p.call(i)},_=function(S){p.call(i,S)},w=function(){var S;if(f&&!o)return(!i._readableState||!i._readableState.ended)&&(S=new e),p.call(i,S);if(h&&!s)return(!i._writableState||!i._writableState.ended)&&(S=new e),p.call(i,S)},a=function(){i.req.on("finish",c)};return t(i)?(i.on("complete",c),i.on("abort",w),i.req?a():i.on("request",a)):h&&!i._writableState&&(i.on("end",g),i.on("close",g)),i.on("end",m),i.on("finish",c),u.error!==!1&&i.on("error",_),i.on("close",w),function(){i.removeListener("complete",c),i.removeListener("abort",w),i.removeListener("request",a),i.req&&i.req.removeListener("finish",c),i.removeListener("end",g),i.removeListener("close",g),i.removeListener("finish",c),i.removeListener("end",m),i.removeListener("error",_),i.removeListener("close",w)}}return oi=d,oi}var ai,qa;function Xh(){if(qa)return ai;qa=1;var e;function r(S,I,T){return I=n(I),I in S?Object.defineProperty(S,I,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[I]=T,S}function n(S){var I=t(S,"string");return typeof I=="symbol"?I:String(I)}function t(S,I){if(typeof S!="object"||S===null)return S;var T=S[Symbol.toPrimitive];if(T!==void 0){var q=T.call(S,I);if(typeof q!="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(S)}var d=Qs(),i=Symbol("lastResolve"),u=Symbol("lastReject"),p=Symbol("error"),f=Symbol("ended"),h=Symbol("lastPromise"),g=Symbol("handlePromise"),s=Symbol("stream");function c(S,I){return{value:S,done:I}}function o(S){var I=S[i];if(I!==null){var T=S[s].read();T!==null&&(S[h]=null,S[i]=null,S[u]=null,I(c(T,!1)))}}function m(S){me.nextTick(o,S)}function _(S,I){return function(T,q){S.then(function(){if(I[f]){T(c(void 0,!0));return}I[g](T,q)},q)}}var w=Object.getPrototypeOf(function(){}),a=Object.setPrototypeOf((e={get stream(){return this[s]},next:function(){var I=this,T=this[p];if(T!==null)return Promise.reject(T);if(this[f])return Promise.resolve(c(void 0,!0));if(this[s].destroyed)return new Promise(function(K,X){me.nextTick(function(){I[p]?X(I[p]):K(c(void 0,!0))})});var q=this[h],N;if(q)N=new Promise(_(q,this));else{var H=this[s].read();if(H!==null)return Promise.resolve(c(H,!1));N=new Promise(this[g])}return this[h]=N,N}},r(e,Symbol.asyncIterator,function(){return this}),r(e,"return",function(){var I=this;return new Promise(function(T,q){I[s].destroy(null,function(N){if(N){q(N);return}T(c(void 0,!0))})})}),e),w),E=function(I){var T,q=Object.create(a,(T={},r(T,s,{value:I,writable:!0}),r(T,i,{value:null,writable:!0}),r(T,u,{value:null,writable:!0}),r(T,p,{value:null,writable:!0}),r(T,f,{value:I._readableState.endEmitted,writable:!0}),r(T,g,{value:function(H,K){var X=q[s].read();X?(q[h]=null,q[i]=null,q[u]=null,H(c(X,!1))):(q[i]=H,q[u]=K)},writable:!0}),T));return q[h]=null,d(I,function(N){if(N&&N.code!=="ERR_STREAM_PREMATURE_CLOSE"){var H=q[u];H!==null&&(q[h]=null,q[i]=null,q[u]=null,H(N)),q[p]=N;return}var K=q[i];K!==null&&(q[h]=null,q[i]=null,q[u]=null,K(c(void 0,!0))),q[f]=!0}),I.on("readable",m.bind(null,q)),q};return ai=E,ai}var ci,ja;function ef(){return ja||(ja=1,ci=function(){throw new Error("Readable.from is not available in the browser")}),ci}var ui,Ua;function El(){if(Ua)return ui;Ua=1,ui=K;var e;K.ReadableState=H,pn().EventEmitter;var r=function(F,te){return F.listeners(te).length},n=yl(),t=Wr().Buffer,d=(typeof tr<"u"?tr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(B){return t.from(B)}function u(B){return t.isBuffer(B)||B instanceof d}var p=wl(),f;p&&p.debuglog?f=p.debuglog("stream"):f=function(){};var h=Qh(),g=vl(),s=bl(),c=s.getHighWaterMark,o=ir().codes,m=o.ERR_INVALID_ARG_TYPE,_=o.ERR_STREAM_PUSH_AFTER_EOF,w=o.ERR_METHOD_NOT_IMPLEMENTED,a=o.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,E,S,I;Xe()(K,n);var T=g.errorOrDestroy,q=["error","close","destroy","pause","resume"];function N(B,F,te){if(typeof B.prependListener=="function")return B.prependListener(F,te);!B._events||!B._events[F]?B.on(F,te):Array.isArray(B._events[F])?B._events[F].unshift(te):B._events[F]=[te,B._events[F]]}function H(B,F,te){e=e||rr(),B=B||{},typeof te!="boolean"&&(te=F instanceof e),this.objectMode=!!B.objectMode,te&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=c(this,B,"readableHighWaterMark",te),this.buffer=new h,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=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(E||(E=Fa().StringDecoder),this.decoder=new E(B.encoding),this.encoding=B.encoding)}function K(B){if(e=e||rr(),!(this instanceof K))return new K(B);var F=this instanceof e;this._readableState=new H(B,this,F),this.readable=!0,B&&(typeof B.read=="function"&&(this._read=B.read),typeof B.destroy=="function"&&(this._destroy=B.destroy)),n.call(this)}Object.defineProperty(K.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(F){this._readableState&&(this._readableState.destroyed=F)}}),K.prototype.destroy=g.destroy,K.prototype._undestroy=g.undestroy,K.prototype._destroy=function(B,F){F(B)},K.prototype.push=function(B,F){var te=this._readableState,ne;return te.objectMode?ne=!0:typeof B=="string"&&(F=F||te.defaultEncoding,F!==te.encoding&&(B=t.from(B,F),F=""),ne=!0),X(this,B,F,!1,ne)},K.prototype.unshift=function(B){return X(this,B,null,!0,!1)};function X(B,F,te,ne,se){f("readableAddChunk",F);var ce=B._readableState;if(F===null)ce.reading=!1,C(B,ce);else{var ae;if(se||(ae=W(ce,F)),ae)T(B,ae);else if(ce.objectMode||F&&F.length>0)if(typeof F!="string"&&!ce.objectMode&&Object.getPrototypeOf(F)!==t.prototype&&(F=i(F)),ne)ce.endEmitted?T(B,new a):re(B,ce,F,!0);else if(ce.ended)T(B,new _);else{if(ce.destroyed)return!1;ce.reading=!1,ce.decoder&&!te?(F=ce.decoder.write(F),ce.objectMode||F.length!==0?re(B,ce,F,!1):O(B,ce)):re(B,ce,F,!1)}else ne||(ce.reading=!1,O(B,ce))}return!ce.ended&&(ce.length<ce.highWaterMark||ce.length===0)}function re(B,F,te,ne){F.flowing&&F.length===0&&!F.sync?(F.awaitDrain=0,B.emit("data",te)):(F.length+=F.objectMode?1:te.length,ne?F.buffer.unshift(te):F.buffer.push(te),F.needReadable&&k(B)),O(B,F)}function W(B,F){var te;return!u(F)&&typeof F!="string"&&F!==void 0&&!B.objectMode&&(te=new m("chunk",["string","Buffer","Uint8Array"],F)),te}K.prototype.isPaused=function(){return this._readableState.flowing===!1},K.prototype.setEncoding=function(B){E||(E=Fa().StringDecoder);var F=new E(B);this._readableState.decoder=F,this._readableState.encoding=this._readableState.decoder.encoding;for(var te=this._readableState.buffer.head,ne="";te!==null;)ne+=F.write(te.data),te=te.next;return this._readableState.buffer.clear(),ne!==""&&this._readableState.buffer.push(ne),this._readableState.length=ne.length,this};var D=1073741824;function l(B){return B>=D?B=D:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}function b(B,F){return B<=0||F.length===0&&F.ended?0:F.objectMode?1:B!==B?F.flowing&&F.length?F.buffer.head.data.length:F.length:(B>F.highWaterMark&&(F.highWaterMark=l(B)),B<=F.length?B:F.ended?F.length:(F.needReadable=!0,0))}K.prototype.read=function(B){f("read",B),B=parseInt(B,10);var F=this._readableState,te=B;if(B!==0&&(F.emittedReadable=!1),B===0&&F.needReadable&&((F.highWaterMark!==0?F.length>=F.highWaterMark:F.length>0)||F.ended))return f("read: emitReadable",F.length,F.ended),F.length===0&&F.ended?Z(this):k(this),null;if(B=b(B,F),B===0&&F.ended)return F.length===0&&Z(this),null;var ne=F.needReadable;f("need readable",ne),(F.length===0||F.length-B<F.highWaterMark)&&(ne=!0,f("length less than watermark",ne)),F.ended||F.reading?(ne=!1,f("reading or ended",ne)):ne&&(f("do read"),F.reading=!0,F.sync=!0,F.length===0&&(F.needReadable=!0),this._read(F.highWaterMark),F.sync=!1,F.reading||(B=b(te,F)));var se;return B>0?se=V(B,F):se=null,se===null?(F.needReadable=F.length<=F.highWaterMark,B=0):(F.length-=B,F.awaitDrain=0),F.length===0&&(F.ended||(F.needReadable=!0),te!==B&&F.ended&&Z(this)),se!==null&&this.emit("data",se),se};function C(B,F){if(f("onEofChunk"),!F.ended){if(F.decoder){var te=F.decoder.end();te&&te.length&&(F.buffer.push(te),F.length+=F.objectMode?1:te.length)}F.ended=!0,F.sync?k(B):(F.needReadable=!1,F.emittedReadable||(F.emittedReadable=!0,x(B)))}}function k(B){var F=B._readableState;f("emitReadable",F.needReadable,F.emittedReadable),F.needReadable=!1,F.emittedReadable||(f("emitReadable",F.flowing),F.emittedReadable=!0,me.nextTick(x,B))}function x(B){var F=B._readableState;f("emitReadable_",F.destroyed,F.length,F.ended),!F.destroyed&&(F.length||F.ended)&&(B.emit("readable"),F.emittedReadable=!1),F.needReadable=!F.flowing&&!F.ended&&F.length<=F.highWaterMark,j(B)}function O(B,F){F.readingMore||(F.readingMore=!0,me.nextTick(U,B,F))}function U(B,F){for(;!F.reading&&!F.ended&&(F.length<F.highWaterMark||F.flowing&&F.length===0);){var te=F.length;if(f("maybeReadMore read 0"),B.read(0),te===F.length)break}F.readingMore=!1}K.prototype._read=function(B){T(this,new w("_read()"))},K.prototype.pipe=function(B,F){var te=this,ne=this._readableState;switch(ne.pipesCount){case 0:ne.pipes=B;break;case 1:ne.pipes=[ne.pipes,B];break;default:ne.pipes.push(B);break}ne.pipesCount+=1,f("pipe count=%d opts=%j",ne.pipesCount,F);var se=(!F||F.end!==!1)&&B!==me.stdout&&B!==me.stderr,ce=se?ye:Se;ne.endEmitted?me.nextTick(ce):te.once("end",ce),B.on("unpipe",ae);function ae(be,ze){f("onunpipe"),be===te&&ze&&ze.hasUnpiped===!1&&(ze.hasUnpiped=!0,pe())}function ye(){f("onend"),B.end()}var ee=L(te);B.on("drain",ee);var ve=!1;function pe(){f("cleanup"),B.removeListener("close",Ee),B.removeListener("finish",Qe),B.removeListener("drain",ee),B.removeListener("error",fe),B.removeListener("unpipe",ae),te.removeListener("end",ye),te.removeListener("end",Se),te.removeListener("data",we),ve=!0,ne.awaitDrain&&(!B._writableState||B._writableState.needDrain)&&ee()}te.on("data",we);function we(be){f("ondata");var ze=B.write(be);f("dest.write",ze),ze===!1&&((ne.pipesCount===1&&ne.pipes===B||ne.pipesCount>1&&ie(ne.pipes,B)!==-1)&&!ve&&(f("false write response, pause",ne.awaitDrain),ne.awaitDrain++),te.pause())}function fe(be){f("onerror",be),Se(),B.removeListener("error",fe),r(B,"error")===0&&T(B,be)}N(B,"error",fe);function Ee(){B.removeListener("finish",Qe),Se()}B.once("close",Ee);function Qe(){f("onfinish"),B.removeListener("close",Ee),Se()}B.once("finish",Qe);function Se(){f("unpipe"),te.unpipe(B)}return B.emit("pipe",te),ne.flowing||(f("pipe resume"),te.resume()),B};function L(B){return function(){var te=B._readableState;f("pipeOnDrain",te.awaitDrain),te.awaitDrain&&te.awaitDrain--,te.awaitDrain===0&&r(B,"data")&&(te.flowing=!0,j(B))}}K.prototype.unpipe=function(B){var F=this._readableState,te={hasUnpiped:!1};if(F.pipesCount===0)return this;if(F.pipesCount===1)return B&&B!==F.pipes?this:(B||(B=F.pipes),F.pipes=null,F.pipesCount=0,F.flowing=!1,B&&B.emit("unpipe",this,te),this);if(!B){var ne=F.pipes,se=F.pipesCount;F.pipes=null,F.pipesCount=0,F.flowing=!1;for(var ce=0;ce<se;ce++)ne[ce].emit("unpipe",this,{hasUnpiped:!1});return this}var ae=ie(F.pipes,B);return ae===-1?this:(F.pipes.splice(ae,1),F.pipesCount-=1,F.pipesCount===1&&(F.pipes=F.pipes[0]),B.emit("unpipe",this,te),this)},K.prototype.on=function(B,F){var te=n.prototype.on.call(this,B,F),ne=this._readableState;return B==="data"?(ne.readableListening=this.listenerCount("readable")>0,ne.flowing!==!1&&this.resume()):B==="readable"&&!ne.endEmitted&&!ne.readableListening&&(ne.readableListening=ne.needReadable=!0,ne.flowing=!1,ne.emittedReadable=!1,f("on readable",ne.length,ne.reading),ne.length?k(this):ne.reading||me.nextTick(M,this)),te},K.prototype.addListener=K.prototype.on,K.prototype.removeListener=function(B,F){var te=n.prototype.removeListener.call(this,B,F);return B==="readable"&&me.nextTick(v,this),te},K.prototype.removeAllListeners=function(B){var F=n.prototype.removeAllListeners.apply(this,arguments);return(B==="readable"||B===void 0)&&me.nextTick(v,this),F};function v(B){var F=B._readableState;F.readableListening=B.listenerCount("readable")>0,F.resumeScheduled&&!F.paused?F.flowing=!0:B.listenerCount("data")>0&&B.resume()}function M(B){f("readable nexttick read 0"),B.read(0)}K.prototype.resume=function(){var B=this._readableState;return B.flowing||(f("resume"),B.flowing=!B.readableListening,G(this,B)),B.paused=!1,this};function G(B,F){F.resumeScheduled||(F.resumeScheduled=!0,me.nextTick(J,B,F))}function J(B,F){f("resume",F.reading),F.reading||B.read(0),F.resumeScheduled=!1,B.emit("resume"),j(B),F.flowing&&!F.reading&&B.read(0)}K.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function j(B){var F=B._readableState;for(f("flow",F.flowing);F.flowing&&B.read()!==null;);}K.prototype.wrap=function(B){var F=this,te=this._readableState,ne=!1;B.on("end",function(){if(f("wrapped end"),te.decoder&&!te.ended){var ae=te.decoder.end();ae&&ae.length&&F.push(ae)}F.push(null)}),B.on("data",function(ae){if(f("wrapped data"),te.decoder&&(ae=te.decoder.write(ae)),!(te.objectMode&&ae==null)&&!(!te.objectMode&&(!ae||!ae.length))){var ye=F.push(ae);ye||(ne=!0,B.pause())}});for(var se in B)this[se]===void 0&&typeof B[se]=="function"&&(this[se]=function(ye){return function(){return B[ye].apply(B,arguments)}}(se));for(var ce=0;ce<q.length;ce++)B.on(q[ce],this.emit.bind(this,q[ce]));return this._read=function(ae){f("wrapped _read",ae),ne&&(ne=!1,B.resume())},this},typeof Symbol=="function"&&(K.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=Xh()),S(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(F){this._readableState&&(this._readableState.flowing=F)}}),K._fromList=V,Object.defineProperty(K.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function V(B,F){if(F.length===0)return null;var te;return F.objectMode?te=F.buffer.shift():!B||B>=F.length?(F.decoder?te=F.buffer.join(""):F.buffer.length===1?te=F.buffer.first():te=F.buffer.concat(F.length),F.buffer.clear()):te=F.buffer.consume(B,F.decoder),te}function Z(B){var F=B._readableState;f("endReadable",F.endEmitted),F.endEmitted||(F.ended=!0,me.nextTick(Y,F,B))}function Y(B,F){if(f("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&B.length===0&&(B.endEmitted=!0,F.readable=!1,F.emit("end"),B.autoDestroy)){var te=F._writableState;(!te||te.autoDestroy&&te.finished)&&F.destroy()}}typeof Symbol=="function"&&(K.from=function(B,F){return I===void 0&&(I=ef()),I(K,B,F)});function ie(B,F){for(var te=0,ne=B.length;te<ne;te++)if(B[te]===F)return te;return-1}return ui}var li,Ha;function Sl(){if(Ha)return li;Ha=1,li=p;var e=ir().codes,r=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,t=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,d=e.ERR_TRANSFORM_WITH_LENGTH_0,i=rr();Xe()(p,i);function u(g,s){var c=this._transformState;c.transforming=!1;var o=c.writecb;if(o===null)return this.emit("error",new n);c.writechunk=null,c.writecb=null,s!=null&&this.push(s),o(g);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function p(g){if(!(this instanceof p))return new p(g);i.call(this,g),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,g&&(typeof g.transform=="function"&&(this._transform=g.transform),typeof g.flush=="function"&&(this._flush=g.flush)),this.on("prefinish",f)}function f(){var g=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,c){h(g,s,c)}):h(this,null,null)}p.prototype.push=function(g,s){return this._transformState.needTransform=!1,i.prototype.push.call(this,g,s)},p.prototype._transform=function(g,s,c){c(new r("_transform()"))},p.prototype._write=function(g,s,c){var o=this._transformState;if(o.writecb=c,o.writechunk=g,o.writeencoding=s,!o.transforming){var m=this._readableState;(o.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}},p.prototype._read=function(g){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},p.prototype._destroy=function(g,s){i.prototype._destroy.call(this,g,function(c){s(c)})};function h(g,s,c){if(s)return g.emit("error",s);if(c!=null&&g.push(c),g._writableState.length)throw new d;if(g._transformState.transforming)throw new t;return g.push(null)}return li}var hi,Wa;function tf(){if(Wa)return hi;Wa=1,hi=r;var e=Sl();Xe()(r,e);function r(n){if(!(this instanceof r))return new r(n);e.call(this,n)}return r.prototype._transform=function(n,t,d){d(null,n)},hi}var fi,Va;function rf(){if(Va)return fi;Va=1;var e;function r(c){var o=!1;return function(){o||(o=!0,c.apply(void 0,arguments))}}var n=ir().codes,t=n.ERR_MISSING_ARGS,d=n.ERR_STREAM_DESTROYED;function i(c){if(c)throw c}function u(c){return c.setHeader&&typeof c.abort=="function"}function p(c,o,m,_){_=r(_);var w=!1;c.on("close",function(){w=!0}),e===void 0&&(e=Qs()),e(c,{readable:o,writable:m},function(E){if(E)return _(E);w=!0,_()});var a=!1;return function(E){if(!w&&!a){if(a=!0,u(c))return c.abort();if(typeof c.destroy=="function")return c.destroy();_(E||new d("pipe"))}}}function f(c){c()}function h(c,o){return c.pipe(o)}function g(c){return!c.length||typeof c[c.length-1]!="function"?i:c.pop()}function s(){for(var c=arguments.length,o=new Array(c),m=0;m<c;m++)o[m]=arguments[m];var _=g(o);if(Array.isArray(o[0])&&(o=o[0]),o.length<2)throw new t("streams");var w,a=o.map(function(E,S){var I=S<o.length-1,T=S>0;return p(E,I,T,function(q){w||(w=q),q&&a.forEach(f),!I&&(a.forEach(f),_(w))})});return o.reduce(h)}return fi=s,fi}var za;function Rl(){return za||(za=1,function(e,r){r=e.exports=El(),r.Stream=r,r.Readable=r,r.Writable=_l(),r.Duplex=rr(),r.Transform=Sl(),r.PassThrough=tf(),r.finished=Qs(),r.pipeline=rf()}(sn,sn.exports)),sn.exports}var di,Ga;function nf(){if(Ga)return di;Ga=1;const{Transform:e}=Rl();return di=r=>class Cl extends e{constructor(t,d,i,u,p){super(p),this._rate=t,this._capacity=d,this._delimitedSuffix=i,this._hashBitLength=u,this._options=p,this._state=new r,this._state.initialize(t,d),this._finalized=!1}_transform(t,d,i){let u=null;try{this.update(t,d)}catch(p){u=p}i(u)}_flush(t){let d=null;try{this.push(this.digest())}catch(i){d=i}t(d)}update(t,d){if(!ge.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return ge.isBuffer(t)||(t=ge.from(t,d)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let d=this._state.squeeze(this._hashBitLength/8);return t!==void 0&&(d=d.toString(t)),this._resetState(),d}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new Cl(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},di}var pi,Ja;function sf(){if(Ja)return pi;Ja=1;const{Transform:e}=Rl();return pi=r=>class Ml extends e{constructor(t,d,i,u){super(u),this._rate=t,this._capacity=d,this._delimitedSuffix=i,this._options=u,this._state=new r,this._state.initialize(t,d),this._finalized=!1}_transform(t,d,i){let u=null;try{this.update(t,d)}catch(p){u=p}i(u)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,d){if(!ge.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return ge.isBuffer(t)||(t=ge.from(t,d)),this._state.absorb(t),this}squeeze(t,d){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(t);return d!==void 0&&(i=i.toString(d)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new Ml(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},pi}var gi,$a;function of(){if($a)return gi;$a=1;const e=nf(),r=sf();return gi=function(n){const t=e(n),d=r(n);return function(i,u){switch(typeof i=="string"?i.toLowerCase():i){case"keccak224":return new t(1152,448,null,224,u);case"keccak256":return new t(1088,512,null,256,u);case"keccak384":return new t(832,768,null,384,u);case"keccak512":return new t(576,1024,null,512,u);case"sha3-224":return new t(1152,448,6,224,u);case"sha3-256":return new t(1088,512,6,256,u);case"sha3-384":return new t(832,768,6,384,u);case"sha3-512":return new t(576,1024,6,512,u);case"shake128":return new d(1344,256,31,u);case"shake256":return new d(1088,512,31,u);default:throw new Error("Invald algorithm: "+i)}}},gi}var mi={},Za;function af(){if(Za)return mi;Za=1;const e=[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];return mi.p1600=function(r){for(let n=0;n<24;++n){const t=r[0]^r[10]^r[20]^r[30]^r[40],d=r[1]^r[11]^r[21]^r[31]^r[41],i=r[2]^r[12]^r[22]^r[32]^r[42],u=r[3]^r[13]^r[23]^r[33]^r[43],p=r[4]^r[14]^r[24]^r[34]^r[44],f=r[5]^r[15]^r[25]^r[35]^r[45],h=r[6]^r[16]^r[26]^r[36]^r[46],g=r[7]^r[17]^r[27]^r[37]^r[47],s=r[8]^r[18]^r[28]^r[38]^r[48],c=r[9]^r[19]^r[29]^r[39]^r[49];let o=s^(i<<1|u>>>31),m=c^(u<<1|i>>>31);const _=r[0]^o,w=r[1]^m,a=r[10]^o,E=r[11]^m,S=r[20]^o,I=r[21]^m,T=r[30]^o,q=r[31]^m,N=r[40]^o,H=r[41]^m;o=t^(p<<1|f>>>31),m=d^(f<<1|p>>>31);const K=r[2]^o,X=r[3]^m,re=r[12]^o,W=r[13]^m,D=r[22]^o,l=r[23]^m,b=r[32]^o,C=r[33]^m,k=r[42]^o,x=r[43]^m;o=i^(h<<1|g>>>31),m=u^(g<<1|h>>>31);const O=r[4]^o,U=r[5]^m,L=r[14]^o,v=r[15]^m,M=r[24]^o,G=r[25]^m,J=r[34]^o,j=r[35]^m,V=r[44]^o,Z=r[45]^m;o=p^(s<<1|c>>>31),m=f^(c<<1|s>>>31);const Y=r[6]^o,ie=r[7]^m,B=r[16]^o,F=r[17]^m,te=r[26]^o,ne=r[27]^m,se=r[36]^o,ce=r[37]^m,ae=r[46]^o,ye=r[47]^m;o=h^(t<<1|d>>>31),m=g^(d<<1|t>>>31);const ee=r[8]^o,ve=r[9]^m,pe=r[18]^o,we=r[19]^m,fe=r[28]^o,Ee=r[29]^m,Qe=r[38]^o,Se=r[39]^m,be=r[48]^o,ze=r[49]^m,Re=_,Ie=w,at=E<<4|a>>>28,Le=a<<4|E>>>28,Te=S<<3|I>>>29,Ke=I<<3|S>>>29,Ce=q<<9|T>>>23,Ne=T<<9|q>>>23,ft=N<<18|H>>>14,Ae=H<<18|N>>>14,Oe=K<<1|X>>>31,dt=X<<1|K>>>31,Be=W<<12|re>>>20,Me=re<<12|W>>>20,We=D<<10|l>>>22,xe=l<<10|D>>>22,Pe=C<<13|b>>>19,Ge=b<<13|C>>>19,Fe=k<<2|x>>>30,A=x<<2|k>>>30,y=U<<30|O>>>2,R=O<<30|U>>>2,P=L<<6|v>>>26,z=v<<6|L>>>26,$=G<<11|M>>>21,Q=M<<11|G>>>21,de=J<<15|j>>>17,he=j<<15|J>>>17,le=Z<<29|V>>>3,ke=V<<29|Z>>>3,ue=Y<<28|ie>>>4,De=ie<<28|Y>>>4,er=F<<23|B>>>9,qe=B<<23|F>>>9,je=te<<25|ne>>>7,mt=ne<<25|te>>>7,yt=se<<21|ce>>>11,wt=ce<<21|se>>>11,vt=ye<<24|ae>>>8,bt=ae<<24|ye>>>8,_t=ee<<27|ve>>>5,Et=ve<<27|ee>>>5,St=pe<<20|we>>>12,Rt=we<<20|pe>>>12,Ct=Ee<<7|fe>>>25,Mt=fe<<7|Ee>>>25,kt=Qe<<8|Se>>>24,It=Se<<8|Qe>>>24,At=be<<14|ze>>>18,xt=ze<<14|be>>>18;r[0]=Re^~Be&$,r[1]=Ie^~Me&Q,r[10]=ue^~St&Te,r[11]=De^~Rt&Ke,r[20]=Oe^~P&je,r[21]=dt^~z&mt,r[30]=_t^~at&We,r[31]=Et^~Le&xe,r[40]=y^~er&Ct,r[41]=R^~qe&Mt,r[2]=Be^~$&yt,r[3]=Me^~Q&wt,r[12]=St^~Te&Pe,r[13]=Rt^~Ke&Ge,r[22]=P^~je&kt,r[23]=z^~mt&It,r[32]=at^~We&de,r[33]=Le^~xe&he,r[42]=er^~Ct&Ce,r[43]=qe^~Mt&Ne,r[4]=$^~yt&At,r[5]=Q^~wt&xt,r[14]=Te^~Pe&le,r[15]=Ke^~Ge&ke,r[24]=je^~kt&ft,r[25]=mt^~It&Ae,r[34]=We^~de&vt,r[35]=xe^~he&bt,r[44]=Ct^~Ce&Fe,r[45]=Mt^~Ne&A,r[6]=yt^~At&Re,r[7]=wt^~xt&Ie,r[16]=Pe^~le&ue,r[17]=Ge^~ke&De,r[26]=kt^~ft&Oe,r[27]=It^~Ae&dt,r[36]=de^~vt&_t,r[37]=he^~bt&Et,r[46]=Ce^~Fe&y,r[47]=Ne^~A&R,r[8]=At^~Re&Be,r[9]=xt^~Ie&Me,r[18]=le^~ue&St,r[19]=ke^~De&Rt,r[28]=ft^~Oe&P,r[29]=Ae^~dt&z,r[38]=vt^~_t&at,r[39]=bt^~Et&Le,r[48]=Fe^~y&er,r[49]=A^~R&qe,r[0]^=e[n*2],r[1]^=e[n*2+1]}},mi}var yi,Ka;function cf(){if(Ka)return yi;Ka=1;const e=af();function r(){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}return r.prototype.initialize=function(n,t){for(let d=0;d<50;++d)this.state[d]=0;this.blockSize=n/8,this.count=0,this.squeezing=!1},r.prototype.absorb=function(n){for(let t=0;t<n.length;++t)this.state[~~(this.count/4)]^=n[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0)},r.prototype.absorbLastFewBits=function(n){this.state[~~(this.count/4)]^=n<<8*(this.count%4),n&128&&this.count===this.blockSize-1&&e.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),e.p1600(this.state),this.count=0,this.squeezing=!0},r.prototype.squeeze=function(n){this.squeezing||this.absorbLastFewBits(1);const t=ge.alloc(n);for(let d=0;d<n;++d)t[d]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0);return t},r.prototype.copy=function(n){for(let t=0;t<50;++t)n.state[t]=this.state[t];n.blockSize=this.blockSize,n.count=this.count,n.squeezing=this.squeezing},yi=r,yi}var wi,Qa;function uf(){return Qa||(Qa=1,wi=of()(cf())),wi}var vi,Ya;function kl(){if(Ya)return vi;Ya=1;const e=uf(),r=gn();function n(s){return ge.allocUnsafe(s).fill(0)}function t(s,c,o){const m=n(c);return s=i(s),o?s.length<c?(s.copy(m),m):s.slice(0,c):s.length<c?(s.copy(m,c-s.length),m):s.slice(-c)}function d(s,c){return t(s,c,!0)}function i(s){if(!ge.isBuffer(s))if(Array.isArray(s))s=ge.from(s);else if(typeof s=="string")h(s)?s=ge.from(f(g(s)),"hex"):s=ge.from(s);else if(typeof s=="number")s=intToBuffer(s);else if(s==null)s=ge.allocUnsafe(0);else if(r.isBN(s))s=s.toArrayLike(ge);else if(s.toArray)s=ge.from(s.toArray());else throw new Error("invalid type");return s}function u(s){return s=i(s),"0x"+s.toString("hex")}function p(s,c){return s=i(s),c||(c=256),e("keccak"+c).update(s).digest()}function f(s){return s.length%2?"0"+s:s}function h(s){return typeof s=="string"&&s.match(/^0x[0-9A-Fa-f]*$/)}function g(s){return typeof s=="string"&&s.startsWith("0x")?s.slice(2):s}return vi={zeros:n,setLength:t,setLengthRight:d,isHexString:h,stripHexPrefix:g,toBuffer:i,bufferToHex:u,keccak:p},vi}var bi,Xa;function lf(){if(Xa)return bi;Xa=1;const e=kl(),r=gn();function n(o){return o.startsWith("int[")?"int256"+o.slice(3):o==="int"?"int256":o.startsWith("uint[")?"uint256"+o.slice(4):o==="uint"?"uint256":o.startsWith("fixed[")?"fixed128x128"+o.slice(5):o==="fixed"?"fixed128x128":o.startsWith("ufixed[")?"ufixed128x128"+o.slice(6):o==="ufixed"?"ufixed128x128":o}function t(o){return parseInt(/^\D+(\d+)$/.exec(o)[1],10)}function d(o){var m=/^\D+(\d+)x(\d+)$/.exec(o);return[parseInt(m[1],10),parseInt(m[2],10)]}function i(o){var m=o.match(/(.*)\[(.*?)\]$/);return m?m[2]===""?"dynamic":parseInt(m[2],10):null}function u(o){var m=typeof o;if(m==="string")return e.isHexString(o)?new r(e.stripHexPrefix(o),16):new r(o,10);if(m==="number")return new r(o);if(o.toArray)return o;throw new Error("Argument is not a number")}function p(o,m){var _,w,a,E;if(o==="address")return p("uint160",u(m));if(o==="bool")return p("uint8",m?1:0);if(o==="string")return p("bytes",new ge(m,"utf8"));if(h(o)){if(typeof m.length>"u")throw new Error("Not an array?");if(_=i(o),_!=="dynamic"&&_!==0&&m.length>_)throw new Error("Elements exceed array size: "+_);a=[],o=o.slice(0,o.lastIndexOf("[")),typeof m=="string"&&(m=JSON.parse(m));for(E in m)a.push(p(o,m[E]));if(_==="dynamic"){var S=p("uint256",m.length);a.unshift(S)}return ge.concat(a)}else{if(o==="bytes")return m=new ge(m),a=ge.concat([p("uint256",m.length),m]),m.length%32!==0&&(a=ge.concat([a,e.zeros(32-m.length%32)])),a;if(o.startsWith("bytes")){if(_=t(o),_<1||_>32)throw new Error("Invalid bytes<N> width: "+_);return e.setLengthRight(m,32)}else if(o.startsWith("uint")){if(_=t(o),_%8||_<8||_>256)throw new Error("Invalid uint<N> width: "+_);if(w=u(m),w.bitLength()>_)throw new Error("Supplied uint exceeds width: "+_+" vs "+w.bitLength());if(w<0)throw new Error("Supplied uint is negative");return w.toArrayLike(ge,"be",32)}else if(o.startsWith("int")){if(_=t(o),_%8||_<8||_>256)throw new Error("Invalid int<N> width: "+_);if(w=u(m),w.bitLength()>_)throw new Error("Supplied int exceeds width: "+_+" vs "+w.bitLength());return w.toTwos(256).toArrayLike(ge,"be",32)}else if(o.startsWith("ufixed")){if(_=d(o),w=u(m),w<0)throw new Error("Supplied ufixed is negative");return p("uint256",w.mul(new r(2).pow(new r(_[1]))))}else if(o.startsWith("fixed"))return _=d(o),p("int256",u(m).mul(new r(2).pow(new r(_[1]))))}throw new Error("Unsupported or invalid type: "+o)}function f(o){return o==="string"||o==="bytes"||i(o)==="dynamic"}function h(o){return o.lastIndexOf("]")===o.length-1}function g(o,m){var _=[],w=[],a=32*o.length;for(var E in o){var S=n(o[E]),I=m[E],T=p(S,I);f(S)?(_.push(p("uint256",a)),w.push(T),a+=T.length):_.push(T)}return ge.concat(_.concat(w))}function s(o,m){if(o.length!==m.length)throw new Error("Number of types are not matching the values");for(var _,w,a=[],E=0;E<o.length;E++){var S=n(o[E]),I=m[E];if(S==="bytes")a.push(I);else if(S==="string")a.push(new ge(I,"utf8"));else if(S==="bool")a.push(new ge(I?"01":"00","hex"));else if(S==="address")a.push(e.setLength(I,20));else if(S.startsWith("bytes")){if(_=t(S),_<1||_>32)throw new Error("Invalid bytes<N> width: "+_);a.push(e.setLengthRight(I,_))}else if(S.startsWith("uint")){if(_=t(S),_%8||_<8||_>256)throw new Error("Invalid uint<N> width: "+_);if(w=u(I),w.bitLength()>_)throw new Error("Supplied uint exceeds width: "+_+" vs "+w.bitLength());a.push(w.toArrayLike(ge,"be",_/8))}else if(S.startsWith("int")){if(_=t(S),_%8||_<8||_>256)throw new Error("Invalid int<N> width: "+_);if(w=u(I),w.bitLength()>_)throw new Error("Supplied int exceeds width: "+_+" vs "+w.bitLength());a.push(w.toTwos(_).toArrayLike(ge,"be",_/8))}else throw new Error("Unsupported or invalid type: "+S)}return ge.concat(a)}function c(o,m){return e.keccak(s(o,m))}return bi={rawEncode:g,solidityPack:s,soliditySHA3:c},bi}var _i,ec;function hf(){if(ec)return _i;ec=1;const e=kl(),r=lf(),n={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"]},t={encodeData(i,u,p,f=!0){const h=["bytes32"],g=[this.hashType(i,p)];if(f){const s=(c,o,m)=>{if(p[o]!==void 0)return["bytes32",m==null?"0x0000000000000000000000000000000000000000000000000000000000000000":e.keccak(this.encodeData(o,m,p,f))];if(m===void 0)throw new Error(`missing value for field ${c} of type ${o}`);if(o==="bytes")return["bytes32",e.keccak(m)];if(o==="string")return typeof m=="string"&&(m=ge.from(m,"utf8")),["bytes32",e.keccak(m)];if(o.lastIndexOf("]")===o.length-1){const _=o.slice(0,o.lastIndexOf("[")),w=m.map(a=>s(c,_,a));return["bytes32",e.keccak(r.rawEncode(w.map(([a])=>a),w.map(([,a])=>a)))]}return[o,m]};for(const c of p[i]){const[o,m]=s(c.name,c.type,u[c.name]);h.push(o),g.push(m)}}else for(const s of p[i]){let c=u[s.name];if(c!==void 0)if(s.type==="bytes")h.push("bytes32"),c=e.keccak(c),g.push(c);else if(s.type==="string")h.push("bytes32"),typeof c=="string"&&(c=ge.from(c,"utf8")),c=e.keccak(c),g.push(c);else if(p[s.type]!==void 0)h.push("bytes32"),c=e.keccak(this.encodeData(s.type,c,p,f)),g.push(c);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");h.push(s.type),g.push(c)}}return r.rawEncode(h,g)},encodeType(i,u){let p="",f=this.findTypeDependencies(i,u).filter(h=>h!==i);f=[i].concat(f.sort());for(const h of f){if(!u[h])throw new Error("No type definition specified: "+h);p+=h+"("+u[h].map(({name:s,type:c})=>c+" "+s).join(",")+")"}return p},findTypeDependencies(i,u,p=[]){if(i=i.match(/^\w*/)[0],p.includes(i)||u[i]===void 0)return p;p.push(i);for(const f of u[i])for(const h of this.findTypeDependencies(f.type,u,p))!p.includes(h)&&p.push(h);return p},hashStruct(i,u,p,f=!0){return e.keccak(this.encodeData(i,u,p,f))},hashType(i,u){return e.keccak(this.encodeType(i,u))},sanitizeData(i){const u={};for(const p in n.properties)i[p]&&(u[p]=i[p]);return u.types&&(u.types=Object.assign({EIP712Domain:[]},u.types)),u},hash(i,u=!0){const p=this.sanitizeData(i),f=[ge.from("1901","hex")];return f.push(this.hashStruct("EIP712Domain",p.domain,p.types,u)),p.primaryType!=="EIP712Domain"&&f.push(this.hashStruct(p.primaryType,p.message,p.types,u)),e.keccak(ge.concat(f))}};_i={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:t,hashForSignTypedDataLegacy:function(i){return d(i.data)},hashForSignTypedData_v3:function(i){return t.hash(i.data,!1)},hashForSignTypedData_v4:function(i){return t.hash(i.data)}};function d(i){const u=new Error("Expect argument to be non-empty array");if(typeof i!="object"||!i.length)throw u;const p=i.map(function(g){return g.type==="bytes"?e.toBuffer(g.value):g.value}),f=i.map(function(g){return g.type}),h=i.map(function(g){if(!g.name)throw u;return g.type+" "+g.name});return r.soliditySHA3(["bytes32","bytes32"],[r.soliditySHA3(new Array(i.length).fill("string"),h),r.soliditySHA3(f,p)])}return _i}var Ut={},tc;function ff(){if(tc)return Ut;tc=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.filterFromParam=Ut.FilterPolyfill=void 0;const e=wn(),r=lt(),n=5*60*1e3,t={jsonrpc:"2.0",id:0};let d=class{constructor(c){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,e.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=c}async newFilter(c){const o=i(c),m=this.makeFilterId(),_=await this.setInitialCursorPosition(m,o.fromBlock);return console.info(`Installing new log filter(${m}):`,o,"initial cursor position:",_),this.logFilters.set(m,o),this.setFilterTimeout(m),(0,r.hexStringFromIntNumber)(m)}async newBlockFilter(){const c=this.makeFilterId(),o=await this.setInitialCursorPosition(c,"latest");return console.info(`Installing new block filter (${c}) with initial cursor position:`,o),this.blockFilters.add(c),this.setFilterTimeout(c),(0,r.hexStringFromIntNumber)(c)}async newPendingTransactionFilter(){const c=this.makeFilterId(),o=await this.setInitialCursorPosition(c,"latest");return console.info(`Installing new block filter (${c}) with initial cursor position:`,o),this.pendingTransactionFilters.add(c),this.setFilterTimeout(c),(0,r.hexStringFromIntNumber)(c)}uninstallFilter(c){const o=(0,r.intNumberFromHexString)(c);return console.info(`Uninstalling filter (${o})`),this.deleteFilter(o),!0}getFilterChanges(c){const o=(0,r.intNumberFromHexString)(c);return this.timeouts.has(o)&&this.setFilterTimeout(o),this.logFilters.has(o)?this.getLogFilterChanges(o):this.blockFilters.has(o)?this.getBlockFilterChanges(o):this.pendingTransactionFilters.has(o)?this.getPendingTransactionFilterChanges(o):Promise.resolve(h())}async getFilterLogs(c){const o=(0,r.intNumberFromHexString)(c),m=this.logFilters.get(o);return m?this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[u(m)]})):h()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(c){return new Promise((o,m)=>{this.provider.sendAsync(c,(_,w)=>{if(_)return m(_);if(Array.isArray(w)||w==null)return m(new Error(`unexpected response received: ${JSON.stringify(w)}`));o(w)})})}deleteFilter(c){console.info(`Deleting filter (${c})`),this.logFilters.delete(c),this.blockFilters.delete(c),this.pendingTransactionFilters.delete(c),this.cursors.delete(c),this.timeouts.delete(c)}async getLogFilterChanges(c){const o=this.logFilters.get(c),m=this.cursors.get(c);if(!m||!o)return h();const _=await this.getCurrentBlockHeight(),w=o.toBlock==="latest"?_:o.toBlock;if(m>_||m>Number(o.toBlock))return g();console.info(`Fetching logs from ${m} to ${w} for filter ${c}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[u(Object.assign(Object.assign({},o),{fromBlock:m,toBlock:w}))]}));if(Array.isArray(a.result)){const E=a.result.map(I=>(0,r.intNumberFromHexString)(I.blockNumber||"0x0")),S=Math.max(...E);if(S&&S>m){const I=(0,e.IntNumber)(S+1);console.info(`Moving cursor position for filter (${c}) from ${m} to ${I}`),this.cursors.set(c,I)}}return a}async getBlockFilterChanges(c){const o=this.cursors.get(c);if(!o)return h();const m=await this.getCurrentBlockHeight();if(o>m)return g();console.info(`Fetching blocks from ${o} to ${m} for filter (${c})`);const _=(await Promise.all((0,r.range)(o,m+1).map(a=>this.getBlockHashByNumber((0,e.IntNumber)(a))))).filter(a=>!!a),w=(0,e.IntNumber)(o+_.length);return console.info(`Moving cursor position for filter (${c}) from ${o} to ${w}`),this.cursors.set(c,w),Object.assign(Object.assign({},t),{result:_})}async getPendingTransactionFilterChanges(c){return Promise.resolve(g())}async setInitialCursorPosition(c,o){const m=await this.getCurrentBlockHeight(),_=typeof o=="number"&&o>m?o:m;return this.cursors.set(c,_),_}setFilterTimeout(c){const o=this.timeouts.get(c);o&&window.clearTimeout(o);const m=window.setTimeout(()=>{console.info(`Filter (${c}) timed out`),this.deleteFilter(c)},n);this.timeouts.set(c,m)}async getCurrentBlockHeight(){const c=new Date;if(c.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=c;const o=await this._getCurrentBlockHeight();this.currentBlockHeight=o,this.resolvers.forEach(m=>m(o)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(o=>this.resolvers.push(o))}async _getCurrentBlockHeight(){const{result:c}=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_blockNumber",params:[]}));return(0,r.intNumberFromHexString)((0,r.ensureHexString)(c))}async getBlockHashByNumber(c){const o=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getBlockByNumber",params:[(0,r.hexStringFromIntNumber)(c),!1]}));return o.result&&typeof o.result.hash=="string"?(0,r.ensureHexString)(o.result.hash):null}};Ut.FilterPolyfill=d;function i(s){return{fromBlock:p(s.fromBlock),toBlock:p(s.toBlock),addresses:s.address===void 0?null:Array.isArray(s.address)?s.address:[s.address],topics:s.topics||[]}}Ut.filterFromParam=i;function u(s){const c={fromBlock:f(s.fromBlock),toBlock:f(s.toBlock),topics:s.topics};return s.addresses!==null&&(c.address=s.addresses),c}function p(s){if(s===void 0||s==="latest"||s==="pending")return"latest";if(s==="earliest")return(0,e.IntNumber)(0);if((0,r.isHexString)(s))return(0,r.intNumberFromHexString)(s);throw new Error(`Invalid block option: ${String(s)}`)}function f(s){return s==="latest"?s:(0,r.hexStringFromIntNumber)(s)}function h(){return Object.assign(Object.assign({},t),{error:{code:-32e3,message:"filter not found"}})}function g(){return Object.assign(Object.assign({},t),{result:[]})}return Ut}var Br={},Ht={},Wt={},Ei,rc;function Ys(){if(rc)return Ei;rc=1,Ei=e;function e(r){r=r||{};var n=r.max||Number.MAX_SAFE_INTEGER,t=typeof r.start<"u"?r.start:Math.floor(Math.random()*n);return function(){return t=t%n,t++}}return Ei}var Si,nc;function df(){if(nc)return Si;nc=1;const e=(r,n)=>function(){const t=n.promiseModule,d=new Array(arguments.length);for(let i=0;i<arguments.length;i++)d[i]=arguments[i];return new t((i,u)=>{n.errorFirst?d.push(function(p,f){if(n.multiArgs){const h=new Array(arguments.length-1);for(let g=1;g<arguments.length;g++)h[g-1]=arguments[g];p?(h.unshift(p),u(h)):i(h)}else p?u(p):i(f)}):d.push(function(p){if(n.multiArgs){const f=new Array(arguments.length-1);for(let h=0;h<arguments.length;h++)f[h]=arguments[h];i(f)}else i(p)}),r.apply(this,d)})};return Si=(r,n)=>{n=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},n);const t=i=>{const u=p=>typeof p=="string"?i===p:p.test(i);return n.include?n.include.some(u):!n.exclude.some(u)};let d;typeof r=="function"?d=function(){return n.excludeMain?r.apply(this,arguments):e(r,n).apply(this,arguments)}:d=Object.create(Object.getPrototypeOf(r));for(const i in r){const u=r[i];d[i]=typeof u=="function"&&t(i)?e(u,n):u}return d},Si}var Vt={},on={},ic;function Xs(){if(ic)return on;ic=1,Object.defineProperty(on,"__esModule",{value:!0});const e=pn();function r(d,i,u){try{Reflect.apply(d,i,u)}catch(p){setTimeout(()=>{throw p})}}function n(d){const i=d.length,u=new Array(i);for(let p=0;p<i;p+=1)u[p]=d[p];return u}class t extends e.EventEmitter{emit(i,...u){let p=i==="error";const f=this._events;if(f!==void 0)p=p&&f.error===void 0;else if(!p)return!1;if(p){let g;if(u.length>0&&([g]=u),g instanceof Error)throw g;const s=new Error(`Unhandled error.${g?` (${g.message})`:""}`);throw s.context=g,s}const h=f[i];if(h===void 0)return!1;if(typeof h=="function")r(h,this,u);else{const g=h.length,s=n(h);for(let c=0;c<g;c+=1)r(s[c],this,u)}return!0}}return on.default=t,on}var sc;function Il(){if(sc)return Vt;sc=1;var e=Vt&&Vt.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.BaseBlockTracker=void 0;const r=e(Xs()),n=1e3,t=(p,f)=>p+f,d=["sync","latest"];let i=class extends r.default{constructor(f){super(),this._blockResetDuration=f.blockResetDuration||20*n,this._usePastBlocks=f.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(h=>this.once("latest",h))}removeAllListeners(f){return f?super.removeAllListeners(f):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(f){d.includes(f)&&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 d.map(f=>this.listenerCount(f)).reduce(t)}_shouldUseNewBlock(f){const h=this._currentBlock;if(!h)return!0;const g=u(f),s=u(h);return this._usePastBlocks&&g<s||g>s}_newPotentialLatest(f){this._shouldUseNewBlock(f)&&this._setCurrentBlock(f)}_setCurrentBlock(f){const h=this._currentBlock;this._currentBlock=f,this.emit("latest",f),this.emit("sync",{oldBlock:h,newBlock:f})}_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}};Vt.BaseBlockTracker=i;function u(p){return Number.parseInt(p,16)}return Vt}var Ri={},zt={},tt={};class Al extends TypeError{constructor(r,n){let t;const{message:d,explanation:i,...u}=r,{path:p}=r,f=p.length===0?d:`At path: ${p.join(".")} -- ${d}`;super(i??f),i!=null&&(this.cause=f),Object.assign(this,u),this.name=this.constructor.name,this.failures=()=>t??(t=[r,...n()])}}function pf(e){return Ye(e)&&typeof e[Symbol.iterator]=="function"}function Ye(e){return typeof e=="object"&&e!=null}function oc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function He(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function gf(e){const{done:r,value:n}=e.next();return r?void 0:n}function mf(e,r,n,t){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:d,branch:i}=r,{type:u}=n,{refinement:p,message:f=`Expected a value of type \`${u}\`${p?` with refinement \`${p}\``:""}, but received: \`${He(t)}\``}=e;return{value:t,type:u,refinement:p,key:d[d.length-1],path:d,branch:i,...e,message:f}}function*Hs(e,r,n,t){pf(e)||(e=[e]);for(const d of e){const i=mf(d,r,n,t);i&&(yield i)}}function*eo(e,r,n={}){const{path:t=[],branch:d=[e],coerce:i=!1,mask:u=!1}=n,p={path:t,branch:d};if(i&&(e=r.coercer(e,p),u&&r.type!=="type"&&Ye(r.schema)&&Ye(e)&&!Array.isArray(e)))for(const h in e)r.schema[h]===void 0&&delete e[h];let f="valid";for(const h of r.validator(e,p))h.explanation=n.message,f="not_valid",yield[h,void 0];for(let[h,g,s]of r.entries(e,p)){const c=eo(g,s,{path:h===void 0?t:[...t,h],branch:h===void 0?d:[...d,g],coerce:i,mask:u,message:n.message});for(const o of c)o[0]?(f=o[0].refinement!=null?"not_refined":"not_valid",yield[o[0],void 0]):i&&(g=o[1],h===void 0?e=g:e instanceof Map?e.set(h,g):e instanceof Set?e.add(g):Ye(e)&&(g!==void 0||h in e)&&(e[h]=g))}if(f!=="not_valid")for(const h of r.refiner(e,p))h.explanation=n.message,f="not_refined",yield[h,void 0];f==="valid"&&(yield[void 0,e])}class Ue{constructor(r){const{type:n,schema:t,validator:d,refiner:i,coercer:u=f=>f,entries:p=function*(){}}=r;this.type=n,this.schema=t,this.entries=p,this.coercer=u,d?this.validator=(f,h)=>{const g=d(f,h);return Hs(g,h,this,f)}:this.validator=()=>[],i?this.refiner=(f,h)=>{const g=i(f,h);return Hs(g,h,this,f)}:this.refiner=()=>[]}assert(r,n){return xl(r,this,n)}create(r,n){return Tl(r,this,n)}is(r){return to(r,this)}mask(r,n){return Bl(r,this,n)}validate(r,n={}){return sr(r,this,n)}}function xl(e,r,n){const t=sr(e,r,{message:n});if(t[0])throw t[0]}function Tl(e,r,n){const t=sr(e,r,{coerce:!0,message:n});if(t[0])throw t[0];return t[1]}function Bl(e,r,n){const t=sr(e,r,{coerce:!0,mask:!0,message:n});if(t[0])throw t[0];return t[1]}function to(e,r){return!sr(e,r)[0]}function sr(e,r,n={}){const t=eo(e,r,n),d=gf(t);return d[0]?[new Al(d[0],function*(){for(const u of t)u[0]&&(yield u[0])}),void 0]:[void 0,d[1]]}function yf(...e){const r=e[0].type==="type",n=e.map(d=>d.schema),t=Object.assign({},...n);return r?Gr(t):zr(t)}function Ze(e,r){return new Ue({type:e,schema:null,validator:r})}function wf(e,r){return new Ue({...e,refiner:(n,t)=>n===void 0||e.refiner(n,t),validator(n,t){return n===void 0?!0:(r(n,t),e.validator(n,t))}})}function vf(e){return new Ue({type:"dynamic",schema:null,*entries(r,n){yield*e(r,n).entries(r,n)},validator(r,n){return e(r,n).validator(r,n)},coercer(r,n){return e(r,n).coercer(r,n)},refiner(r,n){return e(r,n).refiner(r,n)}})}function bf(e){let r;return new Ue({type:"lazy",schema:null,*entries(n,t){r??(r=e()),yield*r.entries(n,t)},validator(n,t){return r??(r=e()),r.validator(n,t)},coercer(n,t){return r??(r=e()),r.coercer(n,t)},refiner(n,t){return r??(r=e()),r.refiner(n,t)}})}function _f(e,r){const{schema:n}=e,t={...n};for(const d of r)delete t[d];switch(e.type){case"type":return Gr(t);default:return zr(t)}}function Ef(e){const r=e instanceof Ue,n=r?{...e.schema}:{...e};for(const t in n)n[t]=Ll(n[t]);return r&&e.type==="type"?Gr(n):zr(n)}function Sf(e,r){const{schema:n}=e,t={};for(const d of r)t[d]=n[d];switch(e.type){case"type":return Gr(t);default:return zr(t)}}function Rf(e,r){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ze(e,r)}function Cf(){return Ze("any",()=>!0)}function Mf(e){return new Ue({type:"array",schema:e,*entries(r){if(e&&Array.isArray(r))for(const[n,t]of r.entries())yield[n,t,e]},coercer(r){return Array.isArray(r)?r.slice():r},validator(r){return Array.isArray(r)||`Expected an array value, but received: ${He(r)}`}})}function kf(){return Ze("bigint",e=>typeof e=="bigint")}function If(){return Ze("boolean",e=>typeof e=="boolean")}function Af(){return Ze("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${He(e)}`)}function xf(e){const r={},n=e.map(t=>He(t)).join();for(const t of e)r[t]=t;return new Ue({type:"enums",schema:r,validator(t){return e.includes(t)||`Expected one of \`${n}\`, but received: ${He(t)}`}})}function Tf(){return Ze("func",e=>typeof e=="function"||`Expected a function, but received: ${He(e)}`)}function Bf(e){return Ze("instance",r=>r instanceof e||`Expected a \`${e.name}\` instance, but received: ${He(r)}`)}function Lf(){return Ze("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${He(e)}`)}function Nf(e){return new Ue({type:"intersection",schema:null,*entries(r,n){for(const t of e)yield*t.entries(r,n)},*validator(r,n){for(const t of e)yield*t.validator(r,n)},*refiner(r,n){for(const t of e)yield*t.refiner(r,n)}})}function Of(e){const r=He(e),n=typeof e;return new Ue({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator(t){return t===e||`Expected the literal \`${r}\`, but received: ${He(t)}`}})}function Pf(e,r){return new Ue({type:"map",schema:null,*entries(n){if(e&&r&&n instanceof Map)for(const[t,d]of n.entries())yield[t,t,e],yield[t,d,r]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${He(n)}`}})}function ro(){return Ze("never",()=>!1)}function Ff(e){return new Ue({...e,validator:(r,n)=>r===null||e.validator(r,n),refiner:(r,n)=>r===null||e.refiner(r,n)})}function Df(){return Ze("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${He(e)}`)}function zr(e){const r=e?Object.keys(e):[],n=ro();return new Ue({type:"object",schema:e||null,*entries(t){if(e&&Ye(t)){const d=new Set(Object.keys(t));for(const i of r)d.delete(i),yield[i,t[i],e[i]];for(const i of d)yield[i,t[i],n]}},validator(t){return Ye(t)||`Expected an object, but received: ${He(t)}`},coercer(t){return Ye(t)?{...t}:t}})}function Ll(e){return new Ue({...e,validator:(r,n)=>r===void 0||e.validator(r,n),refiner:(r,n)=>r===void 0||e.refiner(r,n)})}function qf(e,r){return new Ue({type:"record",schema:null,*entries(n){if(Ye(n))for(const t in n){const d=n[t];yield[t,t,e],yield[t,d,r]}},validator(n){return Ye(n)||`Expected an object, but received: ${He(n)}`}})}function jf(){return Ze("regexp",e=>e instanceof RegExp)}function Uf(e){return new Ue({type:"set",schema:null,*entries(r){if(e&&r instanceof Set)for(const n of r)yield[n,n,e]},coercer(r){return r instanceof Set?new Set(r):r},validator(r){return r instanceof Set||`Expected a \`Set\` object, but received: ${He(r)}`}})}function Nl(){return Ze("string",e=>typeof e=="string"||`Expected a string, but received: ${He(e)}`)}function Hf(e){const r=ro();return new Ue({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const t=Math.max(e.length,n.length);for(let d=0;d<t;d++)yield[d,n[d],e[d]||r]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${He(n)}`}})}function Gr(e){const r=Object.keys(e);return new Ue({type:"type",schema:e,*entries(n){if(Ye(n))for(const t of r)yield[t,n[t],e[t]]},validator(n){return Ye(n)||`Expected an object, but received: ${He(n)}`},coercer(n){return Ye(n)?{...n}:n}})}function Wf(e){const r=e.map(n=>n.type).join(" | ");return new Ue({type:"union",schema:null,coercer(n){for(const t of e){const[d,i]=t.validate(n,{coerce:!0});if(!d)return i}return n},validator(n,t){const d=[];for(const i of e){const[...u]=eo(n,i,t),[p]=u;if(p[0])for(const[f]of u)f&&d.push(f);else return[]}return[`Expected the value to satisfy a union of \`${r}\`, but received: ${He(n)}`,...d]}})}function Ol(){return Ze("unknown",()=>!0)}function no(e,r,n){return new Ue({...e,coercer:(t,d)=>to(t,r)?e.coercer(n(t,d),d):e.coercer(t,d)})}function Vf(e,r,n={}){return no(e,Ol(),t=>{const d=typeof r=="function"?r():r;if(t===void 0)return d;if(!n.strict&&oc(t)&&oc(d)){const i={...t};let u=!1;for(const p in d)i[p]===void 0&&(i[p]=d[p],u=!0);if(u)return i}return t})}function zf(e){return no(e,Nl(),r=>r.trim())}function Gf(e){return Yt(e,"empty",r=>{const n=Pl(r);return n===0||`Expected an empty ${e.type} but received one with a size of \`${n}\``})}function Pl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Jf(e,r,n={}){const{exclusive:t}=n;return Yt(e,"max",d=>t?d<r:d<=r||`Expected a ${e.type} less than ${t?"":"or equal to "}${r} but received \`${d}\``)}function $f(e,r,n={}){const{exclusive:t}=n;return Yt(e,"min",d=>t?d>r:d>=r||`Expected a ${e.type} greater than ${t?"":"or equal to "}${r} but received \`${d}\``)}function Zf(e){return Yt(e,"nonempty",r=>Pl(r)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Kf(e,r){return Yt(e,"pattern",n=>r.test(n)||`Expected a ${e.type} matching \`/${r.source}/\` but received "${n}"`)}function Qf(e,r,n=r){const t=`Expected a ${e.type}`,d=r===n?`of \`${r}\``:`between \`${r}\` and \`${n}\``;return Yt(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return r<=i&&i<=n||`${t} ${d} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:u}=i;return r<=u&&u<=n||`${t} with a size ${d} but received one with a size of \`${u}\``}else{const{length:u}=i;return r<=u&&u<=n||`${t} with a length ${d} but received one with a length of \`${u}\``}})}function Yt(e,r,n){return new Ue({...e,*refiner(t,d){yield*e.refiner(t,d);const i=n(t,d),u=Hs(i,d,e,t);for(const p of u)yield{...p,refinement:r}}})}const Yf=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ue,StructError:Al,any:Cf,array:Mf,assert:xl,assign:yf,bigint:kf,boolean:If,coerce:no,create:Tl,date:Af,defaulted:Vf,define:Ze,deprecated:wf,dynamic:vf,empty:Gf,enums:xf,func:Tf,instance:Bf,integer:Lf,intersection:Nf,is:to,lazy:bf,literal:Of,map:Pf,mask:Bl,max:Jf,min:$f,never:ro,nonempty:Zf,nullable:Ff,number:Df,object:zr,omit:_f,optional:Ll,partial:Ef,pattern:Kf,pick:Sf,record:qf,refine:Yt,regexp:jf,set:Uf,size:Qf,string:Nl,struct:Rf,trimmed:zf,tuple:Hf,type:Gr,union:Wf,unknown:Ol,validate:sr},Symbol.toStringTag,{value:"Module"})),Xt=dn(Yf);var ac;function gt(){if(ac)return tt;ac=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.assertExhaustive=tt.assertStruct=tt.assert=tt.AssertionError=void 0;const e=Xt;function r(h){return typeof h=="object"&&h!==null&&"message"in h}function n(h){var g,s;return typeof((s=(g=h==null?void 0:h.prototype)===null||g===void 0?void 0:g.constructor)===null||s===void 0?void 0:s.name)=="string"}function t(h){const g=r(h)?h.message:String(h);return g.endsWith(".")?g.slice(0,-1):g}function d(h,g){return n(h)?new h({message:g}):h({message:g})}class i extends Error{constructor(g){super(g.message),this.code="ERR_ASSERTION"}}tt.AssertionError=i;function u(h,g="Assertion failed.",s=i){if(!h)throw g instanceof Error?g:d(s,g)}tt.assert=u;function p(h,g,s="Assertion failed",c=i){try{(0,e.assert)(h,g)}catch(o){throw d(c,`${s}: ${t(o)}.`)}}tt.assertStruct=p;function f(h){throw new Error("Invalid branch reached. Should be detected during compilation.")}return tt.assertExhaustive=f,tt}var Lr={},cc;function Fl(){if(cc)return Lr;cc=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.base64=void 0;const e=Xt,r=gt(),n=(t,d={})=>{var i,u;const p=(i=d.paddingRequired)!==null&&i!==void 0?i:!1,f=(u=d.characterSet)!==null&&u!==void 0?u:"base64";let h;f==="base64"?h=String.raw`[A-Za-z0-9+\/]`:((0,r.assert)(f==="base64url"),h=String.raw`[-_A-Za-z0-9]`);let g;return p?g=new RegExp(`^(?:${h}{4})*(?:${h}{3}=|${h}{2}==)?$`,"u"):g=new RegExp(`^(?:${h}{4})*(?:${h}{2,3}|${h}{3}=|${h}{2}==)?$`,"u"),(0,e.pattern)(t,g)};return Lr.base64=n,Lr}var _e={},Ci={},uc;function bn(){return uc||(uc=1,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 r=Xt,n=gt();e.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/iu);function t(h){return(0,r.is)(h,e.HexStruct)}e.isHexString=t;function d(h){return(0,r.is)(h,e.StrictHexStruct)}e.isStrictHexString=d;function i(h){(0,n.assert)(t(h),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function u(h){(0,n.assert)(d(h),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=u;function p(h){return h.startsWith("0x")?h:h.startsWith("0X")?`0x${h.substring(2)}`:`0x${h}`}e.add0x=p;function f(h){return h.startsWith("0x")||h.startsWith("0X")?h.substring(2):h}e.remove0x=f}(Ci)),Ci}var lc;function Dl(){if(lc)return _e;lc=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.createDataView=_e.concatBytes=_e.valueToBytes=_e.stringToBytes=_e.numberToBytes=_e.signedBigIntToBytes=_e.bigIntToBytes=_e.hexToBytes=_e.bytesToString=_e.bytesToNumber=_e.bytesToSignedBigInt=_e.bytesToBigInt=_e.bytesToHex=_e.assertIsBytes=_e.isBytes=void 0;const e=gt(),r=bn(),n=48,t=58,d=87;function i(){const N=[];return()=>{if(N.length===0)for(let H=0;H<256;H++)N.push(H.toString(16).padStart(2,"0"));return N}}const u=i();function p(N){return N instanceof Uint8Array}_e.isBytes=p;function f(N){(0,e.assert)(p(N),"Value must be a Uint8Array.")}_e.assertIsBytes=f;function h(N){if(f(N),N.length===0)return"0x";const H=u(),K=new Array(N.length);for(let X=0;X<N.length;X++)K[X]=H[N[X]];return(0,r.add0x)(K.join(""))}_e.bytesToHex=h;function g(N){f(N);const H=h(N);return BigInt(H)}_e.bytesToBigInt=g;function s(N){f(N);let H=BigInt(0);for(const K of N)H=(H<<BigInt(8))+BigInt(K);return BigInt.asIntN(N.length*8,H)}_e.bytesToSignedBigInt=s;function c(N){f(N);const H=g(N);return(0,e.assert)(H<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(H)}_e.bytesToNumber=c;function o(N){return f(N),new TextDecoder().decode(N)}_e.bytesToString=o;function m(N){var H;if(((H=N==null?void 0:N.toLowerCase)===null||H===void 0?void 0:H.call(N))==="0x")return new Uint8Array;(0,r.assertIsHexString)(N);const K=(0,r.remove0x)(N).toLowerCase(),X=K.length%2===0?K:`0${K}`,re=new Uint8Array(X.length/2);for(let W=0;W<re.length;W++){const D=X.charCodeAt(W*2),l=X.charCodeAt(W*2+1),b=D-(D<t?n:d),C=l-(l<t?n:d);re[W]=b*16+C}return re}_e.hexToBytes=m;function _(N){(0,e.assert)(typeof N=="bigint","Value must be a bigint."),(0,e.assert)(N>=BigInt(0),"Value must be a non-negative bigint.");const H=N.toString(16);return m(H)}_e.bigIntToBytes=_;function w(N,H){(0,e.assert)(H>0);const K=N>>BigInt(31);return!((~N&K)+(N&~K)>>BigInt(H*8+-1))}function a(N,H){(0,e.assert)(typeof N=="bigint","Value must be a bigint."),(0,e.assert)(typeof H=="number","Byte length must be a number."),(0,e.assert)(H>0,"Byte length must be greater than 0."),(0,e.assert)(w(N,H),"Byte length is too small to represent the given value.");let K=N;const X=new Uint8Array(H);for(let re=0;re<X.length;re++)X[re]=Number(BigInt.asUintN(8,K)),K>>=BigInt(8);return X.reverse()}_e.signedBigIntToBytes=a;function E(N){(0,e.assert)(typeof N=="number","Value must be a number."),(0,e.assert)(N>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(N),"Value is not a safe integer. Use `bigIntToBytes` instead.");const H=N.toString(16);return m(H)}_e.numberToBytes=E;function S(N){return(0,e.assert)(typeof N=="string","Value must be a string."),new TextEncoder().encode(N)}_e.stringToBytes=S;function I(N){if(typeof N=="bigint")return _(N);if(typeof N=="number")return E(N);if(typeof N=="string")return N.startsWith("0x")?m(N):S(N);if(p(N))return N;throw new TypeError(`Unsupported value type: "${typeof N}".`)}_e.valueToBytes=I;function T(N){const H=new Array(N.length);let K=0;for(let re=0;re<N.length;re++){const W=I(N[re]);H[re]=W,K+=W.length}const X=new Uint8Array(K);for(let re=0,W=0;re<H.length;re++)X.set(H[re],W),W+=H[re].length;return X}_e.concatBytes=T;function q(N){if(typeof ge<"u"&&N instanceof ge){const H=N.buffer.slice(N.byteOffset,N.byteOffset+N.byteLength);return new DataView(H)}return new DataView(N.buffer,N.byteOffset,N.byteLength)}return _e.createDataView=q,_e}var Nr={},hc;function Xf(){if(hc)return Nr;hc=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.ChecksumStruct=void 0;const e=Xt,r=Fl();return Nr.ChecksumStruct=(0,e.size)((0,r.base64)((0,e.string)(),{paddingRequired:!0}),44,44),Nr}var rt={},fc;function ed(){if(fc)return rt;fc=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.createHex=rt.createBytes=rt.createBigInt=rt.createNumber=void 0;const e=Xt,r=gt(),n=Dl(),t=bn(),d=(0,e.union)([(0,e.number)(),(0,e.bigint)(),(0,e.string)(),t.StrictHexStruct]),i=(0,e.coerce)((0,e.number)(),d,Number),u=(0,e.coerce)((0,e.bigint)(),d,BigInt);(0,e.union)([t.StrictHexStruct,(0,e.instance)(Uint8Array)]);const p=(0,e.coerce)((0,e.instance)(Uint8Array),(0,e.union)([t.StrictHexStruct]),n.hexToBytes),f=(0,e.coerce)(t.StrictHexStruct,(0,e.instance)(Uint8Array),n.bytesToHex);function h(o){try{const m=(0,e.create)(o,i);return(0,r.assert)(Number.isFinite(m),`Expected a number-like value, got "${o}".`),m}catch(m){throw m instanceof e.StructError?new Error(`Expected a number-like value, got "${o}".`):m}}rt.createNumber=h;function g(o){try{return(0,e.create)(o,u)}catch(m){throw m instanceof e.StructError?new Error(`Expected a number-like value, got "${String(m.value)}".`):m}}rt.createBigInt=g;function s(o){if(typeof o=="string"&&o.toLowerCase()==="0x")return new Uint8Array;try{return(0,e.create)(o,p)}catch(m){throw m instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(m.value)}".`):m}}rt.createBytes=s;function c(o){if(o instanceof Uint8Array&&o.length===0||typeof o=="string"&&o.toLowerCase()==="0x")return"0x";try{return(0,e.create)(o,f)}catch(m){throw m instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(m.value)}".`):m}}return rt.createHex=c,rt}var nt={},dc;function td(){if(dc)return nt;dc=1;var e=nt&&nt.__classPrivateFieldSet||function(u,p,f,h,g){if(h==="m")throw new TypeError("Private method is not writable");if(h==="a"&&!g)throw new TypeError("Private accessor was defined without a setter");if(typeof p=="function"?u!==p||!g:!p.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return h==="a"?g.call(u,f):g?g.value=f:p.set(u,f),f},r=nt&&nt.__classPrivateFieldGet||function(u,p,f,h){if(f==="a"&&!h)throw new TypeError("Private accessor was defined without a getter");if(typeof p=="function"?u!==p||!h:!p.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?h:f==="a"?h.call(u):h?h.value:p.get(u)},n,t;Object.defineProperty(nt,"__esModule",{value:!0}),nt.FrozenSet=nt.FrozenMap=void 0;class d{constructor(p){n.set(this,void 0),e(this,n,new Map(p),"f"),Object.freeze(this)}get size(){return r(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return r(this,n,"f")[Symbol.iterator]()}entries(){return r(this,n,"f").entries()}forEach(p,f){return r(this,n,"f").forEach((h,g,s)=>p.call(f,h,g,this))}get(p){return r(this,n,"f").get(p)}has(p){return r(this,n,"f").has(p)}keys(){return r(this,n,"f").keys()}values(){return r(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([p,f])=>`${String(p)} => ${String(f)}`).join(", ")} `:""}}`}}nt.FrozenMap=d;class i{constructor(p){t.set(this,void 0),e(this,t,new Set(p),"f"),Object.freeze(this)}get size(){return r(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return r(this,t,"f")[Symbol.iterator]()}entries(){return r(this,t,"f").entries()}forEach(p,f){return r(this,t,"f").forEach((h,g,s)=>p.call(f,h,g,this))}has(p){return r(this,t,"f").has(p)}keys(){return r(this,t,"f").keys()}values(){return r(this,t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(p=>String(p)).join(", ")} `:""}}`}}return nt.FrozenSet=i,Object.freeze(d),Object.freeze(d.prototype),Object.freeze(i),Object.freeze(i.prototype),nt}var Mi={},pc;function rd(){return pc||(pc=1,Object.defineProperty(Mi,"__esModule",{value:!0})),Mi}var ki={},gc;function nd(){return gc||(gc=1,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 r=Xt,n=gt(),t=()=>(0,r.define)("finite number",T=>(0,r.is)(T,(0,r.number)())&&Number.isFinite(T));e.UnsafeJsonStruct=(0,r.union)([(0,r.literal)(null),(0,r.boolean)(),t(),(0,r.string)(),(0,r.array)((0,r.lazy)(()=>e.UnsafeJsonStruct)),(0,r.record)((0,r.string)(),(0,r.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,r.define)("Json",(T,q)=>{function N(H,K){const re=[...K.validator(H,q)];return re.length>0?re:!0}try{const H=N(T,e.UnsafeJsonStruct);return H!==!0?H:N(JSON.parse(JSON.stringify(T)),e.UnsafeJsonStruct)}catch(H){return H instanceof RangeError?"Circular reference detected":!1}});function d(T){return(0,r.is)(T,e.JsonStruct)}e.isValidJson=d;function i(T){(0,n.assertStruct)(T,e.JsonStruct,"Invalid JSON value");const q=JSON.stringify(T);return new TextEncoder().encode(q).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,r.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,r.nullable)((0,r.union)([(0,r.number)(),(0,r.string)()])),e.JsonRpcErrorStruct=(0,r.object)({code:(0,r.integer)(),message:(0,r.string)(),data:(0,r.optional)(e.JsonStruct),stack:(0,r.optional)((0,r.string)())}),e.JsonRpcParamsStruct=(0,r.optional)((0,r.union)([(0,r.record)((0,r.string)(),e.JsonStruct),(0,r.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,r.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,r.omit)(e.JsonRpcRequestStruct,["id"]);function u(T){return(0,r.is)(T,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=u;function p(T,q){(0,n.assertStruct)(T,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",q)}e.assertIsJsonRpcNotification=p;function f(T){return(0,r.is)(T,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=f;function h(T,q){(0,n.assertStruct)(T,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",q)}e.assertIsJsonRpcRequest=h,e.PendingJsonRpcResponseStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,r.optional)((0,r.unknown)()),error:(0,r.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,r.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function g(T){return(0,r.is)(T,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=g;function s(T,q){(0,n.assertStruct)(T,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",q)}e.assertIsPendingJsonRpcResponse=s;function c(T){return(0,r.is)(T,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=c;function o(T,q){(0,n.assertStruct)(T,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",q)}e.assertIsJsonRpcResponse=o;function m(T){return(0,r.is)(T,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=m;function _(T,q){(0,n.assertStruct)(T,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",q)}e.assertIsJsonRpcSuccess=_;function w(T){return(0,r.is)(T,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=w;function a(T,q){(0,n.assertStruct)(T,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",q)}e.assertIsJsonRpcFailure=a;function E(T){return(0,r.is)(T,e.JsonRpcErrorStruct)}e.isJsonRpcError=E;function S(T,q){(0,n.assertStruct)(T,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",q)}e.assertIsJsonRpcError=S;function I(T){const{permitEmptyString:q,permitFractions:N,permitNull:H}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},T);return X=>!!(typeof X=="number"&&(N||Number.isInteger(X))||typeof X=="string"&&(q||X.length>0)||H&&X===null)}e.getJsonRpcIdValidator=I}(ki)),ki}var Ii={},mc;function id(){return mc||(mc=1,Object.defineProperty(Ii,"__esModule",{value:!0})),Ii}var ut={},an={exports:{}},Ai,yc;function sd(){if(yc)return Ai;yc=1;var e=1e3,r=e*60,n=r*60,t=n*24,d=t*7,i=t*365.25;Ai=function(g,s){s=s||{};var c=typeof g;if(c==="string"&&g.length>0)return u(g);if(c==="number"&&isFinite(g))return s.long?f(g):p(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function u(g){if(g=String(g),!(g.length>100)){var s=/^(-?(?:\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(s){var c=parseFloat(s[1]),o=(s[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*d;case"days":case"day":case"d":return c*t;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function p(g){var s=Math.abs(g);return s>=t?Math.round(g/t)+"d":s>=n?Math.round(g/n)+"h":s>=r?Math.round(g/r)+"m":s>=e?Math.round(g/e)+"s":g+"ms"}function f(g){var s=Math.abs(g);return s>=t?h(g,s,t,"day"):s>=n?h(g,s,n,"hour"):s>=r?h(g,s,r,"minute"):s>=e?h(g,s,e,"second"):g+" ms"}function h(g,s,c,o){var m=s>=c*1.5;return Math.round(g/c)+" "+o+(m?"s":"")}return Ai}var xi,wc;function od(){if(wc)return xi;wc=1;function e(r){t.debug=t,t.default=t,t.coerce=h,t.disable=p,t.enable=i,t.enabled=f,t.humanize=sd(),t.destroy=g,Object.keys(r).forEach(s=>{t[s]=r[s]}),t.names=[],t.skips=[],t.formatters={};function n(s){let c=0;for(let o=0;o<s.length;o++)c=(c<<5)-c+s.charCodeAt(o),c|=0;return t.colors[Math.abs(c)%t.colors.length]}t.selectColor=n;function t(s){let c,o=null,m,_;function w(...a){if(!w.enabled)return;const E=w,S=Number(new Date),I=S-(c||S);E.diff=I,E.prev=c,E.curr=S,c=S,a[0]=t.coerce(a[0]),typeof a[0]!="string"&&a.unshift("%O");let T=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(N,H)=>{if(N==="%%")return"%";T++;const K=t.formatters[H];if(typeof K=="function"){const X=a[T];N=K.call(E,X),a.splice(T,1),T--}return N}),t.formatArgs.call(E,a),(E.log||t.log).apply(E,a)}return w.namespace=s,w.useColors=t.useColors(),w.color=t.selectColor(s),w.extend=d,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>o!==null?o:(m!==t.namespaces&&(m=t.namespaces,_=t.enabled(s)),_),set:a=>{o=a}}),typeof t.init=="function"&&t.init(w),w}function d(s,c){const o=t(this.namespace+(typeof c>"u"?":":c)+s);return o.log=this.log,o}function i(s){t.save(s),t.namespaces=s,t.names=[],t.skips=[];const c=(typeof s=="string"?s:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const o of c)o[0]==="-"?t.skips.push(o.slice(1)):t.names.push(o)}function u(s,c){let o=0,m=0,_=-1,w=0;for(;o<s.length;)if(m<c.length&&(c[m]===s[o]||c[m]==="*"))c[m]==="*"?(_=m,w=o,m++):(o++,m++);else if(_!==-1)m=_+1,w++,o=w;else return!1;for(;m<c.length&&c[m]==="*";)m++;return m===c.length}function p(){const s=[...t.names,...t.skips.map(c=>"-"+c)].join(",");return t.enable(""),s}function f(s){for(const c of t.skips)if(u(s,c))return!1;for(const c of t.names)if(u(s,c))return!0;return!1}function h(s){return s instanceof Error?s.stack||s.message:s}function g(){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 t.enable(t.load()),t}return xi=e,xi}var vc;function ad(){return vc||(vc=1,function(e,r){var n={};r.formatArgs=d,r.save=i,r.load=u,r.useColors=t,r.storage=p(),r.destroy=(()=>{let h=!1;return()=>{h||(h=!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`."))}})(),r.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 t(){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 h;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&&(h=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(h[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function d(h){if(h[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+h[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const g="color: "+this.color;h.splice(1,0,g,"color: inherit");let s=0,c=0;h[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(s++,o==="%c"&&(c=s))}),h.splice(c,0,g)}r.log=console.debug||console.log||(()=>{});function i(h){try{h?r.storage.setItem("debug",h):r.storage.removeItem("debug")}catch{}}function u(){let h;try{h=r.storage.getItem("debug")||r.storage.getItem("DEBUG")}catch{}return!h&&typeof me<"u"&&"env"in me&&(h=n.DEBUG),h}function p(){try{return localStorage}catch{}}e.exports=od()(r);const{formatters:f}=e.exports;f.j=function(h){try{return JSON.stringify(h)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}(an,an.exports)),an.exports}var bc;function cd(){if(bc)return ut;bc=1;var e=ut&&ut.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ut,"__esModule",{value:!0}),ut.createModuleLogger=ut.createProjectLogger=void 0;const n=(0,e(ad()).default)("metamask");function t(i){return n.extend(i)}ut.createProjectLogger=t;function d(i,u){return i.extend(u)}return ut.createModuleLogger=d,ut}var Ti={},_c;function ud(){return _c||(_c=1,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 r(h){return Array.isArray(h)&&h.length>0}e.isNonEmptyArray=r;function n(h){return h==null}e.isNullOrUndefined=n;function t(h){return!!h&&typeof h=="object"&&!Array.isArray(h)}e.isObject=t;const d=(h,g)=>Object.hasOwnProperty.call(h,g);e.hasProperty=d,function(h){h[h.Null=4]="Null",h[h.Comma=1]="Comma",h[h.Wrapper=1]="Wrapper",h[h.True=4]="True",h[h.False=5]="False",h[h.Quote=1]="Quote",h[h.Colon=1]="Colon",h[h.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(h){if(typeof h!="object"||h===null)return!1;try{let g=h;for(;Object.getPrototypeOf(g)!==null;)g=Object.getPrototypeOf(g);return Object.getPrototypeOf(h)===g}catch{return!1}}e.isPlainObject=i;function u(h){return h.charCodeAt(0)<=127}e.isASCII=u;function p(h){var g;return h.split("").reduce((c,o)=>u(o)?c+1:c+2,0)+((g=h.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&g!==void 0?g:[]).length}e.calculateStringSize=p;function f(h){return h.toString().length}e.calculateNumberSize=f}(Ti)),Ti}var it={},Ec;function ld(){if(Ec)return it;Ec=1,Object.defineProperty(it,"__esModule",{value:!0}),it.hexToBigInt=it.hexToNumber=it.bigIntToHex=it.numberToHex=void 0;const e=gt(),r=bn(),n=u=>((0,e.assert)(typeof u=="number","Value must be a number."),(0,e.assert)(u>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(u),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,r.add0x)(u.toString(16)));it.numberToHex=n;const t=u=>((0,e.assert)(typeof u=="bigint","Value must be a bigint."),(0,e.assert)(u>=0,"Value must be a non-negative bigint."),(0,r.add0x)(u.toString(16)));it.bigIntToHex=t;const d=u=>{(0,r.assertIsHexString)(u);const p=parseInt(u,16);return(0,e.assert)(Number.isSafeInteger(p),"Value is not a safe integer. Use `hexToBigInt` instead."),p};it.hexToNumber=d;const i=u=>((0,r.assertIsHexString)(u),BigInt((0,r.add0x)(u)));return it.hexToBigInt=i,it}var Bi={},Sc;function hd(){return Sc||(Sc=1,Object.defineProperty(Bi,"__esModule",{value:!0})),Bi}var Li={},Rc;function fd(){return Rc||(Rc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const r=i=>Number.isInteger(i)&&i>=0,n=(i,u)=>{if(!r(i))throw new Error(`"${u}" must be a non-negative integer. Received: "${i}".`)};function t(i,u){return n(i,"count"),i*u}e.inMilliseconds=t;function d(i){return n(i,"timestamp"),Date.now()-i}e.timeSince=d}(Li)),Li}var Ni={},Cc;function dd(){return Cc||(Cc=1,Object.defineProperty(Ni,"__esModule",{value:!0})),Ni}var Oi={},cn={exports:{}},Pi,Mc;function _n(){if(Mc)return Pi;Mc=1;const e="2.0.0",r=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,t=16,d=r-6;return Pi={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:d,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Pi}var Fi,kc;function En(){if(kc)return Fi;kc=1;var e={};return Fi=typeof me=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Fi}var Ic;function Jr(){return Ic||(Ic=1,function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:d}=_n(),i=En();r=e.exports={};const u=r.re=[],p=r.safeRe=[],f=r.src=[],h=r.safeSrc=[],g=r.t={};let s=0;const c="[a-zA-Z0-9-]",o=[["\\s",1],["\\d",d],[c,t]],m=w=>{for(const[a,E]of o)w=w.split(`${a}*`).join(`${a}{0,${E}}`).split(`${a}+`).join(`${a}{1,${E}}`);return w},_=(w,a,E)=>{const S=m(a),I=s++;i(w,I,a),g[w]=I,f[I]=a,h[I]=S,u[I]=new RegExp(a,E?"g":void 0),p[I]=new RegExp(S,E?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${c}*`),_("MAINVERSION",`(${f[g.NUMERICIDENTIFIER]})\\.(${f[g.NUMERICIDENTIFIER]})\\.(${f[g.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${f[g.NUMERICIDENTIFIERLOOSE]})\\.(${f[g.NUMERICIDENTIFIERLOOSE]})\\.(${f[g.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${f[g.NONNUMERICIDENTIFIER]}|${f[g.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${f[g.NONNUMERICIDENTIFIER]}|${f[g.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${f[g.PRERELEASEIDENTIFIER]}(?:\\.${f[g.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${f[g.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[g.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${c}+`),_("BUILD",`(?:\\+(${f[g.BUILDIDENTIFIER]}(?:\\.${f[g.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${f[g.MAINVERSION]}${f[g.PRERELEASE]}?${f[g.BUILD]}?`),_("FULL",`^${f[g.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${f[g.MAINVERSIONLOOSE]}${f[g.PRERELEASELOOSE]}?${f[g.BUILD]}?`),_("LOOSE",`^${f[g.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${f[g.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${f[g.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${f[g.XRANGEIDENTIFIER]})(?:\\.(${f[g.XRANGEIDENTIFIER]})(?:\\.(${f[g.XRANGEIDENTIFIER]})(?:${f[g.PRERELEASE]})?${f[g.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${f[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[g.XRANGEIDENTIFIERLOOSE]})(?:${f[g.PRERELEASELOOSE]})?${f[g.BUILD]}?)?)?`),_("XRANGE",`^${f[g.GTLT]}\\s*${f[g.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${f[g.GTLT]}\\s*${f[g.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),_("COERCE",`${f[g.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",f[g.COERCEPLAIN]+`(?:${f[g.PRERELEASE]})?(?:${f[g.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",f[g.COERCE],!0),_("COERCERTLFULL",f[g.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${f[g.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",_("TILDE",`^${f[g.LONETILDE]}${f[g.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${f[g.LONETILDE]}${f[g.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${f[g.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",_("CARET",`^${f[g.LONECARET]}${f[g.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${f[g.LONECARET]}${f[g.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${f[g.GTLT]}\\s*(${f[g.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${f[g.GTLT]}\\s*(${f[g.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${f[g.GTLT]}\\s*(${f[g.LOOSEPLAIN]}|${f[g.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${f[g.XRANGEPLAIN]})\\s+-\\s+(${f[g.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${f[g.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[g.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(cn,cn.exports)),cn.exports}var Di,Ac;function io(){if(Ac)return Di;Ac=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return Di=t=>t?typeof t!="object"?e:t:r,Di}var qi,xc;function ql(){if(xc)return qi;xc=1;const e=/^[0-9]+$/,r=(t,d)=>{if(typeof t=="number"&&typeof d=="number")return t===d?0:t<d?-1:1;const i=e.test(t),u=e.test(d);return i&&u&&(t=+t,d=+d),t===d?0:i&&!u?-1:u&&!i?1:t<d?-1:1};return qi={compareIdentifiers:r,rcompareIdentifiers:(t,d)=>r(d,t)},qi}var ji,Tc;function Je(){if(Tc)return ji;Tc=1;const e=En(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:n}=_n(),{safeRe:t,t:d}=Jr(),i=io(),{compareIdentifiers:u}=ql();class p{constructor(h,g){if(g=i(g),h instanceof p){if(h.loose===!!g.loose&&h.includePrerelease===!!g.includePrerelease)return h;h=h.version}else if(typeof h!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof h}".`);if(h.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",h,g),this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease;const s=h.trim().match(g.loose?t[d.LOOSE]:t[d.FULL]);if(!s)throw new TypeError(`Invalid Version: ${h}`);if(this.raw=h,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(c=>{if(/^[0-9]+$/.test(c)){const o=+c;if(o>=0&&o<n)return o}return c}):this.prerelease=[],this.build=s[5]?s[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(h){if(e("SemVer.compare",this.version,this.options,h),!(h instanceof p)){if(typeof h=="string"&&h===this.version)return 0;h=new p(h,this.options)}return h.version===this.version?0:this.compareMain(h)||this.comparePre(h)}compareMain(h){return h instanceof p||(h=new p(h,this.options)),this.major<h.major?-1:this.major>h.major?1:this.minor<h.minor?-1:this.minor>h.minor?1:this.patch<h.patch?-1:this.patch>h.patch?1:0}comparePre(h){if(h instanceof p||(h=new p(h,this.options)),this.prerelease.length&&!h.prerelease.length)return-1;if(!this.prerelease.length&&h.prerelease.length)return 1;if(!this.prerelease.length&&!h.prerelease.length)return 0;let g=0;do{const s=this.prerelease[g],c=h.prerelease[g];if(e("prerelease compare",g,s,c),s===void 0&&c===void 0)return 0;if(c===void 0)return 1;if(s===void 0)return-1;if(s===c)continue;return u(s,c)}while(++g)}compareBuild(h){h instanceof p||(h=new p(h,this.options));let g=0;do{const s=this.build[g],c=h.build[g];if(e("build compare",g,s,c),s===void 0&&c===void 0)return 0;if(c===void 0)return 1;if(s===void 0)return-1;if(s===c)continue;return u(s,c)}while(++g)}inc(h,g,s){if(h.startsWith("pre")){if(!g&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(g){const c=`-${g}`.match(this.options.loose?t[d.PRERELEASELOOSE]:t[d.PRERELEASE]);if(!c||c[1]!==g)throw new Error(`invalid identifier: ${g}`)}}switch(h){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",g,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",g,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",g,s),this.inc("pre",g,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",g,s),this.inc("pre",g,s);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 c=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[c];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(g===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(c)}}if(g){let o=[g,c];s===!1&&(o=[g]),u(this.prerelease[0],g)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${h}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ji=p,ji}var Ui,Bc;function or(){if(Bc)return Ui;Bc=1;const e=Je();return Ui=(n,t,d=!1)=>{if(n instanceof e)return n;try{return new e(n,t)}catch(i){if(!d)return null;throw i}},Ui}var Hi,Lc;function pd(){if(Lc)return Hi;Lc=1;const e=or();return Hi=(n,t)=>{const d=e(n,t);return d?d.version:null},Hi}var Wi,Nc;function gd(){if(Nc)return Wi;Nc=1;const e=or();return Wi=(n,t)=>{const d=e(n.trim().replace(/^[=v]+/,""),t);return d?d.version:null},Wi}var Vi,Oc;function md(){if(Oc)return Vi;Oc=1;const e=Je();return Vi=(n,t,d,i,u)=>{typeof d=="string"&&(u=i,i=d,d=void 0);try{return new e(n instanceof e?n.version:n,d).inc(t,i,u).version}catch{return null}},Vi}var zi,Pc;function yd(){if(Pc)return zi;Pc=1;const e=or();return zi=(n,t)=>{const d=e(n,null,!0),i=e(t,null,!0),u=d.compare(i);if(u===0)return null;const p=u>0,f=p?d:i,h=p?i:d,g=!!f.prerelease.length;if(!!h.prerelease.length&&!g){if(!h.patch&&!h.minor)return"major";if(h.compareMain(f)===0)return h.minor&&!h.patch?"minor":"patch"}const c=g?"pre":"";return d.major!==i.major?c+"major":d.minor!==i.minor?c+"minor":d.patch!==i.patch?c+"patch":"prerelease"},zi}var Gi,Fc;function wd(){if(Fc)return Gi;Fc=1;const e=Je();return Gi=(n,t)=>new e(n,t).major,Gi}var Ji,Dc;function vd(){if(Dc)return Ji;Dc=1;const e=Je();return Ji=(n,t)=>new e(n,t).minor,Ji}var $i,qc;function bd(){if(qc)return $i;qc=1;const e=Je();return $i=(n,t)=>new e(n,t).patch,$i}var Zi,jc;function _d(){if(jc)return Zi;jc=1;const e=or();return Zi=(n,t)=>{const d=e(n,t);return d&&d.prerelease.length?d.prerelease:null},Zi}var Ki,Uc;function st(){if(Uc)return Ki;Uc=1;const e=Je();return Ki=(n,t,d)=>new e(n,d).compare(new e(t,d)),Ki}var Qi,Hc;function Ed(){if(Hc)return Qi;Hc=1;const e=st();return Qi=(n,t,d)=>e(t,n,d),Qi}var Yi,Wc;function Sd(){if(Wc)return Yi;Wc=1;const e=st();return Yi=(n,t)=>e(n,t,!0),Yi}var Xi,Vc;function so(){if(Vc)return Xi;Vc=1;const e=Je();return Xi=(n,t,d)=>{const i=new e(n,d),u=new e(t,d);return i.compare(u)||i.compareBuild(u)},Xi}var es,zc;function Rd(){if(zc)return es;zc=1;const e=so();return es=(n,t)=>n.sort((d,i)=>e(d,i,t)),es}var ts,Gc;function Cd(){if(Gc)return ts;Gc=1;const e=so();return ts=(n,t)=>n.sort((d,i)=>e(i,d,t)),ts}var rs,Jc;function Sn(){if(Jc)return rs;Jc=1;const e=st();return rs=(n,t,d)=>e(n,t,d)>0,rs}var ns,$c;function oo(){if($c)return ns;$c=1;const e=st();return ns=(n,t,d)=>e(n,t,d)<0,ns}var is,Zc;function jl(){if(Zc)return is;Zc=1;const e=st();return is=(n,t,d)=>e(n,t,d)===0,is}var ss,Kc;function Ul(){if(Kc)return ss;Kc=1;const e=st();return ss=(n,t,d)=>e(n,t,d)!==0,ss}var os,Qc;function ao(){if(Qc)return os;Qc=1;const e=st();return os=(n,t,d)=>e(n,t,d)>=0,os}var as,Yc;function co(){if(Yc)return as;Yc=1;const e=st();return as=(n,t,d)=>e(n,t,d)<=0,as}var cs,Xc;function Hl(){if(Xc)return cs;Xc=1;const e=jl(),r=Ul(),n=Sn(),t=ao(),d=oo(),i=co();return cs=(p,f,h,g)=>{switch(f){case"===":return typeof p=="object"&&(p=p.version),typeof h=="object"&&(h=h.version),p===h;case"!==":return typeof p=="object"&&(p=p.version),typeof h=="object"&&(h=h.version),p!==h;case"":case"=":case"==":return e(p,h,g);case"!=":return r(p,h,g);case">":return n(p,h,g);case">=":return t(p,h,g);case"<":return d(p,h,g);case"<=":return i(p,h,g);default:throw new TypeError(`Invalid operator: ${f}`)}},cs}var us,eu;function Md(){if(eu)return us;eu=1;const e=Je(),r=or(),{safeRe:n,t}=Jr();return us=(i,u)=>{if(i instanceof e)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;u=u||{};let p=null;if(!u.rtl)p=i.match(u.includePrerelease?n[t.COERCEFULL]:n[t.COERCE]);else{const o=u.includePrerelease?n[t.COERCERTLFULL]:n[t.COERCERTL];let m;for(;(m=o.exec(i))&&(!p||p.index+p[0].length!==i.length);)(!p||m.index+m[0].length!==p.index+p[0].length)&&(p=m),o.lastIndex=m.index+m[1].length+m[2].length;o.lastIndex=-1}if(p===null)return null;const f=p[2],h=p[3]||"0",g=p[4]||"0",s=u.includePrerelease&&p[5]?`-${p[5]}`:"",c=u.includePrerelease&&p[6]?`+${p[6]}`:"";return r(`${f}.${h}.${g}${s}${c}`,u)},us}var ls,tu;function kd(){if(tu)return ls;tu=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const t=this.map.get(n);if(t!==void 0)return this.map.delete(n),this.map.set(n,t),t}delete(n){return this.map.delete(n)}set(n,t){if(!this.delete(n)&&t!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(n,t)}return this}}return ls=e,ls}var hs,ru;function ot(){if(ru)return hs;ru=1;const e=/\s+/g;class r{constructor(b,C){if(C=d(C),b instanceof r)return b.loose===!!C.loose&&b.includePrerelease===!!C.includePrerelease?b:new r(b.raw,C);if(b instanceof i)return this.raw=b.value,this.set=[[b]],this.formatted=void 0,this;if(this.options=C,this.loose=!!C.loose,this.includePrerelease=!!C.includePrerelease,this.raw=b.trim().replace(e," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(x=>!_(x[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const x of this.set)if(x.length===1&&w(x[0])){this.set=[x];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let b=0;b<this.set.length;b++){b>0&&(this.formatted+="||");const C=this.set[b];for(let k=0;k<C.length;k++)k>0&&(this.formatted+=" "),this.formatted+=C[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(b){const k=((this.options.includePrerelease&&o)|(this.options.loose&&m))+":"+b,x=t.get(k);if(x)return x;const O=this.options.loose,U=O?f[h.HYPHENRANGELOOSE]:f[h.HYPHENRANGE];b=b.replace(U,W(this.options.includePrerelease)),u("hyphen replace",b),b=b.replace(f[h.COMPARATORTRIM],g),u("comparator trim",b),b=b.replace(f[h.TILDETRIM],s),u("tilde trim",b),b=b.replace(f[h.CARETTRIM],c),u("caret trim",b);let L=b.split(" ").map(J=>E(J,this.options)).join(" ").split(/\s+/).map(J=>re(J,this.options));O&&(L=L.filter(J=>(u("loose invalid filter",J,this.options),!!J.match(f[h.COMPARATORLOOSE])))),u("range list",L);const v=new Map,M=L.map(J=>new i(J,this.options));for(const J of M){if(_(J))return[J];v.set(J.value,J)}v.size>1&&v.has("")&&v.delete("");const G=[...v.values()];return t.set(k,G),G}intersects(b,C){if(!(b instanceof r))throw new TypeError("a Range is required");return this.set.some(k=>a(k,C)&&b.set.some(x=>a(x,C)&&k.every(O=>x.every(U=>O.intersects(U,C)))))}test(b){if(!b)return!1;if(typeof b=="string")try{b=new p(b,this.options)}catch{return!1}for(let C=0;C<this.set.length;C++)if(D(this.set[C],b,this.options))return!0;return!1}}hs=r;const n=kd(),t=new n,d=io(),i=Rn(),u=En(),p=Je(),{safeRe:f,t:h,comparatorTrimReplace:g,tildeTrimReplace:s,caretTrimReplace:c}=Jr(),{FLAG_INCLUDE_PRERELEASE:o,FLAG_LOOSE:m}=_n(),_=l=>l.value==="<0.0.0-0",w=l=>l.value==="",a=(l,b)=>{let C=!0;const k=l.slice();let x=k.pop();for(;C&&k.length;)C=k.every(O=>x.intersects(O,b)),x=k.pop();return C},E=(l,b)=>(l=l.replace(f[h.BUILD],""),u("comp",l,b),l=q(l,b),u("caret",l),l=I(l,b),u("tildes",l),l=H(l,b),u("xrange",l),l=X(l,b),u("stars",l),l),S=l=>!l||l.toLowerCase()==="x"||l==="*",I=(l,b)=>l.trim().split(/\s+/).map(C=>T(C,b)).join(" "),T=(l,b)=>{const C=b.loose?f[h.TILDELOOSE]:f[h.TILDE];return l.replace(C,(k,x,O,U,L)=>{u("tilde",l,k,x,O,U,L);let v;return S(x)?v="":S(O)?v=`>=${x}.0.0 <${+x+1}.0.0-0`:S(U)?v=`>=${x}.${O}.0 <${x}.${+O+1}.0-0`:L?(u("replaceTilde pr",L),v=`>=${x}.${O}.${U}-${L} <${x}.${+O+1}.0-0`):v=`>=${x}.${O}.${U} <${x}.${+O+1}.0-0`,u("tilde return",v),v})},q=(l,b)=>l.trim().split(/\s+/).map(C=>N(C,b)).join(" "),N=(l,b)=>{u("caret",l,b);const C=b.loose?f[h.CARETLOOSE]:f[h.CARET],k=b.includePrerelease?"-0":"";return l.replace(C,(x,O,U,L,v)=>{u("caret",l,x,O,U,L,v);let M;return S(O)?M="":S(U)?M=`>=${O}.0.0${k} <${+O+1}.0.0-0`:S(L)?O==="0"?M=`>=${O}.${U}.0${k} <${O}.${+U+1}.0-0`:M=`>=${O}.${U}.0${k} <${+O+1}.0.0-0`:v?(u("replaceCaret pr",v),O==="0"?U==="0"?M=`>=${O}.${U}.${L}-${v} <${O}.${U}.${+L+1}-0`:M=`>=${O}.${U}.${L}-${v} <${O}.${+U+1}.0-0`:M=`>=${O}.${U}.${L}-${v} <${+O+1}.0.0-0`):(u("no pr"),O==="0"?U==="0"?M=`>=${O}.${U}.${L}${k} <${O}.${U}.${+L+1}-0`:M=`>=${O}.${U}.${L}${k} <${O}.${+U+1}.0-0`:M=`>=${O}.${U}.${L} <${+O+1}.0.0-0`),u("caret return",M),M})},H=(l,b)=>(u("replaceXRanges",l,b),l.split(/\s+/).map(C=>K(C,b)).join(" ")),K=(l,b)=>{l=l.trim();const C=b.loose?f[h.XRANGELOOSE]:f[h.XRANGE];return l.replace(C,(k,x,O,U,L,v)=>{u("xRange",l,k,x,O,U,L,v);const M=S(O),G=M||S(U),J=G||S(L),j=J;return x==="="&&j&&(x=""),v=b.includePrerelease?"-0":"",M?x===">"||x==="<"?k="<0.0.0-0":k="*":x&&j?(G&&(U=0),L=0,x===">"?(x=">=",G?(O=+O+1,U=0,L=0):(U=+U+1,L=0)):x==="<="&&(x="<",G?O=+O+1:U=+U+1),x==="<"&&(v="-0"),k=`${x+O}.${U}.${L}${v}`):G?k=`>=${O}.0.0${v} <${+O+1}.0.0-0`:J&&(k=`>=${O}.${U}.0${v} <${O}.${+U+1}.0-0`),u("xRange return",k),k})},X=(l,b)=>(u("replaceStars",l,b),l.trim().replace(f[h.STAR],"")),re=(l,b)=>(u("replaceGTE0",l,b),l.trim().replace(f[b.includePrerelease?h.GTE0PRE:h.GTE0],"")),W=l=>(b,C,k,x,O,U,L,v,M,G,J,j)=>(S(k)?C="":S(x)?C=`>=${k}.0.0${l?"-0":""}`:S(O)?C=`>=${k}.${x}.0${l?"-0":""}`:U?C=`>=${C}`:C=`>=${C}${l?"-0":""}`,S(M)?v="":S(G)?v=`<${+M+1}.0.0-0`:S(J)?v=`<${M}.${+G+1}.0-0`:j?v=`<=${M}.${G}.${J}-${j}`:l?v=`<${M}.${G}.${+J+1}-0`:v=`<=${v}`,`${C} ${v}`.trim()),D=(l,b,C)=>{for(let k=0;k<l.length;k++)if(!l[k].test(b))return!1;if(b.prerelease.length&&!C.includePrerelease){for(let k=0;k<l.length;k++)if(u(l[k].semver),l[k].semver!==i.ANY&&l[k].semver.prerelease.length>0){const x=l[k].semver;if(x.major===b.major&&x.minor===b.minor&&x.patch===b.patch)return!0}return!1}return!0};return hs}var fs,nu;function Rn(){if(nu)return fs;nu=1;const e=Symbol("SemVer ANY");class r{static get ANY(){return e}constructor(g,s){if(s=n(s),g instanceof r){if(g.loose===!!s.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),u("comparator",g,s),this.options=s,this.loose=!!s.loose,this.parse(g),this.semver===e?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(g){const s=this.options.loose?t[d.COMPARATORLOOSE]:t[d.COMPARATOR],c=g.match(s);if(!c)throw new TypeError(`Invalid comparator: ${g}`);this.operator=c[1]!==void 0?c[1]:"",this.operator==="="&&(this.operator=""),c[2]?this.semver=new p(c[2],this.options.loose):this.semver=e}toString(){return this.value}test(g){if(u("Comparator.test",g,this.options.loose),this.semver===e||g===e)return!0;if(typeof g=="string")try{g=new p(g,this.options)}catch{return!1}return i(g,this.operator,this.semver,this.options)}intersects(g,s){if(!(g instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f(g.value,s).test(this.value):g.operator===""?g.value===""?!0:new f(this.value,s).test(g.semver):(s=n(s),s.includePrerelease&&(this.value==="<0.0.0-0"||g.value==="<0.0.0-0")||!s.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("=")||i(this.semver,"<",g.semver,s)&&this.operator.startsWith(">")&&g.operator.startsWith("<")||i(this.semver,">",g.semver,s)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}fs=r;const n=io(),{safeRe:t,t:d}=Jr(),i=Hl(),u=En(),p=Je(),f=ot();return fs}var ds,iu;function Cn(){if(iu)return ds;iu=1;const e=ot();return ds=(n,t,d)=>{try{t=new e(t,d)}catch{return!1}return t.test(n)},ds}var ps,su;function Id(){if(su)return ps;su=1;const e=ot();return ps=(n,t)=>new e(n,t).set.map(d=>d.map(i=>i.value).join(" ").trim().split(" ")),ps}var gs,ou;function Ad(){if(ou)return gs;ou=1;const e=Je(),r=ot();return gs=(t,d,i)=>{let u=null,p=null,f=null;try{f=new r(d,i)}catch{return null}return t.forEach(h=>{f.test(h)&&(!u||p.compare(h)===-1)&&(u=h,p=new e(u,i))}),u},gs}var ms,au;function xd(){if(au)return ms;au=1;const e=Je(),r=ot();return ms=(t,d,i)=>{let u=null,p=null,f=null;try{f=new r(d,i)}catch{return null}return t.forEach(h=>{f.test(h)&&(!u||p.compare(h)===1)&&(u=h,p=new e(u,i))}),u},ms}var ys,cu;function Td(){if(cu)return ys;cu=1;const e=Je(),r=ot(),n=Sn();return ys=(d,i)=>{d=new r(d,i);let u=new e("0.0.0");if(d.test(u)||(u=new e("0.0.0-0"),d.test(u)))return u;u=null;for(let p=0;p<d.set.length;++p){const f=d.set[p];let h=null;f.forEach(g=>{const s=new e(g.semver.version);switch(g.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!h||n(s,h))&&(h=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${g.operator}`)}}),h&&(!u||n(u,h))&&(u=h)}return u&&d.test(u)?u:null},ys}var ws,uu;function Bd(){if(uu)return ws;uu=1;const e=ot();return ws=(n,t)=>{try{return new e(n,t).range||"*"}catch{return null}},ws}var vs,lu;function uo(){if(lu)return vs;lu=1;const e=Je(),r=Rn(),{ANY:n}=r,t=ot(),d=Cn(),i=Sn(),u=oo(),p=co(),f=ao();return vs=(g,s,c,o)=>{g=new e(g,o),s=new t(s,o);let m,_,w,a,E;switch(c){case">":m=i,_=p,w=u,a=">",E=">=";break;case"<":m=u,_=f,w=i,a="<",E="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(d(g,s,o))return!1;for(let S=0;S<s.set.length;++S){const I=s.set[S];let T=null,q=null;if(I.forEach(N=>{N.semver===n&&(N=new r(">=0.0.0")),T=T||N,q=q||N,m(N.semver,T.semver,o)?T=N:w(N.semver,q.semver,o)&&(q=N)}),T.operator===a||T.operator===E||(!q.operator||q.operator===a)&&_(g,q.semver))return!1;if(q.operator===E&&w(g,q.semver))return!1}return!0},vs}var bs,hu;function Ld(){if(hu)return bs;hu=1;const e=uo();return bs=(n,t,d)=>e(n,t,">",d),bs}var _s,fu;function Nd(){if(fu)return _s;fu=1;const e=uo();return _s=(n,t,d)=>e(n,t,"<",d),_s}var Es,du;function Od(){if(du)return Es;du=1;const e=ot();return Es=(n,t,d)=>(n=new e(n,d),t=new e(t,d),n.intersects(t,d)),Es}var Ss,pu;function Pd(){if(pu)return Ss;pu=1;const e=Cn(),r=st();return Ss=(n,t,d)=>{const i=[];let u=null,p=null;const f=n.sort((c,o)=>r(c,o,d));for(const c of f)e(c,t,d)?(p=c,u||(u=c)):(p&&i.push([u,p]),p=null,u=null);u&&i.push([u,null]);const h=[];for(const[c,o]of i)c===o?h.push(c):!o&&c===f[0]?h.push("*"):o?c===f[0]?h.push(`<=${o}`):h.push(`${c} - ${o}`):h.push(`>=${c}`);const g=h.join(" || "),s=typeof t.raw=="string"?t.raw:String(t);return g.length<s.length?g:t},Ss}var Rs,gu;function Fd(){if(gu)return Rs;gu=1;const e=ot(),r=Rn(),{ANY:n}=r,t=Cn(),d=st(),i=(s,c,o={})=>{if(s===c)return!0;s=new e(s,o),c=new e(c,o);let m=!1;e:for(const _ of s.set){for(const w of c.set){const a=f(_,w,o);if(m=m||a!==null,a)continue e}if(m)return!1}return!0},u=[new r(">=0.0.0-0")],p=[new r(">=0.0.0")],f=(s,c,o)=>{if(s===c)return!0;if(s.length===1&&s[0].semver===n){if(c.length===1&&c[0].semver===n)return!0;o.includePrerelease?s=u:s=p}if(c.length===1&&c[0].semver===n){if(o.includePrerelease)return!0;c=p}const m=new Set;let _,w;for(const H of s)H.operator===">"||H.operator===">="?_=h(_,H,o):H.operator==="<"||H.operator==="<="?w=g(w,H,o):m.add(H.semver);if(m.size>1)return null;let a;if(_&&w){if(a=d(_.semver,w.semver,o),a>0)return null;if(a===0&&(_.operator!==">="||w.operator!=="<="))return null}for(const H of m){if(_&&!t(H,String(_),o)||w&&!t(H,String(w),o))return null;for(const K of c)if(!t(H,String(K),o))return!1;return!0}let E,S,I,T,q=w&&!o.includePrerelease&&w.semver.prerelease.length?w.semver:!1,N=_&&!o.includePrerelease&&_.semver.prerelease.length?_.semver:!1;q&&q.prerelease.length===1&&w.operator==="<"&&q.prerelease[0]===0&&(q=!1);for(const H of c){if(T=T||H.operator===">"||H.operator===">=",I=I||H.operator==="<"||H.operator==="<=",_){if(N&&H.semver.prerelease&&H.semver.prerelease.length&&H.semver.major===N.major&&H.semver.minor===N.minor&&H.semver.patch===N.patch&&(N=!1),H.operator===">"||H.operator===">="){if(E=h(_,H,o),E===H&&E!==_)return!1}else if(_.operator===">="&&!t(_.semver,String(H),o))return!1}if(w){if(q&&H.semver.prerelease&&H.semver.prerelease.length&&H.semver.major===q.major&&H.semver.minor===q.minor&&H.semver.patch===q.patch&&(q=!1),H.operator==="<"||H.operator==="<="){if(S=g(w,H,o),S===H&&S!==w)return!1}else if(w.operator==="<="&&!t(w.semver,String(H),o))return!1}if(!H.operator&&(w||_)&&a!==0)return!1}return!(_&&I&&!w&&a!==0||w&&T&&!_&&a!==0||N||q)},h=(s,c,o)=>{if(!s)return c;const m=d(s.semver,c.semver,o);return m>0?s:m<0||c.operator===">"&&s.operator===">="?c:s},g=(s,c,o)=>{if(!s)return c;const m=d(s.semver,c.semver,o);return m<0?s:m>0||c.operator==="<"&&s.operator==="<="?c:s};return Rs=i,Rs}var Cs,mu;function Dd(){if(mu)return Cs;mu=1;const e=Jr(),r=_n(),n=Je(),t=ql(),d=or(),i=pd(),u=gd(),p=md(),f=yd(),h=wd(),g=vd(),s=bd(),c=_d(),o=st(),m=Ed(),_=Sd(),w=so(),a=Rd(),E=Cd(),S=Sn(),I=oo(),T=jl(),q=Ul(),N=ao(),H=co(),K=Hl(),X=Md(),re=Rn(),W=ot(),D=Cn(),l=Id(),b=Ad(),C=xd(),k=Td(),x=Bd(),O=uo(),U=Ld(),L=Nd(),v=Od(),M=Pd(),G=Fd();return Cs={parse:d,valid:i,clean:u,inc:p,diff:f,major:h,minor:g,patch:s,prerelease:c,compare:o,rcompare:m,compareLoose:_,compareBuild:w,sort:a,rsort:E,gt:S,lt:I,eq:T,neq:q,gte:N,lte:H,cmp:K,coerce:X,Comparator:re,Range:W,satisfies:D,toComparators:l,maxSatisfying:b,minSatisfying:C,minVersion:k,validRange:x,outside:O,gtr:U,ltr:L,intersects:v,simplifyRange:M,subset:G,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers},Cs}var yu;function qd(){return yu||(yu=1,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 r=Dd(),n=Xt,t=gt();e.VersionStruct=(0,n.refine)((0,n.string)(),"Version",s=>(0,r.valid)(s)===null?`Expected SemVer version, got "${s}"`:!0),e.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",s=>(0,r.validRange)(s)===null?`Expected SemVer range, got "${s}"`:!0);function d(s){return(0,n.is)(s,e.VersionStruct)}e.isValidSemVerVersion=d;function i(s){return(0,n.is)(s,e.VersionRangeStruct)}e.isValidSemVerRange=i;function u(s){(0,t.assertStruct)(s,e.VersionStruct)}e.assertIsSemVerVersion=u;function p(s){(0,t.assertStruct)(s,e.VersionRangeStruct)}e.assertIsSemVerRange=p;function f(s,c){return(0,r.gt)(s,c)}e.gtVersion=f;function h(s,c){return(0,r.gtr)(s,c)}e.gtRange=h;function g(s,c){return(0,r.satisfies)(s,c,{includePrerelease:!0})}e.satisfiesVersionRange=g}(Oi)),Oi}var wu;function jd(){return wu||(wu=1,function(e){var r=zt&&zt.__createBinding||(Object.create?function(t,d,i,u){u===void 0&&(u=i);var p=Object.getOwnPropertyDescriptor(d,i);(!p||("get"in p?!d.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return d[i]}}),Object.defineProperty(t,u,p)}:function(t,d,i,u){u===void 0&&(u=i),t[u]=d[i]}),n=zt&&zt.__exportStar||function(t,d){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(d,i)&&r(d,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(gt(),e),n(Fl(),e),n(Dl(),e),n(Xf(),e),n(ed(),e),n(td(),e),n(rd(),e),n(bn(),e),n(nd(),e),n(id(),e),n(cd(),e),n(ud(),e),n(ld(),e),n(hd(),e),n(fd(),e),n(dd(),e),n(qd(),e)}(zt)),zt}var vu;function Ud(){return vu||(vu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const r=jd();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return r.createModuleLogger}}),e.projectLogger=(0,r.createProjectLogger)("eth-block-tracker")}(Ri)),Ri}var bu;function Hd(){if(bu)return Wt;bu=1;var e=Wt&&Wt.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.PollingBlockTracker=void 0;const r=e(Ys()),n=e(df()),t=Il(),d=Ud(),i=(0,d.createModuleLogger)(d.projectLogger,"polling-block-tracker"),u=(0,r.default)(),p=1e3;let f=class extends t.BaseBlockTracker{constructor(s={}){var c;if(!s.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},s),{blockResetDuration:(c=s.blockResetDuration)!==null&&c!==void 0?c:s.pollingInterval})),this._provider=s.provider,this._pollingInterval=s.pollingInterval||20*p,this._retryTimeout=s.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=s.keepEventLoopActive===void 0?!0:s.keepEventLoopActive,this._setSkipCacheFlag=s.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var s;this._isRunning;)try{await this._updateLatestBlock();const c=h(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await c}catch(c){const o=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
17
|
-
${(s=c.stack)!==null&&s!==void 0?s:c}`);try{this.emit("error",o)}catch{console.error(o)}const m=h(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await m}}async _updateLatestBlock(){const s=await this._fetchLatestBlock();this._newPotentialLatest(s)}async _fetchLatestBlock(){const s={jsonrpc:"2.0",id:u(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(s.skipCache=!0),i("Making request",s);const c=await(0,n.default)(o=>this._provider.sendAsync(s,o))();if(i("Got response",c),c.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
18
|
-
${c.error.message}`);return c.result}};Wt.PollingBlockTracker=f;function h(g,s){return new Promise(c=>{const o=setTimeout(c,g);o.unref&&s&&o.unref()})}return Wt}var Gt={},_u;function Wd(){if(_u)return Gt;_u=1;var e=Gt&&Gt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.SubscribeBlockTracker=void 0;const r=e(Ys()),n=Il(),t=(0,r.default)();let d=class extends n.BaseBlockTracker{constructor(u={}){if(!u.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(u),this._provider=u.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const u=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(u)}catch(u){this.emit("error",u)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(u){this.emit("error",u)}}_call(u,...p){return new Promise((f,h)=>{this._provider.sendAsync({id:t(),method:u,params:p,jsonrpc:"2.0"},(g,s)=>{g?h(g):f(s.result)})})}_handleSubData(u,p){var f;p.method==="eth_subscription"&&((f=p.params)===null||f===void 0?void 0:f.subscription)===this._subscriptionId&&this._newPotentialLatest(p.params.result.number)}};return Gt.SubscribeBlockTracker=d,Gt}var Eu;function Vd(){return Eu||(Eu=1,function(e){var r=Ht&&Ht.__createBinding||(Object.create?function(t,d,i,u){u===void 0&&(u=i),Object.defineProperty(t,u,{enumerable:!0,get:function(){return d[i]}})}:function(t,d,i,u){u===void 0&&(u=i),t[u]=d[i]}),n=Ht&&Ht.__exportStar||function(t,d){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(d,i)&&r(d,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Hd(),e),n(Wd(),e)}(Ht)),Ht}var Jt={},Or={},Pr={},Su;function Wl(){if(Su)return Pr;Su=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.getUniqueId=void 0;const e=4294967295;let r=Math.floor(Math.random()*e);function n(){return r=(r+1)%e,r}return Pr.getUniqueId=n,Pr}var Ru;function zd(){if(Ru)return Or;Ru=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.createIdRemapMiddleware=void 0;const e=Wl();function r(){return(n,t,d,i)=>{const u=n.id,p=e.getUniqueId();n.id=p,t.id=p,d(f=>{n.id=u,t.id=u,f()})}}return Or.createIdRemapMiddleware=r,Or}var Fr={},Cu;function Gd(){if(Cu)return Fr;Cu=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.createAsyncMiddleware=void 0;function e(r){return async(n,t,d,i)=>{let u;const p=new Promise(s=>{u=s});let f=null,h=!1;const g=async()=>{h=!0,d(s=>{f=s,u()}),await p};try{await r(n,t,g),h?(await p,f(null)):i(null)}catch(s){f?f(s):i(s)}}}return Fr.createAsyncMiddleware=e,Fr}var Dr={},Mu;function Jd(){if(Mu)return Dr;Mu=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.createScaffoldMiddleware=void 0;function e(r){return(n,t,d,i)=>{const u=r[n.method];return u===void 0?d():typeof u=="function"?u(n,t,d,i):(t.result=u,i())}}return Dr.createScaffoldMiddleware=e,Dr}var $t={},un={},ku;function $d(){if(ku)return un;ku=1,Object.defineProperty(un,"__esModule",{value:!0});const e=pn();function r(d,i,u){try{Reflect.apply(d,i,u)}catch(p){setTimeout(()=>{throw p})}}function n(d){const i=d.length,u=new Array(i);for(let p=0;p<i;p+=1)u[p]=d[p];return u}class t extends e.EventEmitter{emit(i,...u){let p=i==="error";const f=this._events;if(f!==void 0)p=p&&f.error===void 0;else if(!p)return!1;if(p){let g;if(u.length>0&&([g]=u),g instanceof Error)throw g;const s=new Error(`Unhandled error.${g?` (${g.message})`:""}`);throw s.context=g,s}const h=f[i];if(h===void 0)return!1;if(typeof h=="function")r(h,this,u);else{const g=h.length,s=n(h);for(let c=0;c<g;c+=1)r(s[c],this,u)}return!0}}return un.default=t,un}var Ms={},Zt={},ks,Iu;function Zd(){if(Iu)return ks;Iu=1,ks=i,i.default=i,i.stable=h,i.stableStringify=h;var e="[...]",r="[Circular]",n=[],t=[];function d(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function i(c,o,m,_){typeof _>"u"&&(_=d()),p(c,"",0,[],void 0,0,_);var w;try{t.length===0?w=JSON.stringify(c,o,m):w=JSON.stringify(c,s(o),m)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var a=n.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return w}function u(c,o,m,_){var w=Object.getOwnPropertyDescriptor(_,m);w.get!==void 0?w.configurable?(Object.defineProperty(_,m,{value:c}),n.push([_,m,o,w])):t.push([o,m,c]):(_[m]=c,n.push([_,m,o]))}function p(c,o,m,_,w,a,E){a+=1;var S;if(typeof c=="object"&&c!==null){for(S=0;S<_.length;S++)if(_[S]===c){u(r,c,o,w);return}if(typeof E.depthLimit<"u"&&a>E.depthLimit){u(e,c,o,w);return}if(typeof E.edgesLimit<"u"&&m+1>E.edgesLimit){u(e,c,o,w);return}if(_.push(c),Array.isArray(c))for(S=0;S<c.length;S++)p(c[S],S,S,_,c,a,E);else{var I=Object.keys(c);for(S=0;S<I.length;S++){var T=I[S];p(c[T],T,S,_,c,a,E)}}_.pop()}}function f(c,o){return c<o?-1:c>o?1:0}function h(c,o,m,_){typeof _>"u"&&(_=d());var w=g(c,"",0,[],void 0,0,_)||c,a;try{t.length===0?a=JSON.stringify(w,o,m):a=JSON.stringify(w,s(o),m)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var E=n.pop();E.length===4?Object.defineProperty(E[0],E[1],E[3]):E[0][E[1]]=E[2]}}return a}function g(c,o,m,_,w,a,E){a+=1;var S;if(typeof c=="object"&&c!==null){for(S=0;S<_.length;S++)if(_[S]===c){u(r,c,o,w);return}try{if(typeof c.toJSON=="function")return}catch{return}if(typeof E.depthLimit<"u"&&a>E.depthLimit){u(e,c,o,w);return}if(typeof E.edgesLimit<"u"&&m+1>E.edgesLimit){u(e,c,o,w);return}if(_.push(c),Array.isArray(c))for(S=0;S<c.length;S++)g(c[S],S,S,_,c,a,E);else{var I={},T=Object.keys(c).sort(f);for(S=0;S<T.length;S++){var q=T[S];g(c[q],q,S,_,c,a,E),I[q]=c[q]}if(typeof w<"u")n.push([w,o,c]),w[o]=I;else return I}_.pop()}}function s(c){return c=typeof c<"u"?c:function(o,m){return m},function(o,m){if(t.length>0)for(var _=0;_<t.length;_++){var w=t[_];if(w[1]===o&&w[0]===m){m=w[2],t.splice(_,1);break}}return c.call(this,o,m)}}return ks}var Au;function lo(){if(Au)return Zt;Au=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.EthereumProviderError=Zt.EthereumRpcError=void 0;const e=Zd();class r extends Error{constructor(u,p,f){if(!Number.isInteger(u))throw new Error('"code" must be an integer.');if(!p||typeof p!="string")throw new Error('"message" must be a nonempty string.');super(p),this.code=u,f!==void 0&&(this.data=f)}serialize(){const u={code:this.code,message:this.message};return this.data!==void 0&&(u.data=this.data),this.stack&&(u.stack=this.stack),u}toString(){return e.default(this.serialize(),d,2)}}Zt.EthereumRpcError=r;class n extends r{constructor(u,p,f){if(!t(u))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(u,p,f)}}Zt.EthereumProviderError=n;function t(i){return Number.isInteger(i)&&i>=1e3&&i<=4999}function d(i,u){if(u!=="[Circular]")return u}return Zt}var Is={},Kt={},xu;function ho(){return xu||(xu=1,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."}}),Kt}var Tu;function Vl(){return Tu||(Tu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=ho(),n=lo(),t=r.errorCodes.rpc.internal,d="Unspecified error message. This is a bug, please report it.",i={code:t,message:u(t)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function u(c,o=d){if(Number.isInteger(c)){const m=c.toString();if(s(r.errorValues,m))return r.errorValues[m].message;if(h(c))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return o}e.getMessageFromCode=u;function p(c){if(!Number.isInteger(c))return!1;const o=c.toString();return!!(r.errorValues[o]||h(c))}e.isValidCode=p;function f(c,{fallbackError:o=i,shouldIncludeStack:m=!1}={}){var _,w;if(!o||!Number.isInteger(o.code)||typeof o.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(c instanceof n.EthereumRpcError)return c.serialize();const a={};if(c&&typeof c=="object"&&!Array.isArray(c)&&s(c,"code")&&p(c.code)){const S=c;a.code=S.code,S.message&&typeof S.message=="string"?(a.message=S.message,s(S,"data")&&(a.data=S.data)):(a.message=u(a.code),a.data={originalError:g(c)})}else{a.code=o.code;const S=(_=c)===null||_===void 0?void 0:_.message;a.message=S&&typeof S=="string"?S:o.message,a.data={originalError:g(c)}}const E=(w=c)===null||w===void 0?void 0:w.stack;return m&&c&&E&&typeof E=="string"&&(a.stack=E),a}e.serializeError=f;function h(c){return c>=-32099&&c<=-32e3}function g(c){return c&&typeof c=="object"&&!Array.isArray(c)?Object.assign({},c):c}function s(c,o){return Object.prototype.hasOwnProperty.call(c,o)}}(Is)),Is}var qr={},Bu;function Kd(){if(Bu)return qr;Bu=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.ethErrors=void 0;const e=lo(),r=Vl(),n=ho();qr.ethErrors={rpc:{parse:u=>t(n.errorCodes.rpc.parse,u),invalidRequest:u=>t(n.errorCodes.rpc.invalidRequest,u),invalidParams:u=>t(n.errorCodes.rpc.invalidParams,u),methodNotFound:u=>t(n.errorCodes.rpc.methodNotFound,u),internal:u=>t(n.errorCodes.rpc.internal,u),server:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:p}=u;if(!Number.isInteger(p)||p>-32005||p<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(p,u)},invalidInput:u=>t(n.errorCodes.rpc.invalidInput,u),resourceNotFound:u=>t(n.errorCodes.rpc.resourceNotFound,u),resourceUnavailable:u=>t(n.errorCodes.rpc.resourceUnavailable,u),transactionRejected:u=>t(n.errorCodes.rpc.transactionRejected,u),methodNotSupported:u=>t(n.errorCodes.rpc.methodNotSupported,u),limitExceeded:u=>t(n.errorCodes.rpc.limitExceeded,u)},provider:{userRejectedRequest:u=>d(n.errorCodes.provider.userRejectedRequest,u),unauthorized:u=>d(n.errorCodes.provider.unauthorized,u),unsupportedMethod:u=>d(n.errorCodes.provider.unsupportedMethod,u),disconnected:u=>d(n.errorCodes.provider.disconnected,u),chainDisconnected:u=>d(n.errorCodes.provider.chainDisconnected,u),custom:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:p,message:f,data:h}=u;if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(p,f,h)}}};function t(u,p){const[f,h]=i(p);return new e.EthereumRpcError(u,f||r.getMessageFromCode(u),h)}function d(u,p){const[f,h]=i(p);return new e.EthereumProviderError(u,f||r.getMessageFromCode(u),h)}function i(u){if(u){if(typeof u=="string")return[u];if(typeof u=="object"&&!Array.isArray(u)){const{message:p,data:f}=u;if(p&&typeof p!="string")throw new Error("Must specify string message.");return[p||void 0,f]}}return[]}return qr}var Lu;function Qd(){return Lu||(Lu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const r=lo();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});const n=Vl();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const t=Kd();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return t.ethErrors}});const d=ho();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return d.errorCodes}})}(Ms)),Ms}var Nu;function zl(){if(Nu)return $t;Nu=1;var e=$t&&$t.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty($t,"__esModule",{value:!0}),$t.JsonRpcEngine=void 0;const r=e($d()),n=Qd();let t=class pt extends r.default{constructor(){super(),this._middleware=[]}push(u){this._middleware.push(u)}handle(u,p){if(p&&typeof p!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(u)?p?this._handleBatch(u,p):this._handleBatch(u):p?this._handle(u,p):this._promiseHandle(u)}asMiddleware(){return async(u,p,f,h)=>{try{const[g,s,c]=await pt._runAllMiddleware(u,p,this._middleware);return s?(await pt._runReturnHandlers(c),h(g)):f(async o=>{try{await pt._runReturnHandlers(c)}catch(m){return o(m)}return o()})}catch(g){return h(g)}}}async _handleBatch(u,p){try{const f=await Promise.all(u.map(this._promiseHandle.bind(this)));return p?p(null,f):f}catch(f){if(p)return p(f);throw f}}_promiseHandle(u){return new Promise(p=>{this._handle(u,(f,h)=>{p(h)})})}async _handle(u,p){if(!u||Array.isArray(u)||typeof u!="object"){const s=new n.EthereumRpcError(n.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof u}`,{request:u});return p(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof u.method!="string"){const s=new n.EthereumRpcError(n.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof u.method}`,{request:u});return p(s,{id:u.id,jsonrpc:"2.0",error:s})}const f=Object.assign({},u),h={id:f.id,jsonrpc:f.jsonrpc};let g=null;try{await this._processRequest(f,h)}catch(s){g=s}return g&&(delete h.result,h.error||(h.error=n.serializeError(g))),p(g,h)}async _processRequest(u,p){const[f,h,g]=await pt._runAllMiddleware(u,p,this._middleware);if(pt._checkForCompletion(u,p,h),await pt._runReturnHandlers(g),f)throw f}static async _runAllMiddleware(u,p,f){const h=[];let g=null,s=!1;for(const c of f)if([g,s]=await pt._runMiddleware(u,p,c,h),s)break;return[g,s,h.reverse()]}static _runMiddleware(u,p,f,h){return new Promise(g=>{const s=o=>{const m=o||p.error;m&&(p.error=n.serializeError(m)),g([m,!0])},c=o=>{p.error?s(p.error):(o&&(typeof o!="function"&&s(new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof o}" for request:
|
|
19
|
-
${d(u)}`,{request:u})),h.push(o)),g([null,!1]))};try{f(u,p,c,s)}catch(o){s(o)}})}static async _runReturnHandlers(u){for(const p of u)await new Promise((f,h)=>{p(g=>g?h(g):f())})}static _checkForCompletion(u,p,f){if(!("result"in p)&&!("error"in p))throw new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
20
|
-
${d(u)}`,{request:u});if(!f)throw new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
21
|
-
${d(u)}`,{request:u})}};$t.JsonRpcEngine=t;function d(i){return JSON.stringify(i,null,2)}return $t}var jr={},Ou;function Yd(){if(Ou)return jr;Ou=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.mergeMiddleware=void 0;const e=zl();function r(n){const t=new e.JsonRpcEngine;return n.forEach(d=>t.push(d)),t.asMiddleware()}return jr.mergeMiddleware=r,jr}var Pu;function Gl(){return Pu||(Pu=1,function(e){var r=Jt&&Jt.__createBinding||(Object.create?function(t,d,i,u){u===void 0&&(u=i),Object.defineProperty(t,u,{enumerable:!0,get:function(){return d[i]}})}:function(t,d,i,u){u===void 0&&(u=i),t[u]=d[i]}),n=Jt&&Jt.__exportStar||function(t,d){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(d,i)&&r(d,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(zd(),e),n(Gd(),e),n(Jd(),e),n(Wl(),e),n(zl(),e),n(Yd(),e)}(Jt)),Jt}var As={},ln={},hn={},Fu;function Jl(){if(Fu)return hn;Fu=1,Object.defineProperty(hn,"__esModule",{value:!0});var e=Vs,r=function(){function n(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return n.prototype.acquire=function(){var t=this,d=this.isLocked(),i=new Promise(function(u){return t._queue.push(u)});return d||this._dispatch(),i},n.prototype.runExclusive=function(t){return e.__awaiter(this,void 0,void 0,function(){var d,i,u;return e.__generator(this,function(p){switch(p.label){case 0:return[4,this.acquire()];case 1:d=p.sent(),i=d[0],u=d[1],p.label=2;case 2:return p.trys.push([2,,4,5]),[4,t(i)];case 3:return[2,p.sent()];case 4:return u(),[7];case 5:return[2]}})})},n.prototype.isLocked=function(){return this._value<=0},n.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()}},n.prototype._dispatch=function(){var t=this,d=this._queue.shift();if(d){var i=!1;this._currentReleaser=function(){i||(i=!0,t._value++,t._dispatch())},d([this._value--,this._currentReleaser])}},n}();return hn.default=r,hn}var Du;function Xd(){if(Du)return ln;Du=1,Object.defineProperty(ln,"__esModule",{value:!0});var e=Vs,r=Jl(),n=function(){function t(){this._semaphore=new r.default(1)}return t.prototype.acquire=function(){return e.__awaiter(this,void 0,void 0,function(){var d,i;return e.__generator(this,function(u){switch(u.label){case 0:return[4,this._semaphore.acquire()];case 1:return d=u.sent(),i=d[1],[2,i]}})})},t.prototype.runExclusive=function(d){return this._semaphore.runExclusive(function(){return d()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();return ln.default=n,ln}var Ur={},qu;function e0(){if(qu)return Ur;qu=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.withTimeout=void 0;var e=Vs;function r(n,t,d){var i=this;return d===void 0&&(d=new Error("timeout")),{acquire:function(){return new Promise(function(u,p){return e.__awaiter(i,void 0,void 0,function(){var f,h,g;return e.__generator(this,function(s){switch(s.label){case 0:return f=!1,setTimeout(function(){f=!0,p(d)},t),[4,n.acquire()];case 1:return h=s.sent(),f?(g=Array.isArray(h)?h[1]:h,g()):u(h),[2]}})})})},runExclusive:function(u){return e.__awaiter(this,void 0,void 0,function(){var p,f;return e.__generator(this,function(h){switch(h.label){case 0:p=function(){},h.label=1;case 1:return h.trys.push([1,,7,8]),[4,this.acquire()];case 2:return f=h.sent(),Array.isArray(f)?(p=f[1],[4,u(f[0])]):[3,4];case 3:return[2,h.sent()];case 4:return p=f,[4,u()];case 5:return[2,h.sent()];case 6:return[3,8];case 7:return p(),[7];case 8:return[2]}})})},release:function(){n.release()},isLocked:function(){return n.isLocked()}}}return Ur.withTimeout=r,Ur}var ju;function t0(){return ju||(ju=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var r=Xd();Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return r.default}});var n=Jl();Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return n.default}});var t=e0();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return t.withTimeout}})}(As)),As}var xs,Uu;function r0(){if(Uu)return xs;Uu=1,xs=r;var e=Object.prototype.hasOwnProperty;function r(){for(var n={},t=0;t<arguments.length;t++){var d=arguments[t];for(var i in d)e.call(d,i)&&(n[i]=d[i])}return n}return xs}var Ts,Hu;function n0(){if(Hu)return Ts;Hu=1;const e=r0(),r=Ys()();Ts=n;function n(u){const p=this;p.currentProvider=u}n.prototype.getBalance=d(2,"eth_getBalance"),n.prototype.getCode=d(2,"eth_getCode"),n.prototype.getTransactionCount=d(2,"eth_getTransactionCount"),n.prototype.getStorageAt=d(3,"eth_getStorageAt"),n.prototype.call=d(2,"eth_call"),n.prototype.protocolVersion=t("eth_protocolVersion"),n.prototype.syncing=t("eth_syncing"),n.prototype.coinbase=t("eth_coinbase"),n.prototype.mining=t("eth_mining"),n.prototype.hashrate=t("eth_hashrate"),n.prototype.gasPrice=t("eth_gasPrice"),n.prototype.accounts=t("eth_accounts"),n.prototype.blockNumber=t("eth_blockNumber"),n.prototype.getBlockTransactionCountByHash=t("eth_getBlockTransactionCountByHash"),n.prototype.getBlockTransactionCountByNumber=t("eth_getBlockTransactionCountByNumber"),n.prototype.getUncleCountByBlockHash=t("eth_getUncleCountByBlockHash"),n.prototype.getUncleCountByBlockNumber=t("eth_getUncleCountByBlockNumber"),n.prototype.sign=t("eth_sign"),n.prototype.sendTransaction=t("eth_sendTransaction"),n.prototype.sendRawTransaction=t("eth_sendRawTransaction"),n.prototype.estimateGas=t("eth_estimateGas"),n.prototype.getBlockByHash=t("eth_getBlockByHash"),n.prototype.getBlockByNumber=t("eth_getBlockByNumber"),n.prototype.getTransactionByHash=t("eth_getTransactionByHash"),n.prototype.getTransactionByBlockHashAndIndex=t("eth_getTransactionByBlockHashAndIndex"),n.prototype.getTransactionByBlockNumberAndIndex=t("eth_getTransactionByBlockNumberAndIndex"),n.prototype.getTransactionReceipt=t("eth_getTransactionReceipt"),n.prototype.getUncleByBlockHashAndIndex=t("eth_getUncleByBlockHashAndIndex"),n.prototype.getUncleByBlockNumberAndIndex=t("eth_getUncleByBlockNumberAndIndex"),n.prototype.getCompilers=t("eth_getCompilers"),n.prototype.compileLLL=t("eth_compileLLL"),n.prototype.compileSolidity=t("eth_compileSolidity"),n.prototype.compileSerpent=t("eth_compileSerpent"),n.prototype.newFilter=t("eth_newFilter"),n.prototype.newBlockFilter=t("eth_newBlockFilter"),n.prototype.newPendingTransactionFilter=t("eth_newPendingTransactionFilter"),n.prototype.uninstallFilter=t("eth_uninstallFilter"),n.prototype.getFilterChanges=t("eth_getFilterChanges"),n.prototype.getFilterLogs=t("eth_getFilterLogs"),n.prototype.getLogs=t("eth_getLogs"),n.prototype.getWork=t("eth_getWork"),n.prototype.submitWork=t("eth_submitWork"),n.prototype.submitHashrate=t("eth_submitHashrate"),n.prototype.sendAsync=function(u,p){this.currentProvider.sendAsync(i(u),function(h,g){if(!h&&g.error&&(h=new Error("EthQuery - RPC Error - "+g.error.message)),h)return p(h);p(null,g.result)})};function t(u){return function(){const p=this;var f=[].slice.call(arguments),h=f.pop();p.sendAsync({method:u,params:f},h)}}function d(u,p){return function(){const f=this;var h=[].slice.call(arguments),g=h.pop();h.length<u&&h.push("latest"),f.sendAsync({method:p,params:h},g)}}function i(u){return e({id:r(),jsonrpc:"2.0",params:[]},u)}return Ts}var Bs,Wu;function i0(){if(Wu)return Bs;Wu=1;const e=(n,t,d,i)=>function(...u){const p=t.promiseModule;return new p((f,h)=>{t.multiArgs?u.push((...s)=>{t.errorFirst?s[0]?h(s):(s.shift(),f(s)):f(s)}):t.errorFirst?u.push((s,c)=>{s?h(s):f(c)}):u.push(f),Reflect.apply(n,this===d?i:this,u)})},r=new WeakMap;return Bs=(n,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const d=typeof n;if(!(n!==null&&(d==="object"||d==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${n===null?"null":d}\``);const i=(f,h)=>{let g=r.get(f);if(g||(g={},r.set(f,g)),h in g)return g[h];const s=w=>typeof w=="string"||typeof h=="symbol"?h===w:w.test(h),c=Reflect.getOwnPropertyDescriptor(f,h),o=c===void 0||c.writable||c.configurable,_=(t.include?t.include.some(s):!t.exclude.some(s))&&o;return g[h]=_,_},u=new WeakMap,p=new Proxy(n,{apply(f,h,g){const s=u.get(f);if(s)return Reflect.apply(s,h,g);const c=t.excludeMain?f:e(f,t,p,f);return u.set(f,c),Reflect.apply(c,h,g)},get(f,h){const g=f[h];if(!i(f,h)||g===Function.prototype[h])return g;const s=u.get(g);if(s)return s;if(typeof g=="function"){const c=e(g,t,p,f);return u.set(g,c),c}return g}});return p},Bs}var Ls,Vu;function fo(){if(Vu)return Ls;Vu=1;const e=Xs().default;class r extends e{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(d=>this.emit("update",d))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}}return Ls=r,Ls}var Ns,zu;function s0(){if(zu)return Ns;zu=1;const e=fo();class r extends e{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}}return Ns=r,Ns}var Os,Gu;function $r(){if(Gu)return Os;Gu=1,Os={minBlockRef:e,maxBlockRef:r,sortBlockRefs:n,bnToHex:t,blockRefIsNumber:d,hexToInt:i,incrementHexInt:u,intToHex:p,unsafeRandomBytes:f};function e(...g){return n(g)[0]}function r(...g){const s=n(g);return s[s.length-1]}function n(g){return g.sort((s,c)=>s==="latest"||c==="earliest"?1:c==="latest"||s==="earliest"?-1:i(s)-i(c))}function t(g){return"0x"+g.toString(16)}function d(g){return g&&!["earliest","latest","pending"].includes(g)}function i(g){return g==null?g:Number.parseInt(g,16)}function u(g){if(g==null)return g;const s=i(g);return p(s+1)}function p(g){if(g==null)return g;let s=g.toString(16);return s.length%2&&(s="0"+s),"0x"+s}function f(g){let s="0x";for(let c=0;c<g;c++)s+=h(),s+=h();return s}function h(){return Math.floor(Math.random()*16).toString(16)}return Os}var Ps,Ju;function o0(){if(Ju)return Ps;Ju=1;const e=n0(),r=i0(),n=s0(),{bnToHex:t,hexToInt:d,incrementHexInt:i,minBlockRef:u,blockRefIsNumber:p}=$r();class f extends n{constructor({provider:g,params:s}){super(),this.type="log",this.ethQuery=new e(g),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},s),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(c=>c.toLowerCase()))}async initialize({currentBlock:g}){let s=this.params.fromBlock;["latest","pending"].includes(s)&&(s=g),s==="earliest"&&(s="0x0"),this.params.fromBlock=s;const c=u(this.params.toBlock,g),o=Object.assign({},this.params,{toBlock:c}),m=await this._fetchLogs(o);this.addInitialResults(m)}async update({oldBlock:g,newBlock:s}){const c=s;let o;g?o=i(g):o=s;const m=Object.assign({},this.params,{fromBlock:o,toBlock:c}),w=(await this._fetchLogs(m)).filter(a=>this.matchLog(a));this.addResults(w)}async _fetchLogs(g){return await r(c=>this.ethQuery.getLogs(g,c))()}matchLog(g){if(d(this.params.fromBlock)>=d(g.blockNumber)||p(this.params.toBlock)&&d(this.params.toBlock)<=d(g.blockNumber))return!1;const s=g.address&&g.address.toLowerCase();return this.params.address&&s&&!this.params.address.includes(s)?!1:this.params.topics.every((o,m)=>{let _=g.topics[m];if(!_)return!1;_=_.toLowerCase();let w=Array.isArray(o)?o:[o];return w.includes(null)?!0:(w=w.map(S=>S.toLowerCase()),w.includes(_))})}}return Ps=f,Ps}var Fs,$u;function po(){if($u)return Fs;$u=1,Fs=e;async function e({provider:i,fromBlock:u,toBlock:p}){u||(u=p);const f=r(u),g=r(p)-f+1,s=Array(g).fill().map((o,m)=>f+m).map(n);let c=await Promise.all(s.map(o=>d(i,"eth_getBlockByNumber",[o,!1])));return c=c.filter(o=>o!==null),c}function r(i){return i==null?i:Number.parseInt(i,16)}function n(i){return i==null?i:"0x"+i.toString(16)}function t(i,u){return new Promise((p,f)=>{i.sendAsync(u,(h,g)=>{h?f(h):g.error?f(g.error):g.result?p(g.result):f(new Error("Result was empty"))})})}async function d(i,u,p){for(let f=0;f<3;f++)try{return await t(i,{id:1,jsonrpc:"2.0",method:u,params:p})}catch(h){console.error(`provider.sendAsync failed: ${h.stack||h.message||h}`)}return null}return Fs}var Ds,Zu;function a0(){if(Zu)return Ds;Zu=1;const e=fo(),r=po(),{incrementHexInt:n}=$r();class t extends e{constructor({provider:i,params:u}){super(),this.type="block",this.provider=i}async update({oldBlock:i,newBlock:u}){const p=u,f=n(i),g=(await r({provider:this.provider,fromBlock:f,toBlock:p})).map(s=>s.hash);this.addResults(g)}}return Ds=t,Ds}var qs,Ku;function c0(){if(Ku)return qs;Ku=1;const e=fo(),r=po(),{incrementHexInt:n}=$r();class t extends e{constructor({provider:i}){super(),this.type="tx",this.provider=i}async update({oldBlock:i}){const u=i,p=n(i),f=await r({provider:this.provider,fromBlock:p,toBlock:u}),h=[];for(const g of f)h.push(...g.transactions);this.addResults(h)}}return qs=t,qs}var js,Qu;function u0(){if(Qu)return js;Qu=1;const e=t0().Mutex,{createAsyncMiddleware:r,createScaffoldMiddleware:n}=Gl(),t=o0(),d=a0(),i=c0(),{intToHex:u,hexToInt:p}=$r();js=f;function f({blockTracker:o,provider:m}){let _=0,w={};const a=new e,E=s({mutex:a}),S=n({eth_newFilter:E(h(T)),eth_newBlockFilter:E(h(q)),eth_newPendingTransactionFilter:E(h(N)),eth_uninstallFilter:E(g(X)),eth_getFilterChanges:E(g(H)),eth_getFilterLogs:E(g(K))}),I=async({oldBlock:b,newBlock:C})=>{if(w.length===0)return;const k=await a.acquire();try{await Promise.all(c(w).map(async x=>{try{await x.update({oldBlock:b,newBlock:C})}catch(O){console.error(O)}}))}catch(x){console.error(x)}k()};return S.newLogFilter=T,S.newBlockFilter=q,S.newPendingTransactionFilter=N,S.uninstallFilter=X,S.getFilterChanges=H,S.getFilterLogs=K,S.destroy=()=>{D()},S;async function T(b){const C=new t({provider:m,params:b});return await re(C),C}async function q(){const b=new d({provider:m});return await re(b),b}async function N(){const b=new i({provider:m});return await re(b),b}async function H(b){const C=p(b),k=w[C];if(!k)throw new Error(`No filter for index "${C}"`);return k.getChangesAndClear()}async function K(b){const C=p(b),k=w[C];if(!k)throw new Error(`No filter for index "${C}"`);let x=[];return k.type==="log"&&(x=k.getAllResults()),x}async function X(b){const C=p(b),x=!!w[C];return x&&await W(C),x}async function re(b){const C=c(w).length,k=await o.getLatestBlock();await b.initialize({currentBlock:k}),_++,w[_]=b,b.id=_,b.idHex=u(_);const x=c(w).length;return l({prevFilterCount:C,newFilterCount:x}),_}async function W(b){const C=c(w).length;delete w[b];const k=c(w).length;l({prevFilterCount:C,newFilterCount:k})}async function D(){const b=c(w).length;w={},l({prevFilterCount:b,newFilterCount:0})}function l({prevFilterCount:b,newFilterCount:C}){if(b===0&&C>0){o.on("sync",I);return}if(b>0&&C===0){o.removeListener("sync",I);return}}}function h(o){return g(async(...m)=>{const _=await o(...m);return u(_.id)})}function g(o){return r(async(m,_)=>{const w=await o.apply(null,m.params);_.result=w})}function s({mutex:o}){return m=>async(_,w,a,E)=>{(await o.acquire())(),m(_,w,a,E)}}function c(o,m){const _=[];for(let w in o)_.push(o[w]);return _}return js}var Us,Yu;function l0(){if(Yu)return Us;Yu=1;const e=Xs().default,{createAsyncMiddleware:r,createScaffoldMiddleware:n}=Gl(),t=u0(),{unsafeRandomBytes:d,incrementHexInt:i}=$r(),u=po();Us=p;function p({blockTracker:h,provider:g}){const s={},c=t({blockTracker:h,provider:g});let o=!1;const m=new e,_=n({eth_subscribe:r(w),eth_unsubscribe:r(a)});return _.destroy=S,{events:m,middleware:_};async function w(I,T){if(o)throw new Error("SubscriptionManager - attempting to use after destroying");const q=I.params[0],N=d(16);let H;switch(q){case"newHeads":H=K({subId:N});break;case"logs":const re=I.params[1],W=await c.newLogFilter(re);H=X({subId:N,filter:W});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${q}"`)}s[N]=H,T.result=N;return;function K({subId:re}){const W={type:q,destroy:async()=>{h.removeListener("sync",W.update)},update:async({oldBlock:D,newBlock:l})=>{const b=l,C=i(D);(await u({provider:g,fromBlock:C,toBlock:b})).map(f).filter(O=>O!==null).forEach(O=>{E(re,O)})}};return h.on("sync",W.update),W}function X({subId:re,filter:W}){return W.on("update",l=>E(re,l)),{type:q,destroy:async()=>await c.uninstallFilter(W.idHex)}}}async function a(I,T){if(o)throw new Error("SubscriptionManager - attempting to use after destroying");const q=I.params[0],N=s[q];if(!N){T.result=!1;return}delete s[q],await N.destroy(),T.result=!0}function E(I,T){m.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:I,result:T}})}function S(){m.removeAllListeners();for(const I in s)s[I].destroy(),delete s[I];o=!0}}function f(h){return h==null?null:{hash:h.hash,parentHash:h.parentHash,sha3Uncles:h.sha3Uncles,miner:h.miner,stateRoot:h.stateRoot,transactionsRoot:h.transactionsRoot,receiptsRoot:h.receiptsRoot,logsBloom:h.logsBloom,difficulty:h.difficulty,number:h.number,gasLimit:h.gasLimit,gasUsed:h.gasUsed,nonce:h.nonce,mixHash:h.mixHash,timestamp:h.timestamp,extraData:h.extraData}}return Us}var Xu;function h0(){if(Xu)return Br;Xu=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.SubscriptionManager=void 0;const e=Vd(),r=l0(),n=()=>{};let t=class{constructor(i){const u=new e.PollingBlockTracker({provider:i,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:p,middleware:f}=r({blockTracker:u,provider:i});this.events=p,this.subscriptionMiddleware=f}async handleRequest(i){const u={};return await this.subscriptionMiddleware(i,u,n,n),u}destroy(){this.subscriptionMiddleware.destroy()}};return Br.SubscriptionManager=t,Br}var el;function Ws(){if(el)return Bt;el=1;var e=Bt&&Bt.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.CoinbaseWalletProvider=void 0;const r=e(gn()),n=Kl(),t=yn(),d=lt(),i=ml(),u=Zs(),p=Ks(),f=Gs(),h=e(hf()),g=$s(),s=ff(),c=h0(),o="DefaultChainId",m="DefaultJsonRpcUrl";let _=class extends n.EventEmitter{constructor(a){var E,S;super(),this._filterPolyfill=new s.FilterPolyfill(this),this._subscriptionManager=new c.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=a.chainId,this._jsonRpcUrlFromOpts=a.jsonRpcUrl,this._overrideIsMetaMask=a.overrideIsMetaMask,this._relayProvider=a.relayProvider,this._storage=a.storage,this._relayEventManager=a.relayEventManager,this.diagnostic=a.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(E=a.overrideIsCoinbaseWallet)!==null&&E!==void 0?E:!0,this.isCoinbaseBrowser=(S=a.overrideIsCoinbaseBrowser)!==null&&S!==void 0?S:!1,this.qrUrl=a.qrUrl;const I=this.getChainId(),T=(0,d.prepend0x)(I.toString(16));this.emit("connect",{chainIdStr:T});const q=this._storage.getItem(u.LOCAL_STORAGE_ADDRESSES_KEY);if(q){const N=q.split(" ");N[0]!==""&&(this._addresses=N.map(H=>(0,d.ensureAddressString)(H)),this.emit("accountsChanged",N))}this._subscriptionManager.events.on("notification",N=>{this.emit("message",{type:N.method,data:N.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",N=>{var H;if(!(N.origin!==location.origin||N.source!==window)&&N.data.type==="walletLinkMessage"&&N.data.data.action==="dappChainSwitched"){const K=N.data.data.chainId,X=(H=N.data.data.jsonRpcUrl)!==null&&H!==void 0?H:this.jsonRpcUrl;this.updateProviderInfo(X,Number(K))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,d.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 a;return(a=this._storage.getItem(m))!==null&&a!==void 0?a:this._jsonRpcUrlFromOpts}set jsonRpcUrl(a){this._storage.setItem(m,a)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(a,E){this.isCoinbaseBrowser||(this._chainIdFromOpts=E,this._jsonRpcUrlFromOpts=a),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(a,E){this.jsonRpcUrl=a;const S=this.getChainId();this._storage.setItem(o,E.toString(10)),((0,d.ensureIntNumber)(E)!==S||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(a,E,S,I,T,q){const H=await(await this.initializeRelay()).watchAsset(a,E,S,I,T,q==null?void 0:q.toString()).promise;return(0,f.isErrorResponse)(H)?!1:!!H.result}async addEthereumChain(a,E,S,I,T,q){var N,H;if((0,d.ensureIntNumber)(a)===this.getChainId())return!1;const K=await this.initializeRelay(),X=K.inlineAddEthereumChain(a.toString());!this._isAuthorized()&&!X&&await K.requestEthereumAccounts().promise;const re=await K.addEthereumChain(a.toString(),E,T,S,I,q).promise;return(0,f.isErrorResponse)(re)?!1:(((N=re.result)===null||N===void 0?void 0:N.isApproved)===!0&&this.updateProviderInfo(E[0],a),((H=re.result)===null||H===void 0?void 0:H.isApproved)===!0)}async switchEthereumChain(a){const S=await(await this.initializeRelay()).switchEthereumChain(a.toString(10),this.selectedAddress||void 0).promise;if((0,f.isErrorResponse)(S)){if(!S.errorCode)return;throw S.errorCode===t.standardErrorCodes.provider.unsupportedChain?t.standardErrors.provider.unsupportedChain():t.standardErrors.provider.custom({message:S.errorMessage,code:S.errorCode})}const I=S.result;I.isApproved&&I.rpcUrl.length>0&&this.updateProviderInfo(I.rpcUrl,a)}setAppInfo(a,E){this.initializeRelay().then(S=>S.setAppInfo(a,E))}async enable(){var a;return(a=this.diagnostic)===null||a===void 0||a.log(g.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(a,E){try{const S=this._send(a,E);if(S instanceof Promise)return S.catch(I=>{throw(0,t.serializeError)(I,a)})}catch(S){throw(0,t.serializeError)(S,a)}}_send(a,E){if(typeof a=="string"){const I=a,T=Array.isArray(E)?E:E!==void 0?[E]:[],q={jsonrpc:"2.0",id:0,method:I,params:T};return this._sendRequestAsync(q).then(N=>N.result)}if(typeof E=="function"){const I=a,T=E;return this._sendAsync(I,T)}if(Array.isArray(a))return a.map(T=>this._sendRequest(T));const S=a;return this._sendRequest(S)}async sendAsync(a,E){try{return this._sendAsync(a,E).catch(S=>{throw(0,t.serializeError)(S,a)})}catch(S){return Promise.reject((0,t.serializeError)(S,a))}}async _sendAsync(a,E){if(typeof E!="function")throw new Error("callback is required");if(Array.isArray(a)){const I=E;this._sendMultipleRequestsAsync(a).then(T=>I(null,T)).catch(T=>I(T,null));return}const S=E;return this._sendRequestAsync(a).then(I=>S(null,I)).catch(I=>S(I,null))}async request(a){try{return this._request(a).catch(E=>{throw(0,t.serializeError)(E,a.method)})}catch(E){return Promise.reject((0,t.serializeError)(E,a.method))}}async _request(a){if(!a||typeof a!="object"||Array.isArray(a))throw t.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:a});const{method:E,params:S}=a;if(typeof E!="string"||E.length===0)throw t.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:a});if(S!==void 0&&!Array.isArray(S)&&(typeof S!="object"||S===null))throw t.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:a});const I=S===void 0?[]:S,T=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:E,params:I,jsonrpc:"2.0",id:T})).result}async scanQRCode(a){const S=await(await this.initializeRelay()).scanQRCode((0,d.ensureRegExpString)(a)).promise;if((0,f.isErrorResponse)(S))throw(0,t.serializeError)(S.errorMessage,"scanQRCode");if(typeof S.result!="string")throw(0,t.serializeError)("result was not a string","scanQRCode");return S.result}async genericRequest(a,E){const I=await(await this.initializeRelay()).genericRequest(a,E).promise;if((0,f.isErrorResponse)(I))throw(0,t.serializeError)(I.errorMessage,"generic");if(typeof I.result!="string")throw(0,t.serializeError)("result was not a string","generic");return I.result}async connectAndSignIn(a){var E;(E=this.diagnostic)===null||E===void 0||E.log(g.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0});let S;try{const T=await this.initializeRelay();if(!(T instanceof i.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(S=await T.connectAndSignIn(a).promise,(0,f.isErrorResponse)(S))throw new Error(S.errorMessage)}catch(T){throw typeof T.message=="string"&&T.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):T}if(!S.result)throw new Error("accounts received is empty");const{accounts:I}=S.result;return this._setAddresses(I),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),S.result}async selectProvider(a){const S=await(await this.initializeRelay()).selectProvider(a).promise;if((0,f.isErrorResponse)(S))throw(0,t.serializeError)(S.errorMessage,"selectProvider");if(typeof S.result!="string")throw(0,t.serializeError)("result was not a string","selectProvider");return S.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(a){const E={jsonrpc:"2.0",id:a.id},{method:S}=a;if(E.result=this._handleSynchronousMethods(a),E.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${S} synchronously without a callback. Please provide a callback parameter to call ${S} asynchronously.`);return E}_setAddresses(a,E){if(!Array.isArray(a))throw new Error("addresses is not an array");const S=a.map(I=>(0,d.ensureAddressString)(I));JSON.stringify(S)!==JSON.stringify(this._addresses)&&(this._addresses=S,this.emit("accountsChanged",this._addresses),this._storage.setItem(u.LOCAL_STORAGE_ADDRESSES_KEY,S.join(" ")))}_sendRequestAsync(a){return new Promise((E,S)=>{try{const I=this._handleSynchronousMethods(a);if(I!==void 0)return E({jsonrpc:"2.0",id:a.id,result:I});const T=this._handleAsynchronousFilterMethods(a);if(T!==void 0){T.then(N=>E(Object.assign(Object.assign({},N),{id:a.id}))).catch(N=>S(N));return}const q=this._handleSubscriptionMethods(a);if(q!==void 0){q.then(N=>E({jsonrpc:"2.0",id:a.id,result:N.result})).catch(N=>S(N));return}}catch(I){return S(I)}this._handleAsynchronousMethods(a).then(I=>I&&E(Object.assign(Object.assign({},I),{id:a.id}))).catch(I=>S(I))})}_sendMultipleRequestsAsync(a){return Promise.all(a.map(E=>this._sendRequestAsync(E)))}_handleSynchronousMethods(a){const{method:E}=a,S=a.params||[];switch(E){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(S);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(a){const{method:E}=a,S=a.params||[];switch(E){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(S);case"eth_ecRecover":return this._eth_ecRecover(S);case"personal_sign":return this._personal_sign(S);case"personal_ecRecover":return this._personal_ecRecover(S);case"eth_signTransaction":return this._eth_signTransaction(S);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(S);case"eth_sendTransaction":return this._eth_sendTransaction(S);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(S);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(S);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(S);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(S);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(S);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(S);case"wallet_watchAsset":return this._wallet_watchAsset(S)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(a,this.jsonRpcUrl).catch(T=>{var q;throw(T.code===t.standardErrorCodes.rpc.methodNotFound||T.code===t.standardErrorCodes.rpc.methodNotSupported)&&((q=this.diagnostic)===null||q===void 0||q.log(g.EVENTS.METHOD_NOT_IMPLEMENTED,{method:a.method,sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0})),T})}_handleAsynchronousFilterMethods(a){const{method:E}=a,S=a.params||[];switch(E){case"eth_newFilter":return this._eth_newFilter(S);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(S);case"eth_getFilterLogs":return this._eth_getFilterLogs(S)}}_handleSubscriptionMethods(a){switch(a.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(a)}}_isKnownAddress(a){try{const E=(0,d.ensureAddressString)(a);return this._addresses.map(I=>(0,d.ensureAddressString)(I)).includes(E)}catch{}return!1}_ensureKnownAddress(a){var E;if(!this._isKnownAddress(a))throw(E=this.diagnostic)===null||E===void 0||E.log(g.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(a){const E=a.from?(0,d.ensureAddressString)(a.from):this.selectedAddress;if(!E)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(E);const S=a.to?(0,d.ensureAddressString)(a.to):null,I=a.value!=null?(0,d.ensureBN)(a.value):new r.default(0),T=a.data?(0,d.ensureBuffer)(a.data):ge.alloc(0),q=a.nonce!=null?(0,d.ensureIntNumber)(a.nonce):null,N=a.gasPrice!=null?(0,d.ensureBN)(a.gasPrice):null,H=a.maxFeePerGas!=null?(0,d.ensureBN)(a.maxFeePerGas):null,K=a.maxPriorityFeePerGas!=null?(0,d.ensureBN)(a.maxPriorityFeePerGas):null,X=a.gas!=null?(0,d.ensureBN)(a.gas):null,re=a.chainId?(0,d.ensureIntNumber)(a.chainId):this.getChainId();return{fromAddress:E,toAddress:S,weiValue:I,data:T,nonce:q,gasPriceInWei:N,maxFeePerGas:H,maxPriorityFeePerGas:K,gasLimit:X,chainId:re}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw t.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw t.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(a,E,S,I){this._ensureKnownAddress(E);try{const q=await(await this.initializeRelay()).signEthereumMessage(a,E,S,I).promise;if((0,f.isErrorResponse)(q))throw new Error(q.errorMessage);return{jsonrpc:"2.0",id:0,result:q.result}}catch(T){throw typeof T.message=="string"&&T.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied message signature"):T}}async _ethereumAddressFromSignedMessage(a,E,S){const T=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(a,E,S).promise;if((0,f.isErrorResponse)(T))throw new Error(T.errorMessage);return{jsonrpc:"2.0",id:0,result:T.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,d.hexStringFromIntNumber)(this.getChainId())}getChainId(){const a=this._storage.getItem(o);if(!a)return(0,d.ensureIntNumber)(this._chainIdFromOpts);const E=parseInt(a,10);return(0,d.ensureIntNumber)(E)}async _eth_requestAccounts(){var a;if((a=this.diagnostic)===null||a===void 0||a.log(g.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let E;try{if(E=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,f.isErrorResponse)(E))throw new Error(E.errorMessage)}catch(S){throw typeof S.message=="string"&&S.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):S}if(!E.result)throw new Error("accounts received is empty");return this._setAddresses(E.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(a){this._requireAuthorization();const E=(0,d.ensureAddressString)(a[0]),S=(0,d.ensureBuffer)(a[1]);return this._signEthereumMessage(S,E,!1)}_eth_ecRecover(a){const E=(0,d.ensureBuffer)(a[0]),S=(0,d.ensureBuffer)(a[1]);return this._ethereumAddressFromSignedMessage(E,S,!1)}_personal_sign(a){this._requireAuthorization();const E=(0,d.ensureBuffer)(a[0]),S=(0,d.ensureAddressString)(a[1]);return this._signEthereumMessage(E,S,!0)}_personal_ecRecover(a){const E=(0,d.ensureBuffer)(a[0]),S=(0,d.ensureBuffer)(a[1]);return this._ethereumAddressFromSignedMessage(E,S,!0)}async _eth_signTransaction(a){this._requireAuthorization();const E=this._prepareTransactionParams(a[0]||{});try{const I=await(await this.initializeRelay()).signEthereumTransaction(E).promise;if((0,f.isErrorResponse)(I))throw new Error(I.errorMessage);return{jsonrpc:"2.0",id:0,result:I.result}}catch(S){throw typeof S.message=="string"&&S.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):S}}async _eth_sendRawTransaction(a){const E=(0,d.ensureBuffer)(a[0]),I=await(await this.initializeRelay()).submitEthereumTransaction(E,this.getChainId()).promise;if((0,f.isErrorResponse)(I))throw new Error(I.errorMessage);return{jsonrpc:"2.0",id:0,result:I.result}}async _eth_sendTransaction(a){this._requireAuthorization();const E=this._prepareTransactionParams(a[0]||{});try{const I=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(E).promise;if((0,f.isErrorResponse)(I))throw new Error(I.errorMessage);return{jsonrpc:"2.0",id:0,result:I.result}}catch(S){throw typeof S.message=="string"&&S.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):S}}async _eth_signTypedData_v1(a){this._requireAuthorization();const E=(0,d.ensureParsedJSONObject)(a[0]),S=(0,d.ensureAddressString)(a[1]);this._ensureKnownAddress(S);const I=h.default.hashForSignTypedDataLegacy({data:E}),T=JSON.stringify(E,null,2);return this._signEthereumMessage(I,S,!1,T)}async _eth_signTypedData_v3(a){this._requireAuthorization();const E=(0,d.ensureAddressString)(a[0]),S=(0,d.ensureParsedJSONObject)(a[1]);this._ensureKnownAddress(E);const I=h.default.hashForSignTypedData_v3({data:S}),T=JSON.stringify(S,null,2);return this._signEthereumMessage(I,E,!1,T)}async _eth_signTypedData_v4(a){this._requireAuthorization();const E=(0,d.ensureAddressString)(a[0]),S=(0,d.ensureParsedJSONObject)(a[1]);this._ensureKnownAddress(E);const I=h.default.hashForSignTypedData_v4({data:S}),T=JSON.stringify(S,null,2);return this._signEthereumMessage(I,E,!1,T)}async _cbwallet_arbitrary(a){const E=a[0],S=a[1];if(typeof S!="string")throw new Error("parameter must be a string");if(typeof E!="object"||E===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(E,S)}}async _wallet_addEthereumChain(a){var E,S,I,T;const q=a[0];if(((E=q.rpcUrls)===null||E===void 0?void 0:E.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!q.chainName||q.chainName.trim()==="")throw t.standardErrors.rpc.invalidParams("chainName is a required field");if(!q.nativeCurrency)throw t.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const N=parseInt(q.chainId,16);return await this.addEthereumChain(N,(S=q.rpcUrls)!==null&&S!==void 0?S:[],(I=q.blockExplorerUrls)!==null&&I!==void 0?I:[],q.chainName,(T=q.iconUrls)!==null&&T!==void 0?T:[],q.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(a){const E=a[0];return await this.switchEthereumChain(parseInt(E.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(a){const E=Array.isArray(a)?a[0]:a;if(!E.type)throw t.standardErrors.rpc.invalidParams("Type is required");if((E==null?void 0:E.type)!=="ERC20")throw t.standardErrors.rpc.invalidParams(`Asset of type '${E.type}' is not supported`);if(!(E!=null&&E.options))throw t.standardErrors.rpc.invalidParams("Options are required");if(!(E!=null&&E.options.address))throw t.standardErrors.rpc.invalidParams("Address is required");const S=this.getChainId(),{address:I,symbol:T,image:q,decimals:N}=E.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(E.type,I,T,N,q,S)}}_eth_uninstallFilter(a){const E=(0,d.ensureHexString)(a[0]);return this._filterPolyfill.uninstallFilter(E)}async _eth_newFilter(a){const E=a[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(E)}}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(a){const E=(0,d.ensureHexString)(a[0]);return this._filterPolyfill.getFilterChanges(E)}_eth_getFilterLogs(a){const E=(0,d.ensureHexString)(a[0]);return this._filterPolyfill.getFilterLogs(E)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(a=>(a.setAccountsCallback((E,S)=>this._setAddresses(E,S)),a.setChainCallback((E,S)=>{this.updateProviderInfo(S,parseInt(E,10))}),a.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=a,a))}};return Bt.CoinbaseWalletProvider=_,Bt}var Hr={},tl;function f0(){if(tl)return Hr;tl=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.RelayEventManager=void 0;const e=lt();let r=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,d=(0,e.prepend0x)(t.toString(16));return this.callbacks.get(d)&&this.callbacks.delete(d),t}};return Hr.RelayEventManager=r,Hr}var rl;function nl(){if(rl)return ar;rl=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.CoinbaseWalletSDK=void 0;const e=ch(),r=uh(),n=lt(),t=dh(),d=Ws(),i=ml(),u=gl(),p=f0(),f=dl(),h=pl(),g=Js();let s=class $l{constructor(o){var m,_,w;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const a=o.linkAPIUrl||r.LINK_API_URL;typeof o.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=o.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(m=o.overrideIsCoinbaseWallet)!==null&&m!==void 0?m:!0,this._overrideIsCoinbaseBrowser=(_=o.overrideIsCoinbaseBrowser)!==null&&_!==void 0?_:!1,this._diagnosticLogger=o.diagnosticLogger,this._reloadOnDisconnect=(w=o.reloadOnDisconnect)!==null&&w!==void 0?w:!0;const E=new URL(a),S=`${E.protocol}//${E.host}`;if(this._storage=new t.ScopedLocalStorage(`-walletlink:${S}`),this._storage.setItem("version",$l.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new p.RelayEventManager;const I=(0,n.isMobileWeb)(),T=o.uiConstructor||(N=>I?new u.MobileRelayUI(N):new f.WalletLinkRelayUI(N)),q={linkAPIUrl:a,version:g.LIB_VERSION,darkMode:!!o.darkMode,headlessMode:!!o.headlessMode,uiConstructor:T,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:o.enableMobileWalletLink};this._relay=I?new i.MobileRelay(q):new h.WalletLinkRelay(q),this.setAppInfo(o.appName,o.appLogoUrl),!o.headlessMode&&this._relay.attachUI()}makeWeb3Provider(o="",m=1){const _=this.walletExtension;if(_)return this.isCipherProvider(_)||_.setProviderInfo(o,m),this._reloadOnDisconnect===!1&&typeof _.disableReloadOnDisconnect=="function"&&_.disableReloadOnDisconnect(),_;const w=this.coinbaseBrowser;if(w)return w;const a=this._relay;if(!a||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return o||a.setConnectDisabled(!0),new d.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(a),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:o,chainId:m,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(o,m){var _;this._appName=o||"DApp",this._appLogoUrl=m||(0,n.getFavicon)();const w=this.walletExtension;w?this.isCipherProvider(w)||w.setAppInfo(this._appName,this._appLogoUrl):(_=this._relay)===null||_===void 0||_.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var o;const m=this===null||this===void 0?void 0:this.walletExtension;m?m.close():(o=this._relay)===null||o===void 0||o.resetAndReload()}getQrUrl(){var o,m;return(m=(o=this._relay)===null||o===void 0?void 0:o.getQRCodeUrl())!==null&&m!==void 0?m:null}getCoinbaseWalletLogo(o,m=240){return(0,e.walletLogo)(o,m)}get walletExtension(){var o;return(o=window.coinbaseWalletExtension)!==null&&o!==void 0?o:window.walletLinkExtension}get coinbaseBrowser(){var o,m;try{const _=(o=window.ethereum)!==null&&o!==void 0?o:(m=window.top)===null||m===void 0?void 0:m.ethereum;return _&&"isCoinbaseBrowser"in _&&_.isCoinbaseBrowser?_:void 0}catch{return}}isCipherProvider(o){return typeof o.isCipher=="boolean"&&o.isCipher}};return ar.CoinbaseWalletSDK=s,s.VERSION=g.LIB_VERSION,ar}var il;function d0(){return il||(il=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const r=nl(),n=Ws();var t=nl();Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}});var d=Ws();Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return d.CoinbaseWalletProvider}}),e.default=r.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=r.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=r.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)}(xn)),xn}var Zl=d0();const p0=Ql(Zl),F0=ah({__proto__:null,default:p0},[Zl]);export{F0 as i};
|