@dcl/landing-site 0.0.1-23617412190.commit-e3cca1e → 0.0.1-23619144615.commit-9dd6c8c
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/{AnimatedBackground-gNtI-YhV.js → AnimatedBackground-BX21LYI2.js} +2 -2
- package/assets/FooterLanding-r_hZlF_u.js +1 -0
- package/assets/{add-CHM98Fes.js → add-DaN_WwVR.js} +1 -1
- package/assets/all-wallets-Dnuhj0Og.js +6 -0
- package/assets/{app-store-CRgqc_8W.js → app-store-CcYHqDTq.js} +2 -2
- package/assets/{apple-DA-gL0ew.js → apple-BP0ixQ55.js} +2 -2
- package/assets/arrow-bottom-DCVMAr8H.js +8 -0
- package/assets/{arrow-bottom-circle-W7EphmHv.js → arrow-bottom-circle-BcZjyH_3.js} +2 -2
- package/assets/arrow-left-B8e4P5ki.js +8 -0
- package/assets/arrow-right-Cb1MhLlX.js +8 -0
- package/assets/arrow-top-CsxZbNjO.js +8 -0
- package/assets/auto-track-BOxo_bvT.js +1 -0
- package/assets/{bank-BJ_zMNdO.js → bank-CmtjeWfr.js} +1 -1
- package/assets/{basic-Cbs3wtVd.js → basic-DzuqKs2l.js} +1 -1
- package/assets/{browser-BZI6LlMK.js → browser-DQjkDFvi.js} +2 -2
- package/assets/{card-a0PEwixX.js → card-C3dOAVqt.js} +2 -2
- package/assets/ccip-Z16c_UnO.js +1 -0
- package/assets/{checkmark-bold-nUmAb0Jv.js → checkmark-bold-ButdL_LZ.js} +2 -2
- package/assets/{checkmark-DxhM6kxf.js → checkmark-iVuMZlIm.js} +2 -2
- package/assets/chevron-bottom-jJpGeUUx.js +8 -0
- package/assets/chevron-left-Ch61xlSU.js +8 -0
- package/assets/chevron-right-BTWePK-z.js +8 -0
- package/assets/chevron-top-DT7Y9DlB.js +8 -0
- package/assets/{chrome-store-C0l7_S46.js → chrome-store-WwSkA5JI.js} +2 -2
- package/assets/{clock-CGFlkuTk.js → clock-DLLelcN_.js} +2 -2
- package/assets/close-2B53ZcOr.js +8 -0
- package/assets/{coinPlaceholder-BcTAu_IN.js → coinPlaceholder-BqU1Y-z1.js} +2 -2
- package/assets/{compass-AzcmZa1s.js → compass-Dkii6WBH.js} +2 -2
- package/assets/{copy-DU6nZmjR.js → copy-CtlKkDiy.js} +2 -2
- package/assets/core-CTGAiloq.js +908 -0
- package/assets/cursor-h29Fyu_C.js +3 -0
- package/assets/{cursor-transparent-CBn-iCcY.js → cursor-transparent-Cna8_emv.js} +1 -1
- package/assets/{desktop-Cgv-18ZV.js → desktop-DVSar6pk.js} +2 -2
- package/assets/{disconnect-BccJ3jIT.js → disconnect-DWAlWLSE.js} +2 -2
- package/assets/{discord-5RUDhSal.js → discord-qzKpdTIN.js} +2 -2
- package/assets/{etherscan-C3fPztHb.js → etherscan-Dq8VeI1F.js} +2 -2
- package/assets/{exclamation-triangle-D_ozpW4c.js → exclamation-triangle-DB0vGdPg.js} +2 -2
- package/assets/{extension-BBOn_gDX.js → extension-DrmX2qvD.js} +1 -1
- package/assets/{external-link-BWUOLdmG.js → external-link-CQ-Po7zU.js} +1 -1
- package/assets/{facebook-CPf0OEse.js → facebook-Cj_V7srz.js} +2 -2
- package/assets/{farcaster-CR6V0phI.js → farcaster-j1zJY7FO.js} +2 -2
- package/assets/filters-CoTrUOjM.js +8 -0
- package/assets/{github-Df-6J-fJ.js → github-BiFTJBr4.js} +2 -2
- package/assets/{google-ZDEMGNHZ.js → google-CoUxHqlc.js} +1 -1
- package/assets/{help-circle-BL4M8ISL.js → help-circle-CmYFWRl7.js} +1 -1
- package/assets/hooks.module-Dz_XB4AG.js +1 -0
- package/assets/{id-B8ywMzga.js → id-DT3gYsIn.js} +2 -2
- package/assets/{image-CwqhHOgq.js → image-2xI41_yv.js} +2 -2
- package/assets/index-4qKnY3-Z.js +1 -0
- package/assets/index-BGXseWrC.js +7 -0
- package/assets/index-BHPQscxU.js +51 -0
- package/assets/index-Bk20Akf-.js +1 -0
- package/assets/index-BopA34hw.js +1 -0
- package/assets/index-BrKy0seX.js +5 -0
- package/assets/index-BwH4aTS1.js +811 -0
- package/assets/index-CXihcgXx.js +1 -0
- package/assets/index-D8K5W9P2.js +1 -0
- package/assets/index-DI7YJmGL.js +1 -0
- package/assets/index-DSHMyLVX.js +1 -0
- package/assets/{index-BfZPjAvn.js → index-DZDTS3ye.js} +3 -3
- package/assets/index-DiIGGt9K.js +2 -0
- package/assets/index-DrVu52Xh.js +1 -0
- package/assets/index-SuZZOLV8.js +44 -0
- package/assets/index-WOcjF2jM.js +1 -0
- package/assets/index-YmvX5-ha.js +2 -0
- package/assets/index-nibyPLVP.js +1 -0
- package/assets/index.es-jzCaEkpf.js +39 -0
- package/assets/index.umd--3ii-zIl.js +1 -0
- package/assets/{info-COI3OebQ.js → info-DjLA3veR.js} +2 -2
- package/assets/{info-circle-D_RgtoG_.js → info-circle-3PDrwt0H.js} +2 -2
- package/assets/{lightbulb-D29oA1kW.js → lightbulb-DhWVBMDA.js} +2 -2
- package/assets/{mail-CJ9rvNEO.js → mail-BsPt7fsq.js} +1 -1
- package/assets/{mobile-BSTR0oWP.js → mobile-CgXcD3VR.js} +2 -2
- package/assets/{more-BcYAHybc.js → more-DIJuTEs0.js} +2 -2
- package/assets/{network-placeholder-Cnunuezr.js → network-placeholder-66B326HU.js} +2 -2
- package/assets/{nftPlaceholder-rT8UJE4K.js → nftPlaceholder-BLN_a1sQ.js} +2 -2
- package/assets/node-COcrmc-E.js +4 -0
- package/assets/off-D2UQbFAS.js +8 -0
- package/assets/{play-store-DvfWnN4y.js → play-store-SCtH_5I1.js} +2 -2
- package/assets/{plus-gHBDgGjM.js → plus-DHy0b-9d.js} +2 -2
- package/assets/{qr-code-DDHcNUue.js → qr-code-PfdfX8iw.js} +1 -1
- package/assets/{recycle-horizontal-BRiwD6Mt.js → recycle-horizontal-BuVlk9dd.js} +1 -1
- package/assets/{refresh-B9gXvGXV.js → refresh-LidcEqi6.js} +2 -2
- package/assets/{reown-logo-WhOyJ0P-.js → reown-logo-CAccVEkV.js} +2 -2
- package/assets/search-oQ7C4gac.js +8 -0
- package/assets/secp256k1-SQKxdWJA.js +1 -0
- package/assets/secp256k1-r2Z-F5jQ.js +1 -0
- package/assets/{send-Bwl7uhNH.js → send-Czq-woFq.js} +2 -2
- package/assets/{swapHorizontal-DZpWZtIz.js → swapHorizontal-BLAZ4GpX.js} +2 -2
- package/assets/{swapHorizontalBold-BsXTfOUB.js → swapHorizontalBold-CeMDPZ2B.js} +2 -2
- package/assets/{swapHorizontalMedium-C_6kbXTl.js → swapHorizontalMedium-CVCZLiVS.js} +2 -2
- package/assets/{swapHorizontalRoundedBold-C0Zn63rG.js → swapHorizontalRoundedBold-D00KZQV-.js} +2 -2
- package/assets/{swapVertical-3Bh1HEox.js → swapVertical-CtlfdZa9.js} +2 -2
- package/assets/swiper-react-ZPE95VoW.js +1 -0
- package/assets/{telegram-DNIzTF3I.js → telegram-DiYfT0lk.js} +2 -2
- package/assets/{three-dots-COxARji7.js → three-dots-BpX8IpHh.js} +2 -2
- package/assets/{twitch-CZ-7Kiwd.js → twitch-CSH-Nxxc.js} +2 -2
- package/assets/{twitterIcon-Dcm6rS6L.js → twitterIcon-DiNCGGjL.js} +2 -2
- package/assets/{verify-CDFvKR62.js → verify-B4Hhnjw3.js} +2 -2
- package/assets/{verify-filled-xoYiPqK4.js → verify-filled-BO8MFee3.js} +2 -2
- package/assets/{w3m-modal-DelFzwRg.js → w3m-modal-Ch3BGvga.js} +1 -1
- package/assets/{wallet-BFpTXEJT.js → wallet-CNUrWE3L.js} +2 -2
- package/assets/{wallet-placeholder-AXXSMd3R.js → wallet-placeholder-CtQg5prg.js} +2 -2
- package/assets/{walletconnect-Cz3JVcWt.js → walletconnect-DxVGyv5n.js} +4 -4
- package/assets/{warning-circle-8Kak1pmh.js → warning-circle-BNcoUtgr.js} +1 -1
- package/assets/{x-C-F8mfxV.js → x-C0p-xVca.js} +2 -2
- package/index.html +2 -5
- package/package.json +3 -3
- package/assets/FooterLanding-iYuz415B.js +0 -1
- package/assets/all-wallets-Qb9stbRm.js +0 -6
- package/assets/arrow-bottom-rhor6qOA.js +0 -8
- package/assets/arrow-left-Bq3H-u24.js +0 -8
- package/assets/arrow-right-CkiCqXKz.js +0 -8
- package/assets/arrow-top-BbayD3ny.js +0 -8
- package/assets/auto-track-CpyrW7jj.js +0 -1
- package/assets/chevron-bottom-C2GrTkGW.js +0 -8
- package/assets/chevron-left-TOHygVkY.js +0 -8
- package/assets/chevron-right-kK9l_fNM.js +0 -8
- package/assets/chevron-top-GkMD6fM_.js +0 -8
- package/assets/close-D_Rm3jAw.js +0 -8
- package/assets/core-kZLq_ADy.js +0 -907
- package/assets/cursor-BkgcU3pB.js +0 -3
- package/assets/filters-DJ44i8Mo.js +0 -8
- package/assets/index-BA7pz-wf.js +0 -1
- package/assets/index-BFntqBXC.js +0 -1
- package/assets/index-B_dMHlXr.js +0 -1
- package/assets/index-BgXJ6Z6L.js +0 -1
- package/assets/index-CJxXHUcP.js +0 -1
- package/assets/index-CXz9iuA3.js +0 -1
- package/assets/index-Cg_5qxO-.js +0 -2
- package/assets/index-CntXRSz5.js +0 -2
- package/assets/index-DIS5DQM_.js +0 -1
- package/assets/index-Dbv53o1b.js +0 -1
- package/assets/index-DoaqdCF9.js +0 -601
- package/assets/index-Dsk1niAz.js +0 -7
- package/assets/index-HuL12PNJ.js +0 -5
- package/assets/index-mgaHX57j.js +0 -1
- package/assets/index-vWYtvmN_.js +0 -1
- package/assets/index.es-D0tGeUGR.js +0 -38
- package/assets/index.umd-CIiTi8qb.js +0 -1
- package/assets/off-B_Wn42xj.js +0 -8
- package/assets/search-DpE00x6Q.js +0 -8
- package/assets/swiper-react-BALcxKpm.js +0 -1
- package/assets/vendor-mui-40jyI-Tp.js +0 -197
- package/assets/vendor-react-DJXYd7Dm.js +0 -40
- package/assets/vendor-web3-Dw3dBix7.js +0 -74
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{aq as Ma,p as de,f as G,i as br,au as jh,B as re,av as Qr,aw as Uh,j as Hh}from"./index-BwH4aTS1.js";import{i as _t}from"./inherits_browser-BlmhoU4v.js";import{p as Wh,a as Vh}from"./hooks.module-Dz_XB4AG.js";const qh=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:Ma,default:Ma},Symbol.toStringTag,{value:"Module"}));var Eo={exports:{}},Os,Ca;function zh(){if(Ca)return Os;Ca=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;Os=function(d,y){y=y||{};var m=typeof d;if(m==="string"&&d.length>0)return a(d);if(m==="number"&&isFinite(d))return y.long?h(d):c(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function a(d){if(d=String(d),!(d.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(y){var m=parseFloat(y[1]),C=(y[2]||"ms").toLowerCase();switch(C){case"years":case"year":case"yrs":case"yr":case"y":return m*s;case"weeks":case"week":case"w":return m*i;case"days":case"day":case"d":return m*n;case"hours":case"hour":case"hrs":case"hr":case"h":return m*r;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function c(d){var y=Math.abs(d);return y>=n?Math.round(d/n)+"d":y>=r?Math.round(d/r)+"h":y>=t?Math.round(d/t)+"m":y>=e?Math.round(d/e)+"s":d+"ms"}function h(d){var y=Math.abs(d);return y>=n?f(d,y,n,"day"):y>=r?f(d,y,r,"hour"):y>=t?f(d,y,t,"minute"):y>=e?f(d,y,e,"second"):d+" ms"}function f(d,y,m,C){var P=y>=m*1.5;return Math.round(d/m)+" "+C+(P?"s":"")}return Os}function Gh(e){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=i,r.enabled=a,r.humanize=zh(),r.destroy=f,Object.keys(e).forEach(d=>{r[d]=e[d]}),r.names=[],r.skips=[],r.formatters={};function t(d){let y=0;for(let m=0;m<d.length;m++)y=(y<<5)-y+d.charCodeAt(m),y|=0;return r.colors[Math.abs(y)%r.colors.length]}r.selectColor=t;function r(d){let y,m=null,C,P;function N(...L){if(!N.enabled)return;const M=N,I=Number(new Date),T=I-(y||I);M.diff=T,M.prev=y,M.curr=I,y=I,L[0]=r.coerce(L[0]),typeof L[0]!="string"&&L.unshift("%O");let $=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(F,J)=>{if(F==="%%")return"%";$++;const z=r.formatters[J];if(typeof z=="function"){const V=L[$];F=z.call(M,V),L.splice($,1),$--}return F}),r.formatArgs.call(M,L),(M.log||r.log).apply(M,L)}return N.namespace=d,N.useColors=r.useColors(),N.color=r.selectColor(d),N.extend=n,N.destroy=r.destroy,Object.defineProperty(N,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(C!==r.namespaces&&(C=r.namespaces,P=r.enabled(d)),P),set:L=>{m=L}}),typeof r.init=="function"&&r.init(N),N}function n(d,y){const m=r(this.namespace+(typeof y>"u"?":":y)+d);return m.log=this.log,m}function i(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let y;const m=(typeof d=="string"?d:"").split(/[\s,]+/),C=m.length;for(y=0;y<C;y++)m[y]&&(d=m[y].replace(/\*/g,".*?"),d[0]==="-"?r.skips.push(new RegExp("^"+d.slice(1)+"$")):r.names.push(new RegExp("^"+d+"$")))}function s(){const d=[...r.names.map(c),...r.skips.map(c).map(y=>"-"+y)].join(",");return r.enable(""),d}function a(d){if(d[d.length-1]==="*")return!0;let y,m;for(y=0,m=r.skips.length;y<m;y++)if(r.skips[y].test(d))return!1;for(y=0,m=r.names.length;y<m;y++)if(r.names[y].test(d))return!0;return!1}function c(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function h(d){return d instanceof Error?d.stack||d.message:d}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Jh=Gh;(function(e,t){var r={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/landing-site/0.0.1-23619144615.commit-9dd6c8c"};t.formatArgs=i,t.save=s,t.load=a,t.useColors=n,t.storage=c(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;f.splice(1,0,d,"color: inherit");let y=0,m=0;f[0].replace(/%[a-zA-Z%]/g,C=>{C!=="%%"&&(y++,C==="%c"&&(m=y))}),f.splice(m,0,d)}t.log=console.debug||console.log||(()=>{});function s(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function a(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof de<"u"&&"env"in de&&(f=r.DEBUG),f}function c(){try{return localStorage}catch{}}e.exports=Jh(t);const{formatters:h}=e.exports;h.j=function(f){try{return JSON.stringify(f)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(Eo,Eo.exports);var Zh=Eo.exports,Kh=_n;_n.default=_n;_n.stable=Rl;_n.stableStringify=Rl;var Ci="[...]",El="[Circular]",yr=[],fr=[];function Sl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function _n(e,t,r,n){typeof n>"u"&&(n=Sl()),So(e,"",0,[],void 0,0,n);var i;try{fr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Ml(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yr.length!==0;){var s=yr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function zr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),yr.push([n,r,t,i])):fr.push([t,r,e]):(n[r]=e,yr.push([n,r,t]))}function So(e,t,r,n,i,s,a){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){zr(El,e,t,i);return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){zr(Ci,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){zr(Ci,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)So(e[c],c,c,n,e,s,a);else{var h=Object.keys(e);for(c=0;c<h.length;c++){var f=h[c];So(e[f],f,c,n,e,s,a)}}n.pop()}}function Qh(e,t){return e<t?-1:e>t?1:0}function Rl(e,t,r,n){typeof n>"u"&&(n=Sl());var i=Ro(e,"",0,[],void 0,0,n)||e,s;try{fr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Ml(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yr.length!==0;){var a=yr.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function Ro(e,t,r,n,i,s,a){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){zr(El,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&s>a.depthLimit){zr(Ci,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){zr(Ci,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)Ro(e[c],c,c,n,e,s,a);else{var h={},f=Object.keys(e).sort(Qh);for(c=0;c<f.length;c++){var d=f[c];Ro(e[d],d,c,n,e,s,a),h[d]=e[d]}if(typeof i<"u")yr.push([i,t,e]),i[t]=h;else return h}n.pop()}}function Ml(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(fr.length>0)for(var n=0;n<fr.length;n++){var i=fr[n];if(i[1]===t&&i[0]===r){r=i[2],fr.splice(n,1);break}}return e.call(this,t,r)}}var bi=Object.defineProperty||!1;if(bi)try{bi({},"a",{value:1})}catch{bi=!1}var Pi=bi,Cl=SyntaxError,Cn=TypeError,Yh=Object.getOwnPropertyDescriptor,wi=Yh;if(wi)try{wi([],"length")}catch{wi=null}var kn=wi,ka=Pi,Xh=Cl,Or=Cn,Aa=kn,ed=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Or("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Or("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Or("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Or("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Or("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Or("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!Aa&&Aa(t,r);if(ka)ka(t,r,{configurable:a===null&&h?h.configurable:!a,enumerable:i===null&&h?h.enumerable:!i,value:n,writable:s===null&&h?h.writable:!s});else if(c||!i&&!s&&!a)t[r]=n;else throw new Xh("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Mo=Pi,kl=function(){return!!Mo};kl.hasArrayLengthDefineBug=function(){if(!Mo)return null;try{return Mo([],"length",{value:1}).length!==1}catch{return!0}};var td=kl,Al={exports:{}},Il=Object,rd=Error,nd=EvalError,id=RangeError,sd=ReferenceError,od=URIError,ad=Math.abs,cd=Math.floor,ld=Math.max,ud=Math.min,hd=Math.pow,dd=Math.round,fd=Number.isNaN||function(t){return t!==t},pd=fd,gd=function(t){return pd(t)||t===0?t:t<0?-1:1},xl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0},Ia=typeof Symbol<"u"&&Symbol,md=xl,yd=function(){return typeof Ia!="function"||typeof Symbol!="function"||typeof Ia("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:md()},Tl=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,vd=Il,Nl=vd.getPrototypeOf||null,$s,xa;function bd(){if(xa)return $s;xa=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(h,f){for(var d=[],y=0;y<h.length;y+=1)d[y]=h[y];for(var m=0;m<f.length;m+=1)d[m+h.length]=f[m];return d},s=function(h,f){for(var d=[],y=f,m=0;y<h.length;y+=1,m+=1)d[m]=h[y];return d},a=function(c,h){for(var f="",d=0;d<c.length;d+=1)f+=c[d],d+1<c.length&&(f+=h);return f};return $s=function(h){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var d=s(arguments,1),y,m=function(){if(this instanceof y){var M=f.apply(this,i(d,arguments));return Object(M)===M?M:this}return f.apply(h,i(d,arguments))},C=r(0,f.length-d.length),P=[],N=0;N<C;N++)P[N]="$"+N;if(y=Function("binder","return function ("+a(P,",")+"){ return binder.apply(this,arguments); }")(m),f.prototype){var L=function(){};L.prototype=f.prototype,y.prototype=new L,L.prototype=null}return y},$s}var Bs,Ta;function An(){if(Ta)return Bs;Ta=1;var e=bd();return Bs=Function.prototype.bind||e,Bs}var Fs,Na;function $o(){return Na||(Na=1,Fs=Function.prototype.call),Fs}var Ds,Pa;function Bo(){return Pa||(Pa=1,Ds=Function.prototype.apply),Ds}var wd=typeof Reflect<"u"&&Reflect&&Reflect.apply,_d=An(),Ed=Bo(),Sd=$o(),Rd=wd,Pl=Rd||_d.call(Sd,Ed),Md=An(),Cd=Cn,kd=$o(),Ad=Pl,Fo=function(t){if(t.length<1||typeof t[0]!="function")throw new Cd("a function is required");return Ad(Md,kd,t)},Id=Fo,La=kn,Ll;try{Ll=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var js=!!Ll&&La&&La(Object.prototype,"__proto__"),Ol=Object,Oa=Ol.getPrototypeOf,xd=js&&typeof js.get=="function"?Id([js.get]):typeof Oa=="function"?function(t){return Oa(t==null?t:Ol(t))}:!1,$a=Tl,Ba=Nl,Fa=xd,$l=$a?function(t){return $a(t)}:Ba?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ba(t)}:Fa?function(t){return Fa(t)}:null,Td=Function.prototype.call,Nd=Object.prototype.hasOwnProperty,Pd=An(),Ld=Pd.call(Td,Nd),se,Od=Il,$d=rd,Bd=nd,Fd=id,Dd=sd,Yr=Cl,Gr=Cn,jd=od,Ud=ad,Hd=cd,Wd=ld,Vd=ud,qd=hd,zd=dd,Gd=gd,Bl=Function,Us=function(e){try{return Bl('"use strict"; return ('+e+").constructor;")()}catch{}},En=kn,Jd=Pi,Hs=function(){throw new Gr},Zd=En?function(){try{return arguments.callee,Hs}catch{try{return En(arguments,"callee").get}catch{return Hs}}}():Hs,$r=yd(),Ke=$l,Kd=Nl,Qd=Tl,Fl=Bo(),In=$o(),Hr={},Yd=typeof Uint8Array>"u"||!Ke?se:Ke(Uint8Array),gr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?se:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?se:ArrayBuffer,"%ArrayIteratorPrototype%":$r&&Ke?Ke([][Symbol.iterator]()):se,"%AsyncFromSyncIteratorPrototype%":se,"%AsyncFunction%":Hr,"%AsyncGenerator%":Hr,"%AsyncGeneratorFunction%":Hr,"%AsyncIteratorPrototype%":Hr,"%Atomics%":typeof Atomics>"u"?se:Atomics,"%BigInt%":typeof BigInt>"u"?se:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?se:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?se:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?se:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$d,"%eval%":eval,"%EvalError%":Bd,"%Float16Array%":typeof Float16Array>"u"?se:Float16Array,"%Float32Array%":typeof Float32Array>"u"?se:Float32Array,"%Float64Array%":typeof Float64Array>"u"?se:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?se:FinalizationRegistry,"%Function%":Bl,"%GeneratorFunction%":Hr,"%Int8Array%":typeof Int8Array>"u"?se:Int8Array,"%Int16Array%":typeof Int16Array>"u"?se:Int16Array,"%Int32Array%":typeof Int32Array>"u"?se:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$r&&Ke?Ke(Ke([][Symbol.iterator]())):se,"%JSON%":typeof JSON=="object"?JSON:se,"%Map%":typeof Map>"u"?se:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$r||!Ke?se:Ke(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Od,"%Object.getOwnPropertyDescriptor%":En,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?se:Promise,"%Proxy%":typeof Proxy>"u"?se:Proxy,"%RangeError%":Fd,"%ReferenceError%":Dd,"%Reflect%":typeof Reflect>"u"?se:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?se:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$r||!Ke?se:Ke(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?se:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$r&&Ke?Ke(""[Symbol.iterator]()):se,"%Symbol%":$r?Symbol:se,"%SyntaxError%":Yr,"%ThrowTypeError%":Zd,"%TypedArray%":Yd,"%TypeError%":Gr,"%Uint8Array%":typeof Uint8Array>"u"?se:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?se:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?se:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?se:Uint32Array,"%URIError%":jd,"%WeakMap%":typeof WeakMap>"u"?se:WeakMap,"%WeakRef%":typeof WeakRef>"u"?se:WeakRef,"%WeakSet%":typeof WeakSet>"u"?se:WeakSet,"%Function.prototype.call%":In,"%Function.prototype.apply%":Fl,"%Object.defineProperty%":Jd,"%Object.getPrototypeOf%":Kd,"%Math.abs%":Ud,"%Math.floor%":Hd,"%Math.max%":Wd,"%Math.min%":Vd,"%Math.pow%":qd,"%Math.round%":zd,"%Math.sign%":Gd,"%Reflect.getPrototypeOf%":Qd};if(Ke)try{null.error}catch(e){var Xd=Ke(Ke(e));gr["%Error.prototype%"]=Xd}var ef=function e(t){var r;if(t==="%AsyncFunction%")r=Us("async function () {}");else if(t==="%GeneratorFunction%")r=Us("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Us("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Ke&&(r=Ke(i.prototype))}return gr[t]=r,r},Da={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xn=An(),ki=Ld,tf=xn.call(In,Array.prototype.concat),rf=xn.call(Fl,Array.prototype.splice),ja=xn.call(In,String.prototype.replace),Ai=xn.call(In,String.prototype.slice),nf=xn.call(In,RegExp.prototype.exec),sf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,of=/\\(\\)?/g,af=function(t){var r=Ai(t,0,1),n=Ai(t,-1);if(r==="%"&&n!=="%")throw new Yr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Yr("invalid intrinsic syntax, expected opening `%`");var i=[];return ja(t,sf,function(s,a,c,h){i[i.length]=c?ja(h,of,"$1"):a||s}),i},cf=function(t,r){var n=t,i;if(ki(Da,n)&&(i=Da[n],n="%"+i[0]+"%"),ki(gr,n)){var s=gr[n];if(s===Hr&&(s=ef(n)),typeof s>"u"&&!r)throw new Gr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Yr("intrinsic "+t+" does not exist!")},Dl=function(t,r){if(typeof t!="string"||t.length===0)throw new Gr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Gr('"allowMissing" argument must be a boolean');if(nf(/^%?[^%]*%?$/,t)===null)throw new Yr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=af(t),i=n.length>0?n[0]:"",s=cf("%"+i+"%",r),a=s.name,c=s.value,h=!1,f=s.alias;f&&(i=f[0],rf(n,tf([0,1],f)));for(var d=1,y=!0;d<n.length;d+=1){var m=n[d],C=Ai(m,0,1),P=Ai(m,-1);if((C==='"'||C==="'"||C==="`"||P==='"'||P==="'"||P==="`")&&C!==P)throw new Yr("property names with quotes must have matching quotes");if((m==="constructor"||!y)&&(h=!0),i+="."+m,a="%"+i+"%",ki(gr,a))c=gr[a];else if(c!=null){if(!(m in c)){if(!r)throw new Gr("base intrinsic for "+t+" exists, but the property is not available.");return}if(En&&d+1>=n.length){var N=En(c,m);y=!!N,y&&"get"in N&&!("originalValue"in N.get)?c=N.get:c=c[m]}else y=ki(c,m),c=c[m];y&&!h&&(gr[a]=c)}}return c},lf=Dl,Ua=ed,uf=td(),Ha=kn,Wa=Cn,hf=lf("%Math.floor%"),df=function(t,r){if(typeof t!="function")throw new Wa("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||hf(r)!==r)throw new Wa("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&Ha){var a=Ha(t,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(s=!1)}return(i||s||!n)&&(uf?Ua(t,"length",r,!0,!0):Ua(t,"length",r)),t},ff=An(),pf=Bo(),gf=Pl,mf=function(){return gf(ff,pf,arguments)};(function(e){var t=df,r=Pi,n=Fo,i=mf;e.exports=function(a){var c=n(arguments),h=a.length-(arguments.length-1);return t(c,1+(h>0?h:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i})(Al);var yf=Al.exports,jl=Dl,Ul=Fo,vf=Ul([jl("%String.prototype.indexOf%")]),Hl=function(t,r){var n=jl(t,!!r);return typeof n=="function"&&vf(t,".prototype.")>-1?Ul([n]):n},bf=xl,wf=function(){return bf()&&!!Symbol.toStringTag},_f={}.toString,Ef=Array.isArray||function(e){return _f.call(e)=="[object Array]"},Wl=Function.prototype.toString,Vr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Co,_i;if(typeof Vr=="function"&&typeof Object.defineProperty=="function")try{Co=Object.defineProperty({},"length",{get:function(){throw _i}}),_i={},Vr(function(){throw 42},null,Co)}catch(e){e!==_i&&(Vr=null)}else Vr=null;var Sf=/^\s*class\b/,ko=function(t){try{var r=Wl.call(t);return Sf.test(r)}catch{return!1}},Ws=function(t){try{return ko(t)?!1:(Wl.call(t),!0)}catch{return!1}},Ei=Object.prototype.toString,Rf="[object Object]",Mf="[object Function]",Cf="[object GeneratorFunction]",kf="[object HTMLAllCollection]",Af="[object HTML document.all class]",If="[object HTMLCollection]",xf=typeof Symbol=="function"&&!!Symbol.toStringTag,Tf=!(0 in[,]),Ao=function(){return!1};if(typeof document=="object"){var Nf=document.all;Ei.call(Nf)===Ei.call(document.all)&&(Ao=function(t){if((Tf||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=Ei.call(t);return(r===kf||r===Af||r===If||r===Rf)&&t("")==null}catch{}return!1})}var Pf=Vr?function(t){if(Ao(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Vr(t,null,Co)}catch(r){if(r!==_i)return!1}return!ko(t)&&Ws(t)}:function(t){if(Ao(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(xf)return Ws(t);if(ko(t))return!1;var r=Ei.call(t);return r!==Mf&&r!==Cf&&!/^\[object HTML/.test(r)?!1:Ws(t)},Lf=Pf,Of=Object.prototype.toString,Vl=Object.prototype.hasOwnProperty,$f=function(t,r,n){for(var i=0,s=t.length;i<s;i++)Vl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))},Bf=function(t,r,n){for(var i=0,s=t.length;i<s;i++)n==null?r(t.charAt(i),i,t):r.call(n,t.charAt(i),i,t)},Ff=function(t,r,n){for(var i in t)Vl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))};function Df(e){return Of.call(e)==="[object Array]"}var jf=function(t,r,n){if(!Lf(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Df(t)?$f(t,r,i):typeof t=="string"?Bf(t,r,i):Ff(t,r,i)},Uf=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Vs=Uf,Hf=typeof globalThis>"u"?G:globalThis,Wf=function(){for(var t=[],r=0;r<Vs.length;r++)typeof Hf[Vs[r]]=="function"&&(t[t.length]=Vs[r]);return t},Ii=jf,Vf=Wf,Va=yf,Do=Hl,Si=kn,ni=$l,qf=Do("Object.prototype.toString"),ql=wf(),qa=typeof globalThis>"u"?G:globalThis,Io=Vf(),jo=Do("String.prototype.slice"),zf=Do("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},xi={__proto__:null};ql&&Si&&ni?Ii(Io,function(e){var t=new qa[e];if(Symbol.toStringTag in t&&ni){var r=ni(t),n=Si(r,Symbol.toStringTag);if(!n&&r){var i=ni(r);n=Si(i,Symbol.toStringTag)}xi["$"+e]=Va(n.get)}}):Ii(Io,function(e){var t=new qa[e],r=t.slice||t.set;r&&(xi["$"+e]=Va(r))});var Gf=function(t){var r=!1;return Ii(xi,function(n,i){if(!r)try{"$"+n(t)===i&&(r=jo(i,1))}catch{}}),r},Jf=function(t){var r=!1;return Ii(xi,function(n,i){if(!r)try{n(t),r=jo(i,1)}catch{}}),r},Zf=function(t){if(!t||typeof t!="object")return!1;if(!ql){var r=jo(qf(t),8,-1);return zf(Io,r)>-1?r:r!=="Object"?!1:Jf(t)}return Si?Gf(t):null},zl={},Sn={},Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.walletLogo=void 0;const Kf=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Li.walletLogo=Kf;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.LINK_API_URL=void 0;Oi.LINK_API_URL="https://www.walletlink.org";var q={},Uo={exports:{}};const Tn=br(jh);Uo.exports;(function(e){(function(t,r){function n(R,o){if(!R)throw new Error(o||"Assertion failed")}function i(R,o){R.super_=o;var u=function(){};u.prototype=o.prototype,R.prototype=new u,R.prototype.constructor=R}function s(R,o,u){if(s.isBN(R))return R;this.negative=0,this.words=null,this.length=0,this.red=null,R!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(R||0,o||10,u||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=Tn.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,u){return o.cmp(u)>0?o:u},s.min=function(o,u){return o.cmp(u)<0?o:u},s.prototype._init=function(o,u,p){if(typeof o=="number")return this._initNumber(o,u,p);if(typeof o=="object")return this._initArray(o,u,p);u==="hex"&&(u=16),n(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var g=0;o[0]==="-"&&(g++,this.negative=1),g<o.length&&(u===16?this._parseHex(o,g,p):(this._parseBase(o,u,g),p==="le"&&this._initArray(this.toArray(),u,p)))},s.prototype._initNumber=function(o,u,p){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},s.prototype._initArray=function(o,u,p){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var b,S,A=0;if(p==="be")for(g=o.length-1,b=0;g>=0;g-=3)S=o[g]|o[g-1]<<8|o[g-2]<<16,this.words[b]|=S<<A&67108863,this.words[b+1]=S>>>26-A&67108863,A+=24,A>=26&&(A-=26,b++);else if(p==="le")for(g=0,b=0;g<o.length;g+=3)S=o[g]|o[g+1]<<8|o[g+2]<<16,this.words[b]|=S<<A&67108863,this.words[b+1]=S>>>26-A&67108863,A+=24,A>=26&&(A-=26,b++);return this._strip()};function c(R,o){var u=R.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;n(!1,"Invalid character in "+R)}function h(R,o,u){var p=c(R,u);return u-1>=o&&(p|=c(R,u-1)<<4),p}s.prototype._parseHex=function(o,u,p){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var b=0,S=0,A;if(p==="be")for(g=o.length-1;g>=u;g-=2)A=h(o,u,g)<<b,this.words[S]|=A&67108863,b>=18?(b-=18,S+=1,this.words[S]|=A>>>26):b+=8;else{var v=o.length-u;for(g=v%2===0?u+1:u;g<o.length;g+=2)A=h(o,u,g)<<b,this.words[S]|=A&67108863,b>=18?(b-=18,S+=1,this.words[S]|=A>>>26):b+=8}this._strip()};function f(R,o,u,p){for(var g=0,b=0,S=Math.min(R.length,u),A=o;A<S;A++){var v=R.charCodeAt(A)-48;g*=p,v>=49?b=v-49+10:v>=17?b=v-17+10:b=v,n(v>=0&&b<p,"Invalid character"),g+=b}return g}s.prototype._parseBase=function(o,u,p){this.words=[0],this.length=1;for(var g=0,b=1;b<=67108863;b*=u)g++;g--,b=b/u|0;for(var S=o.length-p,A=S%g,v=Math.min(S,S-A)+p,l=0,w=p;w<v;w+=g)l=f(o,w,w+g,u),this.imuln(b),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(A!==0){var W=1;for(l=f(o,w,o.length,u),w=0;w<A;w++)W*=u;this.imuln(W),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},s.prototype.copy=function(o){o.words=new Array(this.length);for(var u=0;u<this.length;u++)o.words[u]=this.words[u];o.length=this.length,o.negative=this.negative,o.red=this.red};function d(R,o){R.words=o.words,R.length=o.length,R.negative=o.negative,R.red=o.red}if(s.prototype._move=function(o){d(o,this)},s.prototype.clone=function(){var o=new s(null);return this.copy(o),o},s.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=y}catch{s.prototype.inspect=y}else s.prototype.inspect=y;function y(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","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"],C=[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],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(o,u){o=o||10,u=u|0||1;var p;if(o===16||o==="hex"){p="";for(var g=0,b=0,S=0;S<this.length;S++){var A=this.words[S],v=((A<<g|b)&16777215).toString(16);b=A>>>24-g&16777215,g+=2,g>=26&&(g-=26,S--),b!==0||S!==this.length-1?p=m[6-v.length]+v+p:p=v+p}for(b!==0&&(p=b.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(o===(o|0)&&o>=2&&o<=36){var l=C[o],w=P[o];p="";var W=this.clone();for(W.negative=0;!W.isZero();){var U=W.modrn(w).toString(o);W=W.idivn(w),W.isZero()?p=U+p:p=m[l-U.length]+U+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,u){return this.toArrayLike(a,o,u)}),s.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var N=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};s.prototype.toArrayLike=function(o,u,p){this._strip();var g=this.byteLength(),b=p||Math.max(1,g);n(g<=b,"byte array longer than desired length"),n(b>0,"Requested array length <= 0");var S=N(o,b),A=u==="le"?"LE":"BE";return this["_toArrayLike"+A](S,g),S},s.prototype._toArrayLikeLE=function(o,u){for(var p=0,g=0,b=0,S=0;b<this.length;b++){var A=this.words[b]<<S|g;o[p++]=A&255,p<o.length&&(o[p++]=A>>8&255),p<o.length&&(o[p++]=A>>16&255),S===6?(p<o.length&&(o[p++]=A>>24&255),g=0,S=0):(g=A>>>24,S+=2)}if(p<o.length)for(o[p++]=g;p<o.length;)o[p++]=0},s.prototype._toArrayLikeBE=function(o,u){for(var p=o.length-1,g=0,b=0,S=0;b<this.length;b++){var A=this.words[b]<<S|g;o[p--]=A&255,p>=0&&(o[p--]=A>>8&255),p>=0&&(o[p--]=A>>16&255),S===6?(p>=0&&(o[p--]=A>>24&255),g=0,S=0):(g=A>>>24,S+=2)}if(p>=0)for(o[p--]=g;p>=0;)o[p--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var u=o,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},s.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,p=0;return u&8191||(p+=13,u>>>=13),u&127||(p+=7,u>>>=7),u&15||(p+=4,u>>>=4),u&3||(p+=2,u>>>=2),u&1||p++,p},s.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function L(R){for(var o=new Array(R.bitLength()),u=0;u<o.length;u++){var p=u/26|0,g=u%26;o[u]=R.words[p]>>>g&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(o+=p,p!==26)break}return o},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},s.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var u=0;u<o.length;u++)this.words[u]=this.words[u]|o.words[u];return this._strip()},s.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},s.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&o.words[p];return this.length=u.length,this._strip()},s.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},s.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var u,p;this.length>o.length?(u=this,p=o):(u=o,p=this);for(var g=0;g<p.length;g++)this.words[g]=u.words[g]^p.words[g];if(this!==u)for(;g<u.length;g++)this.words[g]=u.words[g];return this.length=u.length,this._strip()},s.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},s.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,p=o%26;this._expand(u),p>0&&u--;for(var g=0;g<u;g++)this.words[g]=~this.words[g]&67108863;return p>0&&(this.words[g]=~this.words[g]&67108863>>26-p),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,u){n(typeof o=="number"&&o>=0);var p=o/26|0,g=o%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<g:this.words[p]=this.words[p]&~(1<<g),this._strip()},s.prototype.iadd=function(o){var u;if(this.negative!==0&&o.negative===0)return this.negative=0,u=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,u=this.isub(o),o.negative=1,u._normSign();var p,g;this.length>o.length?(p=this,g=o):(p=o,g=this);for(var b=0,S=0;S<g.length;S++)u=(p.words[S]|0)+(g.words[S]|0)+b,this.words[S]=u&67108863,b=u>>>26;for(;b!==0&&S<p.length;S++)u=(p.words[S]|0)+b,this.words[S]=u&67108863,b=u>>>26;if(this.length=p.length,b!==0)this.words[this.length]=b,this.length++;else if(p!==this)for(;S<p.length;S++)this.words[S]=p.words[S];return this},s.prototype.add=function(o){var u;return o.negative!==0&&this.negative===0?(o.negative=0,u=this.sub(o),o.negative^=1,u):o.negative===0&&this.negative!==0?(this.negative=0,u=o.sub(this),this.negative=1,u):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var p=this.cmp(o);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,b;p>0?(g=this,b=o):(g=o,b=this);for(var S=0,A=0;A<b.length;A++)u=(g.words[A]|0)-(b.words[A]|0)+S,S=u>>26,this.words[A]=u&67108863;for(;S!==0&&A<g.length;A++)u=(g.words[A]|0)+S,S=u>>26,this.words[A]=u&67108863;if(S===0&&A<g.length&&g!==this)for(;A<g.length;A++)this.words[A]=g.words[A];return this.length=Math.max(this.length,A),g!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(o){return this.clone().isub(o)};function M(R,o,u){u.negative=o.negative^R.negative;var p=R.length+o.length|0;u.length=p,p=p-1|0;var g=R.words[0]|0,b=o.words[0]|0,S=g*b,A=S&67108863,v=S/67108864|0;u.words[0]=A;for(var l=1;l<p;l++){for(var w=v>>>26,W=v&67108863,U=Math.min(l,o.length-1),k=Math.max(0,l-R.length+1);k<=U;k++){var x=l-k|0;g=R.words[x]|0,b=o.words[k]|0,S=g*b+W,w+=S/67108864|0,W=S&67108863}u.words[l]=W|0,v=w|0}return v!==0?u.words[l]=v|0:u.length--,u._strip()}var I=function(o,u,p){var g=o.words,b=u.words,S=p.words,A=0,v,l,w,W=g[0]|0,U=W&8191,k=W>>>13,x=g[1]|0,B=x&8191,H=x>>>13,ee=g[2]|0,_=ee&8191,E=ee>>>13,D=g[3]|0,j=D&8191,K=D>>>13,X=g[4]|0,Z=X&8191,ue=X>>>13,Rt=g[5]|0,me=Rt&8191,ye=Rt>>>13,jt=g[6]|0,pe=jt&8191,ge=jt>>>13,Lt=g[7]|0,fe=Lt&8191,he=Lt>>>13,at=g[8]|0,ve=at&8191,be=at>>>13,Rr=g[9]|0,we=Rr&8191,_e=Rr>>>13,Mr=b[0]|0,Ee=Mr&8191,Se=Mr>>>13,Cr=b[1]|0,Re=Cr&8191,Me=Cr>>>13,kr=b[2]|0,Ce=kr&8191,ke=kr>>>13,Ar=b[3]|0,Ae=Ar&8191,Ie=Ar>>>13,Ir=b[4]|0,xe=Ir&8191,Te=Ir>>>13,xr=b[5]|0,Ne=xr&8191,Pe=xr>>>13,Tr=b[6]|0,Le=Tr&8191,Oe=Tr>>>13,Nr=b[7]|0,$e=Nr&8191,Be=Nr>>>13,Pr=b[8]|0,Fe=Pr&8191,De=Pr>>>13,Lr=b[9]|0,je=Lr&8191,Ue=Lr>>>13;p.negative=o.negative^u.negative,p.length=19,v=Math.imul(U,Ee),l=Math.imul(U,Se),l=l+Math.imul(k,Ee)|0,w=Math.imul(k,Se);var Gt=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,v=Math.imul(B,Ee),l=Math.imul(B,Se),l=l+Math.imul(H,Ee)|0,w=Math.imul(H,Se),v=v+Math.imul(U,Re)|0,l=l+Math.imul(U,Me)|0,l=l+Math.imul(k,Re)|0,w=w+Math.imul(k,Me)|0;var Jt=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,v=Math.imul(_,Ee),l=Math.imul(_,Se),l=l+Math.imul(E,Ee)|0,w=Math.imul(E,Se),v=v+Math.imul(B,Re)|0,l=l+Math.imul(B,Me)|0,l=l+Math.imul(H,Re)|0,w=w+Math.imul(H,Me)|0,v=v+Math.imul(U,Ce)|0,l=l+Math.imul(U,ke)|0,l=l+Math.imul(k,Ce)|0,w=w+Math.imul(k,ke)|0;var Zt=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,v=Math.imul(j,Ee),l=Math.imul(j,Se),l=l+Math.imul(K,Ee)|0,w=Math.imul(K,Se),v=v+Math.imul(_,Re)|0,l=l+Math.imul(_,Me)|0,l=l+Math.imul(E,Re)|0,w=w+Math.imul(E,Me)|0,v=v+Math.imul(B,Ce)|0,l=l+Math.imul(B,ke)|0,l=l+Math.imul(H,Ce)|0,w=w+Math.imul(H,ke)|0,v=v+Math.imul(U,Ae)|0,l=l+Math.imul(U,Ie)|0,l=l+Math.imul(k,Ae)|0,w=w+Math.imul(k,Ie)|0;var Kt=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,v=Math.imul(Z,Ee),l=Math.imul(Z,Se),l=l+Math.imul(ue,Ee)|0,w=Math.imul(ue,Se),v=v+Math.imul(j,Re)|0,l=l+Math.imul(j,Me)|0,l=l+Math.imul(K,Re)|0,w=w+Math.imul(K,Me)|0,v=v+Math.imul(_,Ce)|0,l=l+Math.imul(_,ke)|0,l=l+Math.imul(E,Ce)|0,w=w+Math.imul(E,ke)|0,v=v+Math.imul(B,Ae)|0,l=l+Math.imul(B,Ie)|0,l=l+Math.imul(H,Ae)|0,w=w+Math.imul(H,Ie)|0,v=v+Math.imul(U,xe)|0,l=l+Math.imul(U,Te)|0,l=l+Math.imul(k,xe)|0,w=w+Math.imul(k,Te)|0;var Qt=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,v=Math.imul(me,Ee),l=Math.imul(me,Se),l=l+Math.imul(ye,Ee)|0,w=Math.imul(ye,Se),v=v+Math.imul(Z,Re)|0,l=l+Math.imul(Z,Me)|0,l=l+Math.imul(ue,Re)|0,w=w+Math.imul(ue,Me)|0,v=v+Math.imul(j,Ce)|0,l=l+Math.imul(j,ke)|0,l=l+Math.imul(K,Ce)|0,w=w+Math.imul(K,ke)|0,v=v+Math.imul(_,Ae)|0,l=l+Math.imul(_,Ie)|0,l=l+Math.imul(E,Ae)|0,w=w+Math.imul(E,Ie)|0,v=v+Math.imul(B,xe)|0,l=l+Math.imul(B,Te)|0,l=l+Math.imul(H,xe)|0,w=w+Math.imul(H,Te)|0,v=v+Math.imul(U,Ne)|0,l=l+Math.imul(U,Pe)|0,l=l+Math.imul(k,Ne)|0,w=w+Math.imul(k,Pe)|0;var Yt=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,v=Math.imul(pe,Ee),l=Math.imul(pe,Se),l=l+Math.imul(ge,Ee)|0,w=Math.imul(ge,Se),v=v+Math.imul(me,Re)|0,l=l+Math.imul(me,Me)|0,l=l+Math.imul(ye,Re)|0,w=w+Math.imul(ye,Me)|0,v=v+Math.imul(Z,Ce)|0,l=l+Math.imul(Z,ke)|0,l=l+Math.imul(ue,Ce)|0,w=w+Math.imul(ue,ke)|0,v=v+Math.imul(j,Ae)|0,l=l+Math.imul(j,Ie)|0,l=l+Math.imul(K,Ae)|0,w=w+Math.imul(K,Ie)|0,v=v+Math.imul(_,xe)|0,l=l+Math.imul(_,Te)|0,l=l+Math.imul(E,xe)|0,w=w+Math.imul(E,Te)|0,v=v+Math.imul(B,Ne)|0,l=l+Math.imul(B,Pe)|0,l=l+Math.imul(H,Ne)|0,w=w+Math.imul(H,Pe)|0,v=v+Math.imul(U,Le)|0,l=l+Math.imul(U,Oe)|0,l=l+Math.imul(k,Le)|0,w=w+Math.imul(k,Oe)|0;var Xt=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,v=Math.imul(fe,Ee),l=Math.imul(fe,Se),l=l+Math.imul(he,Ee)|0,w=Math.imul(he,Se),v=v+Math.imul(pe,Re)|0,l=l+Math.imul(pe,Me)|0,l=l+Math.imul(ge,Re)|0,w=w+Math.imul(ge,Me)|0,v=v+Math.imul(me,Ce)|0,l=l+Math.imul(me,ke)|0,l=l+Math.imul(ye,Ce)|0,w=w+Math.imul(ye,ke)|0,v=v+Math.imul(Z,Ae)|0,l=l+Math.imul(Z,Ie)|0,l=l+Math.imul(ue,Ae)|0,w=w+Math.imul(ue,Ie)|0,v=v+Math.imul(j,xe)|0,l=l+Math.imul(j,Te)|0,l=l+Math.imul(K,xe)|0,w=w+Math.imul(K,Te)|0,v=v+Math.imul(_,Ne)|0,l=l+Math.imul(_,Pe)|0,l=l+Math.imul(E,Ne)|0,w=w+Math.imul(E,Pe)|0,v=v+Math.imul(B,Le)|0,l=l+Math.imul(B,Oe)|0,l=l+Math.imul(H,Le)|0,w=w+Math.imul(H,Oe)|0,v=v+Math.imul(U,$e)|0,l=l+Math.imul(U,Be)|0,l=l+Math.imul(k,$e)|0,w=w+Math.imul(k,Be)|0;var er=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(er>>>26)|0,er&=67108863,v=Math.imul(ve,Ee),l=Math.imul(ve,Se),l=l+Math.imul(be,Ee)|0,w=Math.imul(be,Se),v=v+Math.imul(fe,Re)|0,l=l+Math.imul(fe,Me)|0,l=l+Math.imul(he,Re)|0,w=w+Math.imul(he,Me)|0,v=v+Math.imul(pe,Ce)|0,l=l+Math.imul(pe,ke)|0,l=l+Math.imul(ge,Ce)|0,w=w+Math.imul(ge,ke)|0,v=v+Math.imul(me,Ae)|0,l=l+Math.imul(me,Ie)|0,l=l+Math.imul(ye,Ae)|0,w=w+Math.imul(ye,Ie)|0,v=v+Math.imul(Z,xe)|0,l=l+Math.imul(Z,Te)|0,l=l+Math.imul(ue,xe)|0,w=w+Math.imul(ue,Te)|0,v=v+Math.imul(j,Ne)|0,l=l+Math.imul(j,Pe)|0,l=l+Math.imul(K,Ne)|0,w=w+Math.imul(K,Pe)|0,v=v+Math.imul(_,Le)|0,l=l+Math.imul(_,Oe)|0,l=l+Math.imul(E,Le)|0,w=w+Math.imul(E,Oe)|0,v=v+Math.imul(B,$e)|0,l=l+Math.imul(B,Be)|0,l=l+Math.imul(H,$e)|0,w=w+Math.imul(H,Be)|0,v=v+Math.imul(U,Fe)|0,l=l+Math.imul(U,De)|0,l=l+Math.imul(k,Fe)|0,w=w+Math.imul(k,De)|0;var tr=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(tr>>>26)|0,tr&=67108863,v=Math.imul(we,Ee),l=Math.imul(we,Se),l=l+Math.imul(_e,Ee)|0,w=Math.imul(_e,Se),v=v+Math.imul(ve,Re)|0,l=l+Math.imul(ve,Me)|0,l=l+Math.imul(be,Re)|0,w=w+Math.imul(be,Me)|0,v=v+Math.imul(fe,Ce)|0,l=l+Math.imul(fe,ke)|0,l=l+Math.imul(he,Ce)|0,w=w+Math.imul(he,ke)|0,v=v+Math.imul(pe,Ae)|0,l=l+Math.imul(pe,Ie)|0,l=l+Math.imul(ge,Ae)|0,w=w+Math.imul(ge,Ie)|0,v=v+Math.imul(me,xe)|0,l=l+Math.imul(me,Te)|0,l=l+Math.imul(ye,xe)|0,w=w+Math.imul(ye,Te)|0,v=v+Math.imul(Z,Ne)|0,l=l+Math.imul(Z,Pe)|0,l=l+Math.imul(ue,Ne)|0,w=w+Math.imul(ue,Pe)|0,v=v+Math.imul(j,Le)|0,l=l+Math.imul(j,Oe)|0,l=l+Math.imul(K,Le)|0,w=w+Math.imul(K,Oe)|0,v=v+Math.imul(_,$e)|0,l=l+Math.imul(_,Be)|0,l=l+Math.imul(E,$e)|0,w=w+Math.imul(E,Be)|0,v=v+Math.imul(B,Fe)|0,l=l+Math.imul(B,De)|0,l=l+Math.imul(H,Fe)|0,w=w+Math.imul(H,De)|0,v=v+Math.imul(U,je)|0,l=l+Math.imul(U,Ue)|0,l=l+Math.imul(k,je)|0,w=w+Math.imul(k,Ue)|0;var rr=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(rr>>>26)|0,rr&=67108863,v=Math.imul(we,Re),l=Math.imul(we,Me),l=l+Math.imul(_e,Re)|0,w=Math.imul(_e,Me),v=v+Math.imul(ve,Ce)|0,l=l+Math.imul(ve,ke)|0,l=l+Math.imul(be,Ce)|0,w=w+Math.imul(be,ke)|0,v=v+Math.imul(fe,Ae)|0,l=l+Math.imul(fe,Ie)|0,l=l+Math.imul(he,Ae)|0,w=w+Math.imul(he,Ie)|0,v=v+Math.imul(pe,xe)|0,l=l+Math.imul(pe,Te)|0,l=l+Math.imul(ge,xe)|0,w=w+Math.imul(ge,Te)|0,v=v+Math.imul(me,Ne)|0,l=l+Math.imul(me,Pe)|0,l=l+Math.imul(ye,Ne)|0,w=w+Math.imul(ye,Pe)|0,v=v+Math.imul(Z,Le)|0,l=l+Math.imul(Z,Oe)|0,l=l+Math.imul(ue,Le)|0,w=w+Math.imul(ue,Oe)|0,v=v+Math.imul(j,$e)|0,l=l+Math.imul(j,Be)|0,l=l+Math.imul(K,$e)|0,w=w+Math.imul(K,Be)|0,v=v+Math.imul(_,Fe)|0,l=l+Math.imul(_,De)|0,l=l+Math.imul(E,Fe)|0,w=w+Math.imul(E,De)|0,v=v+Math.imul(B,je)|0,l=l+Math.imul(B,Ue)|0,l=l+Math.imul(H,je)|0,w=w+Math.imul(H,Ue)|0;var nr=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(nr>>>26)|0,nr&=67108863,v=Math.imul(we,Ce),l=Math.imul(we,ke),l=l+Math.imul(_e,Ce)|0,w=Math.imul(_e,ke),v=v+Math.imul(ve,Ae)|0,l=l+Math.imul(ve,Ie)|0,l=l+Math.imul(be,Ae)|0,w=w+Math.imul(be,Ie)|0,v=v+Math.imul(fe,xe)|0,l=l+Math.imul(fe,Te)|0,l=l+Math.imul(he,xe)|0,w=w+Math.imul(he,Te)|0,v=v+Math.imul(pe,Ne)|0,l=l+Math.imul(pe,Pe)|0,l=l+Math.imul(ge,Ne)|0,w=w+Math.imul(ge,Pe)|0,v=v+Math.imul(me,Le)|0,l=l+Math.imul(me,Oe)|0,l=l+Math.imul(ye,Le)|0,w=w+Math.imul(ye,Oe)|0,v=v+Math.imul(Z,$e)|0,l=l+Math.imul(Z,Be)|0,l=l+Math.imul(ue,$e)|0,w=w+Math.imul(ue,Be)|0,v=v+Math.imul(j,Fe)|0,l=l+Math.imul(j,De)|0,l=l+Math.imul(K,Fe)|0,w=w+Math.imul(K,De)|0,v=v+Math.imul(_,je)|0,l=l+Math.imul(_,Ue)|0,l=l+Math.imul(E,je)|0,w=w+Math.imul(E,Ue)|0;var ir=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(ir>>>26)|0,ir&=67108863,v=Math.imul(we,Ae),l=Math.imul(we,Ie),l=l+Math.imul(_e,Ae)|0,w=Math.imul(_e,Ie),v=v+Math.imul(ve,xe)|0,l=l+Math.imul(ve,Te)|0,l=l+Math.imul(be,xe)|0,w=w+Math.imul(be,Te)|0,v=v+Math.imul(fe,Ne)|0,l=l+Math.imul(fe,Pe)|0,l=l+Math.imul(he,Ne)|0,w=w+Math.imul(he,Pe)|0,v=v+Math.imul(pe,Le)|0,l=l+Math.imul(pe,Oe)|0,l=l+Math.imul(ge,Le)|0,w=w+Math.imul(ge,Oe)|0,v=v+Math.imul(me,$e)|0,l=l+Math.imul(me,Be)|0,l=l+Math.imul(ye,$e)|0,w=w+Math.imul(ye,Be)|0,v=v+Math.imul(Z,Fe)|0,l=l+Math.imul(Z,De)|0,l=l+Math.imul(ue,Fe)|0,w=w+Math.imul(ue,De)|0,v=v+Math.imul(j,je)|0,l=l+Math.imul(j,Ue)|0,l=l+Math.imul(K,je)|0,w=w+Math.imul(K,Ue)|0;var sr=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(sr>>>26)|0,sr&=67108863,v=Math.imul(we,xe),l=Math.imul(we,Te),l=l+Math.imul(_e,xe)|0,w=Math.imul(_e,Te),v=v+Math.imul(ve,Ne)|0,l=l+Math.imul(ve,Pe)|0,l=l+Math.imul(be,Ne)|0,w=w+Math.imul(be,Pe)|0,v=v+Math.imul(fe,Le)|0,l=l+Math.imul(fe,Oe)|0,l=l+Math.imul(he,Le)|0,w=w+Math.imul(he,Oe)|0,v=v+Math.imul(pe,$e)|0,l=l+Math.imul(pe,Be)|0,l=l+Math.imul(ge,$e)|0,w=w+Math.imul(ge,Be)|0,v=v+Math.imul(me,Fe)|0,l=l+Math.imul(me,De)|0,l=l+Math.imul(ye,Fe)|0,w=w+Math.imul(ye,De)|0,v=v+Math.imul(Z,je)|0,l=l+Math.imul(Z,Ue)|0,l=l+Math.imul(ue,je)|0,w=w+Math.imul(ue,Ue)|0;var or=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(or>>>26)|0,or&=67108863,v=Math.imul(we,Ne),l=Math.imul(we,Pe),l=l+Math.imul(_e,Ne)|0,w=Math.imul(_e,Pe),v=v+Math.imul(ve,Le)|0,l=l+Math.imul(ve,Oe)|0,l=l+Math.imul(be,Le)|0,w=w+Math.imul(be,Oe)|0,v=v+Math.imul(fe,$e)|0,l=l+Math.imul(fe,Be)|0,l=l+Math.imul(he,$e)|0,w=w+Math.imul(he,Be)|0,v=v+Math.imul(pe,Fe)|0,l=l+Math.imul(pe,De)|0,l=l+Math.imul(ge,Fe)|0,w=w+Math.imul(ge,De)|0,v=v+Math.imul(me,je)|0,l=l+Math.imul(me,Ue)|0,l=l+Math.imul(ye,je)|0,w=w+Math.imul(ye,Ue)|0;var xs=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(xs>>>26)|0,xs&=67108863,v=Math.imul(we,Le),l=Math.imul(we,Oe),l=l+Math.imul(_e,Le)|0,w=Math.imul(_e,Oe),v=v+Math.imul(ve,$e)|0,l=l+Math.imul(ve,Be)|0,l=l+Math.imul(be,$e)|0,w=w+Math.imul(be,Be)|0,v=v+Math.imul(fe,Fe)|0,l=l+Math.imul(fe,De)|0,l=l+Math.imul(he,Fe)|0,w=w+Math.imul(he,De)|0,v=v+Math.imul(pe,je)|0,l=l+Math.imul(pe,Ue)|0,l=l+Math.imul(ge,je)|0,w=w+Math.imul(ge,Ue)|0;var Ts=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Ts>>>26)|0,Ts&=67108863,v=Math.imul(we,$e),l=Math.imul(we,Be),l=l+Math.imul(_e,$e)|0,w=Math.imul(_e,Be),v=v+Math.imul(ve,Fe)|0,l=l+Math.imul(ve,De)|0,l=l+Math.imul(be,Fe)|0,w=w+Math.imul(be,De)|0,v=v+Math.imul(fe,je)|0,l=l+Math.imul(fe,Ue)|0,l=l+Math.imul(he,je)|0,w=w+Math.imul(he,Ue)|0;var Ns=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,v=Math.imul(we,Fe),l=Math.imul(we,De),l=l+Math.imul(_e,Fe)|0,w=Math.imul(_e,De),v=v+Math.imul(ve,je)|0,l=l+Math.imul(ve,Ue)|0,l=l+Math.imul(be,je)|0,w=w+Math.imul(be,Ue)|0;var Ps=(A+v|0)+((l&8191)<<13)|0;A=(w+(l>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,v=Math.imul(we,je),l=Math.imul(we,Ue),l=l+Math.imul(_e,je)|0,w=Math.imul(_e,Ue);var Ls=(A+v|0)+((l&8191)<<13)|0;return A=(w+(l>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,S[0]=Gt,S[1]=Jt,S[2]=Zt,S[3]=Kt,S[4]=Qt,S[5]=Yt,S[6]=Xt,S[7]=er,S[8]=tr,S[9]=rr,S[10]=nr,S[11]=ir,S[12]=sr,S[13]=or,S[14]=xs,S[15]=Ts,S[16]=Ns,S[17]=Ps,S[18]=Ls,A!==0&&(S[19]=A,p.length++),p};Math.imul||(I=M);function T(R,o,u){u.negative=o.negative^R.negative,u.length=R.length+o.length;for(var p=0,g=0,b=0;b<u.length-1;b++){var S=g;g=0;for(var A=p&67108863,v=Math.min(b,o.length-1),l=Math.max(0,b-R.length+1);l<=v;l++){var w=b-l,W=R.words[w]|0,U=o.words[l]|0,k=W*U,x=k&67108863;S=S+(k/67108864|0)|0,x=x+A|0,A=x&67108863,S=S+(x>>>26)|0,g+=S>>>26,S&=67108863}u.words[b]=A,p=S,S=g}return p!==0?u.words[b]=p:u.length--,u._strip()}function $(R,o,u){return T(R,o,u)}s.prototype.mulTo=function(o,u){var p,g=this.length+o.length;return this.length===10&&o.length===10?p=I(this,o,u):g<63?p=M(this,o,u):g<1024?p=T(this,o,u):p=$(this,o,u),p},s.prototype.mul=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},s.prototype.mulf=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),$(this,o,u)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var u=o<0;u&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var p=0,g=0;g<this.length;g++){var b=(this.words[g]|0)*o,S=(b&67108863)+(p&67108863);p>>=26,p+=b/67108864|0,p+=S>>>26,this.words[g]=S&67108863}return p!==0&&(this.words[g]=p,this.length++),this.length=o===0?1:this.length,u?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var u=L(o);if(u.length===0)return new s(1);for(var p=this,g=0;g<u.length&&u[g]===0;g++,p=p.sqr());if(++g<u.length)for(var b=p.sqr();g<u.length;g++,b=b.sqr())u[g]!==0&&(p=p.mul(b));return p},s.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,g=67108863>>>26-u<<26-u,b;if(u!==0){var S=0;for(b=0;b<this.length;b++){var A=this.words[b]&g,v=(this.words[b]|0)-A<<u;this.words[b]=v|S,S=A>>>26-u}S&&(this.words[b]=S,this.length++)}if(p!==0){for(b=this.length-1;b>=0;b--)this.words[b+p]=this.words[b];for(b=0;b<p;b++)this.words[b]=0;this.length+=p}return this._strip()},s.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},s.prototype.iushrn=function(o,u,p){n(typeof o=="number"&&o>=0);var g;u?g=(u-u%26)/26:g=0;var b=o%26,S=Math.min((o-b)/26,this.length),A=67108863^67108863>>>b<<b,v=p;if(g-=S,g=Math.max(0,g),v){for(var l=0;l<S;l++)v.words[l]=this.words[l];v.length=S}if(S!==0)if(this.length>S)for(this.length-=S,l=0;l<this.length;l++)this.words[l]=this.words[l+S];else this.words[0]=0,this.length=1;var w=0;for(l=this.length-1;l>=0&&(w!==0||l>=g);l--){var W=this.words[l]|0;this.words[l]=w<<26-b|W>>>b,w=W&A}return v&&w!==0&&(v.words[v.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,u,p){return n(this.negative===0),this.iushrn(o,u,p)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,g=1<<u;if(this.length<=p)return!1;var b=this.words[p];return!!(b&g)},s.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var g=67108863^67108863>>>u<<u;this.words[this.length-1]&=g}return this._strip()},s.prototype.maskn=function(o){return this.clone().imaskn(o)},s.prototype.iaddn=function(o){return n(typeof o=="number"),n(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<=o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},s.prototype._iaddn=function(o){this.words[0]+=o;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},s.prototype.addn=function(o){return this.clone().iaddn(o)},s.prototype.subn=function(o){return this.clone().isubn(o)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(o,u,p){var g=o.length+p,b;this._expand(g);var S,A=0;for(b=0;b<o.length;b++){S=(this.words[b+p]|0)+A;var v=(o.words[b]|0)*u;S-=v&67108863,A=(S>>26)-(v/67108864|0),this.words[b+p]=S&67108863}for(;b<this.length-p;b++)S=(this.words[b+p]|0)+A,A=S>>26,this.words[b+p]=S&67108863;if(A===0)return this._strip();for(n(A===-1),A=0,b=0;b<this.length;b++)S=-(this.words[b]|0)+A,A=S>>26,this.words[b]=S&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,u){var p=this.length-o.length,g=this.clone(),b=o,S=b.words[b.length-1]|0,A=this._countBits(S);p=26-A,p!==0&&(b=b.ushln(p),g.iushln(p),S=b.words[b.length-1]|0);var v=g.length-b.length,l;if(u!=="mod"){l=new s(null),l.length=v+1,l.words=new Array(l.length);for(var w=0;w<l.length;w++)l.words[w]=0}var W=g.clone()._ishlnsubmul(b,1,v);W.negative===0&&(g=W,l&&(l.words[v]=1));for(var U=v-1;U>=0;U--){var k=(g.words[b.length+U]|0)*67108864+(g.words[b.length+U-1]|0);for(k=Math.min(k/S|0,67108863),g._ishlnsubmul(b,k,U);g.negative!==0;)k--,g.negative=0,g._ishlnsubmul(b,1,U),g.isZero()||(g.negative^=1);l&&(l.words[U]=k)}return l&&l._strip(),g._strip(),u!=="div"&&p!==0&&g.iushrn(p),{div:l||null,mod:g}},s.prototype.divmod=function(o,u,p){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var g,b,S;return this.negative!==0&&o.negative===0?(S=this.neg().divmod(o,u),u!=="mod"&&(g=S.div.neg()),u!=="div"&&(b=S.mod.neg(),p&&b.negative!==0&&b.iadd(o)),{div:g,mod:b}):this.negative===0&&o.negative!==0?(S=this.divmod(o.neg(),u),u!=="mod"&&(g=S.div.neg()),{div:g,mod:S.mod}):this.negative&o.negative?(S=this.neg().divmod(o.neg(),u),u!=="div"&&(b=S.mod.neg(),p&&b.negative!==0&&b.isub(o)),{div:S.div,mod:b}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,u)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(o):u.mod,g=o.ushrn(1),b=o.andln(1),S=p.cmp(g);return S<0||b===1&&S===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},s.prototype.modrn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=(1<<26)%o,g=0,b=this.length-1;b>=0;b--)g=(p*g+(this.words[b]|0))%o;return u?-g:g},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=0,g=this.length-1;g>=0;g--){var b=(this.words[g]|0)+p*67108864;this.words[g]=b/o|0,p=b%o}return this._strip(),u?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var g=new s(1),b=new s(0),S=new s(0),A=new s(1),v=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++v;for(var l=p.clone(),w=u.clone();!u.isZero();){for(var W=0,U=1;!(u.words[0]&U)&&W<26;++W,U<<=1);if(W>0)for(u.iushrn(W);W-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(l),b.isub(w)),g.iushrn(1),b.iushrn(1);for(var k=0,x=1;!(p.words[0]&x)&&k<26;++k,x<<=1);if(k>0)for(p.iushrn(k);k-- >0;)(S.isOdd()||A.isOdd())&&(S.iadd(l),A.isub(w)),S.iushrn(1),A.iushrn(1);u.cmp(p)>=0?(u.isub(p),g.isub(S),b.isub(A)):(p.isub(u),S.isub(g),A.isub(b))}return{a:S,b:A,gcd:p.iushln(v)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var g=new s(1),b=new s(0),S=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var A=0,v=1;!(u.words[0]&v)&&A<26;++A,v<<=1);if(A>0)for(u.iushrn(A);A-- >0;)g.isOdd()&&g.iadd(S),g.iushrn(1);for(var l=0,w=1;!(p.words[0]&w)&&l<26;++l,w<<=1);if(l>0)for(p.iushrn(l);l-- >0;)b.isOdd()&&b.iadd(S),b.iushrn(1);u.cmp(p)>=0?(u.isub(p),g.isub(b)):(p.isub(u),b.isub(g))}var W;return u.cmpn(1)===0?W=g:W=b,W.cmpn(0)<0&&W.iadd(o),W},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),p=o.clone();u.negative=0,p.negative=0;for(var g=0;u.isEven()&&p.isEven();g++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var b=u.cmp(p);if(b<0){var S=u;u=p,p=S}else if(b===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(g)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var u=o%26,p=(o-u)/26,g=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=g,this;for(var b=g,S=p;b!==0&&S<this.length;S++){var A=this.words[S]|0;A+=b,b=A>>>26,A&=67108863,this.words[S]=A}return b!==0&&(this.words[S]=b,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(o=-o),n(o<=67108863,"Number is too big");var g=this.words[0]|0;p=g===o?0:g<o?-1:1}return this.negative!==0?-p|0:p},s.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var u=this.ucmp(o);return this.negative!==0?-u|0:u},s.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var g=this.words[p]|0,b=o.words[p]|0;if(g!==b){g<b?u=-1:g>b&&(u=1);break}}return u},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new Q(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var O={k256:null,p224:null,p192:null,p25519:null};function F(R,o){this.name=R,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},F.prototype.ireduce=function(o){var u=o,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var g=p<this.n?-1:u.ucmp(this.p);return g===0?(u.words[0]=0,u.length=1):g>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},F.prototype.split=function(o,u){o.iushrn(this.n,0,u)},F.prototype.imulK=function(o){return o.imul(this.k)};function J(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(J,F),J.prototype.split=function(o,u){for(var p=4194303,g=Math.min(o.length,9),b=0;b<g;b++)u.words[b]=o.words[b];if(u.length=g,o.length<=9){o.words[0]=0,o.length=1;return}var S=o.words[9];for(u.words[u.length++]=S&p,b=10;b<o.length;b++){var A=o.words[b]|0;o.words[b-10]=(A&p)<<4|S>>>22,S=A}S>>>=22,o.words[b-10]=S,S===0&&o.length>10?o.length-=10:o.length-=9},J.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,p=0;p<o.length;p++){var g=o.words[p]|0;u+=g*977,o.words[p]=u&67108863,u=g*64+(u/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function z(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(z,F);function V(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(V,F);function ie(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ie,F),ie.prototype.imulK=function(o){for(var u=0,p=0;p<o.length;p++){var g=(o.words[p]|0)*19+u,b=g&67108863;g>>>=26,o.words[p]=b,u=g}return u!==0&&(o.words[o.length++]=u),o},s._prime=function(o){if(O[o])return O[o];var u;if(o==="k256")u=new J;else if(o==="p224")u=new z;else if(o==="p192")u=new V;else if(o==="p25519")u=new ie;else throw new Error("Unknown prime "+o);return O[o]=u,u};function Q(R){if(typeof R=="string"){var o=s._prime(R);this.m=o.p,this.prime=o}else n(R.gtn(1),"modulus must be greater than 1"),this.m=R,this.prime=null}Q.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},Q.prototype._verify2=function(o,u){n((o.negative|u.negative)===0,"red works only with positives"),n(o.red&&o.red===u.red,"red works only with red numbers")},Q.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(d(o,o.umod(this.m)._forceRed(this)),o)},Q.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},Q.prototype.add=function(o,u){this._verify2(o,u);var p=o.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},Q.prototype.iadd=function(o,u){this._verify2(o,u);var p=o.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},Q.prototype.sub=function(o,u){this._verify2(o,u);var p=o.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},Q.prototype.isub=function(o,u){this._verify2(o,u);var p=o.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},Q.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},Q.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},Q.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},Q.prototype.isqr=function(o){return this.imul(o,o.clone())},Q.prototype.sqr=function(o){return this.mul(o,o)},Q.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(n(u%2===1),u===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(o,p)}for(var g=this.m.subn(1),b=0;!g.isZero()&&g.andln(1)===0;)b++,g.iushrn(1);n(!g.isZero());var S=new s(1).toRed(this),A=S.redNeg(),v=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);this.pow(l,v).cmp(A)!==0;)l.redIAdd(A);for(var w=this.pow(l,g),W=this.pow(o,g.addn(1).iushrn(1)),U=this.pow(o,g),k=b;U.cmp(S)!==0;){for(var x=U,B=0;x.cmp(S)!==0;B++)x=x.redSqr();n(B<k);var H=this.pow(w,new s(1).iushln(k-B-1));W=W.redMul(H),w=H.redSqr(),U=U.redMul(w),k=B}return W},Q.prototype.invm=function(o){var u=o._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},Q.prototype.pow=function(o,u){if(u.isZero())return new s(1).toRed(this);if(u.cmpn(1)===0)return o.clone();var p=4,g=new Array(1<<p);g[0]=new s(1).toRed(this),g[1]=o;for(var b=2;b<g.length;b++)g[b]=this.mul(g[b-1],o);var S=g[0],A=0,v=0,l=u.bitLength()%26;for(l===0&&(l=26),b=u.length-1;b>=0;b--){for(var w=u.words[b],W=l-1;W>=0;W--){var U=w>>W&1;if(S!==g[0]&&(S=this.sqr(S)),U===0&&A===0){v=0;continue}A<<=1,A|=U,v++,!(v!==p&&(b!==0||W!==0))&&(S=this.mul(S,g[A]),v=0,A=0)}l=26}return S},Q.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},Q.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},s.mont=function(o){return new oe(o)};function oe(R){Q.call(this,R),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(oe,Q),oe.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},oe.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},oe.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var p=o.imul(u),g=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=p.isub(g).iushrn(this.shift),S=b;return b.cmp(this.m)>=0?S=b.isub(this.m):b.cmpn(0)<0&&(S=b.iadd(this.m)),S._forceRed(this)},oe.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new s(0)._forceRed(this);var p=o.mul(u),g=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=p.isub(g).iushrn(this.shift),S=b;return b.cmp(this.m)>=0?S=b.isub(this.m):b.cmpn(0)<0&&(S=b.iadd(this.m)),S._forceRed(this)},oe.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,G)})(Uo);var $i=Uo.exports,Nn={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.errorValues=Bt.standardErrorCodes=void 0;Bt.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}};Bt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Bi={},Fi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Bt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(m,C=r){if(m&&Number.isInteger(m)){const P=m.toString();if(d(t.errorValues,P))return t.errorValues[P].message;if(h(m))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return C}e.getMessageFromCode=n;function i(m){if(!Number.isInteger(m))return!1;const C=m.toString();return!!(t.errorValues[C]||h(m))}e.isValidCode=i;function s(m){var C;if(typeof m=="number")return m;if(a(m))return(C=m.code)!==null&&C!==void 0?C:m.errorCode}e.getErrorCode=s;function a(m){return typeof m=="object"&&m!==null&&(typeof m.code=="number"||typeof m.errorCode=="number")}function c(m,{shouldIncludeStack:C=!1}={}){const P={};if(m&&typeof m=="object"&&!Array.isArray(m)&&d(m,"code")&&i(m.code)){const N=m;P.code=N.code,N.message&&typeof N.message=="string"?(P.message=N.message,d(N,"data")&&(P.data=N.data)):(P.message=n(P.code),P.data={originalError:f(m)})}else P.code=t.standardErrorCodes.rpc.internal,P.message=y(m,"message")?m.message:r,P.data={originalError:f(m)};return C&&(P.stack=y(m,"stack")?m.stack:void 0),P}e.serialize=c;function h(m){return m>=-32099&&m<=-32e3}function f(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function d(m,C){return Object.prototype.hasOwnProperty.call(m,C)}function y(m,C){return typeof m=="object"&&m!==null&&C in m&&typeof m[C]=="string"}})(Fi);Object.defineProperty(Bi,"__esModule",{value:!0});Bi.standardErrors=void 0;const Ye=Bt,Gl=Fi;Bi.standardErrors={rpc:{parse:e=>ht(Ye.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ht(Ye.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ht(Ye.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ht(Ye.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ht(Ye.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ht(t,e)},invalidInput:e=>ht(Ye.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ht(Ye.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ht(Ye.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ht(Ye.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ht(Ye.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ht(Ye.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Br(Ye.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Br(Ye.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Br(Ye.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Br(Ye.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Br(Ye.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Br(Ye.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Kl(t,r,n)}}};function ht(e,t){const[r,n]=Jl(t);return new Zl(e,r||(0,Gl.getMessageFromCode)(e),n)}function Br(e,t){const[r,n]=Jl(t);return new Kl(e,r||(0,Gl.getMessageFromCode)(e),n)}function Jl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let Zl=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},Kl=class extends Zl{constructor(t,r,n){if(!Qf(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Qf(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Di={},an={};Object.defineProperty(an,"__esModule",{value:!0});an.isErrorResponse=void 0;function Yf(e){return e.errorMessage!==void 0}an.isErrorResponse=Yf;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.LIB_VERSION=void 0;cn.LIB_VERSION="3.9.3";Object.defineProperty(Di,"__esModule",{value:!0});Di.serializeError=void 0;const Xf=an,e0=cn,t0=Bt,r0=Fi;function n0(e,t){const r=(0,r0.serialize)(i0(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",e0.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=s0(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Di.serializeError=n0;function i0(e){return typeof e=="string"?{message:e,code:t0.standardErrorCodes.rpc.internal}:(0,Xf.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function s0(e,t){const r=e?.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Bt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Bi;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Di;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Fi;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Nn);var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ProviderType=Ge.RegExpString=Ge.IntNumber=Ge.BigIntString=Ge.AddressString=Ge.HexString=Ge.OpaqueType=void 0;function Pn(){return e=>e}Ge.OpaqueType=Pn;Ge.HexString=Pn();Ge.AddressString=Pn();Ge.BigIntString=Pn();function o0(e){return Math.floor(e)}Ge.IntNumber=o0;Ge.RegExpString=Pn();var za;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(za||(Ge.ProviderType=za={}));var a0=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q,"__esModule",{value:!0});q.isMobileWeb=q.getLocation=q.isInIFrame=q.createQrUrl=q.getFavicon=q.range=q.isBigNumber=q.ensureParsedJSONObject=q.ensureBN=q.ensureRegExpString=q.ensureIntNumber=q.ensureBuffer=q.ensureAddressString=q.ensureEvenLengthHexString=q.ensureHexString=q.isHexString=q.prepend0x=q.strip0x=q.has0xPrefix=q.hexStringFromIntNumber=q.intNumberFromHexString=q.bigIntStringFromBN=q.hexStringFromBuffer=q.hexStringToUint8Array=q.uint8ArrayToHex=q.randomBytesHex=void 0;const Wt=a0($i),wr=Nn,gt=Ge,Ql=/^[0-9]*$/,Yl=/^[a-f0-9]*$/;function c0(e){return Xl(crypto.getRandomValues(new Uint8Array(e)))}q.randomBytesHex=c0;function Xl(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}q.uint8ArrayToHex=Xl;function l0(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}q.hexStringToUint8Array=l0;function u0(e,t=!1){const r=e.toString("hex");return(0,gt.HexString)(t?`0x${r}`:r)}q.hexStringFromBuffer=u0;function h0(e){return(0,gt.BigIntString)(e.toString(10))}q.bigIntStringFromBN=h0;function d0(e){return(0,gt.IntNumber)(new Wt.default(On(e,!1),16).toNumber())}q.intNumberFromHexString=d0;function f0(e){return(0,gt.HexString)(`0x${new Wt.default(e).toString(16)}`)}q.hexStringFromIntNumber=f0;function Ho(e){return e.startsWith("0x")||e.startsWith("0X")}q.has0xPrefix=Ho;function ji(e){return Ho(e)?e.slice(2):e}q.strip0x=ji;function eu(e){return Ho(e)?`0x${e.slice(2)}`:`0x${e}`}q.prepend0x=eu;function Ln(e){if(typeof e!="string")return!1;const t=ji(e).toLowerCase();return Yl.test(t)}q.isHexString=Ln;function tu(e,t=!1){if(typeof e=="string"){const r=ji(e).toLowerCase();if(Yl.test(r))return(0,gt.HexString)(t?`0x${r}`:r)}throw wr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}q.ensureHexString=tu;function On(e,t=!1){let r=tu(e,!1);return r.length%2===1&&(r=(0,gt.HexString)(`0${r}`)),t?(0,gt.HexString)(`0x${r}`):r}q.ensureEvenLengthHexString=On;function p0(e){if(typeof e=="string"){const t=ji(e).toLowerCase();if(Ln(t)&&t.length===40)return(0,gt.AddressString)(eu(t))}throw wr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}q.ensureAddressString=p0;function g0(e){if(re.isBuffer(e))return e;if(typeof e=="string"){if(Ln(e)){const t=On(e,!1);return re.from(t,"hex")}return re.from(e,"utf8")}throw wr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}q.ensureBuffer=g0;function ru(e){if(typeof e=="number"&&Number.isInteger(e))return(0,gt.IntNumber)(e);if(typeof e=="string"){if(Ql.test(e))return(0,gt.IntNumber)(Number(e));if(Ln(e))return(0,gt.IntNumber)(new Wt.default(On(e,!1),16).toNumber())}throw wr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}q.ensureIntNumber=ru;function m0(e){if(e instanceof RegExp)return(0,gt.RegExpString)(e.toString());throw wr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}q.ensureRegExpString=m0;function y0(e){if(e!==null&&(Wt.default.isBN(e)||nu(e)))return new Wt.default(e.toString(10),10);if(typeof e=="number")return new Wt.default(ru(e));if(typeof e=="string"){if(Ql.test(e))return new Wt.default(e,10);if(Ln(e))return new Wt.default(On(e,!1),16)}throw wr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}q.ensureBN=y0;function v0(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw wr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}q.ensureParsedJSONObject=v0;function nu(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}q.isBigNumber=nu;function b0(e,t){return Array.from({length:t-e},(r,n)=>e+n)}q.range=b0;function w0(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}q.getFavicon=w0;function _0(e,t,r,n,i,s){const a=n?"parent-id":"id",c=new URLSearchParams({[a]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}q.createQrUrl=_0;function iu(){try{return window.frameElement!==null}catch{return!1}}q.isInIFrame=iu;function E0(){try{return iu()&&window.top?window.top.location:window.location}catch{return window.location}}q.getLocation=E0;function S0(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window?.navigator)===null||e===void 0?void 0:e.userAgent)}q.isMobileWeb=S0;var Ui={};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.ScopedLocalStorage=void 0;class R0{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Ui.ScopedLocalStorage=R0;var Xr={};const M0=br(qh);var $n={},Bn={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.EVENTS=void 0;ln.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.RelayAbstract=pt.APP_VERSION_KEY=pt.LOCAL_STORAGE_ADDRESSES_KEY=pt.WALLET_USER_NAME_KEY=void 0;const Ga=Nn;pt.WALLET_USER_NAME_KEY="walletUsername";pt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";pt.APP_VERSION_KEY="AppVersion";class C0{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Ga.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Ga.serializeError)(s,t.method);return i})}}pt.RelayAbstract=C0;var un={},su={exports:{}},xo={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Tn,n=r.Buffer;function i(a,c){for(var h in a)c[h]=a[h]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(a,c,h){return n(a,c,h)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,c,h){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,c,h)},s.alloc=function(a,c,h){if(typeof a!="number")throw new TypeError("Argument must be a number");var f=n(a);return c!==void 0?typeof h=="string"?f.fill(c,h):f.fill(c):f.fill(0),f},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(xo,xo.exports);var Dt=xo.exports,qs,Ja;function k0(){if(Ja)return qs;Ja=1;var e=Zf;return qs=function(r){return!!e(r)},qs}var A0=Cn,I0=Hl,x0=I0("TypedArray.prototype.buffer",!0),T0=k0(),N0=x0||function(t){if(!T0(t))throw new A0("Not a Typed Array");return t.buffer},wt=Dt.Buffer,P0=Ef,L0=N0,O0=ArrayBuffer.isView||function(t){try{return L0(t),!0}catch{return!1}},$0=typeof Uint8Array<"u",ou=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",B0=ou&&(wt.prototype instanceof Uint8Array||wt.TYPED_ARRAY_SUPPORT),F0=function(t,r){if(wt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?wt.from(t):t;if(typeof t=="string")return wt.from(t,r);if(ou&&O0(t)){if(t.byteLength===0)return wt.alloc(0);if(B0){var n=wt.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=wt.from(i);if(s.length===t.byteLength)return s}if($0&&t instanceof Uint8Array)return wt.from(t);var a=P0(t);if(a)for(var c=0;c<t.length;c+=1){var h=t[c];if(typeof h!="number"||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||wt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return wt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},D0=Dt.Buffer,j0=F0;function Hi(e,t){this._block=D0.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Hi.prototype.update=function(e,t){e=j0(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,a=0;a<i;){for(var c=s%n,h=Math.min(i-a,n-c),f=0;f<h;f++)r[c+f]=e[a+f];s+=h,a+=h,s%n===0&&this._update(r)}return this._len+=i,this};Hi.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};Hi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var hn=Hi,U0=_t,au=hn,H0=Dt.Buffer,W0=[1518500249,1859775393,-1894007588,-899497514],V0=new Array(80);function Fn(){this.init(),this._w=V0,au.call(this,64,56)}U0(Fn,au);Fn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function q0(e){return e<<5|e>>>27}function z0(e){return e<<30|e>>>2}function G0(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Fn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var h=0;h<80;++h){var f=~~(h/20),d=q0(r)+G0(f,n,i,s)+a+t[h]+W0[f]|0;a=s,s=i,i=z0(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Fn.prototype._hash=function(){var e=H0.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var J0=Fn,Z0=_t,cu=hn,K0=Dt.Buffer,Q0=[1518500249,1859775393,-1894007588,-899497514],Y0=new Array(80);function Dn(){this.init(),this._w=Y0,cu.call(this,64,56)}Z0(Dn,cu);Dn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function X0(e){return e<<1|e>>>31}function ep(e){return e<<5|e>>>27}function tp(e){return e<<30|e>>>2}function rp(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Dn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=X0(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var h=0;h<80;++h){var f=~~(h/20),d=ep(r)+rp(f,n,i,s)+a+t[h]+Q0[f]|0;a=s,s=i,i=tp(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Dn.prototype._hash=function(){var e=K0.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var np=Dn,ip=_t,lu=hn,sp=Dt.Buffer,op=[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],ap=new Array(64);function jn(){this.init(),this._w=ap,lu.call(this,64,56)}ip(jn,lu);jn.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 cp(e,t,r){return r^e&(t^r)}function lp(e,t,r){return e&t|r&(e|t)}function up(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function hp(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function dp(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function fp(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}jn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,c=this._f|0,h=this._g|0,f=this._h|0,d=0;d<16;++d)t[d]=e.readInt32BE(d*4);for(;d<64;++d)t[d]=fp(t[d-2])+t[d-7]+dp(t[d-15])+t[d-16]|0;for(var y=0;y<64;++y){var m=f+hp(a)+cp(a,c,h)+op[y]+t[y]|0,C=up(r)+lp(r,n,i)|0;f=h,h=c,c=a,a=s+m|0,s=i,i=n,n=r,r=m+C|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=h+this._g|0,this._h=f+this._h|0};jn.prototype._hash=function(){var e=sp.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var uu=jn,pp=_t,gp=uu,mp=hn,yp=Dt.Buffer,vp=new Array(64);function Wi(){this.init(),this._w=vp,mp.call(this,64,56)}pp(Wi,gp);Wi.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};Wi.prototype._hash=function(){var e=yp.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var bp=Wi,wp=_t,hu=hn,_p=Dt.Buffer,Za=[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],Ep=new Array(160);function Un(){this.init(),this._w=Ep,hu.call(this,128,112)}wp(Un,hu);Un.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 Ka(e,t,r){return r^e&(t^r)}function Qa(e,t,r){return e&t|r&(e|t)}function Ya(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Xa(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Sp(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Rp(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Mp(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Cp(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ze(e,t){return e>>>0<t>>>0?1:0}Un.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,a=this._eh|0,c=this._fh|0,h=this._gh|0,f=this._hh|0,d=this._al|0,y=this._bl|0,m=this._cl|0,C=this._dl|0,P=this._el|0,N=this._fl|0,L=this._gl|0,M=this._hl|0,I=0;I<32;I+=2)t[I]=e.readInt32BE(I*4),t[I+1]=e.readInt32BE(I*4+4);for(;I<160;I+=2){var T=t[I-30],$=t[I-15*2+1],O=Sp(T,$),F=Rp($,T);T=t[I-2*2],$=t[I-2*2+1];var J=Mp(T,$),z=Cp($,T),V=t[I-7*2],ie=t[I-7*2+1],Q=t[I-16*2],oe=t[I-16*2+1],R=F+ie|0,o=O+V+Ze(R,F)|0;R=R+z|0,o=o+J+Ze(R,z)|0,R=R+oe|0,o=o+Q+Ze(R,oe)|0,t[I]=o,t[I+1]=R}for(var u=0;u<160;u+=2){o=t[u],R=t[u+1];var p=Qa(r,n,i),g=Qa(d,y,m),b=Ya(r,d),S=Ya(d,r),A=Xa(a,P),v=Xa(P,a),l=Za[u],w=Za[u+1],W=Ka(a,c,h),U=Ka(P,N,L),k=M+v|0,x=f+A+Ze(k,M)|0;k=k+U|0,x=x+W+Ze(k,U)|0,k=k+w|0,x=x+l+Ze(k,w)|0,k=k+R|0,x=x+o+Ze(k,R)|0;var B=S+g|0,H=b+p+Ze(B,S)|0;f=h,M=L,h=c,L=N,c=a,N=P,P=C+k|0,a=s+x+Ze(P,C)|0,s=i,C=m,i=n,m=y,n=r,y=d,d=k+B|0,r=x+H+Ze(d,k)|0}this._al=this._al+d|0,this._bl=this._bl+y|0,this._cl=this._cl+m|0,this._dl=this._dl+C|0,this._el=this._el+P|0,this._fl=this._fl+N|0,this._gl=this._gl+L|0,this._hl=this._hl+M|0,this._ah=this._ah+r+Ze(this._al,d)|0,this._bh=this._bh+n+Ze(this._bl,y)|0,this._ch=this._ch+i+Ze(this._cl,m)|0,this._dh=this._dh+s+Ze(this._dl,C)|0,this._eh=this._eh+a+Ze(this._el,P)|0,this._fh=this._fh+c+Ze(this._fl,N)|0,this._gh=this._gh+h+Ze(this._gl,L)|0,this._hh=this._hh+f+Ze(this._hl,M)|0};Un.prototype._hash=function(){var e=_p.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var du=Un,kp=_t,Ap=du,Ip=hn,xp=Dt.Buffer,Tp=new Array(160);function Vi(){this.init(),this._w=Tp,Ip.call(this,128,112)}kp(Vi,Ap);Vi.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};Vi.prototype._hash=function(){var e=xp.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Np=Vi;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=J0,e.exports.sha1=np,e.exports.sha224=bp,e.exports.sha256=uu,e.exports.sha384=Np,e.exports.sha512=du})(su);var Pp=su.exports;Object.defineProperty(un,"__esModule",{value:!0});un.Session=void 0;const ec=Pp,tc=q,rc="session:id",nc="session:secret",ic="session:linked";class Wo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,tc.randomBytesHex)(16),this._secret=n||(0,tc.randomBytesHex)(32),this._key=new ec.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(rc),n=t.getItem(ic),i=t.getItem(nc);return r&&i?new Wo(t,r,i,n==="1"):null}static hash(t){return new ec.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(rc,this._id),this._storage.setItem(nc,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(ic,this._linked?"1":"0")}}un.Session=Wo;var qi={},zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.Cipher=void 0;const ii=q;class Lp{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,ii.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),c=16,h=a.slice(a.byteLength-c),f=a.slice(0,a.byteLength-c),d=new Uint8Array(h),y=new Uint8Array(f),m=new Uint8Array([...n,...d,...y]);return(0,ii.uint8ArrayToHex)(m)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,ii.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,ii.hexStringToUint8Array)(t),c=a.slice(0,12),h=a.slice(12,28),f=a.slice(28),d=new Uint8Array([...f,...h]),y={name:"AES-GCM",iv:new Uint8Array(c)};try{const m=await window.crypto.subtle.decrypt(y,s,d),C=new TextDecoder;n(C.decode(m))}catch(m){i(m)}})()})}}zi.Cipher=Lp;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.WalletLinkHTTP=void 0;class Op{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n?.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Gi.WalletLinkHTTP=Op;var en={};Object.defineProperty(en,"__esModule",{value:!0});en.WalletLinkWebSocket=en.ConnectionState=void 0;var qr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(qr||(en.ConnectionState=qr={}));class $p{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,qr.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,qr.DISCONNECTED)},i.onopen=s=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,qr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,c;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,qr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}en.WalletLinkWebSocket=$p;Object.defineProperty(qi,"__esModule",{value:!0});qi.WalletLinkConnection=void 0;const Fr=Ge,Bp=zi,Mt=ln,sc=pt,Dr=un,Fp=Gi,si=en,oc=1e4,Dp=6e4;class jp{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Fr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",f=>c.JsonRpcUrl&&this.handleChainUpdated(f,c.JsonRpcUrl)]]).forEach((f,d)=>{const y=c[d];y!==void 0&&f(y)})},this.handleDestroyed=c=>{var h,f;c==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(f=this.diagnostic)===null||f===void 0||f.log(Mt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Dr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var h,f;try{const d=await this.cipher.decrypt(c);(h=this.listener)===null||h===void 0||h.accountUpdated(d)}catch{(f=this.diagnostic)===null||f===void 0||f.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,h)=>{var f,d;try{const y=await this.cipher.decrypt(h);(f=this.listener)===null||f===void 0||f.metadataUpdated(c,y)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(sc.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(sc.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,h)=>{var f,d;try{const y=await this.cipher.decrypt(c),m=await this.cipher.decrypt(h);(f=this.listener)===null||f===void 0||f.chainUpdated(y,m)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Bp.Cipher(t.secret),this.diagnostic=i,this.listener=n;const a=new si.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async c=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(Mt.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:Dr.Session.hash(t.id)});let f=!1;switch(c){case si.ConnectionState.DISCONNECTED:if(!this.destroyed){const d=async()=>{await new Promise(y=>setTimeout(y,5e3)),this.destroyed||a.connect().catch(()=>{d()})};d()}break;case si.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),f=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},oc),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case si.ConnectionState.CONNECTING:break}this.connected!==f&&(this.connected=f)}),a.setIncomingDataListener(c=>{var h,f,d;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const y=c.type==="IsLinkedOK"?c.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(Mt.EVENTS.LINKED,{sessionIdHash:Dr.Session.hash(t.id),linked:y,type:c.type,onlineGuests:c.onlineGuests}),this.linked=y||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(f=this.diagnostic)===null||f===void 0||f.log(Mt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Dr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((d=this.requestResolutions.get(c.id))===null||d===void 0||d(c))}),this.ws=a,this.http=new Fp.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Dr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.DISCONNECTED,{sessionIdHash:Dr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Fr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Fr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>oc*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Dp){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Fr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Fr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Fr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}qi.WalletLinkConnection=jp;var Hn={},Wn={},Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Up=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.injectCssReset=void 0;const Hp=Up(Vo);function Wp(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Hp.default)),document.documentElement.appendChild(e)}Wn.injectCssReset=Wp;var Ji={};const st=br(Wh);var Zi={};function fu(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=fu(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ac(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=fu(e))&&(n&&(n+=" "),n+=t);return n}const Vp=Object.freeze(Object.defineProperty({__proto__:null,clsx:ac,default:ac},Symbol.toStringTag,{value:"Module"})),Vn=br(Vp),Ki=br(Vh);var tn={},Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.CloseIcon=void 0;const cc=st;function qp(e){return(0,cc.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,cc.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"}))}Qi.CloseIcon=qp;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.CoinbaseWalletRound=void 0;const oi=st;function zp(e){return(0,oi.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,oi.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,oi.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,oi.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}Yi.CoinbaseWalletRound=zp;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.QRCodeIcon=void 0;const mn=st;function Gp(e){return(0,mn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,mn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,mn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,mn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,mn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Xi.QRCodeIcon=Gp;var es={};function pu(e){this.mode=lt.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}pu.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Tt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Tt.prototype={addData:function(e){var t=new pu(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Tt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=We.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var a=s*i,c=0;c<this.modules[s].length;c++){var h=c*i,f=this.modules[s][c];f&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+i,a),n.lineTo(h+i,a+i),n.lineTo(h,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=We.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var a=-2;a<=2;a++)s==-2||s==2||a==-2||a==2||s==0&&a==0?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}},setupTypeNumber:function(e){for(var t=We.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=We.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var h=!1;s<e.length&&(h=(e[s]>>>i&1)==1);var f=We.getMask(t,n,a-c);f&&(h=!h),this.modules[n][a-c]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Tt.PAD0=236;Tt.PAD1=17;Tt.createData=function(e,t,r){for(var n=xt.getRSBlocks(e,t),i=new gu,s=0;s<r.length;s++){var a=r[s];i.put(a.mode,4),i.put(a.getLength(),We.getLengthInBits(a.mode,e)),a.write(i)}for(var c=0,s=0;s<n.length;s++)c+=n[s].dataCount;if(i.getLengthInBits()>c*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Tt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Tt.PAD1,8);return Tt.createBytes(i,n)};Tt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c++){var h=t[c].dataCount,f=t[c].totalCount-h;n=Math.max(n,h),i=Math.max(i,f),s[c]=new Array(h);for(var d=0;d<s[c].length;d++)s[c][d]=255&e.buffer[d+r];r+=h;var y=We.getErrorCorrectPolynomial(f),m=new Jr(s[c],y.getLength()-1),C=m.mod(y);a[c]=new Array(y.getLength()-1);for(var d=0;d<a[c].length;d++){var P=d+C.getLength()-a[c].length;a[c][d]=P>=0?C.get(P):0}}for(var N=0,d=0;d<t.length;d++)N+=t[d].totalCount;for(var L=new Array(N),M=0,d=0;d<n;d++)for(var c=0;c<t.length;c++)d<s[c].length&&(L[M++]=s[c][d]);for(var d=0;d<i;d++)for(var c=0;c<t.length;c++)d<a[c].length&&(L[M++]=a[c][d]);return L};var lt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Vt={L:1,M:0,Q:3,H:2},Ut={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},We={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;We.getBCHDigit(t)-We.getBCHDigit(We.G15)>=0;)t^=We.G15<<We.getBCHDigit(t)-We.getBCHDigit(We.G15);return(e<<10|t)^We.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;We.getBCHDigit(t)-We.getBCHDigit(We.G18)>=0;)t^=We.G18<<We.getBCHDigit(t)-We.getBCHDigit(We.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return We.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Ut.PATTERN000:return(t+r)%2==0;case Ut.PATTERN001:return t%2==0;case Ut.PATTERN010:return r%3==0;case Ut.PATTERN011:return(t+r)%3==0;case Ut.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Ut.PATTERN101:return t*r%2+t*r%3==0;case Ut.PATTERN110:return(t*r%2+t*r%3)%2==0;case Ut.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Jr([1],0),r=0;r<e;r++)t=t.multiply(new Jr([1,Qe.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case lt.MODE_NUMBER:return 10;case lt.MODE_ALPHA_NUM:return 9;case lt.MODE_8BIT_BYTE:return 8;case lt.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case lt.MODE_NUMBER:return 12;case lt.MODE_ALPHA_NUM:return 11;case lt.MODE_8BIT_BYTE:return 16;case lt.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case lt.MODE_NUMBER:return 14;case lt.MODE_ALPHA_NUM:return 13;case lt.MODE_8BIT_BYTE:return 16;case lt.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,a=e.isDark(n,i),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var h=-1;h<=1;h++)i+h<0||t<=i+h||c==0&&h==0||a==e.isDark(n+c,i+h)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var f=0;e.isDark(n,i)&&f++,e.isDark(n+1,i)&&f++,e.isDark(n,i+1)&&f++,e.isDark(n+1,i+1)&&f++,(f==0||f==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var d=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&d++;var y=Math.abs(100*d/t/t-50)/5;return r+=y*10,r}},Qe={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Qe.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Qe.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Xe=0;Xe<8;Xe++)Qe.EXP_TABLE[Xe]=1<<Xe;for(var Xe=8;Xe<256;Xe++)Qe.EXP_TABLE[Xe]=Qe.EXP_TABLE[Xe-4]^Qe.EXP_TABLE[Xe-5]^Qe.EXP_TABLE[Xe-6]^Qe.EXP_TABLE[Xe-8];for(var Xe=0;Xe<255;Xe++)Qe.LOG_TABLE[Qe.EXP_TABLE[Xe]]=Xe;function Jr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Jr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Qe.gexp(Qe.glog(this.get(r))+Qe.glog(e.get(n)));return new Jr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Qe.glog(this.get(0))-Qe.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Qe.gexp(Qe.glog(e.get(n))+t);return new Jr(r,0).mod(e)}};function xt(e,t){this.totalCount=e,this.dataCount=t}xt.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]];xt.getRSBlocks=function(e,t){var r=xt.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var a=r[s*3+0],c=r[s*3+1],h=r[s*3+2],f=0;f<a;f++)i.push(new xt(c,h));return i};xt.getRsBlockTable=function(e,t){switch(t){case Vt.L:return xt.RS_BLOCK_TABLE[(e-1)*4+0];case Vt.M:return xt.RS_BLOCK_TABLE[(e-1)*4+1];case Vt.Q:return xt.RS_BLOCK_TABLE[(e-1)*4+2];case Vt.H:return xt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function gu(){this.buffer=[],this.length=0}gu.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var zs=[[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 mu(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(h){switch(h){case"L":return Vt.L;case"M":return Vt.M;case"Q":return Vt.Q;case"H":return Vt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,f){for(var d=i(h),y=1,m=0,C=0,P=zs.length;C<=P;C++){var N=zs[C];if(!N)throw new Error("Content too long: expected "+m+" but got "+d);switch(f){case"L":m=N[0];break;case"M":m=N[1];break;case"Q":m=N[2];break;case"H":m=N[3];break;default:throw new Error("Unknwon error correction level: "+f)}if(d<=m)break;y++}if(y>zs.length)throw new Error("Content too long");return y}function i(h){var f=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return f.length+(f.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new Tt(a,c),this.qrcode.addData(s),this.qrcode.make()}mu.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r
|
|
2
|
+
`:"",a=t.width,c=t.height,h=r.length,f=a/(h+2*t.padding),d=c/(h+2*t.padding),y=typeof t.join<"u"?!!t.join:!1,m=typeof t.swap<"u"?!!t.swap:!1,C=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,P=typeof t.predefined<"u"?!!t.predefined:!1,N=P?i+'<defs><path id="qrmodule" d="M0 0 h'+d+" v"+f+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",L=i+'<rect x="0" y="0" width="'+a+'" height="'+c+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,M="",I="",T=0;T<h;T++)for(var $=0;$<h;$++){var O=r[$][T];if(O){var F=$*f+t.padding*f,J=T*d+t.padding*d;if(m){var z=F;F=J,J=z}if(y){var V=f+F,ie=d+J;F=Number.isInteger(F)?Number(F):F.toFixed(2),J=Number.isInteger(J)?Number(J):J.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),ie=Number.isInteger(ie)?Number(ie):ie.toFixed(2),I+="M"+F+","+J+" V"+ie+" H"+V+" V"+J+" H"+F+" Z "}else P?M+=i+'<use x="'+F.toString()+'" y="'+J.toString()+'" href="#qrmodule" />'+s:M+=i+'<rect x="'+F.toString()+'" y="'+J.toString()+'" width="'+f+'" height="'+d+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}y&&(M=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+I+'" />');let Q="";if(this.options.image!==void 0&&this.options.image.svg){const R=a*this.options.image.width/100,o=c*this.options.image.height/100,u=a/2-R/2,p=c/2-o/2;Q+=`<svg x="${u}" y="${p}" width="${R}" height="${o}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,Q+=this.options.image.svg+s,Q+="</svg>"}var oe="";switch(e.container){case"svg":C&&(oe+='<?xml version="1.0" standalone="yes"?>'+s),oe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+c+'">'+s,oe+=N+L+M,oe+=Q,oe+="</svg>";break;case"svg-viewbox":C&&(oe+='<?xml version="1.0" standalone="yes"?>'+s),oe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+c+'">'+s,oe+=N+L+M,oe+=Q,oe+="</svg>";break;case"g":oe+='<g width="'+a+'" height="'+c+'">'+s,oe+=N+L+M,oe+=Q,oe+="</g>";break;default:oe+=(N+L+M+Q).replace(/^\s+/,"");break}return oe};var Jp=mu,Zp=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(es,"__esModule",{value:!0});es.QRCode=void 0;const Kp=st,lc=Ki,Qp=Zp(Jp),Yp=e=>{const[t,r]=(0,lc.useState)("");return(0,lc.useEffect)(()=>{var n,i;const s=new Qp.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),a=re.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Kp.h)("img",{src:t,alt:"QR Code"}):null};es.QRCode=Yp;var ts={},qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var Xp=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ts,"__esModule",{value:!0});ts.Spinner=void 0;const ai=st,e1=Xp(qo),t1=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,ai.h)("div",{class:"-cbwsdk-spinner"},(0,ai.h)("style",null,e1.default),(0,ai.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ai.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ts.Spinner=t1;var zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var yu=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.CoinbaseWalletSteps=tn.ConnectContent=void 0;const mr=yu(Vn),ce=st,r1=q,n1=cn,i1=Qi,s1=Yi,o1=Xi,a1=es,c1=ts,l1=yu(zo),Gs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:vu},u1=e=>e==="light"?"#FFFFFF":"#0A0B0D";function h1(e){const{theme:t}=e,r=(0,r1.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Gs.steps;return(0,ce.h)("div",{"data-testid":"connect-content",className:(0,mr.default)("-cbwsdk-connect-content",t)},(0,ce.h)("style",null,l1.default),(0,ce.h)("div",{className:"-cbwsdk-connect-content-header"},(0,ce.h)("h2",{className:(0,mr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,ce.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,ce.h)(i1.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ce.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,ce.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,ce.h)(d1,{title:Gs.title,description:Gs.description,theme:t})),(0,ce.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,ce.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,ce.h)(a1.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,ce.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:n1.LIB_VERSION}),(0,ce.h)("input",{type:"hidden",value:r})),(0,ce.h)(n,{theme:t}),!e.isConnected&&(0,ce.h)("div",{"data-testid":"connecting-spinner",className:(0,mr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,ce.h)(c1.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,ce.h)("p",null,"Connecting...")))))}tn.ConnectContent=h1;function d1({title:e,description:t,theme:r}){return(0,ce.h)("div",{className:(0,mr.default)("-cbwsdk-connect-item",r)},(0,ce.h)("div",null,(0,ce.h)(s1.CoinbaseWalletRound,null)),(0,ce.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,ce.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,ce.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function vu({theme:e}){return(0,ce.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,ce.h)("li",{className:(0,mr.default)("-cbwsdk-wallet-steps-item",e)},(0,ce.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,ce.h)("li",{className:(0,mr.default)("-cbwsdk-wallet-steps-item",e)},(0,ce.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,ce.h)("span",null,"Tap ",(0,ce.h)("strong",null,"Scan")," "),(0,ce.h)("span",{className:(0,mr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,ce.h)(o1.QRCodeIcon,{fill:u1(e)})))))}tn.CoinbaseWalletSteps=vu;var rs={},ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.ArrowLeftIcon=void 0;const uc=st;function f1(e){return(0,uc.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,uc.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"}))}ns.ArrowLeftIcon=f1;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.LaptopIcon=void 0;const Js=st;function p1(e){return(0,Js.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Js.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Js.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"}))}is.LaptopIcon=p1;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.SafeIcon=void 0;const hc=st;function g1(e){return(0,hc.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,hc.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}ss.SafeIcon=g1;var Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var bu=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rs,"__esModule",{value:!0});rs.TryExtensionContent=void 0;const ar=bu(Vn),ze=st,Zs=Ki,m1=ns,y1=is,v1=ss,b1=bu(Go);function w1({theme:e}){const[t,r]=(0,Zs.useState)(!1),n=(0,Zs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Zs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,ze.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension",e)},(0,ze.h)("style",null,b1.default),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("h3",{class:(0,ar.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,ze.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ze.h)("button",{class:(0,ar.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,ze.h)("div",null,!t&&(0,ze.h)(m1.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(y1.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(v1.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}rs.TryExtensionContent=w1;var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var wu=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ConnectDialog=void 0;const Ks=wu(Vn),cr=st,Qs=Ki,_1=tn,E1=rs,S1=wu(Jo),R1=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,Qs.useState)(!t),[s,a]=(0,Qs.useState)(!t);(0,Qs.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[t]);const c=r?"dark":"light";return(0,cr.h)("div",{class:(0,Ks.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,cr.h)("style",null,S1.default),(0,cr.h)("div",{class:(0,Ks.default)("-cbwsdk-connect-dialog-backdrop",c,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,cr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,cr.h)("div",{class:(0,Ks.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,cr.h)(_1.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,cr.h)(E1.TryExtensionContent,{theme:c}))))};Zi.ConnectDialog=R1;Object.defineProperty(Ji,"__esModule",{value:!0});Ji.LinkFlow=void 0;const Ys=st,M1=Zi;class C1{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Ys.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ys.render)((0,Ys.h)(M1.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)}}Ji.LinkFlow=C1;var Zo={},Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=G&&G.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Vn),n=st,i=Ki,s=t(Ko),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(m){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=m.darkMode}attach(m){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",m.appendChild(this.root),this.render()}presentItem(m){const C=this.nextItemKey++;return this.items.set(C,m),this.render(),()=>{this.items.delete(C),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([m,C])=>(0,n.h)(e.SnackbarInstance,Object.assign({},C,{key:m}))))),this.root)}}e.Snackbar=h;const f=y=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},y.children));e.SnackbarContainer=f;const d=({autoExpand:y,message:m,menuItems:C})=>{const[P,N]=(0,i.useState)(!0),[L,M]=(0,i.useState)(y??!1);(0,i.useEffect)(()=>{const T=[window.setTimeout(()=>{N(!1)},1),window.setTimeout(()=>{M(!0)},1e4)];return()=>{T.forEach(window.clearTimeout)}});const I=()=>{M(!L)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",P&&"-cbwsdk-snackbar-instance-hidden",L&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:I},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},m),(0,n.h)("div",{class:"-gear-container"},!L&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),C&&C.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},C.map((T,$)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",T.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:T.onClick,key:$},(0,n.h)("svg",{width:T.svgWidth,height:T.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":T.defaultFillRule,"clip-rule":T.defaultClipRule,d:T.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",T.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},T.info)))))};e.SnackbarInstance=d})(Zo);Object.defineProperty(Hn,"__esModule",{value:!0});Hn.WalletLinkRelayUI=void 0;const k1=Wn,A1=Ji,I1=Zo;class x1{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new I1.Snackbar({darkMode:t.darkMode}),this.linkFlow=new A1.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,k1.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Hn.WalletLinkRelayUI=x1;Object.defineProperty(Bn,"__esModule",{value:!0});Bn.WalletLinkRelay=void 0;const jr=Nn,T1=Ge,He=q,lr=ln,dc=pt,Ht=un,N1=qi,ur=an,P1=Hn;class $t extends dc.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var c;this.isLinked=a;const h=this.storage.getItem(dc.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const f=h.split(" "),d=this.storage.getItem("IsStandaloneSigning")==="true";if(f[0]!==""&&!a&&this.session.linked&&!d){this.isUnlinkedErrorState=!0;const y=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(lr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:y})}}},this.metadataUpdated=(a,c)=>{this.storage.setItem(a,c)},this.chainUpdated=(a,c)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:a,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(a,c))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),$t.accountRequestCallbackIds.size>0&&(Array.from($t.accountRequestCallbackIds.values()).forEach(c=>{const h={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:c}))}),$t.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=Ht.Session.load(this.storage)||new Ht.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new N1.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:t});return i.connect(),{session:t,ui:c,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(lr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Ht.Session.load(this.storage);if(i?.id===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(lr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ht.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(lr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,He.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,He.hexStringFromBuffer)(t,!0),signature:(0,He.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,He.bigIntStringFromBN)(t.weiValue),data:(0,He.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,He.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,He.bigIntStringFromBN)(t.weiValue),data:(0,He.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,He.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,He.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,He.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,He.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,He.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,He.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r?.()};return{promise:new Promise((a,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r?.(),(0,ur.isErrorResponse)(h))return c(new Error(h.errorMessage));a(h)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof P1.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=Ht.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(lr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ht.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(lr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ht.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(lr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){$t.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),$t.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const a=(s=n?.message)!==null&&s!==void 0?s:(0,jr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,He.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,ur.isErrorResponse)(c))return a(new Error(c.errorMessage));s(c)}),this.ui.inlineAccountsResponse()){const c=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=jr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}$t.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,He.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,c)=>{this.relayEventManager.callbacks.set(n,d=>{if((0,ur.isErrorResponse)(d))return c(new Error(d.errorMessage));a(d)});const h=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:T1.ProviderType.Unselected}})},f=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:d}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:f,onCancel:h,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,a){const c={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const f=(0,He.randomBytesHex)(8),d=m=>{this.publishWeb3RequestCanceledEvent(f),this.handleErrorResponse(f,c.method,m),h?.()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}));const y=new Promise((m,C)=>{this.relayEventManager.callbacks.set(f,L=>{if(h?.(),(0,ur.isErrorResponse)(L))return C(new Error(L.errorMessage));m(L)});const P=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f,response:{method:"watchAsset",result:!1}})},N=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:N,onCancel:P,type:t,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(f,c)});return{cancel:d,promise:y}}addEthereumChain(t,r,n,i,s,a){const c={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const f=(0,He.randomBytesHex)(8),d=m=>{this.publishWeb3RequestCanceledEvent(f),this.handleErrorResponse(f,c.method,m),h?.()};return this.ui.inlineAddEthereumChain(t)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload})),{promise:new Promise((m,C)=>{this.relayEventManager.callbacks.set(f,L=>{if(h?.(),(0,ur.isErrorResponse)(L))return C(new Error(L.errorMessage));m(L)});const P=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},N=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:L}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:P,onApprove:N,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(f,c)}),cancel:d}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,He.randomBytesHex)(8),s=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,h)=>{this.relayEventManager.callbacks.set(i,y=>{if((0,ur.isErrorResponse)(y)&&y.errorCode)return h(jr.standardErrors.provider.custom({code:y.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,ur.isErrorResponse)(y))return h(new Error(y.errorMessage));c(y)});const f=y=>{var m;if(y){const C=(m=(0,jr.getErrorCode)(y))!==null&&m!==void 0?m:jr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",y instanceof Error?y:jr.standardErrors.provider.unsupportedChain(t),C)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},d=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:y}}})};this.ui.switchEthereumChain({onCancel:f,onApprove:d,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Ht.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Bn.WalletLinkRelay=$t;$t.accountRequestCallbackIds=new Set;var qn={},os={},_u={};(function(e){var t=G&&G.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=G&&G.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Zo,e)})(_u);var Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Eu=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(os,"__esModule",{value:!0});os.RedirectDialog=void 0;const L1=Eu(Vn),It=st,O1=Wn,$1=_u,B1=Eu(Qo);class F1{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,O1.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,It.render)(null,this.root),t&&(0,It.render)((0,It.h)(D1,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}os.RedirectDialog=F1;const D1=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,It.h)($1.SnackbarContainer,{darkMode:r},(0,It.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,It.h)("style",null,B1.default),(0,It.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,It.h)("div",{class:(0,L1.default)("-cbwsdk-redirect-dialog-box",s)},(0,It.h)("p",null,e),(0,It.h)("button",{onClick:n},t))))};Object.defineProperty(qn,"__esModule",{value:!0});qn.MobileRelayUI=void 0;const j1=os;class U1{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new j1.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}qn.MobileRelayUI=U1;Object.defineProperty($n,"__esModule",{value:!0});$n.MobileRelay=void 0;const H1=q,W1=Bn,V1=qn;class q1 extends W1.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,H1.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof V1.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}$n.MobileRelay=q1;var To={exports:{}},Su=Qr.EventEmitter,Xs,fc;function z1(){if(fc)return Xs;fc=1;function e(P,N){var L=Object.keys(P);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(P);N&&(M=M.filter(function(I){return Object.getOwnPropertyDescriptor(P,I).enumerable})),L.push.apply(L,M)}return L}function t(P){for(var N=1;N<arguments.length;N++){var L=arguments[N]!=null?arguments[N]:{};N%2?e(Object(L),!0).forEach(function(M){r(P,M,L[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(L)):e(Object(L)).forEach(function(M){Object.defineProperty(P,M,Object.getOwnPropertyDescriptor(L,M))})}return P}function r(P,N,L){return N=a(N),N in P?Object.defineProperty(P,N,{value:L,enumerable:!0,configurable:!0,writable:!0}):P[N]=L,P}function n(P,N){if(!(P instanceof N))throw new TypeError("Cannot call a class as a function")}function i(P,N){for(var L=0;L<N.length;L++){var M=N[L];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(P,a(M.key),M)}}function s(P,N,L){return N&&i(P.prototype,N),Object.defineProperty(P,"prototype",{writable:!1}),P}function a(P){var N=c(P,"string");return typeof N=="symbol"?N:String(N)}function c(P,N){if(typeof P!="object"||P===null)return P;var L=P[Symbol.toPrimitive];if(L!==void 0){var M=L.call(P,N||"default");if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(N==="string"?String:Number)(P)}var h=Tn,f=h.Buffer,d=Qr,y=d.inspect,m=y&&y.custom||"inspect";function C(P,N,L){f.prototype.copy.call(P,N,L)}return Xs=function(){function P(){n(this,P),this.head=null,this.tail=null,this.length=0}return s(P,[{key:"push",value:function(L){var M={data:L,next:null};this.length>0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(L){var M={data:L,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var M=this.head,I=""+M.data;M=M.next;)I+=L+M.data;return I}},{key:"concat",value:function(L){if(this.length===0)return f.alloc(0);for(var M=f.allocUnsafe(L>>>0),I=this.head,T=0;I;)C(I.data,M,T),T+=I.data.length,I=I.next;return M}},{key:"consume",value:function(L,M){var I;return L<this.head.data.length?(I=this.head.data.slice(0,L),this.head.data=this.head.data.slice(L)):L===this.head.data.length?I=this.shift():I=M?this._getString(L):this._getBuffer(L),I}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(L){var M=this.head,I=1,T=M.data;for(L-=T.length;M=M.next;){var $=M.data,O=L>$.length?$.length:L;if(O===$.length?T+=$:T+=$.slice(0,L),L-=O,L===0){O===$.length?(++I,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=$.slice(O));break}++I}return this.length-=I,T}},{key:"_getBuffer",value:function(L){var M=f.allocUnsafe(L),I=this.head,T=1;for(I.data.copy(M),L-=I.data.length;I=I.next;){var $=I.data,O=L>$.length?$.length:L;if($.copy(M,M.length-L,0,O),L-=O,L===0){O===$.length?(++T,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=$.slice(O));break}++T}return this.length-=T,M}},{key:m,value:function(L,M){return y(this,t(t({},M),{},{depth:0,customInspect:!1}))}}]),P}(),Xs}function G1(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,de.nextTick(No,this,e)):de.nextTick(No,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?de.nextTick(Ri,r):(r._writableState.errorEmitted=!0,de.nextTick(pc,r,s)):de.nextTick(pc,r,s):t?(de.nextTick(Ri,r),t(s)):de.nextTick(Ri,r)}),this)}function pc(e,t){No(e,t),Ri(e)}function Ri(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function J1(){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 No(e,t){e.emit("error",t)}function Z1(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Ru={destroy:G1,undestroy:J1,errorOrDestroy:Z1},_r={};function K1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Mu={};function yt(e,t,r){r||(r=Error);function n(s,a,c){return typeof t=="string"?t:t(s,a,c)}var i=function(s){K1(a,s);function a(c,h,f){return s.call(this,n(c,h,f))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,Mu[e]=i}function gc(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Q1(e,t,r){return e.substr(0,t.length)===t}function Y1(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function X1(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}yt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);yt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&Q1(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Y1(e," argument"))i="The ".concat(e," ").concat(n," ").concat(gc(t,"type"));else{var s=X1(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(gc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);yt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");yt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});yt("ERR_STREAM_PREMATURE_CLOSE","Premature close");yt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});yt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");yt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");yt("ERR_STREAM_WRITE_AFTER_END","write after end");yt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);yt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);yt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");_r.codes=Mu;var eg=_r.codes.ERR_INVALID_OPT_VALUE;function tg(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function rg(e,t,r,n){var i=tg(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new eg(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Cu={getHighWaterMark:rg},ng=ig;function ig(e,t){if(eo("noDeprecation"))return e;var r=!1;function n(){if(!r){if(eo("throwDeprecation"))throw new Error(t);eo("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function eo(e){try{if(!G.localStorage)return!1}catch{return!1}var t=G.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var to,mc;function ku(){if(mc)return to;mc=1,to=z;function e(k){var x=this;this.next=null,this.entry=null,this.finish=function(){U(x,k)}}var t;z.WritableState=F;var r={deprecate:ng},n=Su,i=Tn.Buffer,s=(typeof G<"u"?G:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(k){return i.from(k)}function c(k){return i.isBuffer(k)||k instanceof s}var h=Ru,f=Cu,d=f.getHighWaterMark,y=_r.codes,m=y.ERR_INVALID_ARG_TYPE,C=y.ERR_METHOD_NOT_IMPLEMENTED,P=y.ERR_MULTIPLE_CALLBACK,N=y.ERR_STREAM_CANNOT_PIPE,L=y.ERR_STREAM_DESTROYED,M=y.ERR_STREAM_NULL_VALUES,I=y.ERR_STREAM_WRITE_AFTER_END,T=y.ERR_UNKNOWN_ENCODING,$=h.errorOrDestroy;_t(z,n);function O(){}function F(k,x,B){t=t||rn(),k=k||{},typeof B!="boolean"&&(B=x instanceof t),this.objectMode=!!k.objectMode,B&&(this.objectMode=this.objectMode||!!k.writableObjectMode),this.highWaterMark=d(this,k,"writableHighWaterMark",B),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var H=k.decodeStrings===!1;this.decodeStrings=!H,this.defaultEncoding=k.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ee){p(x,ee)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}F.prototype.getBuffer=function(){for(var x=this.bufferedRequest,B=[];x;)B.push(x),x=x.next;return B},function(){try{Object.defineProperty(F.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var J;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(J=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(x){return J.call(this,x)?!0:this!==z?!1:x&&x._writableState instanceof F}})):J=function(x){return x instanceof this};function z(k){t=t||rn();var x=this instanceof t;if(!x&&!J.call(z,this))return new z(k);this._writableState=new F(k,this,x),this.writable=!0,k&&(typeof k.write=="function"&&(this._write=k.write),typeof k.writev=="function"&&(this._writev=k.writev),typeof k.destroy=="function"&&(this._destroy=k.destroy),typeof k.final=="function"&&(this._final=k.final)),n.call(this)}z.prototype.pipe=function(){$(this,new N)};function V(k,x){var B=new I;$(k,B),de.nextTick(x,B)}function ie(k,x,B,H){var ee;return B===null?ee=new M:typeof B!="string"&&!x.objectMode&&(ee=new m("chunk",["string","Buffer"],B)),ee?($(k,ee),de.nextTick(H,ee),!1):!0}z.prototype.write=function(k,x,B){var H=this._writableState,ee=!1,_=!H.objectMode&&c(k);return _&&!i.isBuffer(k)&&(k=a(k)),typeof x=="function"&&(B=x,x=null),_?x="buffer":x||(x=H.defaultEncoding),typeof B!="function"&&(B=O),H.ending?V(this,B):(_||ie(this,H,k,B))&&(H.pendingcb++,ee=oe(this,H,_,k,x,B)),ee},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){var k=this._writableState;k.corked&&(k.corked--,!k.writing&&!k.corked&&!k.bufferProcessing&&k.bufferedRequest&&S(this,k))},z.prototype.setDefaultEncoding=function(x){if(typeof x=="string"&&(x=x.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((x+"").toLowerCase())>-1))throw new T(x);return this._writableState.defaultEncoding=x,this},Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(k,x,B){return!k.objectMode&&k.decodeStrings!==!1&&typeof x=="string"&&(x=i.from(x,B)),x}Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function oe(k,x,B,H,ee,_){if(!B){var E=Q(x,H,ee);H!==E&&(B=!0,ee="buffer",H=E)}var D=x.objectMode?1:H.length;x.length+=D;var j=x.length<x.highWaterMark;if(j||(x.needDrain=!0),x.writing||x.corked){var K=x.lastBufferedRequest;x.lastBufferedRequest={chunk:H,encoding:ee,isBuf:B,callback:_,next:null},K?K.next=x.lastBufferedRequest:x.bufferedRequest=x.lastBufferedRequest,x.bufferedRequestCount+=1}else R(k,x,!1,D,H,ee,_);return j}function R(k,x,B,H,ee,_,E){x.writelen=H,x.writecb=E,x.writing=!0,x.sync=!0,x.destroyed?x.onwrite(new L("write")):B?k._writev(ee,x.onwrite):k._write(ee,_,x.onwrite),x.sync=!1}function o(k,x,B,H,ee){--x.pendingcb,B?(de.nextTick(ee,H),de.nextTick(w,k,x),k._writableState.errorEmitted=!0,$(k,H)):(ee(H),k._writableState.errorEmitted=!0,$(k,H),w(k,x))}function u(k){k.writing=!1,k.writecb=null,k.length-=k.writelen,k.writelen=0}function p(k,x){var B=k._writableState,H=B.sync,ee=B.writecb;if(typeof ee!="function")throw new P;if(u(B),x)o(k,B,H,x,ee);else{var _=A(B)||k.destroyed;!_&&!B.corked&&!B.bufferProcessing&&B.bufferedRequest&&S(k,B),H?de.nextTick(g,k,B,_,ee):g(k,B,_,ee)}}function g(k,x,B,H){B||b(k,x),x.pendingcb--,H(),w(k,x)}function b(k,x){x.length===0&&x.needDrain&&(x.needDrain=!1,k.emit("drain"))}function S(k,x){x.bufferProcessing=!0;var B=x.bufferedRequest;if(k._writev&&B&&B.next){var H=x.bufferedRequestCount,ee=new Array(H),_=x.corkedRequestsFree;_.entry=B;for(var E=0,D=!0;B;)ee[E]=B,B.isBuf||(D=!1),B=B.next,E+=1;ee.allBuffers=D,R(k,x,!0,x.length,ee,"",_.finish),x.pendingcb++,x.lastBufferedRequest=null,_.next?(x.corkedRequestsFree=_.next,_.next=null):x.corkedRequestsFree=new e(x),x.bufferedRequestCount=0}else{for(;B;){var j=B.chunk,K=B.encoding,X=B.callback,Z=x.objectMode?1:j.length;if(R(k,x,!1,Z,j,K,X),B=B.next,x.bufferedRequestCount--,x.writing)break}B===null&&(x.lastBufferedRequest=null)}x.bufferedRequest=B,x.bufferProcessing=!1}z.prototype._write=function(k,x,B){B(new C("_write()"))},z.prototype._writev=null,z.prototype.end=function(k,x,B){var H=this._writableState;return typeof k=="function"?(B=k,k=null,x=null):typeof x=="function"&&(B=x,x=null),k!=null&&this.write(k,x),H.corked&&(H.corked=1,this.uncork()),H.ending||W(this,H,B),this},Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function A(k){return k.ending&&k.length===0&&k.bufferedRequest===null&&!k.finished&&!k.writing}function v(k,x){k._final(function(B){x.pendingcb--,B&&$(k,B),x.prefinished=!0,k.emit("prefinish"),w(k,x)})}function l(k,x){!x.prefinished&&!x.finalCalled&&(typeof k._final=="function"&&!x.destroyed?(x.pendingcb++,x.finalCalled=!0,de.nextTick(v,k,x)):(x.prefinished=!0,k.emit("prefinish")))}function w(k,x){var B=A(x);if(B&&(l(k,x),x.pendingcb===0&&(x.finished=!0,k.emit("finish"),x.autoDestroy))){var H=k._readableState;(!H||H.autoDestroy&&H.endEmitted)&&k.destroy()}return B}function W(k,x,B){x.ending=!0,w(k,x),B&&(x.finished?de.nextTick(B):k.once("finish",B)),x.ended=!0,k.writable=!1}function U(k,x,B){var H=k.entry;for(k.entry=null;H;){var ee=H.callback;x.pendingcb--,ee(B),H=H.next}x.corkedRequestsFree.next=k}return Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(x){this._writableState&&(this._writableState.destroyed=x)}}),z.prototype.destroy=h.destroy,z.prototype._undestroy=h.undestroy,z.prototype._destroy=function(k,x){x(k)},to}var ro,yc;function rn(){if(yc)return ro;yc=1;var e=Object.keys||function(f){var d=[];for(var y in f)d.push(y);return d};ro=a;var t=Iu(),r=ku();_t(a,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];a.prototype[s]||(a.prototype[s]=r.prototype[s])}function a(f){if(!(this instanceof a))return new a(f);t.call(this,f),r.call(this,f),this.allowHalfOpen=!0,f&&(f.readable===!1&&(this.readable=!1),f.writable===!1&&(this.writable=!1),f.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",c)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function c(){this._writableState.ended||de.nextTick(h,this)}function h(f){f.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),ro}var no={},vc;function bc(){if(vc)return no;vc=1;var e=Dt.Buffer,t=e.isEncoding||function(M){switch(M=""+M,M&&M.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(M){if(!M)return"utf8";for(var I;;)switch(M){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 M;default:if(I)return;M=(""+M).toLowerCase(),I=!0}}function n(M){var I=r(M);if(typeof I!="string"&&(e.isEncoding===t||!t(M)))throw new Error("Unknown encoding: "+M);return I||M}no.StringDecoder=i;function i(M){this.encoding=n(M);var I;switch(this.encoding){case"utf16le":this.text=y,this.end=m,I=4;break;case"utf8":this.fillLast=h,I=4;break;case"base64":this.text=C,this.end=P,I=3;break;default:this.write=N,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(I)}i.prototype.write=function(M){if(M.length===0)return"";var I,T;if(this.lastNeed){if(I=this.fillLast(M),I===void 0)return"";T=this.lastNeed,this.lastNeed=0}else T=0;return T<M.length?I?I+this.text(M,T):this.text(M,T):I||""},i.prototype.end=d,i.prototype.text=f,i.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length};function s(M){return M<=127?0:M>>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function a(M,I,T){var $=I.length-1;if($<T)return 0;var O=s(I[$]);return O>=0?(O>0&&(M.lastNeed=O-1),O):--$<T||O===-2?0:(O=s(I[$]),O>=0?(O>0&&(M.lastNeed=O-2),O):--$<T||O===-2?0:(O=s(I[$]),O>=0?(O>0&&(O===2?O=0:M.lastNeed=O-3),O):0))}function c(M,I,T){if((I[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&I.length>1){if((I[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&I.length>2&&(I[2]&192)!==128)return M.lastNeed=2,"�"}}function h(M){var I=this.lastTotal-this.lastNeed,T=c(this,M);if(T!==void 0)return T;if(this.lastNeed<=M.length)return M.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,I,0,M.length),this.lastNeed-=M.length}function f(M,I){var T=a(this,M,I);if(!this.lastNeed)return M.toString("utf8",I);this.lastTotal=T;var $=M.length-(T-this.lastNeed);return M.copy(this.lastChar,0,$),M.toString("utf8",I,$)}function d(M){var I=M&&M.length?this.write(M):"";return this.lastNeed?I+"�":I}function y(M,I){if((M.length-I)%2===0){var T=M.toString("utf16le",I);if(T){var $=T.charCodeAt(T.length-1);if($>=55296&&$<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],T.slice(0,-1)}return T}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",I,M.length-1)}function m(M){var I=M&&M.length?this.write(M):"";if(this.lastNeed){var T=this.lastTotal-this.lastNeed;return I+this.lastChar.toString("utf16le",0,T)}return I}function C(M,I){var T=(M.length-I)%3;return T===0?M.toString("base64",I):(this.lastNeed=3-T,this.lastTotal=3,T===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",I,M.length-T))}function P(M){var I=M&&M.length?this.write(M):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function N(M){return M.toString(this.encoding)}function L(M){return M&&M.length?this.write(M):""}return no}var wc=_r.codes.ERR_STREAM_PREMATURE_CLOSE;function sg(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function og(){}function ag(e){return e.setHeader&&typeof e.abort=="function"}function Au(e,t,r){if(typeof t=="function")return Au(e,null,t);t||(t={}),r=sg(r||og);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||c()},a=e._writableState&&e._writableState.finished,c=function(){i=!1,a=!0,n||r.call(e)},h=e._readableState&&e._readableState.endEmitted,f=function(){n=!1,h=!0,i||r.call(e)},d=function(P){r.call(e,P)},y=function(){var P;if(n&&!h)return(!e._readableState||!e._readableState.ended)&&(P=new wc),r.call(e,P);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(P=new wc),r.call(e,P)},m=function(){e.req.on("finish",c)};return ag(e)?(e.on("complete",c),e.on("abort",y),e.req?m():e.on("request",m)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",f),e.on("finish",c),t.error!==!1&&e.on("error",d),e.on("close",y),function(){e.removeListener("complete",c),e.removeListener("abort",y),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",c),e.removeListener("end",f),e.removeListener("error",d),e.removeListener("close",y)}}var Yo=Au,io,_c;function cg(){if(_c)return io;_c=1;var e;function t(T,$,O){return $=r($),$ in T?Object.defineProperty(T,$,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[$]=O,T}function r(T){var $=n(T,"string");return typeof $=="symbol"?$:String($)}function n(T,$){if(typeof T!="object"||T===null)return T;var O=T[Symbol.toPrimitive];if(O!==void 0){var F=O.call(T,$||"default");if(typeof F!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(T)}var i=Yo,s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),h=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),y=Symbol("stream");function m(T,$){return{value:T,done:$}}function C(T){var $=T[s];if($!==null){var O=T[y].read();O!==null&&(T[f]=null,T[s]=null,T[a]=null,$(m(O,!1)))}}function P(T){de.nextTick(C,T)}function N(T,$){return function(O,F){T.then(function(){if($[h]){O(m(void 0,!0));return}$[d](O,F)},F)}}var L=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((e={get stream(){return this[y]},next:function(){var $=this,O=this[c];if(O!==null)return Promise.reject(O);if(this[h])return Promise.resolve(m(void 0,!0));if(this[y].destroyed)return new Promise(function(V,ie){de.nextTick(function(){$[c]?ie($[c]):V(m(void 0,!0))})});var F=this[f],J;if(F)J=new Promise(N(F,this));else{var z=this[y].read();if(z!==null)return Promise.resolve(m(z,!1));J=new Promise(this[d])}return this[f]=J,J}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var $=this;return new Promise(function(O,F){$[y].destroy(null,function(J){if(J){F(J);return}O(m(void 0,!0))})})}),e),L),I=function($){var O,F=Object.create(M,(O={},t(O,y,{value:$,writable:!0}),t(O,s,{value:null,writable:!0}),t(O,a,{value:null,writable:!0}),t(O,c,{value:null,writable:!0}),t(O,h,{value:$._readableState.endEmitted,writable:!0}),t(O,d,{value:function(z,V){var ie=F[y].read();ie?(F[f]=null,F[s]=null,F[a]=null,z(m(ie,!1))):(F[s]=z,F[a]=V)},writable:!0}),O));return F[f]=null,i($,function(J){if(J&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"){var z=F[a];z!==null&&(F[f]=null,F[s]=null,F[a]=null,z(J)),F[c]=J;return}var V=F[s];V!==null&&(F[f]=null,F[s]=null,F[a]=null,V(m(void 0,!0))),F[h]=!0}),$.on("readable",P.bind(null,F)),F};return io=I,io}var so,Ec;function lg(){return Ec||(Ec=1,so=function(){throw new Error("Readable.from is not available in the browser")}),so}var oo,Sc;function Iu(){if(Sc)return oo;Sc=1,oo=V;var e;V.ReadableState=z,Qr.EventEmitter;var t=function(E,D){return E.listeners(D).length},r=Su,n=Tn.Buffer,i=(typeof G<"u"?G:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(_){return n.from(_)}function a(_){return n.isBuffer(_)||_ instanceof i}var c=Qr,h;c&&c.debuglog?h=c.debuglog("stream"):h=function(){};var f=z1(),d=Ru,y=Cu,m=y.getHighWaterMark,C=_r.codes,P=C.ERR_INVALID_ARG_TYPE,N=C.ERR_STREAM_PUSH_AFTER_EOF,L=C.ERR_METHOD_NOT_IMPLEMENTED,M=C.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,I,T,$;_t(V,r);var O=d.errorOrDestroy,F=["error","close","destroy","pause","resume"];function J(_,E,D){if(typeof _.prependListener=="function")return _.prependListener(E,D);!_._events||!_._events[E]?_.on(E,D):Array.isArray(_._events[E])?_._events[E].unshift(D):_._events[E]=[D,_._events[E]]}function z(_,E,D){e=e||rn(),_=_||{},typeof D!="boolean"&&(D=E instanceof e),this.objectMode=!!_.objectMode,D&&(this.objectMode=this.objectMode||!!_.readableObjectMode),this.highWaterMark=m(this,_,"readableHighWaterMark",D),this.buffer=new f,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=_.emitClose!==!1,this.autoDestroy=!!_.autoDestroy,this.destroyed=!1,this.defaultEncoding=_.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,_.encoding&&(I||(I=bc().StringDecoder),this.decoder=new I(_.encoding),this.encoding=_.encoding)}function V(_){if(e=e||rn(),!(this instanceof V))return new V(_);var E=this instanceof e;this._readableState=new z(_,this,E),this.readable=!0,_&&(typeof _.read=="function"&&(this._read=_.read),typeof _.destroy=="function"&&(this._destroy=_.destroy)),r.call(this)}Object.defineProperty(V.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(E){this._readableState&&(this._readableState.destroyed=E)}}),V.prototype.destroy=d.destroy,V.prototype._undestroy=d.undestroy,V.prototype._destroy=function(_,E){E(_)},V.prototype.push=function(_,E){var D=this._readableState,j;return D.objectMode?j=!0:typeof _=="string"&&(E=E||D.defaultEncoding,E!==D.encoding&&(_=n.from(_,E),E=""),j=!0),ie(this,_,E,!1,j)},V.prototype.unshift=function(_){return ie(this,_,null,!0,!1)};function ie(_,E,D,j,K){h("readableAddChunk",E);var X=_._readableState;if(E===null)X.reading=!1,p(_,X);else{var Z;if(K||(Z=oe(X,E)),Z)O(_,Z);else if(X.objectMode||E&&E.length>0)if(typeof E!="string"&&!X.objectMode&&Object.getPrototypeOf(E)!==n.prototype&&(E=s(E)),j)X.endEmitted?O(_,new M):Q(_,X,E,!0);else if(X.ended)O(_,new N);else{if(X.destroyed)return!1;X.reading=!1,X.decoder&&!D?(E=X.decoder.write(E),X.objectMode||E.length!==0?Q(_,X,E,!1):S(_,X)):Q(_,X,E,!1)}else j||(X.reading=!1,S(_,X))}return!X.ended&&(X.length<X.highWaterMark||X.length===0)}function Q(_,E,D,j){E.flowing&&E.length===0&&!E.sync?(E.awaitDrain=0,_.emit("data",D)):(E.length+=E.objectMode?1:D.length,j?E.buffer.unshift(D):E.buffer.push(D),E.needReadable&&g(_)),S(_,E)}function oe(_,E){var D;return!a(E)&&typeof E!="string"&&E!==void 0&&!_.objectMode&&(D=new P("chunk",["string","Buffer","Uint8Array"],E)),D}V.prototype.isPaused=function(){return this._readableState.flowing===!1},V.prototype.setEncoding=function(_){I||(I=bc().StringDecoder);var E=new I(_);this._readableState.decoder=E,this._readableState.encoding=this._readableState.decoder.encoding;for(var D=this._readableState.buffer.head,j="";D!==null;)j+=E.write(D.data),D=D.next;return this._readableState.buffer.clear(),j!==""&&this._readableState.buffer.push(j),this._readableState.length=j.length,this};var R=1073741824;function o(_){return _>=R?_=R:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}function u(_,E){return _<=0||E.length===0&&E.ended?0:E.objectMode?1:_!==_?E.flowing&&E.length?E.buffer.head.data.length:E.length:(_>E.highWaterMark&&(E.highWaterMark=o(_)),_<=E.length?_:E.ended?E.length:(E.needReadable=!0,0))}V.prototype.read=function(_){h("read",_),_=parseInt(_,10);var E=this._readableState,D=_;if(_!==0&&(E.emittedReadable=!1),_===0&&E.needReadable&&((E.highWaterMark!==0?E.length>=E.highWaterMark:E.length>0)||E.ended))return h("read: emitReadable",E.length,E.ended),E.length===0&&E.ended?B(this):g(this),null;if(_=u(_,E),_===0&&E.ended)return E.length===0&&B(this),null;var j=E.needReadable;h("need readable",j),(E.length===0||E.length-_<E.highWaterMark)&&(j=!0,h("length less than watermark",j)),E.ended||E.reading?(j=!1,h("reading or ended",j)):j&&(h("do read"),E.reading=!0,E.sync=!0,E.length===0&&(E.needReadable=!0),this._read(E.highWaterMark),E.sync=!1,E.reading||(_=u(D,E)));var K;return _>0?K=x(_,E):K=null,K===null?(E.needReadable=E.length<=E.highWaterMark,_=0):(E.length-=_,E.awaitDrain=0),E.length===0&&(E.ended||(E.needReadable=!0),D!==_&&E.ended&&B(this)),K!==null&&this.emit("data",K),K};function p(_,E){if(h("onEofChunk"),!E.ended){if(E.decoder){var D=E.decoder.end();D&&D.length&&(E.buffer.push(D),E.length+=E.objectMode?1:D.length)}E.ended=!0,E.sync?g(_):(E.needReadable=!1,E.emittedReadable||(E.emittedReadable=!0,b(_)))}}function g(_){var E=_._readableState;h("emitReadable",E.needReadable,E.emittedReadable),E.needReadable=!1,E.emittedReadable||(h("emitReadable",E.flowing),E.emittedReadable=!0,de.nextTick(b,_))}function b(_){var E=_._readableState;h("emitReadable_",E.destroyed,E.length,E.ended),!E.destroyed&&(E.length||E.ended)&&(_.emit("readable"),E.emittedReadable=!1),E.needReadable=!E.flowing&&!E.ended&&E.length<=E.highWaterMark,k(_)}function S(_,E){E.readingMore||(E.readingMore=!0,de.nextTick(A,_,E))}function A(_,E){for(;!E.reading&&!E.ended&&(E.length<E.highWaterMark||E.flowing&&E.length===0);){var D=E.length;if(h("maybeReadMore read 0"),_.read(0),D===E.length)break}E.readingMore=!1}V.prototype._read=function(_){O(this,new L("_read()"))},V.prototype.pipe=function(_,E){var D=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=_;break;case 1:j.pipes=[j.pipes,_];break;default:j.pipes.push(_);break}j.pipesCount+=1,h("pipe count=%d opts=%j",j.pipesCount,E);var K=(!E||E.end!==!1)&&_!==de.stdout&&_!==de.stderr,X=K?ue:fe;j.endEmitted?de.nextTick(X):D.once("end",X),_.on("unpipe",Z);function Z(he,at){h("onunpipe"),he===D&&at&&at.hasUnpiped===!1&&(at.hasUnpiped=!0,ye())}function ue(){h("onend"),_.end()}var Rt=v(D);_.on("drain",Rt);var me=!1;function ye(){h("cleanup"),_.removeListener("close",ge),_.removeListener("finish",Lt),_.removeListener("drain",Rt),_.removeListener("error",pe),_.removeListener("unpipe",Z),D.removeListener("end",ue),D.removeListener("end",fe),D.removeListener("data",jt),me=!0,j.awaitDrain&&(!_._writableState||_._writableState.needDrain)&&Rt()}D.on("data",jt);function jt(he){h("ondata");var at=_.write(he);h("dest.write",at),at===!1&&((j.pipesCount===1&&j.pipes===_||j.pipesCount>1&&ee(j.pipes,_)!==-1)&&!me&&(h("false write response, pause",j.awaitDrain),j.awaitDrain++),D.pause())}function pe(he){h("onerror",he),fe(),_.removeListener("error",pe),t(_,"error")===0&&O(_,he)}J(_,"error",pe);function ge(){_.removeListener("finish",Lt),fe()}_.once("close",ge);function Lt(){h("onfinish"),_.removeListener("close",ge),fe()}_.once("finish",Lt);function fe(){h("unpipe"),D.unpipe(_)}return _.emit("pipe",D),j.flowing||(h("pipe resume"),D.resume()),_};function v(_){return function(){var D=_._readableState;h("pipeOnDrain",D.awaitDrain),D.awaitDrain&&D.awaitDrain--,D.awaitDrain===0&&t(_,"data")&&(D.flowing=!0,k(_))}}V.prototype.unpipe=function(_){var E=this._readableState,D={hasUnpiped:!1};if(E.pipesCount===0)return this;if(E.pipesCount===1)return _&&_!==E.pipes?this:(_||(_=E.pipes),E.pipes=null,E.pipesCount=0,E.flowing=!1,_&&_.emit("unpipe",this,D),this);if(!_){var j=E.pipes,K=E.pipesCount;E.pipes=null,E.pipesCount=0,E.flowing=!1;for(var X=0;X<K;X++)j[X].emit("unpipe",this,{hasUnpiped:!1});return this}var Z=ee(E.pipes,_);return Z===-1?this:(E.pipes.splice(Z,1),E.pipesCount-=1,E.pipesCount===1&&(E.pipes=E.pipes[0]),_.emit("unpipe",this,D),this)},V.prototype.on=function(_,E){var D=r.prototype.on.call(this,_,E),j=this._readableState;return _==="data"?(j.readableListening=this.listenerCount("readable")>0,j.flowing!==!1&&this.resume()):_==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,h("on readable",j.length,j.reading),j.length?g(this):j.reading||de.nextTick(w,this)),D},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(_,E){var D=r.prototype.removeListener.call(this,_,E);return _==="readable"&&de.nextTick(l,this),D},V.prototype.removeAllListeners=function(_){var E=r.prototype.removeAllListeners.apply(this,arguments);return(_==="readable"||_===void 0)&&de.nextTick(l,this),E};function l(_){var E=_._readableState;E.readableListening=_.listenerCount("readable")>0,E.resumeScheduled&&!E.paused?E.flowing=!0:_.listenerCount("data")>0&&_.resume()}function w(_){h("readable nexttick read 0"),_.read(0)}V.prototype.resume=function(){var _=this._readableState;return _.flowing||(h("resume"),_.flowing=!_.readableListening,W(this,_)),_.paused=!1,this};function W(_,E){E.resumeScheduled||(E.resumeScheduled=!0,de.nextTick(U,_,E))}function U(_,E){h("resume",E.reading),E.reading||_.read(0),E.resumeScheduled=!1,_.emit("resume"),k(_),E.flowing&&!E.reading&&_.read(0)}V.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function k(_){var E=_._readableState;for(h("flow",E.flowing);E.flowing&&_.read()!==null;);}V.prototype.wrap=function(_){var E=this,D=this._readableState,j=!1;_.on("end",function(){if(h("wrapped end"),D.decoder&&!D.ended){var Z=D.decoder.end();Z&&Z.length&&E.push(Z)}E.push(null)}),_.on("data",function(Z){if(h("wrapped data"),D.decoder&&(Z=D.decoder.write(Z)),!(D.objectMode&&Z==null)&&!(!D.objectMode&&(!Z||!Z.length))){var ue=E.push(Z);ue||(j=!0,_.pause())}});for(var K in _)this[K]===void 0&&typeof _[K]=="function"&&(this[K]=function(ue){return function(){return _[ue].apply(_,arguments)}}(K));for(var X=0;X<F.length;X++)_.on(F[X],this.emit.bind(this,F[X]));return this._read=function(Z){h("wrapped _read",Z),j&&(j=!1,_.resume())},this},typeof Symbol=="function"&&(V.prototype[Symbol.asyncIterator]=function(){return T===void 0&&(T=cg()),T(this)}),Object.defineProperty(V.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(V.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(V.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(E){this._readableState&&(this._readableState.flowing=E)}}),V._fromList=x,Object.defineProperty(V.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function x(_,E){if(E.length===0)return null;var D;return E.objectMode?D=E.buffer.shift():!_||_>=E.length?(E.decoder?D=E.buffer.join(""):E.buffer.length===1?D=E.buffer.first():D=E.buffer.concat(E.length),E.buffer.clear()):D=E.buffer.consume(_,E.decoder),D}function B(_){var E=_._readableState;h("endReadable",E.endEmitted),E.endEmitted||(E.ended=!0,de.nextTick(H,E,_))}function H(_,E){if(h("endReadableNT",_.endEmitted,_.length),!_.endEmitted&&_.length===0&&(_.endEmitted=!0,E.readable=!1,E.emit("end"),_.autoDestroy)){var D=E._writableState;(!D||D.autoDestroy&&D.finished)&&E.destroy()}}typeof Symbol=="function"&&(V.from=function(_,E){return $===void 0&&($=lg()),$(V,_,E)});function ee(_,E){for(var D=0,j=_.length;D<j;D++)if(_[D]===E)return D;return-1}return oo}var xu=Ft,as=_r.codes,ug=as.ERR_METHOD_NOT_IMPLEMENTED,hg=as.ERR_MULTIPLE_CALLBACK,dg=as.ERR_TRANSFORM_ALREADY_TRANSFORMING,fg=as.ERR_TRANSFORM_WITH_LENGTH_0,cs=rn();_t(Ft,cs);function pg(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new hg);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ft(e){if(!(this instanceof Ft))return new Ft(e);cs.call(this,e),this._transformState={afterTransform:pg.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",gg)}function gg(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Rc(e,t,r)}):Rc(this,null,null)}Ft.prototype.push=function(e,t){return this._transformState.needTransform=!1,cs.prototype.push.call(this,e,t)};Ft.prototype._transform=function(e,t,r){r(new ug("_transform()"))};Ft.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ft.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Ft.prototype._destroy=function(e,t){cs.prototype._destroy.call(this,e,function(r){t(r)})};function Rc(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new fg;if(e._transformState.transforming)throw new dg;return e.push(null)}var mg=Rn,Tu=xu;_t(Rn,Tu);function Rn(e){if(!(this instanceof Rn))return new Rn(e);Tu.call(this,e)}Rn.prototype._transform=function(e,t,r){r(null,e)};var ao;function yg(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Nu=_r.codes,vg=Nu.ERR_MISSING_ARGS,bg=Nu.ERR_STREAM_DESTROYED;function Mc(e){if(e)throw e}function wg(e){return e.setHeader&&typeof e.abort=="function"}function _g(e,t,r,n){n=yg(n);var i=!1;e.on("close",function(){i=!0}),ao===void 0&&(ao=Yo),ao(e,{readable:t,writable:r},function(a){if(a)return n(a);i=!0,n()});var s=!1;return function(a){if(!i&&!s){if(s=!0,wg(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new bg("pipe"))}}}function Cc(e){e()}function Eg(e,t){return e.pipe(t)}function Sg(e){return!e.length||typeof e[e.length-1]!="function"?Mc:e.pop()}function Rg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Sg(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new vg("streams");var i,s=t.map(function(a,c){var h=c<t.length-1,f=c>0;return _g(a,h,f,function(d){i||(i=d),d&&s.forEach(Cc),!h&&(s.forEach(Cc),n(i))})});return t.reduce(Eg)}var Mg=Rg;(function(e,t){t=e.exports=Iu(),t.Stream=t,t.Readable=t,t.Writable=ku(),t.Duplex=rn(),t.Transform=xu,t.PassThrough=mg,t.finished=Yo,t.pipeline=Mg})(To,To.exports);var Pu=To.exports;const{Transform:Cg}=Pu;var kg=e=>class Lu extends Cg{constructor(r,n,i,s,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!re.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return re.isBuffer(r)||(r=re.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Lu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Ag}=Pu;var Ig=e=>class Ou extends Ag{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!re.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return re.isBuffer(r)||(r=re.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Ou(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const xg=kg,Tg=Ig;var Ng=function(e){const t=xg(e),r=Tg(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},$u={};const kc=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];$u.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],y=e[9]^e[19]^e[29]^e[39]^e[49];let m=d^(i<<1|s>>>31),C=y^(s<<1|i>>>31);const P=e[0]^m,N=e[1]^C,L=e[10]^m,M=e[11]^C,I=e[20]^m,T=e[21]^C,$=e[30]^m,O=e[31]^C,F=e[40]^m,J=e[41]^C;m=r^(a<<1|c>>>31),C=n^(c<<1|a>>>31);const z=e[2]^m,V=e[3]^C,ie=e[12]^m,Q=e[13]^C,oe=e[22]^m,R=e[23]^C,o=e[32]^m,u=e[33]^C,p=e[42]^m,g=e[43]^C;m=i^(h<<1|f>>>31),C=s^(f<<1|h>>>31);const b=e[4]^m,S=e[5]^C,A=e[14]^m,v=e[15]^C,l=e[24]^m,w=e[25]^C,W=e[34]^m,U=e[35]^C,k=e[44]^m,x=e[45]^C;m=a^(d<<1|y>>>31),C=c^(y<<1|d>>>31);const B=e[6]^m,H=e[7]^C,ee=e[16]^m,_=e[17]^C,E=e[26]^m,D=e[27]^C,j=e[36]^m,K=e[37]^C,X=e[46]^m,Z=e[47]^C;m=h^(r<<1|n>>>31),C=f^(n<<1|r>>>31);const ue=e[8]^m,Rt=e[9]^C,me=e[18]^m,ye=e[19]^C,jt=e[28]^m,pe=e[29]^C,ge=e[38]^m,Lt=e[39]^C,fe=e[48]^m,he=e[49]^C,at=P,ve=N,be=M<<4|L>>>28,Rr=L<<4|M>>>28,we=I<<3|T>>>29,_e=T<<3|I>>>29,Mr=O<<9|$>>>23,Ee=$<<9|O>>>23,Se=F<<18|J>>>14,Cr=J<<18|F>>>14,Re=z<<1|V>>>31,Me=V<<1|z>>>31,kr=Q<<12|ie>>>20,Ce=ie<<12|Q>>>20,ke=oe<<10|R>>>22,Ar=R<<10|oe>>>22,Ae=u<<13|o>>>19,Ie=o<<13|u>>>19,Ir=p<<2|g>>>30,xe=g<<2|p>>>30,Te=S<<30|b>>>2,xr=b<<30|S>>>2,Ne=A<<6|v>>>26,Pe=v<<6|A>>>26,Tr=w<<11|l>>>21,Le=l<<11|w>>>21,Oe=W<<15|U>>>17,Nr=U<<15|W>>>17,$e=x<<29|k>>>3,Be=k<<29|x>>>3,Pr=B<<28|H>>>4,Fe=H<<28|B>>>4,De=_<<23|ee>>>9,Lr=ee<<23|_>>>9,je=E<<25|D>>>7,Ue=D<<25|E>>>7,Gt=j<<21|K>>>11,Jt=K<<21|j>>>11,Zt=Z<<24|X>>>8,Kt=X<<24|Z>>>8,Qt=ue<<27|Rt>>>5,Yt=Rt<<27|ue>>>5,Xt=me<<20|ye>>>12,er=ye<<20|me>>>12,tr=pe<<7|jt>>>25,rr=jt<<7|pe>>>25,nr=ge<<8|Lt>>>24,ir=Lt<<8|ge>>>24,sr=fe<<14|he>>>18,or=he<<14|fe>>>18;e[0]=at^~kr&Tr,e[1]=ve^~Ce&Le,e[10]=Pr^~Xt&we,e[11]=Fe^~er&_e,e[20]=Re^~Ne&je,e[21]=Me^~Pe&Ue,e[30]=Qt^~be&ke,e[31]=Yt^~Rr&Ar,e[40]=Te^~De&tr,e[41]=xr^~Lr&rr,e[2]=kr^~Tr&Gt,e[3]=Ce^~Le&Jt,e[12]=Xt^~we&Ae,e[13]=er^~_e&Ie,e[22]=Ne^~je&nr,e[23]=Pe^~Ue&ir,e[32]=be^~ke&Oe,e[33]=Rr^~Ar&Nr,e[42]=De^~tr&Mr,e[43]=Lr^~rr&Ee,e[4]=Tr^~Gt&sr,e[5]=Le^~Jt&or,e[14]=we^~Ae&$e,e[15]=_e^~Ie&Be,e[24]=je^~nr&Se,e[25]=Ue^~ir&Cr,e[34]=ke^~Oe&Zt,e[35]=Ar^~Nr&Kt,e[44]=tr^~Mr&Ir,e[45]=rr^~Ee&xe,e[6]=Gt^~sr&at,e[7]=Jt^~or&ve,e[16]=Ae^~$e&Pr,e[17]=Ie^~Be&Fe,e[26]=nr^~Se&Re,e[27]=ir^~Cr&Me,e[36]=Oe^~Zt&Qt,e[37]=Nr^~Kt&Yt,e[46]=Mr^~Ir&Te,e[47]=Ee^~xe&xr,e[8]=sr^~at&kr,e[9]=or^~ve&Ce,e[18]=$e^~Pr&Xt,e[19]=Be^~Fe&er,e[28]=Se^~Re&Ne,e[29]=Cr^~Me&Pe,e[38]=Zt^~Qt&be,e[39]=Kt^~Yt&Rr,e[48]=Ir^~Te&De,e[49]=xe^~xr&Lr,e[0]^=kc[t*2],e[1]^=kc[t*2+1]}};const Ti=$u;function dn(){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}dn.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};dn.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Ti.p1600(this.state),this.count=0)};dn.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&Ti.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Ti.p1600(this.state),this.count=0,this.squeezing=!0};dn.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=re.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Ti.p1600(this.state),this.count=0);return t};dn.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Pg=dn,Lg=Ng(Pg);const Og=Lg,$g=$i;function Bu(e){return re.allocUnsafe(e).fill(0)}function Fu(e,t,r){const n=Bu(t);return e=ls(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Bg(e,t){return Fu(e,t,!0)}function ls(e){if(!re.isBuffer(e))if(Array.isArray(e))e=re.from(e);else if(typeof e=="string")Du(e)?e=re.from(jg(ju(e)),"hex"):e=re.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=re.allocUnsafe(0);else if($g.isBN(e))e=e.toArrayLike(re);else if(e.toArray)e=re.from(e.toArray());else throw new Error("invalid type");return e}function Fg(e){return e=ls(e),"0x"+e.toString("hex")}function Dg(e,t){return e=ls(e),t||(t=256),Og("keccak"+t).update(e).digest()}function jg(e){return e.length%2?"0"+e:e}function Du(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function ju(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var Uu={zeros:Bu,setLength:Fu,setLengthRight:Bg,isHexString:Du,stripHexPrefix:ju,toBuffer:ls,bufferToHex:Fg,keccak:Dg};const vr=Uu,pr=$i;function Hu(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Zr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Ac(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Wu(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function hr(e){var t=typeof e;if(t==="string")return vr.isHexString(e)?new pr(vr.stripHexPrefix(e),16):new pr(e,10);if(t==="number")return new pr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function At(e,t){var r,n,i,s;if(e==="address")return At("uint160",hr(t));if(e==="bool")return At("uint8",t?1:0);if(e==="string")return At("bytes",new re(t,"utf8"));if(Hg(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Wu(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(At(e,t[s]));if(r==="dynamic"){var a=At("uint256",t.length);i.unshift(a)}return re.concat(i)}else{if(e==="bytes")return t=new re(t),i=re.concat([At("uint256",t.length),t]),t.length%32!==0&&(i=re.concat([i,vr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Zr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return vr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Zr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=hr(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(re,"be",32)}else if(e.startsWith("int")){if(r=Zr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=hr(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(re,"be",32)}else if(e.startsWith("ufixed")){if(r=Ac(e),n=hr(t),n<0)throw new Error("Supplied ufixed is negative");return At("uint256",n.mul(new pr(2).pow(new pr(r[1]))))}else if(e.startsWith("fixed"))return r=Ac(e),At("int256",hr(t).mul(new pr(2).pow(new pr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Ug(e){return e==="string"||e==="bytes"||Wu(e)==="dynamic"}function Hg(e){return e.lastIndexOf("]")===e.length-1}function Wg(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var a=Hu(e[s]),c=t[s],h=At(a,c);Ug(a)?(r.push(At("uint256",i)),n.push(h),i+=h.length):r.push(h)}return re.concat(r.concat(n))}function Vu(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<e.length;s++){var a=Hu(e[s]),c=t[s];if(a==="bytes")i.push(c);else if(a==="string")i.push(new re(c,"utf8"));else if(a==="bool")i.push(new re(c?"01":"00","hex"));else if(a==="address")i.push(vr.setLength(c,20));else if(a.startsWith("bytes")){if(r=Zr(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(vr.setLengthRight(c,r))}else if(a.startsWith("uint")){if(r=Zr(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=hr(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(re,"be",r/8))}else if(a.startsWith("int")){if(r=Zr(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=hr(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(re,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return re.concat(i)}function Vg(e,t){return vr.keccak(Vu(e,t))}var qg={rawEncode:Wg,solidityPack:Vu,soliditySHA3:Vg};const bt=Uu,wn=qg,qu={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"]},co={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const a=(c,h,f)=>{if(r[h]!==void 0)return["bytes32",f==null?"0x0000000000000000000000000000000000000000000000000000000000000000":bt.keccak(this.encodeData(h,f,r,n))];if(f===void 0)throw new Error(`missing value for field ${c} of type ${h}`);if(h==="bytes")return["bytes32",bt.keccak(f)];if(h==="string")return typeof f=="string"&&(f=re.from(f,"utf8")),["bytes32",bt.keccak(f)];if(h.lastIndexOf("]")===h.length-1){const d=h.slice(0,h.lastIndexOf("[")),y=f.map(m=>a(c,d,m));return["bytes32",bt.keccak(wn.rawEncode(y.map(([m])=>m),y.map(([,m])=>m)))]}return[h,f]};for(const c of r[e]){const[h,f]=a(c.name,c.type,t[c.name]);i.push(h),s.push(f)}}else for(const a of r[e]){let c=t[a.name];if(c!==void 0)if(a.type==="bytes")i.push("bytes32"),c=bt.keccak(c),s.push(c);else if(a.type==="string")i.push("bytes32"),typeof c=="string"&&(c=re.from(c,"utf8")),c=bt.keccak(c),s.push(c);else if(r[a.type]!==void 0)i.push("bytes32"),c=bt.keccak(this.encodeData(a.type,c,r,n)),s.push(c);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(c)}}return wn.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:a,type:c})=>c+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return bt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return bt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in qu.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[re.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),bt.keccak(re.concat(n))}};var zg={TYPED_MESSAGE_SCHEMA:qu,TypedDataUtils:co,hashForSignTypedDataLegacy:function(e){return Gg(e.data)},hashForSignTypedData_v3:function(e){return co.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return co.hash(e.data)}};function Gg(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?bt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return wn.soliditySHA3(["bytes32","bytes32"],[wn.soliditySHA3(new Array(e.length).fill("string"),i),wn.soliditySHA3(n,r)])}var nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.filterFromParam=nn.FilterPolyfill=void 0;const Wr=Ge,rt=q,Jg=5*60*1e3,dr={jsonrpc:"2.0",id:0};class Zg{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Wr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=zu(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,rt.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,rt.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,rt.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,rt.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,rt.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(ci())}async getFilterLogs(t){const r=(0,rt.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getLogs",params:[Ic(n)]})):ci()}makeFilterId(){return(0,Wr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return ci();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return li();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getLogs",params:[Ic(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const c=a.result.map(f=>(0,rt.intNumberFromHexString)(f.blockNumber||"0x0")),h=Math.max(...c);if(h&&h>n){const f=(0,Wr.IntNumber)(h+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${f}`),this.cursors.set(t,f)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return ci();const n=await this.getCurrentBlockHeight();if(r>n)return li();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,rt.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Wr.IntNumber)(a))))).filter(a=>!!a),s=(0,Wr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},dr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(li())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},Jg);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_blockNumber",params:[]}));return(0,rt.intNumberFromHexString)((0,rt.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getBlockByNumber",params:[(0,rt.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,rt.ensureHexString)(r.result.hash):null}}nn.FilterPolyfill=Zg;function zu(e){return{fromBlock:xc(e.fromBlock),toBlock:xc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}nn.filterFromParam=zu;function Ic(e){const t={fromBlock:Tc(e.fromBlock),toBlock:Tc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function xc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Wr.IntNumber)(0);if((0,rt.isHexString)(e))return(0,rt.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Tc(e){return e==="latest"?e:(0,rt.hexStringFromIntNumber)(e)}function ci(){return Object.assign(Object.assign({},dr),{error:{code:-32e3,message:"filter not found"}})}function li(){return Object.assign(Object.assign({},dr),{result:[]})}var us={},Gu={},hs={},Xo=Kg;function Kg(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Nc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(a,c){if(t.multiArgs){const h=new Array(arguments.length-1);for(let f=1;f<arguments.length;f++)h[f-1]=arguments[f];a?(h.unshift(a),s(h)):i(h)}else a?s(a):i(c)}):n.push(function(a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let h=0;h<arguments.length;h++)c[h]=arguments[h];i(c)}else i(a)}),e.apply(this,n)})};var Qg=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):Nc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?Nc(s,t):s}return n},zn={},Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});const Yg=Qr;function Pc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Xg(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let em=class extends Yg.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Pc(s,this,r);else{const a=s.length,c=Xg(s);for(let h=0;h<a;h+=1)Pc(c[h],this,r)}return!0}};Gn.default=em;var tm=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zn,"__esModule",{value:!0});zn.BaseBlockTracker=void 0;const rm=tm(Gn),nm=1e3,im=(e,t)=>e+t,Lc=["sync","latest"];class sm extends rm.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*nm,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Lc.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Lc.map(t=>this.listenerCount(t)).reduce(im)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Oc(t),i=Oc(r);return this._usePastBlocks&&n<i||n>i}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}zn.BaseBlockTracker=sm;function Oc(e){return Number.parseInt(e,16)}var Ju={},Zu={},et={};class Ku extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:c}=t,h=c.length===0?i:`At path: ${c.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function om(e){return mt(e)&&typeof e[Symbol.iterator]=="function"}function mt(e){return typeof e=="object"&&e!=null}function $c(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Je(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function am(e){const{done:t,value:r}=e.next();return t?void 0:r}function cm(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:c,message:h=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${Je(n)}\``}=e;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:s,...e,message:h}}function*Po(e,t,r,n){om(e)||(e=[e]);for(const i of e){const s=cm(i,t,r,n);s&&(yield s)}}function*ea(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,c={path:n,branch:i};if(s&&(e=t.coercer(e,c),a&&t.type!=="type"&&mt(t.schema)&&mt(e)&&!Array.isArray(e)))for(const f in e)t.schema[f]===void 0&&delete e[f];let h="valid";for(const f of t.validator(e,c))f.explanation=r.message,h="not_valid",yield[f,void 0];for(let[f,d,y]of t.entries(e,c)){const m=ea(d,y,{path:f===void 0?n:[...n,f],branch:f===void 0?i:[...i,d],coerce:s,mask:a,message:r.message});for(const C of m)C[0]?(h=C[0].refinement!=null?"not_refined":"not_valid",yield[C[0],void 0]):s&&(d=C[1],f===void 0?e=d:e instanceof Map?e.set(f,d):e instanceof Set?e.add(d):mt(e)&&(d!==void 0||f in e)&&(e[f]=d))}if(h!=="not_valid")for(const f of t.refiner(e,c))f.explanation=r.message,h="not_refined",yield[f,void 0];h==="valid"&&(yield[void 0,e])}class qe{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:c=function*(){}}=t;this.type=r,this.schema=n,this.entries=c,this.coercer=a,i?this.validator=(h,f)=>{const d=i(h,f);return Po(d,f,this,h)}:this.validator=()=>[],s?this.refiner=(h,f)=>{const d=s(h,f);return Po(d,f,this,h)}:this.refiner=()=>[]}assert(t,r){return Qu(t,this,r)}create(t,r){return Yu(t,this,r)}is(t){return ta(t,this)}mask(t,r){return Xu(t,this,r)}validate(t,r={}){return fn(t,this,r)}}function Qu(e,t,r){const n=fn(e,t,{message:r});if(n[0])throw n[0]}function Yu(e,t,r){const n=fn(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Xu(e,t,r){const n=fn(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ta(e,t){return!fn(e,t)[0]}function fn(e,t,r={}){const n=ea(e,t,r),i=am(n);return i[0]?[new Ku(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function lm(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Zn(n):Jn(n)}function ot(e,t){return new qe({type:e,schema:null,validator:t})}function um(e,t){return new qe({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function hm(e){return new qe({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function dm(e){let t;return new qe({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function fm(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Zn(n);default:return Jn(n)}}function pm(e){const t=e instanceof qe,r=t?{...e.schema}:{...e};for(const n in r)r[n]=eh(r[n]);return t&&e.type==="type"?Zn(r):Jn(r)}function gm(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Zn(n);default:return Jn(n)}}function mm(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ot(e,t)}function ym(){return ot("any",()=>!0)}function vm(e){return new qe({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Je(t)}`}})}function bm(){return ot("bigint",e=>typeof e=="bigint")}function wm(){return ot("boolean",e=>typeof e=="boolean")}function _m(){return ot("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Je(e)}`)}function Em(e){const t={},r=e.map(n=>Je(n)).join();for(const n of e)t[n]=n;return new qe({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Je(n)}`}})}function Sm(){return ot("func",e=>typeof e=="function"||`Expected a function, but received: ${Je(e)}`)}function Rm(e){return ot("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Je(t)}`)}function Mm(){return ot("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Je(e)}`)}function Cm(e){return new qe({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function km(e){const t=Je(e),r=typeof e;return new qe({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Je(n)}`}})}function Am(e,t){return new qe({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Je(r)}`}})}function ra(){return ot("never",()=>!1)}function Im(e){return new qe({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function xm(){return ot("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Je(e)}`)}function Jn(e){const t=e?Object.keys(e):[],r=ra();return new qe({type:"object",schema:e||null,*entries(n){if(e&&mt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return mt(n)||`Expected an object, but received: ${Je(n)}`},coercer(n){return mt(n)?{...n}:n}})}function eh(e){return new qe({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Tm(e,t){return new qe({type:"record",schema:null,*entries(r){if(mt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return mt(r)||`Expected an object, but received: ${Je(r)}`}})}function Nm(){return ot("regexp",e=>e instanceof RegExp)}function Pm(e){return new qe({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Je(t)}`}})}function th(){return ot("string",e=>typeof e=="string"||`Expected a string, but received: ${Je(e)}`)}function Lm(e){const t=ra();return new qe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${Je(r)}`}})}function Zn(e){const t=Object.keys(e);return new qe({type:"type",schema:e,*entries(r){if(mt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return mt(r)||`Expected an object, but received: ${Je(r)}`},coercer(r){return mt(r)?{...r}:r}})}function Om(e){const t=e.map(r=>r.type).join(" | ");return new qe({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=ea(r,s,n),[c]=a;if(c[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Je(r)}`,...i]}})}function rh(){return ot("unknown",()=>!0)}function na(e,t,r){return new qe({...e,coercer:(n,i)=>ta(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function $m(e,t,r={}){return na(e,rh(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&$c(n)&&$c(i)){const s={...n};let a=!1;for(const c in i)s[c]===void 0&&(s[c]=i[c],a=!0);if(a)return s}return n})}function Bm(e){return na(e,th(),t=>t.trim())}function Fm(e){return Er(e,"empty",t=>{const r=nh(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function nh(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Dm(e,t,r={}){const{exclusive:n}=r;return Er(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function jm(e,t,r={}){const{exclusive:n}=r;return Er(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Um(e){return Er(e,"nonempty",t=>nh(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Hm(e,t){return Er(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function Wm(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Er(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return t<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return t<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function Er(e,t,r){return new qe({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),a=Po(s,i,e,n);for(const c of a)yield{...c,refinement:t}}})}const Vm=Object.freeze(Object.defineProperty({__proto__:null,Struct:qe,StructError:Ku,any:ym,array:vm,assert:Qu,assign:lm,bigint:bm,boolean:wm,coerce:na,create:Yu,date:_m,defaulted:$m,define:ot,deprecated:um,dynamic:hm,empty:Fm,enums:Em,func:Sm,instance:Rm,integer:Mm,intersection:Cm,is:ta,lazy:dm,literal:km,map:Am,mask:Xu,max:Dm,min:jm,never:ra,nonempty:Um,nullable:Im,number:xm,object:Jn,omit:fm,optional:eh,partial:pm,pattern:Hm,pick:gm,record:Tm,refine:Er,regexp:Nm,set:Pm,size:Wm,string:th,struct:mm,trimmed:Bm,tuple:Lm,type:Zn,union:Om,unknown:rh,validate:fn},Symbol.toStringTag,{value:"Module"})),Sr=br(Vm);Object.defineProperty(et,"__esModule",{value:!0});et.assertExhaustive=et.assertStruct=et.assert=et.AssertionError=void 0;const qm=Sr;function zm(e){return typeof e=="object"&&e!==null&&"message"in e}function Gm(e){var t,r;return typeof((r=(t=e?.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function Jm(e){const t=zm(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function ih(e,t){return Gm(e)?new e({message:t}):e({message:t})}class ia extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}et.AssertionError=ia;function Zm(e,t="Assertion failed.",r=ia){if(!e)throw t instanceof Error?t:ih(r,t)}et.assert=Zm;function Km(e,t,r="Assertion failed",n=ia){try{(0,qm.assert)(e,t)}catch(i){throw ih(n,`${r}: ${Jm(i)}.`)}}et.assertStruct=Km;function Qm(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}et.assertExhaustive=Qm;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.base64=void 0;const Ym=Sr,Xm=et,ey=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,Xm.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let c;return i?c=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):c=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,Ym.pattern)(e,c)};Kn.base64=ey;var le={},Qn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Sr,r=et;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(f){return(0,t.is)(f,e.HexStruct)}e.isHexString=n;function i(f){return(0,t.is)(f,e.StrictHexStruct)}e.isStrictHexString=i;function s(f){(0,r.assert)(n(f),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function a(f){(0,r.assert)(i(f),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function c(f){return f.startsWith("0x")?f:f.startsWith("0X")?`0x${f.substring(2)}`:`0x${f}`}e.add0x=c;function h(f){return f.startsWith("0x")||f.startsWith("0X")?f.substring(2):f}e.remove0x=h})(Qn);Object.defineProperty(le,"__esModule",{value:!0});le.createDataView=le.concatBytes=le.valueToBytes=le.stringToBytes=le.numberToBytes=le.signedBigIntToBytes=le.bigIntToBytes=le.hexToBytes=le.bytesToString=le.bytesToNumber=le.bytesToSignedBigInt=le.bytesToBigInt=le.bytesToHex=le.assertIsBytes=le.isBytes=void 0;const ut=et,Lo=Qn,Bc=48,Fc=58,Dc=87;function ty(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const ry=ty();function sa(e){return e instanceof Uint8Array}le.isBytes=sa;function pn(e){(0,ut.assert)(sa(e),"Value must be a Uint8Array.")}le.assertIsBytes=pn;function sh(e){if(pn(e),e.length===0)return"0x";const t=ry(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Lo.add0x)(r.join(""))}le.bytesToHex=sh;function oh(e){pn(e);const t=sh(e);return BigInt(t)}le.bytesToBigInt=oh;function ny(e){pn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}le.bytesToSignedBigInt=ny;function iy(e){pn(e);const t=oh(e);return(0,ut.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}le.bytesToNumber=iy;function sy(e){return pn(e),new TextDecoder().decode(e)}le.bytesToString=sy;function ds(e){var t;if(((t=e?.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Lo.assertIsHexString)(e);const r=(0,Lo.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const a=n.charCodeAt(s*2),c=n.charCodeAt(s*2+1),h=a-(a<Fc?Bc:Dc),f=c-(c<Fc?Bc:Dc);i[s]=h*16+f}return i}le.hexToBytes=ds;function ah(e){(0,ut.assert)(typeof e=="bigint","Value must be a bigint."),(0,ut.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return ds(t)}le.bigIntToBytes=ah;function oy(e,t){(0,ut.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function ay(e,t){(0,ut.assert)(typeof e=="bigint","Value must be a bigint."),(0,ut.assert)(typeof t=="number","Byte length must be a number."),(0,ut.assert)(t>0,"Byte length must be greater than 0."),(0,ut.assert)(oy(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}le.signedBigIntToBytes=ay;function ch(e){(0,ut.assert)(typeof e=="number","Value must be a number."),(0,ut.assert)(e>=0,"Value must be a non-negative number."),(0,ut.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return ds(t)}le.numberToBytes=ch;function lh(e){return(0,ut.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}le.stringToBytes=lh;function uh(e){if(typeof e=="bigint")return ah(e);if(typeof e=="number")return ch(e);if(typeof e=="string")return e.startsWith("0x")?ds(e):lh(e);if(sa(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}le.valueToBytes=uh;function cy(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=uh(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}le.concatBytes=cy;function ly(e){if(typeof re<"u"&&e instanceof re){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}le.createDataView=ly;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});fs.ChecksumStruct=void 0;const jc=Sr,uy=Kn;fs.ChecksumStruct=(0,jc.size)((0,uy.base64)((0,jc.string)(),{paddingRequired:!0}),44,44);var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.createHex=Nt.createBytes=Nt.createBigInt=Nt.createNumber=void 0;const Ve=Sr,hy=et,hh=le,ps=Qn,dh=(0,Ve.union)([(0,Ve.number)(),(0,Ve.bigint)(),(0,Ve.string)(),ps.StrictHexStruct]),dy=(0,Ve.coerce)((0,Ve.number)(),dh,Number),fy=(0,Ve.coerce)((0,Ve.bigint)(),dh,BigInt);(0,Ve.union)([ps.StrictHexStruct,(0,Ve.instance)(Uint8Array)]);const py=(0,Ve.coerce)((0,Ve.instance)(Uint8Array),(0,Ve.union)([ps.StrictHexStruct]),hh.hexToBytes),gy=(0,Ve.coerce)(ps.StrictHexStruct,(0,Ve.instance)(Uint8Array),hh.bytesToHex);function my(e){try{const t=(0,Ve.create)(e,dy);return(0,hy.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Nt.createNumber=my;function yy(e){try{return(0,Ve.create)(e,fy)}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Nt.createBigInt=yy;function vy(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Ve.create)(e,py)}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Nt.createBytes=vy;function by(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Ve.create)(e,gy)}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Nt.createHex=by;var sn={},fh=G&&G.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},nt=G&&G.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},vt,Ct;Object.defineProperty(sn,"__esModule",{value:!0});sn.FrozenSet=sn.FrozenMap=void 0;class oa{constructor(t){vt.set(this,void 0),fh(this,vt,new Map(t),"f"),Object.freeze(this)}get size(){return nt(this,vt,"f").size}[(vt=new WeakMap,Symbol.iterator)](){return nt(this,vt,"f")[Symbol.iterator]()}entries(){return nt(this,vt,"f").entries()}forEach(t,r){return nt(this,vt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return nt(this,vt,"f").get(t)}has(t){return nt(this,vt,"f").has(t)}keys(){return nt(this,vt,"f").keys()}values(){return nt(this,vt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}sn.FrozenMap=oa;class aa{constructor(t){Ct.set(this,void 0),fh(this,Ct,new Set(t),"f"),Object.freeze(this)}get size(){return nt(this,Ct,"f").size}[(Ct=new WeakMap,Symbol.iterator)](){return nt(this,Ct,"f")[Symbol.iterator]()}entries(){return nt(this,Ct,"f").entries()}forEach(t,r){return nt(this,Ct,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return nt(this,Ct,"f").has(t)}keys(){return nt(this,Ct,"f").keys()}values(){return nt(this,Ct,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}sn.FrozenSet=aa;Object.freeze(oa);Object.freeze(oa.prototype);Object.freeze(aa);Object.freeze(aa.prototype);var ph={};Object.defineProperty(ph,"__esModule",{value:!0});var gh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Sr,r=et,n=()=>(0,t.define)("finite number",O=>(0,t.is)(O,(0,t.number)())&&Number.isFinite(O));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(O,F)=>{function J(z,V){const Q=[...V.validator(z,F)];return Q.length>0?Q:!0}try{const z=J(O,e.UnsafeJsonStruct);return z!==!0?z:J(JSON.parse(JSON.stringify(O)),e.UnsafeJsonStruct)}catch(z){return z instanceof RangeError?"Circular reference detected":!1}});function i(O){return(0,t.is)(O,e.JsonStruct)}e.isValidJson=i;function s(O){(0,r.assertStruct)(O,e.JsonStruct,"Invalid JSON value");const F=JSON.stringify(O);return new TextEncoder().encode(F).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function a(O){return(0,t.is)(O,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function c(O,F){(0,r.assertStruct)(O,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",F)}e.assertIsJsonRpcNotification=c;function h(O){return(0,t.is)(O,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function f(O,F){(0,r.assertStruct)(O,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",F)}e.assertIsJsonRpcRequest=f,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function d(O){return(0,t.is)(O,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=d;function y(O,F){(0,r.assertStruct)(O,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",F)}e.assertIsPendingJsonRpcResponse=y;function m(O){return(0,t.is)(O,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=m;function C(O,F){(0,r.assertStruct)(O,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",F)}e.assertIsJsonRpcResponse=C;function P(O){return(0,t.is)(O,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=P;function N(O,F){(0,r.assertStruct)(O,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",F)}e.assertIsJsonRpcSuccess=N;function L(O){return(0,t.is)(O,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=L;function M(O,F){(0,r.assertStruct)(O,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",F)}e.assertIsJsonRpcFailure=M;function I(O){return(0,t.is)(O,e.JsonRpcErrorStruct)}e.isJsonRpcError=I;function T(O,F){(0,r.assertStruct)(O,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",F)}e.assertIsJsonRpcError=T;function $(O){const{permitEmptyString:F,permitFractions:J,permitNull:z}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},O);return ie=>!!(typeof ie=="number"&&(J||Number.isInteger(ie))||typeof ie=="string"&&(F||ie.length>0)||z&&ie===null)}e.getJsonRpcIdValidator=$})(gh);var mh={};Object.defineProperty(mh,"__esModule",{value:!0});var on={},wy=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.createModuleLogger=on.createProjectLogger=void 0;const _y=wy(Zh),Ey=(0,_y.default)("metamask");function Sy(e){return Ey.extend(e)}on.createProjectLogger=Sy;function Ry(e,t){return e.extend(t)}on.createModuleLogger=Ry;var yh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(f){return Array.isArray(f)&&f.length>0}e.isNonEmptyArray=t;function r(f){return f==null}e.isNullOrUndefined=r;function n(f){return!!f&&typeof f=="object"&&!Array.isArray(f)}e.isObject=n;const i=(f,d)=>Object.hasOwnProperty.call(f,d);e.hasProperty=i,function(f){f[f.Null=4]="Null",f[f.Comma=1]="Comma",f[f.Wrapper=1]="Wrapper",f[f.True=4]="True",f[f.False=5]="False",f[f.Quote=1]="Quote",f[f.Colon=1]="Colon",f[f.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(f){if(typeof f!="object"||f===null)return!1;try{let d=f;for(;Object.getPrototypeOf(d)!==null;)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(f)===d}catch{return!1}}e.isPlainObject=s;function a(f){return f.charCodeAt(0)<=127}e.isASCII=a;function c(f){var d;return f.split("").reduce((m,C)=>a(C)?m+1:m+2,0)+((d=f.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&d!==void 0?d:[]).length}e.calculateStringSize=c;function h(f){return f.toString().length}e.calculateNumberSize=h})(yh);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.hexToBigInt=Pt.hexToNumber=Pt.bigIntToHex=Pt.numberToHex=void 0;const Kr=et,Mn=Qn,My=e=>((0,Kr.assert)(typeof e=="number","Value must be a number."),(0,Kr.assert)(e>=0,"Value must be a non-negative number."),(0,Kr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Mn.add0x)(e.toString(16)));Pt.numberToHex=My;const Cy=e=>((0,Kr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Kr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Mn.add0x)(e.toString(16)));Pt.bigIntToHex=Cy;const ky=e=>{(0,Mn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Kr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Pt.hexToNumber=ky;const Ay=e=>((0,Mn.assertIsHexString)(e),BigInt((0,Mn.add0x)(e)));Pt.hexToBigInt=Ay;var vh={};Object.defineProperty(vh,"__esModule",{value:!0});var bh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!t(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(bh);var wh={};Object.defineProperty(wh,"__esModule",{value:!0});var _h={},Oo={exports:{}};const Iy="2.0.0",Eh=256,xy=Number.MAX_SAFE_INTEGER||9007199254740991,Ty=16,Ny=Eh-6,Py=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var gs={MAX_LENGTH:Eh,MAX_SAFE_COMPONENT_LENGTH:Ty,MAX_SAFE_BUILD_LENGTH:Ny,MAX_SAFE_INTEGER:xy,RELEASE_TYPES:Py,SEMVER_SPEC_VERSION:Iy,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},lo={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/landing-site/0.0.1-23619144615.commit-9dd6c8c"};const Ly=typeof de=="object"&&lo&&lo.NODE_DEBUG&&/\bsemver\b/i.test(lo.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var ms=Ly;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=gs,s=ms;t=e.exports={};const a=t.re=[],c=t.safeRe=[],h=t.src=[],f=t.safeSrc=[],d=t.t={};let y=0;const m="[a-zA-Z0-9-]",C=[["\\s",1],["\\d",i],[m,n]],P=L=>{for(const[M,I]of C)L=L.split(`${M}*`).join(`${M}{0,${I}}`).split(`${M}+`).join(`${M}{1,${I}}`);return L},N=(L,M,I)=>{const T=P(M),$=y++;s(L,$,M),d[L]=$,h[$]=M,f[$]=T,a[$]=new RegExp(M,I?"g":void 0),c[$]=new RegExp(T,I?"g":void 0)};N("NUMERICIDENTIFIER","0|[1-9]\\d*"),N("NUMERICIDENTIFIERLOOSE","\\d+"),N("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),N("MAINVERSION",`(${h[d.NUMERICIDENTIFIER]})\\.(${h[d.NUMERICIDENTIFIER]})\\.(${h[d.NUMERICIDENTIFIER]})`),N("MAINVERSIONLOOSE",`(${h[d.NUMERICIDENTIFIERLOOSE]})\\.(${h[d.NUMERICIDENTIFIERLOOSE]})\\.(${h[d.NUMERICIDENTIFIERLOOSE]})`),N("PRERELEASEIDENTIFIER",`(?:${h[d.NONNUMERICIDENTIFIER]}|${h[d.NUMERICIDENTIFIER]})`),N("PRERELEASEIDENTIFIERLOOSE",`(?:${h[d.NONNUMERICIDENTIFIER]}|${h[d.NUMERICIDENTIFIERLOOSE]})`),N("PRERELEASE",`(?:-(${h[d.PRERELEASEIDENTIFIER]}(?:\\.${h[d.PRERELEASEIDENTIFIER]})*))`),N("PRERELEASELOOSE",`(?:-?(${h[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[d.PRERELEASEIDENTIFIERLOOSE]})*))`),N("BUILDIDENTIFIER",`${m}+`),N("BUILD",`(?:\\+(${h[d.BUILDIDENTIFIER]}(?:\\.${h[d.BUILDIDENTIFIER]})*))`),N("FULLPLAIN",`v?${h[d.MAINVERSION]}${h[d.PRERELEASE]}?${h[d.BUILD]}?`),N("FULL",`^${h[d.FULLPLAIN]}$`),N("LOOSEPLAIN",`[v=\\s]*${h[d.MAINVERSIONLOOSE]}${h[d.PRERELEASELOOSE]}?${h[d.BUILD]}?`),N("LOOSE",`^${h[d.LOOSEPLAIN]}$`),N("GTLT","((?:<|>)?=?)"),N("XRANGEIDENTIFIERLOOSE",`${h[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),N("XRANGEIDENTIFIER",`${h[d.NUMERICIDENTIFIER]}|x|X|\\*`),N("XRANGEPLAIN",`[v=\\s]*(${h[d.XRANGEIDENTIFIER]})(?:\\.(${h[d.XRANGEIDENTIFIER]})(?:\\.(${h[d.XRANGEIDENTIFIER]})(?:${h[d.PRERELEASE]})?${h[d.BUILD]}?)?)?`),N("XRANGEPLAINLOOSE",`[v=\\s]*(${h[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[d.XRANGEIDENTIFIERLOOSE]})(?:${h[d.PRERELEASELOOSE]})?${h[d.BUILD]}?)?)?`),N("XRANGE",`^${h[d.GTLT]}\\s*${h[d.XRANGEPLAIN]}$`),N("XRANGELOOSE",`^${h[d.GTLT]}\\s*${h[d.XRANGEPLAINLOOSE]}$`),N("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),N("COERCE",`${h[d.COERCEPLAIN]}(?:$|[^\\d])`),N("COERCEFULL",h[d.COERCEPLAIN]+`(?:${h[d.PRERELEASE]})?(?:${h[d.BUILD]})?(?:$|[^\\d])`),N("COERCERTL",h[d.COERCE],!0),N("COERCERTLFULL",h[d.COERCEFULL],!0),N("LONETILDE","(?:~>?)"),N("TILDETRIM",`(\\s*)${h[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",N("TILDE",`^${h[d.LONETILDE]}${h[d.XRANGEPLAIN]}$`),N("TILDELOOSE",`^${h[d.LONETILDE]}${h[d.XRANGEPLAINLOOSE]}$`),N("LONECARET","(?:\\^)"),N("CARETTRIM",`(\\s*)${h[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",N("CARET",`^${h[d.LONECARET]}${h[d.XRANGEPLAIN]}$`),N("CARETLOOSE",`^${h[d.LONECARET]}${h[d.XRANGEPLAINLOOSE]}$`),N("COMPARATORLOOSE",`^${h[d.GTLT]}\\s*(${h[d.LOOSEPLAIN]})$|^$`),N("COMPARATOR",`^${h[d.GTLT]}\\s*(${h[d.FULLPLAIN]})$|^$`),N("COMPARATORTRIM",`(\\s*)${h[d.GTLT]}\\s*(${h[d.LOOSEPLAIN]}|${h[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",N("HYPHENRANGE",`^\\s*(${h[d.XRANGEPLAIN]})\\s+-\\s+(${h[d.XRANGEPLAIN]})\\s*$`),N("HYPHENRANGELOOSE",`^\\s*(${h[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[d.XRANGEPLAINLOOSE]})\\s*$`),N("STAR","(<|>)?=?\\s*\\*"),N("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),N("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Oo,Oo.exports);var Yn=Oo.exports;const Oy=Object.freeze({loose:!0}),$y=Object.freeze({}),By=e=>e?typeof e!="object"?Oy:e:$y;var ca=By;const Uc=/^[0-9]+$/,Sh=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=Uc.test(e),n=Uc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Fy=(e,t)=>Sh(t,e);var Rh={compareIdentifiers:Sh,rcompareIdentifiers:Fy};const ui=ms,{MAX_LENGTH:Hc,MAX_SAFE_INTEGER:hi}=gs,{safeRe:di,t:fi}=Yn,Dy=ca,{compareIdentifiers:uo}=Rh;let jy=class kt{constructor(t,r){if(r=Dy(r),t instanceof kt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Hc)throw new TypeError(`version is longer than ${Hc} characters`);ui("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?di[fi.LOOSE]:di[fi.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>hi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hi||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<hi)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(ui("SemVer.compare",this.version,this.options,t),!(t instanceof kt)){if(typeof t=="string"&&t===this.version)return 0;t=new kt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof kt||(t=new kt(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof kt||(t=new kt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(ui("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return uo(n,i)}while(++r)}compareBuild(t){t instanceof kt||(t=new kt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(ui("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return uo(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const i=`-${r}`.match(this.options.loose?di[fi.PRERELEASELOOSE]:di[fi.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),uo(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var it=jy;const Wc=it,Uy=(e,t,r=!1)=>{if(e instanceof Wc)return e;try{return new Wc(e,t)}catch(n){if(!r)return null;throw n}};var gn=Uy;const Hy=gn,Wy=(e,t)=>{const r=Hy(e,t);return r?r.version:null};var Vy=Wy;const qy=gn,zy=(e,t)=>{const r=qy(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Gy=zy;const Vc=it,Jy=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Vc(e instanceof Vc?e.version:e,r).inc(t,n,i).version}catch{return null}};var Zy=Jy;const qc=gn,Ky=(e,t)=>{const r=qc(e,null,!0),n=qc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,c=s?n:r,h=!!a.prerelease.length;if(!!c.prerelease.length&&!h){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}const d=h?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};var Qy=Ky;const Yy=it,Xy=(e,t)=>new Yy(e,t).major;var ev=Xy;const tv=it,rv=(e,t)=>new tv(e,t).minor;var nv=rv;const iv=it,sv=(e,t)=>new iv(e,t).patch;var ov=sv;const av=gn,cv=(e,t)=>{const r=av(e,t);return r&&r.prerelease.length?r.prerelease:null};var lv=cv;const zc=it,uv=(e,t,r)=>new zc(e,r).compare(new zc(t,r));var Et=uv;const hv=Et,dv=(e,t,r)=>hv(t,e,r);var fv=dv;const pv=Et,gv=(e,t)=>pv(e,t,!0);var mv=gv;const Gc=it,yv=(e,t,r)=>{const n=new Gc(e,r),i=new Gc(t,r);return n.compare(i)||n.compareBuild(i)};var la=yv;const vv=la,bv=(e,t)=>e.sort((r,n)=>vv(r,n,t));var wv=bv;const _v=la,Ev=(e,t)=>e.sort((r,n)=>_v(n,r,t));var Sv=Ev;const Rv=Et,Mv=(e,t,r)=>Rv(e,t,r)>0;var ys=Mv;const Cv=Et,kv=(e,t,r)=>Cv(e,t,r)<0;var ua=kv;const Av=Et,Iv=(e,t,r)=>Av(e,t,r)===0;var Mh=Iv;const xv=Et,Tv=(e,t,r)=>xv(e,t,r)!==0;var Ch=Tv;const Nv=Et,Pv=(e,t,r)=>Nv(e,t,r)>=0;var ha=Pv;const Lv=Et,Ov=(e,t,r)=>Lv(e,t,r)<=0;var da=Ov;const $v=Mh,Bv=Ch,Fv=ys,Dv=ha,jv=ua,Uv=da,Hv=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return $v(e,r,n);case"!=":return Bv(e,r,n);case">":return Fv(e,r,n);case">=":return Dv(e,r,n);case"<":return jv(e,r,n);case"<=":return Uv(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var kh=Hv;const Wv=it,Vv=gn,{safeRe:pi,t:gi}=Yn,qv=(e,t)=>{if(e instanceof Wv)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?pi[gi.COERCEFULL]:pi[gi.COERCE]);else{const h=t.includePrerelease?pi[gi.COERCERTLFULL]:pi[gi.COERCERTL];let f;for(;(f=h.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||f.index+f[0].length!==r.index+r[0].length)&&(r=f),h.lastIndex=f.index+f[1].length+f[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Vv(`${n}.${i}.${s}${a}${c}`,t)};var zv=qv;class Gv{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var Jv=Gv,ho,Jc;function St(){if(Jc)return ho;Jc=1;const e=/\s+/g;class t{constructor(u,p){if(p=i(p),u instanceof t)return u.loose===!!p.loose&&u.includePrerelease===!!p.includePrerelease?u:new t(u.raw,p);if(u instanceof s)return this.raw=u.value,this.set=[[u]],this.formatted=void 0,this;if(this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease,this.raw=u.trim().replace(e," "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(b=>!N(b[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const b of this.set)if(b.length===1&&L(b[0])){this.set=[b];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let u=0;u<this.set.length;u++){u>0&&(this.formatted+="||");const p=this.set[u];for(let g=0;g<p.length;g++)g>0&&(this.formatted+=" "),this.formatted+=p[g].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(u){const g=((this.options.includePrerelease&&C)|(this.options.loose&&P))+":"+u,b=n.get(g);if(b)return b;const S=this.options.loose,A=S?h[f.HYPHENRANGELOOSE]:h[f.HYPHENRANGE];u=u.replace(A,oe(this.options.includePrerelease)),a("hyphen replace",u),u=u.replace(h[f.COMPARATORTRIM],d),a("comparator trim",u),u=u.replace(h[f.TILDETRIM],y),a("tilde trim",u),u=u.replace(h[f.CARETTRIM],m),a("caret trim",u);let v=u.split(" ").map(U=>I(U,this.options)).join(" ").split(/\s+/).map(U=>Q(U,this.options));S&&(v=v.filter(U=>(a("loose invalid filter",U,this.options),!!U.match(h[f.COMPARATORLOOSE])))),a("range list",v);const l=new Map,w=v.map(U=>new s(U,this.options));for(const U of w){if(N(U))return[U];l.set(U.value,U)}l.size>1&&l.has("")&&l.delete("");const W=[...l.values()];return n.set(g,W),W}intersects(u,p){if(!(u instanceof t))throw new TypeError("a Range is required");return this.set.some(g=>M(g,p)&&u.set.some(b=>M(b,p)&&g.every(S=>b.every(A=>S.intersects(A,p)))))}test(u){if(!u)return!1;if(typeof u=="string")try{u=new c(u,this.options)}catch{return!1}for(let p=0;p<this.set.length;p++)if(R(this.set[p],u,this.options))return!0;return!1}}ho=t;const r=Jv,n=new r,i=ca,s=vs(),a=ms,c=it,{safeRe:h,t:f,comparatorTrimReplace:d,tildeTrimReplace:y,caretTrimReplace:m}=Yn,{FLAG_INCLUDE_PRERELEASE:C,FLAG_LOOSE:P}=gs,N=o=>o.value==="<0.0.0-0",L=o=>o.value==="",M=(o,u)=>{let p=!0;const g=o.slice();let b=g.pop();for(;p&&g.length;)p=g.every(S=>b.intersects(S,u)),b=g.pop();return p},I=(o,u)=>(o=o.replace(h[f.BUILD],""),a("comp",o,u),o=F(o,u),a("caret",o),o=$(o,u),a("tildes",o),o=z(o,u),a("xrange",o),o=ie(o,u),a("stars",o),o),T=o=>!o||o.toLowerCase()==="x"||o==="*",$=(o,u)=>o.trim().split(/\s+/).map(p=>O(p,u)).join(" "),O=(o,u)=>{const p=u.loose?h[f.TILDELOOSE]:h[f.TILDE];return o.replace(p,(g,b,S,A,v)=>{a("tilde",o,g,b,S,A,v);let l;return T(b)?l="":T(S)?l=`>=${b}.0.0 <${+b+1}.0.0-0`:T(A)?l=`>=${b}.${S}.0 <${b}.${+S+1}.0-0`:v?(a("replaceTilde pr",v),l=`>=${b}.${S}.${A}-${v} <${b}.${+S+1}.0-0`):l=`>=${b}.${S}.${A} <${b}.${+S+1}.0-0`,a("tilde return",l),l})},F=(o,u)=>o.trim().split(/\s+/).map(p=>J(p,u)).join(" "),J=(o,u)=>{a("caret",o,u);const p=u.loose?h[f.CARETLOOSE]:h[f.CARET],g=u.includePrerelease?"-0":"";return o.replace(p,(b,S,A,v,l)=>{a("caret",o,b,S,A,v,l);let w;return T(S)?w="":T(A)?w=`>=${S}.0.0${g} <${+S+1}.0.0-0`:T(v)?S==="0"?w=`>=${S}.${A}.0${g} <${S}.${+A+1}.0-0`:w=`>=${S}.${A}.0${g} <${+S+1}.0.0-0`:l?(a("replaceCaret pr",l),S==="0"?A==="0"?w=`>=${S}.${A}.${v}-${l} <${S}.${A}.${+v+1}-0`:w=`>=${S}.${A}.${v}-${l} <${S}.${+A+1}.0-0`:w=`>=${S}.${A}.${v}-${l} <${+S+1}.0.0-0`):(a("no pr"),S==="0"?A==="0"?w=`>=${S}.${A}.${v}${g} <${S}.${A}.${+v+1}-0`:w=`>=${S}.${A}.${v}${g} <${S}.${+A+1}.0-0`:w=`>=${S}.${A}.${v} <${+S+1}.0.0-0`),a("caret return",w),w})},z=(o,u)=>(a("replaceXRanges",o,u),o.split(/\s+/).map(p=>V(p,u)).join(" ")),V=(o,u)=>{o=o.trim();const p=u.loose?h[f.XRANGELOOSE]:h[f.XRANGE];return o.replace(p,(g,b,S,A,v,l)=>{a("xRange",o,g,b,S,A,v,l);const w=T(S),W=w||T(A),U=W||T(v),k=U;return b==="="&&k&&(b=""),l=u.includePrerelease?"-0":"",w?b===">"||b==="<"?g="<0.0.0-0":g="*":b&&k?(W&&(A=0),v=0,b===">"?(b=">=",W?(S=+S+1,A=0,v=0):(A=+A+1,v=0)):b==="<="&&(b="<",W?S=+S+1:A=+A+1),b==="<"&&(l="-0"),g=`${b+S}.${A}.${v}${l}`):W?g=`>=${S}.0.0${l} <${+S+1}.0.0-0`:U&&(g=`>=${S}.${A}.0${l} <${S}.${+A+1}.0-0`),a("xRange return",g),g})},ie=(o,u)=>(a("replaceStars",o,u),o.trim().replace(h[f.STAR],"")),Q=(o,u)=>(a("replaceGTE0",o,u),o.trim().replace(h[u.includePrerelease?f.GTE0PRE:f.GTE0],"")),oe=o=>(u,p,g,b,S,A,v,l,w,W,U,k)=>(T(g)?p="":T(b)?p=`>=${g}.0.0${o?"-0":""}`:T(S)?p=`>=${g}.${b}.0${o?"-0":""}`:A?p=`>=${p}`:p=`>=${p}${o?"-0":""}`,T(w)?l="":T(W)?l=`<${+w+1}.0.0-0`:T(U)?l=`<${w}.${+W+1}.0-0`:k?l=`<=${w}.${W}.${U}-${k}`:o?l=`<${w}.${W}.${+U+1}-0`:l=`<=${l}`,`${p} ${l}`.trim()),R=(o,u,p)=>{for(let g=0;g<o.length;g++)if(!o[g].test(u))return!1;if(u.prerelease.length&&!p.includePrerelease){for(let g=0;g<o.length;g++)if(a(o[g].semver),o[g].semver!==s.ANY&&o[g].semver.prerelease.length>0){const b=o[g].semver;if(b.major===u.major&&b.minor===u.minor&&b.patch===u.patch)return!0}return!1}return!0};return ho}var fo,Zc;function vs(){if(Zc)return fo;Zc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(d,y){if(y=r(y),d instanceof t){if(d.loose===!!y.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),a("comparator",d,y),this.options=y,this.loose=!!y.loose,this.parse(d),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(d){const y=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],m=d.match(y);if(!m)throw new TypeError(`Invalid comparator: ${d}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new c(m[2],this.options.loose):this.semver=e}toString(){return this.value}test(d){if(a("Comparator.test",d,this.options.loose),this.semver===e||d===e)return!0;if(typeof d=="string")try{d=new c(d,this.options)}catch{return!1}return s(d,this.operator,this.semver,this.options)}intersects(d,y){if(!(d instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(d.value,y).test(this.value):d.operator===""?d.value===""?!0:new h(this.value,y).test(d.semver):(y=r(y),y.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!y.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||s(this.semver,"<",d.semver,y)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||s(this.semver,">",d.semver,y)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}fo=t;const r=ca,{safeRe:n,t:i}=Yn,s=kh,a=ms,c=it,h=St();return fo}const Zv=St(),Kv=(e,t,r)=>{try{t=new Zv(t,r)}catch{return!1}return t.test(e)};var bs=Kv;const Qv=St(),Yv=(e,t)=>new Qv(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Xv=Yv;const eb=it,tb=St(),rb=(e,t,r)=>{let n=null,i=null,s=null;try{s=new tb(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new eb(n,r))}),n};var nb=rb;const ib=it,sb=St(),ob=(e,t,r)=>{let n=null,i=null,s=null;try{s=new sb(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new ib(n,r))}),n};var ab=ob;const po=it,cb=St(),Kc=ys,lb=(e,t)=>{e=new cb(e,t);let r=new po("0.0.0");if(e.test(r)||(r=new po("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const i=e.set[n];let s=null;i.forEach(a=>{const c=new po(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Kc(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Kc(r,s))&&(r=s)}return r&&e.test(r)?r:null};var ub=lb;const hb=St(),db=(e,t)=>{try{return new hb(e,t).range||"*"}catch{return null}};var fb=db;const pb=it,Ah=vs(),{ANY:gb}=Ah,mb=St(),yb=bs,Qc=ys,Yc=ua,vb=da,bb=ha,wb=(e,t,r,n)=>{e=new pb(e,n),t=new mb(t,n);let i,s,a,c,h;switch(r){case">":i=Qc,s=vb,a=Yc,c=">",h=">=";break;case"<":i=Yc,s=bb,a=Qc,c="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(yb(e,t,n))return!1;for(let f=0;f<t.set.length;++f){const d=t.set[f];let y=null,m=null;if(d.forEach(C=>{C.semver===gb&&(C=new Ah(">=0.0.0")),y=y||C,m=m||C,i(C.semver,y.semver,n)?y=C:a(C.semver,m.semver,n)&&(m=C)}),y.operator===c||y.operator===h||(!m.operator||m.operator===c)&&s(e,m.semver))return!1;if(m.operator===h&&a(e,m.semver))return!1}return!0};var fa=wb;const _b=fa,Eb=(e,t,r)=>_b(e,t,">",r);var Sb=Eb;const Rb=fa,Mb=(e,t,r)=>Rb(e,t,"<",r);var Cb=Mb;const Xc=St(),kb=(e,t,r)=>(e=new Xc(e,r),t=new Xc(t,r),e.intersects(t,r));var Ab=kb;const Ib=bs,xb=Et;var Tb=(e,t,r)=>{const n=[];let i=null,s=null;const a=e.sort((d,y)=>xb(d,y,r));for(const d of a)Ib(d,t,r)?(s=d,i||(i=d)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const c=[];for(const[d,y]of n)d===y?c.push(d):!y&&d===a[0]?c.push("*"):y?d===a[0]?c.push(`<=${y}`):c.push(`${d} - ${y}`):c.push(`>=${d}`);const h=c.join(" || "),f=typeof t.raw=="string"?t.raw:String(t);return h.length<f.length?h:t};const el=St(),pa=vs(),{ANY:go}=pa,yn=bs,ga=Et,Nb=(e,t,r={})=>{if(e===t)return!0;e=new el(e,r),t=new el(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const a=Lb(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},Pb=[new pa(">=0.0.0-0")],tl=[new pa(">=0.0.0")],Lb=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===go){if(t.length===1&&t[0].semver===go)return!0;r.includePrerelease?e=Pb:e=tl}if(t.length===1&&t[0].semver===go){if(r.includePrerelease)return!0;t=tl}const n=new Set;let i,s;for(const C of e)C.operator===">"||C.operator===">="?i=rl(i,C,r):C.operator==="<"||C.operator==="<="?s=nl(s,C,r):n.add(C.semver);if(n.size>1)return null;let a;if(i&&s){if(a=ga(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const C of n){if(i&&!yn(C,String(i),r)||s&&!yn(C,String(s),r))return null;for(const P of t)if(!yn(C,String(P),r))return!1;return!0}let c,h,f,d,y=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;y&&y.prerelease.length===1&&s.operator==="<"&&y.prerelease[0]===0&&(y=!1);for(const C of t){if(d=d||C.operator===">"||C.operator===">=",f=f||C.operator==="<"||C.operator==="<=",i){if(m&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===m.major&&C.semver.minor===m.minor&&C.semver.patch===m.patch&&(m=!1),C.operator===">"||C.operator===">="){if(c=rl(i,C,r),c===C&&c!==i)return!1}else if(i.operator===">="&&!yn(i.semver,String(C),r))return!1}if(s){if(y&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===y.major&&C.semver.minor===y.minor&&C.semver.patch===y.patch&&(y=!1),C.operator==="<"||C.operator==="<="){if(h=nl(s,C,r),h===C&&h!==s)return!1}else if(s.operator==="<="&&!yn(s.semver,String(C),r))return!1}if(!C.operator&&(s||i)&&a!==0)return!1}return!(i&&f&&!s&&a!==0||s&&d&&!i&&a!==0||m||y)},rl=(e,t,r)=>{if(!e)return t;const n=ga(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},nl=(e,t,r)=>{if(!e)return t;const n=ga(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Ob=Nb;const mo=Yn,il=gs,$b=it,sl=Rh,Bb=gn,Fb=Vy,Db=Gy,jb=Zy,Ub=Qy,Hb=ev,Wb=nv,Vb=ov,qb=lv,zb=Et,Gb=fv,Jb=mv,Zb=la,Kb=wv,Qb=Sv,Yb=ys,Xb=ua,ew=Mh,tw=Ch,rw=ha,nw=da,iw=kh,sw=zv,ow=vs(),aw=St(),cw=bs,lw=Xv,uw=nb,hw=ab,dw=ub,fw=fb,pw=fa,gw=Sb,mw=Cb,yw=Ab,vw=Tb,bw=Ob;var ww={parse:Bb,valid:Fb,clean:Db,inc:jb,diff:Ub,major:Hb,minor:Wb,patch:Vb,prerelease:qb,compare:zb,rcompare:Gb,compareLoose:Jb,compareBuild:Zb,sort:Kb,rsort:Qb,gt:Yb,lt:Xb,eq:ew,neq:tw,gte:rw,lte:nw,cmp:iw,coerce:sw,Comparator:ow,Range:aw,satisfies:cw,toComparators:lw,maxSatisfying:uw,minSatisfying:hw,minVersion:dw,validRange:fw,outside:pw,gtr:gw,ltr:mw,intersects:yw,simplifyRange:vw,subset:bw,SemVer:$b,re:mo.re,src:mo.src,tokens:mo.t,SEMVER_SPEC_VERSION:il.SEMVER_SPEC_VERSION,RELEASE_TYPES:il.RELEASE_TYPES,compareIdentifiers:sl.compareIdentifiers,rcompareIdentifiers:sl.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=ww,r=Sr,n=et;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",y=>(0,t.valid)(y)===null?`Expected SemVer version, got "${y}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",y=>(0,t.validRange)(y)===null?`Expected SemVer range, got "${y}"`:!0);function i(y){return(0,r.is)(y,e.VersionStruct)}e.isValidSemVerVersion=i;function s(y){return(0,r.is)(y,e.VersionRangeStruct)}e.isValidSemVerRange=s;function a(y){(0,n.assertStruct)(y,e.VersionStruct)}e.assertIsSemVerVersion=a;function c(y){(0,n.assertStruct)(y,e.VersionRangeStruct)}e.assertIsSemVerRange=c;function h(y,m){return(0,t.gt)(y,m)}e.gtVersion=h;function f(y,m){return(0,t.gtr)(y,m)}e.gtRange=f;function d(y,m){return(0,t.satisfies)(y,m,{includePrerelease:!0})}e.satisfiesVersionRange=d})(_h);(function(e){var t=G&&G.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,c)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=G&&G.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(et,e),r(Kn,e),r(le,e),r(fs,e),r(Nt,e),r(sn,e),r(ph,e),r(Qn,e),r(gh,e),r(mh,e),r(on,e),r(yh,e),r(Pt,e),r(vh,e),r(bh,e),r(wh,e),r(_h,e)})(Zu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Zu;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Ju);var Ih=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hs,"__esModule",{value:!0});hs.PollingBlockTracker=void 0;const _w=Ih(Xo),Ew=Ih(Qg),Sw=zn,ol=Ju,al=(0,ol.createModuleLogger)(ol.projectLogger,"polling-block-tracker"),Rw=(0,_w.default)(),Mw=1e3;class Cw extends Sw.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Mw,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=cl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
3
|
+
${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=cl(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Rw(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),al("Making request",t);const r=await(0,Ew.default)(n=>this._provider.sendAsync(t,n))();if(al("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
|
+
${r.error.message}`);return r.result}}hs.PollingBlockTracker=Cw;function cl(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var ws={},kw=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ws,"__esModule",{value:!0});ws.SubscribeBlockTracker=void 0;const Aw=kw(Xo),Iw=zn,xw=(0,Aw.default)();class Tw extends Iw.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:xw(),method:t,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}ws.SubscribeBlockTracker=Tw;(function(e){var t=G&&G.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=G&&G.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(hs,e),r(ws,e)})(Gu);var ma={},_s={},Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getUniqueId=void 0;const xh=4294967295;let yo=Math.floor(Math.random()*xh);function Nw(){return yo=(yo+1)%xh,yo}Xn.getUniqueId=Nw;Object.defineProperty(_s,"__esModule",{value:!0});_s.createIdRemapMiddleware=void 0;const Pw=Xn;function Lw(){return(e,t,r,n)=>{const i=e.id,s=Pw.getUniqueId();e.id=s,t.id=s,r(a=>{e.id=i,t.id=i,a()})}}_s.createIdRemapMiddleware=Lw;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.createAsyncMiddleware=void 0;function Ow(e){return async(t,r,n,i)=>{let s;const a=new Promise(d=>{s=d});let c=null,h=!1;const f=async()=>{h=!0,n(d=>{c=d,s()}),await a};try{await e(t,r,f),h?(await a,c(null)):i(null)}catch(d){c?c(d):i(d)}}}Es.createAsyncMiddleware=Ow;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.createScaffoldMiddleware=void 0;function $w(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}Ss.createScaffoldMiddleware=$w;var ei={},ya={};Object.defineProperty(ya,"__esModule",{value:!0});const Bw=Qr;function ll(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Fw(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Dw=class extends Bw.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")ll(s,this,r);else{const a=s.length,c=Fw(s);for(let h=0;h<a;h+=1)ll(c[h],this,r)}return!0}};ya.default=Dw;var Th={},qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.EthereumProviderError=qt.EthereumRpcError=void 0;const jw=Kh;class Nh extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return jw.default(this.serialize(),Ww,2)}}qt.EthereumRpcError=Nh;class Uw extends Nh{constructor(t,r,n){if(!Hw(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}qt.EthereumProviderError=Uw;function Hw(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Ww(e,t){if(t!=="[Circular]")return t}var va={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.errorValues=zt.errorCodes=void 0;zt.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}};zt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=zt,r=qt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(m,C=i){if(Number.isInteger(m)){const P=m.toString();if(y(t.errorValues,P))return t.errorValues[P].message;if(f(m))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return C}e.getMessageFromCode=a;function c(m){if(!Number.isInteger(m))return!1;const C=m.toString();return!!(t.errorValues[C]||f(m))}e.isValidCode=c;function h(m,{fallbackError:C=s,shouldIncludeStack:P=!1}={}){var N,L;if(!C||!Number.isInteger(C.code)||typeof C.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(m instanceof r.EthereumRpcError)return m.serialize();const M={};if(m&&typeof m=="object"&&!Array.isArray(m)&&y(m,"code")&&c(m.code)){const T=m;M.code=T.code,T.message&&typeof T.message=="string"?(M.message=T.message,y(T,"data")&&(M.data=T.data)):(M.message=a(M.code),M.data={originalError:d(m)})}else{M.code=C.code;const T=(N=m)===null||N===void 0?void 0:N.message;M.message=T&&typeof T=="string"?T:C.message,M.data={originalError:d(m)}}const I=(L=m)===null||L===void 0?void 0:L.stack;return P&&m&&I&&typeof I=="string"&&(M.stack=I),M}e.serializeError=h;function f(m){return m>=-32099&&m<=-32e3}function d(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function y(m,C){return Object.prototype.hasOwnProperty.call(m,C)}})(va);var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.ethErrors=void 0;const ba=qt,Ph=va,tt=zt;Rs.ethErrors={rpc:{parse:e=>dt(tt.errorCodes.rpc.parse,e),invalidRequest:e=>dt(tt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>dt(tt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>dt(tt.errorCodes.rpc.methodNotFound,e),internal:e=>dt(tt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return dt(t,e)},invalidInput:e=>dt(tt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>dt(tt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>dt(tt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>dt(tt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>dt(tt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>dt(tt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>vn(tt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>vn(tt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>vn(tt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>vn(tt.errorCodes.provider.disconnected,e),chainDisconnected:e=>vn(tt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ba.EthereumProviderError(t,r,n)}}};function dt(e,t){const[r,n]=Lh(t);return new ba.EthereumRpcError(e,r||Ph.getMessageFromCode(e),n)}function vn(e,t){const[r,n]=Lh(t);return new ba.EthereumProviderError(e,r||Ph.getMessageFromCode(e),n)}function Lh(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=qt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=va;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Rs;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=zt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Th);var Vw=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ei,"__esModule",{value:!0});ei.JsonRpcEngine=void 0;const qw=Vw(ya),ft=Th;class Ot extends qw.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,a,c]=await Ot._runAllMiddleware(t,r,this._middleware);return a?(await Ot._runReturnHandlers(c),i(s)):n(async h=>{try{await Ot._runReturnHandlers(c)}catch(f){return h(f)}return h()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const a=new ft.EthereumRpcError(ft.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){const a=new ft.EthereumRpcError(ft.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=ft.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Ot._runAllMiddleware(t,r,this._middleware);if(Ot._checkForCompletion(t,r,i),await Ot._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,a=!1;for(const c of n)if([s,a]=await Ot._runMiddleware(t,r,c,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const a=h=>{const f=h||r.error;f&&(r.error=ft.serializeError(f)),s([f,!0])},c=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new ft.EthereumRpcError(ft.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request:
|
|
5
|
+
${vo(t)}`,{request:t})),i.push(h)),s([null,!1]))};try{n(t,r,c,a)}catch(h){a(h)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new ft.EthereumRpcError(ft.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
6
|
+
${vo(t)}`,{request:t});if(!n)throw new ft.EthereumRpcError(ft.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
7
|
+
${vo(t)}`,{request:t})}}ei.JsonRpcEngine=Ot;function vo(e){return JSON.stringify(e,null,2)}var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.mergeMiddleware=void 0;const zw=ei;function Gw(e){const t=new zw.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Ms.mergeMiddleware=Gw;(function(e){var t=G&&G.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=G&&G.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(_s,e),r(Es,e),r(Ss,e),r(Xn,e),r(ei,e),r(Ms,e)})(ma);var Oh={},wa={};const _a=br(Uh);var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});var ul=_a,Jw=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return ul.__awaiter(this,void 0,void 0,function(){var r,n,i;return ul.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Cs.default=Jw;Object.defineProperty(wa,"__esModule",{value:!0});var hl=_a,Zw=Cs,Kw=function(){function e(){this._semaphore=new Zw.default(1)}return e.prototype.acquire=function(){return hl.__awaiter(this,void 0,void 0,function(){var t,r;return hl.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();wa.default=Kw;var ks={};Object.defineProperty(ks,"__esModule",{value:!0});ks.withTimeout=void 0;var mi=_a;function Qw(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return mi.__awaiter(n,void 0,void 0,function(){var a,c,h;return mi.__generator(this,function(f){switch(f.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},t),[4,e.acquire()];case 1:return c=f.sent(),a?(h=Array.isArray(c)?c[1]:c,h()):i(c),[2]}})})})},runExclusive:function(i){return mi.__awaiter(this,void 0,void 0,function(){var s,a;return mi.__generator(this,function(c){switch(c.label){case 0:s=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=c.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,c.sent()];case 4:return s=a,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}ks.withTimeout=Qw;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=wa;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Cs;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=ks;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Oh);var Yw=e_,Xw=Object.prototype.hasOwnProperty;function e_(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Xw.call(r,n)&&(e[n]=r[n])}return e}const t_=Yw,r_=Xo();var n_=Y;function Y(e){const t=this;t.currentProvider=e}Y.prototype.getBalance=ti(2,"eth_getBalance");Y.prototype.getCode=ti(2,"eth_getCode");Y.prototype.getTransactionCount=ti(2,"eth_getTransactionCount");Y.prototype.getStorageAt=ti(3,"eth_getStorageAt");Y.prototype.call=ti(2,"eth_call");Y.prototype.protocolVersion=ne("eth_protocolVersion");Y.prototype.syncing=ne("eth_syncing");Y.prototype.coinbase=ne("eth_coinbase");Y.prototype.mining=ne("eth_mining");Y.prototype.hashrate=ne("eth_hashrate");Y.prototype.gasPrice=ne("eth_gasPrice");Y.prototype.accounts=ne("eth_accounts");Y.prototype.blockNumber=ne("eth_blockNumber");Y.prototype.getBlockTransactionCountByHash=ne("eth_getBlockTransactionCountByHash");Y.prototype.getBlockTransactionCountByNumber=ne("eth_getBlockTransactionCountByNumber");Y.prototype.getUncleCountByBlockHash=ne("eth_getUncleCountByBlockHash");Y.prototype.getUncleCountByBlockNumber=ne("eth_getUncleCountByBlockNumber");Y.prototype.sign=ne("eth_sign");Y.prototype.sendTransaction=ne("eth_sendTransaction");Y.prototype.sendRawTransaction=ne("eth_sendRawTransaction");Y.prototype.estimateGas=ne("eth_estimateGas");Y.prototype.getBlockByHash=ne("eth_getBlockByHash");Y.prototype.getBlockByNumber=ne("eth_getBlockByNumber");Y.prototype.getTransactionByHash=ne("eth_getTransactionByHash");Y.prototype.getTransactionByBlockHashAndIndex=ne("eth_getTransactionByBlockHashAndIndex");Y.prototype.getTransactionByBlockNumberAndIndex=ne("eth_getTransactionByBlockNumberAndIndex");Y.prototype.getTransactionReceipt=ne("eth_getTransactionReceipt");Y.prototype.getUncleByBlockHashAndIndex=ne("eth_getUncleByBlockHashAndIndex");Y.prototype.getUncleByBlockNumberAndIndex=ne("eth_getUncleByBlockNumberAndIndex");Y.prototype.getCompilers=ne("eth_getCompilers");Y.prototype.compileLLL=ne("eth_compileLLL");Y.prototype.compileSolidity=ne("eth_compileSolidity");Y.prototype.compileSerpent=ne("eth_compileSerpent");Y.prototype.newFilter=ne("eth_newFilter");Y.prototype.newBlockFilter=ne("eth_newBlockFilter");Y.prototype.newPendingTransactionFilter=ne("eth_newPendingTransactionFilter");Y.prototype.uninstallFilter=ne("eth_uninstallFilter");Y.prototype.getFilterChanges=ne("eth_getFilterChanges");Y.prototype.getFilterLogs=ne("eth_getFilterLogs");Y.prototype.getLogs=ne("eth_getLogs");Y.prototype.getWork=ne("eth_getWork");Y.prototype.submitWork=ne("eth_submitWork");Y.prototype.submitHashrate=ne("eth_submitHashrate");Y.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(i_(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function ne(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function ti(e,t){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function i_(e){return t_({id:r_(),jsonrpc:"2.0",params:[]},e)}const dl=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((a,c)=>{t.multiArgs?i.push((...f)=>{t.errorFirst?f[0]?c(f):(f.shift(),a(f)):a(f)}):t.errorFirst?i.push((f,d)=>{f?c(f):a(d)}):i.push(a),Reflect.apply(e,this===r?n:this,i)})},fl=new WeakMap;var s_=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(a,c)=>{let h=fl.get(a);if(h||(h={},fl.set(a,h)),c in h)return h[c];const f=P=>typeof P=="string"||typeof c=="symbol"?c===P:P.test(c),d=Reflect.getOwnPropertyDescriptor(a,c),y=d===void 0||d.writable||d.configurable,C=(t.include?t.include.some(f):!t.exclude.some(f))&&y;return h[c]=C,C},i=new WeakMap,s=new Proxy(e,{apply(a,c,h){const f=i.get(a);if(f)return Reflect.apply(f,c,h);const d=t.excludeMain?a:dl(a,t,s,a);return i.set(a,d),Reflect.apply(d,c,h)},get(a,c){const h=a[c];if(!n(a,c)||h===Function.prototype[c])return h;const f=i.get(h);if(f)return f;if(typeof h=="function"){const d=dl(h,t,s,a);return i.set(h,d),d}return h}});return s};const o_=Gn.default;let a_=class extends o_{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var Ea=a_;const c_=Ea;let l_=class extends c_{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var u_=l_,ri={minBlockRef:h_,maxBlockRef:d_,sortBlockRefs:Sa,bnToHex:f_,blockRefIsNumber:p_,hexToInt:Ni,incrementHexInt:g_,intToHex:$h,unsafeRandomBytes:m_};function h_(...e){return Sa(e)[0]}function d_(...e){const t=Sa(e);return t[t.length-1]}function Sa(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Ni(t)-Ni(r))}function f_(e){return"0x"+e.toString(16)}function p_(e){return e&&!["earliest","latest","pending"].includes(e)}function Ni(e){return e==null?e:Number.parseInt(e,16)}function g_(e){if(e==null)return e;const t=Ni(e);return $h(t+1)}function $h(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function m_(e){let t="0x";for(let r=0;r<e;r++)t+=pl(),t+=pl();return t}function pl(){return Math.floor(Math.random()*16).toString(16)}const y_=n_,v_=s_,b_=u_,{bnToHex:P2,hexToInt:yi,incrementHexInt:w_,minBlockRef:__,blockRefIsNumber:E_}=ri;let S_=class extends b_{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new y_(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=__(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=w_(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(s)).filter(h=>this.matchLog(h));this.addResults(c)}async _fetchLogs(t){return await v_(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(yi(this.params.fromBlock)>=yi(t.blockNumber)||E_(this.params.toBlock)&&yi(this.params.toBlock)<=yi(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let a=t.topics[s];if(!a)return!1;a=a.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(d=>d.toLowerCase()),c.includes(a))})}};var R_=S_,Ra=M_;async function M_({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=gl(t),s=gl(r)-n+1,a=Array(s).fill().map((h,f)=>n+f).map(C_);let c=await Promise.all(a.map(h=>A_(e,"eth_getBlockByNumber",[h,!1])));return c=c.filter(h=>h!==null),c}function gl(e){return e==null?e:Number.parseInt(e,16)}function C_(e){return e==null?e:"0x"+e.toString(16)}function k_(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function A_(e,t,r){for(let n=0;n<3;n++)try{return await k_(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const I_=Ea,x_=Ra,{incrementHexInt:T_}=ri;let N_=class extends I_{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=T_(t),a=(await x_({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(a)}};var P_=N_;const L_=Ea,O_=Ra,{incrementHexInt:$_}=ri;let B_=class extends L_{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=$_(t),i=await O_({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var F_=B_;const D_=Oh.Mutex,{createAsyncMiddleware:j_,createScaffoldMiddleware:U_}=ma,H_=R_,W_=P_,V_=F_,{intToHex:Bh,hexToInt:bo}=ri;var q_=z_;function z_({blockTracker:e,provider:t}){let r=0,n={};const i=new D_,s=G_({mutex:i}),a=U_({eth_newFilter:s(wo(h)),eth_newBlockFilter:s(wo(f)),eth_newPendingTransactionFilter:s(wo(d)),eth_uninstallFilter:s(Mi(C)),eth_getFilterChanges:s(Mi(y)),eth_getFilterLogs:s(Mi(m))}),c=async({oldBlock:I,newBlock:T})=>{if(n.length===0)return;const $=await i.acquire();try{await Promise.all(Ur(n).map(async O=>{try{await O.update({oldBlock:I,newBlock:T})}catch(F){console.error(F)}}))}catch(O){console.error(O)}$()};return a.newLogFilter=h,a.newBlockFilter=f,a.newPendingTransactionFilter=d,a.uninstallFilter=C,a.getFilterChanges=y,a.getFilterLogs=m,a.destroy=()=>{L()},a;async function h(I){const T=new H_({provider:t,params:I});return await P(T),T}async function f(){const I=new W_({provider:t});return await P(I),I}async function d(){const I=new V_({provider:t});return await P(I),I}async function y(I){const T=bo(I),$=n[T];if(!$)throw new Error(`No filter for index "${T}"`);return $.getChangesAndClear()}async function m(I){const T=bo(I),$=n[T];if(!$)throw new Error(`No filter for index "${T}"`);let O=[];return $.type==="log"&&(O=$.getAllResults()),O}async function C(I){const T=bo(I),O=!!n[T];return O&&await N(T),O}async function P(I){const T=Ur(n).length,$=await e.getLatestBlock();await I.initialize({currentBlock:$}),r++,n[r]=I,I.id=r,I.idHex=Bh(r);const O=Ur(n).length;return M({prevFilterCount:T,newFilterCount:O}),r}async function N(I){const T=Ur(n).length;delete n[I];const $=Ur(n).length;M({prevFilterCount:T,newFilterCount:$})}async function L(){const I=Ur(n).length;n={},M({prevFilterCount:I,newFilterCount:0})}function M({prevFilterCount:I,newFilterCount:T}){if(I===0&&T>0){e.on("sync",c);return}if(I>0&&T===0){e.removeListener("sync",c);return}}}function wo(e){return Mi(async(...t)=>{const r=await e(...t);return Bh(r.id)})}function Mi(e){return j_(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function G_({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Ur(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const J_=Gn.default,{createAsyncMiddleware:ml,createScaffoldMiddleware:Z_}=ma,K_=q_,{unsafeRandomBytes:Q_,incrementHexInt:Y_}=ri,X_=Ra;var e2=t2;function t2({blockTracker:e,provider:t}){const r={},n=K_({blockTracker:e,provider:t});let i=!1;const s=new J_,a=Z_({eth_subscribe:ml(c),eth_unsubscribe:ml(h)});return a.destroy=d,{events:s,middleware:a};async function c(y,m){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=y.params[0],P=Q_(16);let N;switch(C){case"newHeads":N=L({subId:P});break;case"logs":const I=y.params[1],T=await n.newLogFilter(I);N=M({subId:P,filter:T});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${C}"`)}r[P]=N,m.result=P;return;function L({subId:I}){const T={type:C,destroy:async()=>{e.removeListener("sync",T.update)},update:async({oldBlock:$,newBlock:O})=>{const F=O,J=Y_($);(await X_({provider:t,fromBlock:J,toBlock:F})).map(r2).filter(ie=>ie!==null).forEach(ie=>{f(I,ie)})}};return e.on("sync",T.update),T}function M({subId:I,filter:T}){return T.on("update",O=>f(I,O)),{type:C,destroy:async()=>await n.uninstallFilter(T.idHex)}}}async function h(y,m){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=y.params[0],P=r[C];if(!P){m.result=!1;return}delete r[C],await P.destroy(),m.result=!0}function f(y,m){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:y,result:m}})}function d(){s.removeAllListeners();for(const y in r)r[y].destroy(),delete r[y];i=!0}}function r2(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(us,"__esModule",{value:!0});us.SubscriptionManager=void 0;const n2=Gu,i2=e2,yl=()=>{};class s2{constructor(t){const r=new n2.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=i2({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,yl,yl),r}destroy(){this.subscriptionMiddleware.destroy()}}us.SubscriptionManager=s2;var Fh=G&&G.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CoinbaseWalletProvider=void 0;const o2=Fh($i),a2=M0,ae=Nn,te=q,c2=$n,vl=pt,vi=un,ct=an,_o=Fh(zg),bn=ln,l2=nn,u2=us,bl="DefaultChainId",wl="DefaultJsonRpcUrl";class h2 extends a2.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new l2.FilterPolyfill(this),this._subscriptionManager=new u2.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,te.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(vl.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(h=>(0,te.ensureAddressString)(h)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",c=>{var h;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"&&c.data.data.action==="dappChainSwitched"){const f=c.data.data.chainId,d=(h=c.data.data.jsonRpcUrl)!==null&&h!==void 0?h:this.jsonRpcUrl;this.updateProviderInfo(d,Number(f))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,te.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(wl))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(wl,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(bl,r.toString(10)),((0,te.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,a){const h=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,a?.toString()).promise;return(0,ct.isErrorResponse)(h)?!1:!!h.result}async addEthereumChain(t,r,n,i,s,a){var c,h;if((0,te.ensureIntNumber)(t)===this.getChainId())return!1;const f=await this.initializeRelay(),d=f.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!d&&await f.requestEthereumAccounts().promise;const y=await f.addEthereumChain(t.toString(),r,s,n,i,a).promise;return(0,ct.isErrorResponse)(y)?!1:(((c=y.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],t),((h=y.result)===null||h===void 0?void 0:h.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,ct.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===ae.standardErrorCodes.provider.unsupportedChain?ae.standardErrors.provider.unsupportedChain():ae.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(bn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?vi.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,ae.serializeError)(i,t)})}catch(n){throw(0,ae.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(c=>c.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,ae.serializeError)(n,t)})}catch(n){return Promise.reject((0,ae.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,ae.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,ae.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw ae.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw ae.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw ae.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,te.ensureRegExpString)(t)).promise;if((0,ct.isErrorResponse)(n))throw(0,ae.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,ae.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,ct.isErrorResponse)(i))throw(0,ae.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,ae.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(bn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?vi.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof c2.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ct.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ae.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,ct.isErrorResponse)(n))throw(0,ae.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,ae.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,te.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(vl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(c=>r(Object.assign(Object.assign({},c),{id:t.id}))).catch(c=>n(c));return}const a=this._handleSubscriptionMethods(t);if(a!==void 0){a.then(c=>r({jsonrpc:"2.0",id:t.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var a;throw(s.code===ae.standardErrorCodes.rpc.methodNotFound||s.code===ae.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log(bn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?vi.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,te.ensureAddressString)(t);return this._addresses.map(i=>(0,te.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(bn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,te.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,te.ensureAddressString)(t.to):null,i=t.value!=null?(0,te.ensureBN)(t.value):new o2.default(0),s=t.data?(0,te.ensureBuffer)(t.data):re.alloc(0),a=t.nonce!=null?(0,te.ensureIntNumber)(t.nonce):null,c=t.gasPrice!=null?(0,te.ensureBN)(t.gasPrice):null,h=t.maxFeePerGas!=null?(0,te.ensureBN)(t.maxFeePerGas):null,f=t.maxPriorityFeePerGas!=null?(0,te.ensureBN)(t.maxPriorityFeePerGas):null,d=t.gas!=null?(0,te.ensureBN)(t.gas):null,y=t.chainId?(0,te.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:c,maxFeePerGas:h,maxPriorityFeePerGas:f,gasLimit:d,chainId:y}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ae.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ae.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,ct.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ae.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,ct.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,te.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(bl);if(!t)return(0,te.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,te.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(bn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?vi.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,ct.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ae.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,te.ensureAddressString)(t[0]),n=(0,te.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,te.ensureBuffer)(t[0]),n=(0,te.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,te.ensureBuffer)(t[0]),n=(0,te.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,te.ensureBuffer)(t[0]),n=(0,te.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,ct.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ae.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,te.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ct.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,ct.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ae.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,te.ensureParsedJSONObject)(t[0]),n=(0,te.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=_o.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,te.ensureAddressString)(t[0]),n=(0,te.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=_o.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,te.ensureAddressString)(t[0]),n=(0,te.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=_o.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const a=t[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw ae.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw ae.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const c=parseInt(a.chainId,16);return await this.addEthereumChain(c,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw ae.standardErrors.rpc.invalidParams("Type is required");if(r?.type!=="ERC20")throw ae.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!r?.options)throw ae.standardErrors.rpc.invalidParams("Options are required");if(!r?.options.address)throw ae.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:c}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,c,a,n)}}_eth_uninstallFilter(t){const r=(0,te.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,te.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,te.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Xr.CoinbaseWalletProvider=h2;var As={};Object.defineProperty(As,"__esModule",{value:!0});As.RelayEventManager=void 0;const d2=q;class f2{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,d2.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}As.RelayEventManager=f2;Object.defineProperty(Sn,"__esModule",{value:!0});Sn.CoinbaseWalletSDK=void 0;const p2=Li,g2=Oi,_l=q,m2=Ui,y2=Xr,v2=$n,b2=qn,w2=As,_2=Hn,E2=Bn,Dh=cn;class Is{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||g2.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;if(this._storage=new m2.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Is.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new w2.RelayEventManager;const h=(0,_l.isMobileWeb)(),f=t.uiConstructor||(y=>h?new b2.MobileRelayUI(y):new _2.WalletLinkRelayUI(y)),d={linkAPIUrl:s,version:Dh.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:f,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=h?new v2.MobileRelay(d):new E2.WalletLinkRelay(d),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new y2.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,_l.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,p2.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}Sn.CoinbaseWalletSDK=Is;Is.VERSION=Dh.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=Sn,r=Xr;var n=Sn;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Xr;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(zl);const S2=Hh(zl),B2=Object.freeze(Object.defineProperty({__proto__:null,default:S2},Symbol.toStringTag,{value:"Module"}));export{B2 as i};
|