@dcl/blog-site 0.1.2-22200898455.commit-be7c830 → 0.1.2

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.
Files changed (100) hide show
  1. package/assets/{add-CONdz2L0.js → add-CyVnKjs7.js} +1 -1
  2. package/assets/{all-wallets-BqzhB1kH.js → all-wallets-CG777VR6.js} +1 -1
  3. package/assets/{app-store-CG7fZeTB.js → app-store-CyKybWLW.js} +1 -1
  4. package/assets/{apple-qYUKb-fL.js → apple-BLNXiKyR.js} +1 -1
  5. package/assets/{arrow-bottom-circle-wze6Ib1X.js → arrow-bottom-circle-u-wMwhnf.js} +1 -1
  6. package/assets/{arrow-bottom-SgoHwiLt.js → arrow-bottom-qde4rzT6.js} +1 -1
  7. package/assets/{arrow-left-Bc9t_8h8.js → arrow-left-DfxhJBdw.js} +1 -1
  8. package/assets/{arrow-right-DQoklnFO.js → arrow-right-Cb7w__hM.js} +1 -1
  9. package/assets/{arrow-top-CtzlGQJY.js → arrow-top-BeK_c3eg.js} +1 -1
  10. package/assets/auto-track-BdKMoPcs.js +1 -0
  11. package/assets/{bank-DNHWU_Jg.js → bank-HqtNO_bB.js} +1 -1
  12. package/assets/{basic-PxGakulR.js → basic-BNAPw1FU.js} +1 -1
  13. package/assets/{browser-BNy_mm43.js → browser-DIokFqEe.js} +1 -1
  14. package/assets/{card-g11mKc-V.js → card-DjOl3skX.js} +1 -1
  15. package/assets/{ccip-CdVPatLX.js → ccip-DqBdUu6i.js} +1 -1
  16. package/assets/{checkmark-DhBzwQ6t.js → checkmark-CWKlssVu.js} +1 -1
  17. package/assets/{checkmark-bold-svBeKBAh.js → checkmark-bold-Cj3u8wQw.js} +1 -1
  18. package/assets/{chevron-bottom-DAKGIwRE.js → chevron-bottom-D9yVYRKT.js} +1 -1
  19. package/assets/{chevron-left-pJoxer2X.js → chevron-left-DqBwyuOT.js} +1 -1
  20. package/assets/{chevron-right-BZQxa3gA.js → chevron-right-CKqSAH_x.js} +1 -1
  21. package/assets/{chevron-top-B1p3XmfH.js → chevron-top-DFQOHzSJ.js} +1 -1
  22. package/assets/{chrome-store-eRhpzwit.js → chrome-store-wJopyOxA.js} +1 -1
  23. package/assets/{clock-BAS4ouqS.js → clock-9KCU5m2q.js} +1 -1
  24. package/assets/{close-BAQozjiM.js → close-CAlya4Yr.js} +1 -1
  25. package/assets/{coinPlaceholder-BXdMDAlW.js → coinPlaceholder-D-_nqm5Y.js} +1 -1
  26. package/assets/{compass-DEaXwX19.js → compass-Cc9q07ac.js} +1 -1
  27. package/assets/{copy-D5b4R0M8.js → copy-D0kVMzUr.js} +1 -1
  28. package/assets/{core-Chr5umbM.js → core-o6E0YR6k.js} +4 -4
  29. package/assets/{cursor-CToeUN6u.js → cursor-8Q7GmcGD.js} +1 -1
  30. package/assets/{cursor-transparent-akq7d1Vw.js → cursor-transparent-CURyD4kY.js} +1 -1
  31. package/assets/{desktop-DGBZdcEp.js → desktop-DogYiFjA.js} +1 -1
  32. package/assets/{disconnect-CmKUkObt.js → disconnect-CfgkM-B7.js} +1 -1
  33. package/assets/{discord-AGPJXkYv.js → discord-CqpA_3K8.js} +1 -1
  34. package/assets/{etherscan-BCzO-bJK.js → etherscan-BnynTX8C.js} +1 -1
  35. package/assets/{exclamation-triangle-Dsv91uqg.js → exclamation-triangle-DNM8zLTG.js} +1 -1
  36. package/assets/{extension-DptuMijD.js → extension-BWNgZYd9.js} +1 -1
  37. package/assets/{external-link-BtrWPfav.js → external-link-Dz6LJ8_-.js} +1 -1
  38. package/assets/{facebook-BM1mR9Hc.js → facebook-B4NhgA3g.js} +1 -1
  39. package/assets/{farcaster-BnAwNR4c.js → farcaster-x-xnP4zp.js} +1 -1
  40. package/assets/{filters-DnAaDMtu.js → filters-BCP3KZSL.js} +1 -1
  41. package/assets/{github-BiifJsd8.js → github-Bv7KrAHw.js} +1 -1
  42. package/assets/{google-CsZwT3WU.js → google-CRoKw5G5.js} +1 -1
  43. package/assets/{help-circle-B8Z8NC0j.js → help-circle-JerI1UQH.js} +1 -1
  44. package/assets/{id-DBfaQRNy.js → id-DNx9O1ig.js} +1 -1
  45. package/assets/{image-BaZrELj9.js → image-B5lk579u.js} +1 -1
  46. package/assets/index-B4WTLPXJ.js +1 -0
  47. package/assets/{index-3zjttLF9.js → index-BSNxc2aY.js} +3 -3
  48. package/assets/index-C2CVTEjl.js +1 -0
  49. package/assets/index-C6-wFTel.js +1 -0
  50. package/assets/{index-fyJdZPtk.js → index-CTkJr32f.js} +1 -1
  51. package/assets/index-CXSCOxLa.js +1 -0
  52. package/assets/index-D1_e83sD.js +2 -0
  53. package/assets/index-D6ZMQedT.js +1 -0
  54. package/assets/index-FMsmThma.js +2 -0
  55. package/assets/{index-nDqVr4pH.js → index-I3pSy4Zy.js} +6 -6
  56. package/assets/{index-ch5fmFOv.js → index-m9AvnFPE.js} +124 -124
  57. package/assets/{index.es-Cl1t_1D0.js → index.es-ZeQVkZNG.js} +4 -4
  58. package/assets/index.umd-Du5YokXV.js +1 -0
  59. package/assets/{info-Bbb90kQC.js → info-DJJNUdKr.js} +1 -1
  60. package/assets/{info-circle-DC62YK7p.js → info-circle-D3lYH_jg.js} +1 -1
  61. package/assets/inherits_browser-BlmhoU4v.js +1 -0
  62. package/assets/is-plan-event-enabled-DS1Agtkw.js +1 -0
  63. package/assets/{lightbulb-D3KvOoms.js → lightbulb-lHrmWgEw.js} +1 -1
  64. package/assets/localBatchGatewayRequest-D3hqEo4H.js +1 -0
  65. package/assets/{mail-CgVPzJWi.js → mail-Dv_rw0qa.js} +1 -1
  66. package/assets/{mobile-DkODDOLr.js → mobile-CGf02IdD.js} +1 -1
  67. package/assets/{more-Vzh2YixA.js → more-DbI559Pm.js} +1 -1
  68. package/assets/{network-placeholder-CxREg9uT.js → network-placeholder-B53tzK5r.js} +1 -1
  69. package/assets/{nftPlaceholder-D6oHDmUM.js → nftPlaceholder-GEOyPEQA.js} +1 -1
  70. package/assets/{off-D7hAfKPw.js → off-C_yJUsh4.js} +1 -1
  71. package/assets/{play-store-ymeOX5eL.js → play-store-BJLp1IWs.js} +1 -1
  72. package/assets/{plus-BSW9Aosf.js → plus-D6nAtT6O.js} +1 -1
  73. package/assets/{qr-code-Cl8NBuwd.js → qr-code-lrgu_byx.js} +1 -1
  74. package/assets/{recycle-horizontal-DCp7d4ol.js → recycle-horizontal-CNYe9bbF.js} +1 -1
  75. package/assets/{refresh-CgZM0T20.js → refresh-ChVzXve8.js} +1 -1
  76. package/assets/{reown-logo-C4l2_-Rn.js → reown-logo-BvBUEEeQ.js} +1 -1
  77. package/assets/{search-BFwbgBO3.js → search-DQr5xz8G.js} +1 -1
  78. package/assets/{secp256k1-ceIhvGka.js → secp256k1-B5bjmlpC.js} +1 -1
  79. package/assets/{secp256k1-DoSvwiWn.js → secp256k1-DL-MVpVU.js} +1 -1
  80. package/assets/{send-Bw5bc-ux.js → send-BRFJj9vU.js} +1 -1
  81. package/assets/{swapHorizontal-DjoIz7Pz.js → swapHorizontal-4OcpYjBP.js} +1 -1
  82. package/assets/{swapHorizontalBold-7d-pvfYM.js → swapHorizontalBold-BIfY-n1S.js} +1 -1
  83. package/assets/{swapHorizontalMedium-BS3q74Ag.js → swapHorizontalMedium-D-xOF1-1.js} +1 -1
  84. package/assets/{swapHorizontalRoundedBold-7x4y8KAj.js → swapHorizontalRoundedBold-CWefS__1.js} +1 -1
  85. package/assets/{swapVertical-C-I-lOO2.js → swapVertical-10MLOLxY.js} +1 -1
  86. package/assets/{telegram-NT_2PwmR.js → telegram-CpUsTmvb.js} +1 -1
  87. package/assets/{three-dots-B9XoXaah.js → three-dots-BbzO9tlr.js} +1 -1
  88. package/assets/{twitch-DwklO_-v.js → twitch-DElwGcJp.js} +1 -1
  89. package/assets/{twitterIcon-D01VF8Iy.js → twitterIcon-CGBR8jTt.js} +1 -1
  90. package/assets/{verify-filled-BxWo9YFB.js → verify-filled-DkOi1MVN.js} +1 -1
  91. package/assets/{verify-D15WpctO.js → verify-nSw_mp2u.js} +1 -1
  92. package/assets/{w3m-modal-CGtztDSc.js → w3m-modal-o69qIUHV.js} +1 -1
  93. package/assets/{wallet-JyXNRnFs.js → wallet-CU5Un-2k.js} +1 -1
  94. package/assets/{wallet-placeholder-CSmHe_ZB.js → wallet-placeholder-IZIR9OIq.js} +1 -1
  95. package/assets/{walletconnect-B5GjgoQW.js → walletconnect-BqPmquZK.js} +1 -1
  96. package/assets/{warning-circle-BmgJOTmJ.js → warning-circle-BbDzrW_O.js} +1 -1
  97. package/assets/{x-D1Sk_2KN.js → x-Bc8cF9wJ.js} +1 -1
  98. package/index.html +3 -3
  99. package/package.json +3 -3
  100. package/assets/localBatchGatewayRequest-o8j0FHDn.js +0 -1
@@ -1,12 +1,12 @@
1
- import{bB as ka,c as ee,bH as br,g as an,bI as zh,a as Gh}from"./index-ch5fmFOv.js";import{p as Jh,a as Zh}from"./hooks.module-Dz_XB4AG.js";const Kh=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:ka,default:ka},Symbol.toStringTag,{value:"Module"}));var Mo={exports:{}},$s,Ta;function Yh(){if(Ta)return $s;Ta=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;$s=function(p,v){v=v||{};var b=typeof p;if(b==="string"&&p.length>0)return c(p);if(b==="number"&&isFinite(p))return v.long?f(p):o(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function c(p){if(p=String(p),!(p.length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(v){var b=parseFloat(v[1]),k=(v[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return b*s;case"weeks":case"week":case"w":return b*i;case"days":case"day":case"d":return b*n;case"hours":case"hour":case"hrs":case"hr":case"h":return b*r;case"minutes":case"minute":case"mins":case"min":case"m":return b*t;case"seconds":case"second":case"secs":case"sec":case"s":return b*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function o(p){var v=Math.abs(p);return v>=n?Math.round(p/n)+"d":v>=r?Math.round(p/r)+"h":v>=t?Math.round(p/t)+"m":v>=e?Math.round(p/e)+"s":p+"ms"}function f(p){var v=Math.abs(p);return v>=n?g(p,v,n,"day"):v>=r?g(p,v,r,"hour"):v>=t?g(p,v,t,"minute"):v>=e?g(p,v,e,"second"):p+" ms"}function g(p,v,b,k){var j=v>=b*1.5;return Math.round(p/b)+" "+k+(j?"s":"")}return $s}function Qh(e){r.debug=r,r.default=r,r.coerce=f,r.disable=s,r.enable=i,r.enabled=c,r.humanize=Yh(),r.destroy=g,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let v=0;for(let b=0;b<p.length;b++)v=(v<<5)-v+p.charCodeAt(b),v|=0;return r.colors[Math.abs(v)%r.colors.length]}r.selectColor=t;function r(p){let v,b=null,k,j;function O(...H){if(!O.enabled)return;const A=O,P=Number(new Date),$=P-(v||P);A.diff=$,A.prev=v,A.curr=P,v=P,H[0]=r.coerce(H[0]),typeof H[0]!="string"&&H.unshift("%O");let V=0;H[0]=H[0].replace(/%([a-zA-Z%])/g,(z,te)=>{if(z==="%%")return"%";V++;const Q=r.formatters[te];if(typeof Q=="function"){const Y=H[V];z=Q.call(A,Y),H.splice(V,1),V--}return z}),r.formatArgs.call(A,H),(A.log||r.log).apply(A,H)}return O.namespace=p,O.useColors=r.useColors(),O.color=r.selectColor(p),O.extend=n,O.destroy=r.destroy,Object.defineProperty(O,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(k!==r.namespaces&&(k=r.namespaces,j=r.enabled(p)),j),set:H=>{b=H}}),typeof r.init=="function"&&r.init(O),O}function n(p,v){const b=r(this.namespace+(typeof v>"u"?":":v)+p);return b.log=this.log,b}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let v;const b=(typeof p=="string"?p:"").split(/[\s,]+/),k=b.length;for(v=0;v<k;v++)b[v]&&(p=b[v].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function s(){const p=[...r.names.map(o),...r.skips.map(o).map(v=>"-"+v)].join(",");return r.enable(""),p}function c(p){if(p[p.length-1]==="*")return!0;let v,b;for(v=0,b=r.skips.length;v<b;v++)if(r.skips[v].test(p))return!1;for(v=0,b=r.names.length;v<b;v++)if(r.names[v].test(p))return!0;return!1}function o(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function f(p){return p instanceof Error?p.stack||p.message:p}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Xh=Qh;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=c,t.useColors=n,t.storage=o(),t.destroy=(()=>{let g=!1;return()=>{g||(g=!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(g){if(g[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+g[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;g.splice(1,0,p,"color: inherit");let v=0,b=0;g[0].replace(/%[a-zA-Z%]/g,k=>{k!=="%%"&&(v++,k==="%c"&&(b=v))}),g.splice(b,0,p)}t.log=console.debug||console.log||(()=>{});function s(g){try{g?t.storage.setItem("debug",g):t.storage.removeItem("debug")}catch{}}function c(){let g;try{g=t.storage.getItem("debug")}catch{}return!g&&typeof process<"u"&&"env"in process&&(g=r.DEBUG),g}function o(){try{return localStorage}catch{}}e.exports=Xh(t);const{formatters:f}=e.exports;f.j=function(g){try{return JSON.stringify(g)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(Mo,Mo.exports);var ef=Mo.exports,tf=En;En.default=En;En.stable=Al;En.stableStringify=Al;var Ii="[...]",Il="[Circular]",_r=[],mr=[];function xl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function En(e,t,r,n){typeof n>"u"&&(n=xl()),Co(e,"",0,[],void 0,0,n);var i;try{mr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,kl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var s=_r.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Gr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),_r.push([n,r,t,i])):mr.push([t,r,e]):(n[r]=e,_r.push([n,r,t]))}function Co(e,t,r,n,i,s,c){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){Gr(Il,e,t,i);return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Gr(Ii,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Gr(Ii,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)Co(e[o],o,o,n,e,s,c);else{var f=Object.keys(e);for(o=0;o<f.length;o++){var g=f[o];Co(e[g],g,o,n,e,s,c)}}n.pop()}}function rf(e,t){return e<t?-1:e>t?1:0}function Al(e,t,r,n){typeof n>"u"&&(n=xl());var i=Io(e,"",0,[],void 0,0,n)||e,s;try{mr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,kl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var c=_r.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function Io(e,t,r,n,i,s,c){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){Gr(Il,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Gr(Ii,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Gr(Ii,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)Io(e[o],o,o,n,e,s,c);else{var f={},g=Object.keys(e).sort(rf);for(o=0;o<g.length;o++){var p=g[o];Io(e[p],p,o,n,e,s,c),f[p]=e[p]}if(typeof i<"u")_r.push([i,t,e]),i[t]=f;else return f}n.pop()}}function kl(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(mr.length>0)for(var n=0;n<mr.length;n++){var i=mr[n];if(i[1]===t&&i[0]===r){r=i[2],mr.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,Tl=SyntaxError,In=TypeError,nf=Object.getOwnPropertyDescriptor,_i=nf;if(_i)try{_i([],"length")}catch{_i=null}var xn=_i,Ba=Pi,sf=Tl,Lr=In,Na=xn,of=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Lr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Lr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Lr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Lr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Lr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Lr("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,f=!!Na&&Na(t,r);if(Ba)Ba(t,r,{configurable:c===null&&f?f.configurable:!c,enumerable:i===null&&f?f.enumerable:!i,value:n,writable:s===null&&f?f.writable:!s});else if(o||!i&&!s&&!c)t[r]=n;else throw new sf("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},xo=Pi,Bl=function(){return!!xo};Bl.hasArrayLengthDefineBug=function(){if(!xo)return null;try{return xo([],"length",{value:1}).length!==1}catch{return!0}};var af=Bl,Nl={exports:{}},Pl=Object,cf=Error,lf=EvalError,uf=RangeError,hf=ReferenceError,ff=URIError,df=Math.abs,pf=Math.floor,gf=Math.max,mf=Math.min,yf=Math.pow,vf=Math.round,wf=Number.isNaN||function(t){return t!==t},bf=wf,_f=function(t){return bf(t)||t===0?t:t<0?-1:1},Ll=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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Pa=typeof Symbol<"u"&&Symbol,Ef=Ll,Sf=function(){return typeof Pa!="function"||typeof Symbol!="function"||typeof Pa("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ef()},Ol=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,Rf=Pl,$l=Rf.getPrototypeOf||null,Fs,La;function Mf(){if(La)return Fs;La=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(f,g){for(var p=[],v=0;v<f.length;v+=1)p[v]=f[v];for(var b=0;b<g.length;b+=1)p[b+f.length]=g[b];return p},s=function(f,g){for(var p=[],v=g,b=0;v<f.length;v+=1,b+=1)p[b]=f[v];return p},c=function(o,f){for(var g="",p=0;p<o.length;p+=1)g+=o[p],p+1<o.length&&(g+=f);return g};return Fs=function(f){var g=this;if(typeof g!="function"||t.apply(g)!==n)throw new TypeError(e+g);for(var p=s(arguments,1),v,b=function(){if(this instanceof v){var A=g.apply(this,i(p,arguments));return Object(A)===A?A:this}return g.apply(f,i(p,arguments))},k=r(0,g.length-p.length),j=[],O=0;O<k;O++)j[O]="$"+O;if(v=Function("binder","return function ("+c(j,",")+"){ return binder.apply(this,arguments); }")(b),g.prototype){var H=function(){};H.prototype=g.prototype,v.prototype=new H,H.prototype=null}return v},Fs}var Ds,Oa;function An(){if(Oa)return Ds;Oa=1;var e=Mf();return Ds=Function.prototype.bind||e,Ds}var js,$a;function jo(){return $a||($a=1,js=Function.prototype.call),js}var Us,Fa;function Uo(){return Fa||(Fa=1,Us=Function.prototype.apply),Us}var Cf=typeof Reflect<"u"&&Reflect&&Reflect.apply,If=An(),xf=Uo(),Af=jo(),kf=Cf,Fl=kf||If.call(Af,xf),Tf=An(),Bf=In,Nf=jo(),Pf=Fl,Ho=function(t){if(t.length<1||typeof t[0]!="function")throw new Bf("a function is required");return Pf(Tf,Nf,t)},Lf=Ho,Da=xn,Dl;try{Dl=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Hs=!!Dl&&Da&&Da(Object.prototype,"__proto__"),jl=Object,ja=jl.getPrototypeOf,Of=Hs&&typeof Hs.get=="function"?Lf([Hs.get]):typeof ja=="function"?function(t){return ja(t==null?t:jl(t))}:!1,Ua=Ol,Ha=$l,Wa=Of,Ul=Ua?function(t){return Ua(t)}:Ha?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ha(t)}:Wa?function(t){return Wa(t)}:null,$f=Function.prototype.call,Ff=Object.prototype.hasOwnProperty,Df=An(),jf=Df.call($f,Ff),me,Uf=Pl,Hf=cf,Wf=lf,Vf=uf,qf=hf,Qr=Tl,Jr=In,zf=ff,Gf=df,Jf=pf,Zf=gf,Kf=mf,Yf=yf,Qf=vf,Xf=_f,Hl=Function,Ws=function(e){try{return Hl('"use strict"; return ('+e+").constructor;")()}catch{}},Sn=xn,ed=Pi,Vs=function(){throw new Jr},td=Sn?function(){try{return arguments.callee,Vs}catch{try{return Sn(arguments,"callee").get}catch{return Vs}}}():Vs,Or=Sf(),et=Ul,rd=$l,nd=Ol,Wl=Uo(),kn=jo(),Wr={},id=typeof Uint8Array>"u"||!et?me:et(Uint8Array),vr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":Or&&et?et([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":Wr,"%AsyncGenerator%":Wr,"%AsyncGeneratorFunction%":Wr,"%AsyncIteratorPrototype%":Wr,"%Atomics%":typeof Atomics>"u"?me:Atomics,"%BigInt%":typeof BigInt>"u"?me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Hf,"%eval%":eval,"%EvalError%":Wf,"%Float16Array%":typeof Float16Array>"u"?me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?me:FinalizationRegistry,"%Function%":Hl,"%GeneratorFunction%":Wr,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Or&&et?et(et([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Or||!et?me:et(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Uf,"%Object.getOwnPropertyDescriptor%":Sn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":Vf,"%ReferenceError%":qf,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Or||!et?me:et(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Or&&et?et(""[Symbol.iterator]()):me,"%Symbol%":Or?Symbol:me,"%SyntaxError%":Qr,"%ThrowTypeError%":td,"%TypedArray%":id,"%TypeError%":Jr,"%Uint8Array%":typeof Uint8Array>"u"?me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?me:Uint32Array,"%URIError%":zf,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":kn,"%Function.prototype.apply%":Wl,"%Object.defineProperty%":ed,"%Object.getPrototypeOf%":rd,"%Math.abs%":Gf,"%Math.floor%":Jf,"%Math.max%":Zf,"%Math.min%":Kf,"%Math.pow%":Yf,"%Math.round%":Qf,"%Math.sign%":Xf,"%Reflect.getPrototypeOf%":nd};if(et)try{null.error}catch(e){var sd=et(et(e));vr["%Error.prototype%"]=sd}var od=function e(t){var r;if(t==="%AsyncFunction%")r=Ws("async function () {}");else if(t==="%GeneratorFunction%")r=Ws("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Ws("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&et&&(r=et(i.prototype))}return vr[t]=r,r},Va={__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"]},Tn=An(),xi=jf,ad=Tn.call(kn,Array.prototype.concat),cd=Tn.call(Wl,Array.prototype.splice),qa=Tn.call(kn,String.prototype.replace),Ai=Tn.call(kn,String.prototype.slice),ld=Tn.call(kn,RegExp.prototype.exec),ud=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,hd=/\\(\\)?/g,fd=function(t){var r=Ai(t,0,1),n=Ai(t,-1);if(r==="%"&&n!=="%")throw new Qr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Qr("invalid intrinsic syntax, expected opening `%`");var i=[];return qa(t,ud,function(s,c,o,f){i[i.length]=o?qa(f,hd,"$1"):c||s}),i},dd=function(t,r){var n=t,i;if(xi(Va,n)&&(i=Va[n],n="%"+i[0]+"%"),xi(vr,n)){var s=vr[n];if(s===Wr&&(s=od(n)),typeof s>"u"&&!r)throw new Jr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Qr("intrinsic "+t+" does not exist!")},Vl=function(t,r){if(typeof t!="string"||t.length===0)throw new Jr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Jr('"allowMissing" argument must be a boolean');if(ld(/^%?[^%]*%?$/,t)===null)throw new Qr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=fd(t),i=n.length>0?n[0]:"",s=dd("%"+i+"%",r),c=s.name,o=s.value,f=!1,g=s.alias;g&&(i=g[0],cd(n,ad([0,1],g)));for(var p=1,v=!0;p<n.length;p+=1){var b=n[p],k=Ai(b,0,1),j=Ai(b,-1);if((k==='"'||k==="'"||k==="`"||j==='"'||j==="'"||j==="`")&&k!==j)throw new Qr("property names with quotes must have matching quotes");if((b==="constructor"||!v)&&(f=!0),i+="."+b,c="%"+i+"%",xi(vr,c))o=vr[c];else if(o!=null){if(!(b in o)){if(!r)throw new Jr("base intrinsic for "+t+" exists, but the property is not available.");return}if(Sn&&p+1>=n.length){var O=Sn(o,b);v=!!O,v&&"get"in O&&!("originalValue"in O.get)?o=O.get:o=o[b]}else v=xi(o,b),o=o[b];v&&!f&&(vr[c]=o)}}return o},pd=Vl,za=of,gd=af(),Ga=xn,Ja=In,md=pd("%Math.floor%"),yd=function(t,r){if(typeof t!="function")throw new Ja("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||md(r)!==r)throw new Ja("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&Ga){var c=Ga(t,"length");c&&!c.configurable&&(i=!1),c&&!c.writable&&(s=!1)}return(i||s||!n)&&(gd?za(t,"length",r,!0,!0):za(t,"length",r)),t},vd=An(),wd=Uo(),bd=Fl,_d=function(){return bd(vd,wd,arguments)};(function(e){var t=yd,r=Pi,n=Ho,i=_d;e.exports=function(c){var o=n(arguments),f=c.length-(arguments.length-1);return t(o,1+(f>0?f:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i})(Nl);var Ed=Nl.exports,ql=Vl,zl=Ho,Sd=zl([ql("%String.prototype.indexOf%")]),Gl=function(t,r){var n=ql(t,!!r);return typeof n=="function"&&Sd(t,".prototype.")>-1?zl([n]):n},Rd=Ll,Md=function(){return Rd()&&!!Symbol.toStringTag},Cd={}.toString,Id=Array.isArray||function(e){return Cd.call(e)=="[object Array]"},Jl=Function.prototype.toString,qr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ao,Ei;if(typeof qr=="function"&&typeof Object.defineProperty=="function")try{Ao=Object.defineProperty({},"length",{get:function(){throw Ei}}),Ei={},qr(function(){throw 42},null,Ao)}catch(e){e!==Ei&&(qr=null)}else qr=null;var xd=/^\s*class\b/,ko=function(t){try{var r=Jl.call(t);return xd.test(r)}catch{return!1}},qs=function(t){try{return ko(t)?!1:(Jl.call(t),!0)}catch{return!1}},Si=Object.prototype.toString,Ad="[object Object]",kd="[object Function]",Td="[object GeneratorFunction]",Bd="[object HTMLAllCollection]",Nd="[object HTML document.all class]",Pd="[object HTMLCollection]",Ld=typeof Symbol=="function"&&!!Symbol.toStringTag,Od=!(0 in[,]),To=function(){return!1};if(typeof document=="object"){var $d=document.all;Si.call($d)===Si.call(document.all)&&(To=function(t){if((Od||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=Si.call(t);return(r===Bd||r===Nd||r===Pd||r===Ad)&&t("")==null}catch{}return!1})}var Fd=qr?function(t){if(To(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{qr(t,null,Ao)}catch(r){if(r!==Ei)return!1}return!ko(t)&&qs(t)}:function(t){if(To(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Ld)return qs(t);if(ko(t))return!1;var r=Si.call(t);return r!==kd&&r!==Td&&!/^\[object HTML/.test(r)?!1:qs(t)},Dd=Fd,jd=Object.prototype.toString,Zl=Object.prototype.hasOwnProperty,Ud=function(t,r,n){for(var i=0,s=t.length;i<s;i++)Zl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))},Hd=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)},Wd=function(t,r,n){for(var i in t)Zl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))};function Vd(e){return jd.call(e)==="[object Array]"}var qd=function(t,r,n){if(!Dd(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Vd(t)?Ud(t,r,i):typeof t=="string"?Hd(t,r,i):Wd(t,r,i)},zd=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],zs=zd,Gd=typeof globalThis>"u"?ee:globalThis,Jd=function(){for(var t=[],r=0;r<zs.length;r++)typeof Gd[zs[r]]=="function"&&(t[t.length]=zs[r]);return t},ki=qd,Zd=Jd,Za=Ed,Wo=Gl,Ri=xn,ii=Ul,Kd=Wo("Object.prototype.toString"),Kl=Md(),Ka=typeof globalThis>"u"?ee:globalThis,Bo=Zd(),Vo=Wo("String.prototype.slice"),Yd=Wo("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},Ti={__proto__:null};Kl&&Ri&&ii?ki(Bo,function(e){var t=new Ka[e];if(Symbol.toStringTag in t&&ii){var r=ii(t),n=Ri(r,Symbol.toStringTag);if(!n&&r){var i=ii(r);n=Ri(i,Symbol.toStringTag)}Ti["$"+e]=Za(n.get)}}):ki(Bo,function(e){var t=new Ka[e],r=t.slice||t.set;r&&(Ti["$"+e]=Za(r))});var Qd=function(t){var r=!1;return ki(Ti,function(n,i){if(!r)try{"$"+n(t)===i&&(r=Vo(i,1))}catch{}}),r},Xd=function(t){var r=!1;return ki(Ti,function(n,i){if(!r)try{n(t),r=Vo(i,1)}catch{}}),r},e0=function(t){if(!t||typeof t!="object")return!1;if(!Kl){var r=Vo(Kd(t),8,-1);return Yd(Bo,r)>-1?r:r!=="Object"?!1:Xd(t)}return Ri?Qd(t):null},Yl={},Rn={},Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.walletLogo=void 0;const t0=(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=t0;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.LINK_API_URL=void 0;Oi.LINK_API_URL="https://www.walletlink.org";var X={},qo={exports:{}};qo.exports;(function(e){(function(t,r){function n(x,a){if(!x)throw new Error(a||"Assertion failed")}function i(x,a){x.super_=a;var d=function(){};d.prototype=a.prototype,x.prototype=new d,x.prototype.constructor=x}function s(x,a,d){if(s.isBN(x))return x;this.negative=0,this.words=null,this.length=0,this.red=null,x!==null&&((a==="le"||a==="be")&&(d=a,a=10),this._init(x||0,a||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=br.Buffer}catch{}s.isBN=function(a){return a instanceof s?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,d){return a.cmp(d)>0?a:d},s.min=function(a,d){return a.cmp(d)<0?a:d},s.prototype._init=function(a,d,y){if(typeof a=="number")return this._initNumber(a,d,y);if(typeof a=="object")return this._initArray(a,d,y);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),a=a.toString().replace(/\s+/g,"");var w=0;a[0]==="-"&&(w++,this.negative=1),w<a.length&&(d===16?this._parseHex(a,w,y):(this._parseBase(a,d,w),y==="le"&&this._initArray(this.toArray(),d,y)))},s.prototype._initNumber=function(a,d,y){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),d,y)},s.prototype._initArray=function(a,d,y){if(n(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var S,I,B=0;if(y==="be")for(w=a.length-1,S=0;w>=0;w-=3)I=a[w]|a[w-1]<<8|a[w-2]<<16,this.words[S]|=I<<B&67108863,this.words[S+1]=I>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);else if(y==="le")for(w=0,S=0;w<a.length;w+=3)I=a[w]|a[w+1]<<8|a[w+2]<<16,this.words[S]|=I<<B&67108863,this.words[S+1]=I>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);return this._strip()};function o(x,a){var d=x.charCodeAt(a);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+x)}function f(x,a,d){var y=o(x,d);return d-1>=a&&(y|=o(x,d-1)<<4),y}s.prototype._parseHex=function(a,d,y){this.length=Math.ceil((a.length-d)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var S=0,I=0,B;if(y==="be")for(w=a.length-1;w>=d;w-=2)B=f(a,d,w)<<S,this.words[I]|=B&67108863,S>=18?(S-=18,I+=1,this.words[I]|=B>>>26):S+=8;else{var _=a.length-d;for(w=_%2===0?d+1:d;w<a.length;w+=2)B=f(a,d,w)<<S,this.words[I]|=B&67108863,S>=18?(S-=18,I+=1,this.words[I]|=B>>>26):S+=8}this._strip()};function g(x,a,d,y){for(var w=0,S=0,I=Math.min(x.length,d),B=a;B<I;B++){var _=x.charCodeAt(B)-48;w*=y,_>=49?S=_-49+10:_>=17?S=_-17+10:S=_,n(_>=0&&S<y,"Invalid character"),w+=S}return w}s.prototype._parseBase=function(a,d,y){this.words=[0],this.length=1;for(var w=0,S=1;S<=67108863;S*=d)w++;w--,S=S/d|0;for(var I=a.length-y,B=I%w,_=Math.min(I,I-B)+y,u=0,R=y;R<_;R+=w)u=g(a,R,R+w,d),this.imuln(S),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(B!==0){var K=1;for(u=g(a,R,a.length,d),R=0;R<B;R++)K*=d;this.imuln(K),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},s.prototype.copy=function(a){a.words=new Array(this.length);for(var d=0;d<this.length;d++)a.words[d]=this.words[d];a.length=this.length,a.negative=this.negative,a.red=this.red};function p(x,a){x.words=a.words,x.length=a.length,x.negative=a.negative,x.red=a.red}if(s.prototype._move=function(a){p(a,this)},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){for(;this.length<a;)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")]=v}catch{s.prototype.inspect=v}else s.prototype.inspect=v;function v(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],k=[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],j=[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(a,d){a=a||10,d=d|0||1;var y;if(a===16||a==="hex"){y="";for(var w=0,S=0,I=0;I<this.length;I++){var B=this.words[I],_=((B<<w|S)&16777215).toString(16);S=B>>>24-w&16777215,w+=2,w>=26&&(w-=26,I--),S!==0||I!==this.length-1?y=b[6-_.length]+_+y:y=_+y}for(S!==0&&(y=S.toString(16)+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(a===(a|0)&&a>=2&&a<=36){var u=k[a],R=j[a];y="";var K=this.clone();for(K.negative=0;!K.isZero();){var J=K.modrn(R).toString(a);K=K.idivn(R),K.isZero()?y=J+y:y=b[u-J.length]+J+y}for(this.isZero()&&(y="0"+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16,2)},c&&(s.prototype.toBuffer=function(a,d){return this.toArrayLike(c,a,d)}),s.prototype.toArray=function(a,d){return this.toArrayLike(Array,a,d)};var O=function(a,d){return a.allocUnsafe?a.allocUnsafe(d):new a(d)};s.prototype.toArrayLike=function(a,d,y){this._strip();var w=this.byteLength(),S=y||Math.max(1,w);n(w<=S,"byte array longer than desired length"),n(S>0,"Requested array length <= 0");var I=O(a,S),B=d==="le"?"LE":"BE";return this["_toArrayLike"+B](I,w),I},s.prototype._toArrayLikeLE=function(a,d){for(var y=0,w=0,S=0,I=0;S<this.length;S++){var B=this.words[S]<<I|w;a[y++]=B&255,y<a.length&&(a[y++]=B>>8&255),y<a.length&&(a[y++]=B>>16&255),I===6?(y<a.length&&(a[y++]=B>>24&255),w=0,I=0):(w=B>>>24,I+=2)}if(y<a.length)for(a[y++]=w;y<a.length;)a[y++]=0},s.prototype._toArrayLikeBE=function(a,d){for(var y=a.length-1,w=0,S=0,I=0;S<this.length;S++){var B=this.words[S]<<I|w;a[y--]=B&255,y>=0&&(a[y--]=B>>8&255),y>=0&&(a[y--]=B>>16&255),I===6?(y>=0&&(a[y--]=B>>24&255),w=0,I=0):(w=B>>>24,I+=2)}if(y>=0)for(a[y--]=w;y>=0;)a[y--]=0},Math.clz32?s.prototype._countBits=function(a){return 32-Math.clz32(a)}:s.prototype._countBits=function(a){var d=a,y=0;return d>=4096&&(y+=13,d>>>=13),d>=64&&(y+=7,d>>>=7),d>=8&&(y+=4,d>>>=4),d>=2&&(y+=2,d>>>=2),y+d},s.prototype._zeroBits=function(a){if(a===0)return 26;var d=a,y=0;return d&8191||(y+=13,d>>>=13),d&127||(y+=7,d>>>=7),d&15||(y+=4,d>>>=4),d&3||(y+=2,d>>>=2),d&1||y++,y},s.prototype.bitLength=function(){var a=this.words[this.length-1],d=this._countBits(a);return(this.length-1)*26+d};function H(x){for(var a=new Array(x.bitLength()),d=0;d<a.length;d++){var y=d/26|0,w=d%26;a[d]=x.words[y]>>>w&1}return a}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(a+=y,y!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},s.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).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(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var d=0;d<a.length;d++)this.words[d]=this.words[d]|a.words[d];return this._strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},s.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},s.prototype.iuand=function(a){var d;this.length>a.length?d=a:d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&a.words[y];return this.length=d.length,this._strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},s.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},s.prototype.iuxor=function(a){var d,y;this.length>a.length?(d=this,y=a):(d=a,y=this);for(var w=0;w<y.length;w++)this.words[w]=d.words[w]^y.words[w];if(this!==d)for(;w<d.length;w++)this.words[w]=d.words[w];return this.length=d.length,this._strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},s.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a=="number"&&a>=0);var d=Math.ceil(a/26)|0,y=a%26;this._expand(d),y>0&&d--;for(var w=0;w<d;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this._strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,d){n(typeof a=="number"&&a>=0);var y=a/26|0,w=a%26;return this._expand(y+1),d?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this._strip()},s.prototype.iadd=function(a){var d;if(this.negative!==0&&a.negative===0)return this.negative=0,d=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,d=this.isub(a),a.negative=1,d._normSign();var y,w;this.length>a.length?(y=this,w=a):(y=a,w=this);for(var S=0,I=0;I<w.length;I++)d=(y.words[I]|0)+(w.words[I]|0)+S,this.words[I]=d&67108863,S=d>>>26;for(;S!==0&&I<y.length;I++)d=(y.words[I]|0)+S,this.words[I]=d&67108863,S=d>>>26;if(this.length=y.length,S!==0)this.words[this.length]=S,this.length++;else if(y!==this)for(;I<y.length;I++)this.words[I]=y.words[I];return this},s.prototype.add=function(a){var d;return a.negative!==0&&this.negative===0?(a.negative=0,d=this.sub(a),a.negative^=1,d):a.negative===0&&this.negative!==0?(this.negative=0,d=a.sub(this),this.negative=1,d):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var d=this.iadd(a);return a.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var y=this.cmp(a);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,S;y>0?(w=this,S=a):(w=a,S=this);for(var I=0,B=0;B<S.length;B++)d=(w.words[B]|0)-(S.words[B]|0)+I,I=d>>26,this.words[B]=d&67108863;for(;I!==0&&B<w.length;B++)d=(w.words[B]|0)+I,I=d>>26,this.words[B]=d&67108863;if(I===0&&B<w.length&&w!==this)for(;B<w.length;B++)this.words[B]=w.words[B];return this.length=Math.max(this.length,B),w!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function A(x,a,d){d.negative=a.negative^x.negative;var y=x.length+a.length|0;d.length=y,y=y-1|0;var w=x.words[0]|0,S=a.words[0]|0,I=w*S,B=I&67108863,_=I/67108864|0;d.words[0]=B;for(var u=1;u<y;u++){for(var R=_>>>26,K=_&67108863,J=Math.min(u,a.length-1),T=Math.max(0,u-x.length+1);T<=J;T++){var L=u-T|0;w=x.words[L]|0,S=a.words[T]|0,I=w*S+K,R+=I/67108864|0,K=I&67108863}d.words[u]=K|0,_=R|0}return _!==0?d.words[u]=_|0:d.length--,d._strip()}var P=function(a,d,y){var w=a.words,S=d.words,I=y.words,B=0,_,u,R,K=w[0]|0,J=K&8191,T=K>>>13,L=w[1]|0,W=L&8191,Z=L>>>13,le=w[2]|0,M=le&8191,C=le>>>13,q=w[3]|0,G=q&8191,se=q>>>13,ue=w[4]|0,re=ue&8191,be=ue>>>13,pt=w[5]|0,Re=pt&8191,Se=pt>>>13,Ze=w[6]|0,_e=Ze&8191,Me=Ze>>>13,Qe=w[7]|0,Ee=Qe&8191,m=Qe>>>13,l=w[8]|0,h=l&8191,E=l>>>13,N=w[9]|0,F=N&8191,U=N>>>13,he=S[0]|0,ae=he&8191,ie=he>>>13,Ce=S[1]|0,ne=Ce&8191,Ie=Ce>>>13,Ir=S[2]|0,xe=Ir&8191,Ae=Ir>>>13,xr=S[3]|0,ke=xr&8191,Te=xr>>>13,Ar=S[4]|0,Be=Ar&8191,Ne=Ar>>>13,kr=S[5]|0,Pe=kr&8191,Le=kr>>>13,Tr=S[6]|0,Oe=Tr&8191,$e=Tr>>>13,Br=S[7]|0,Fe=Br&8191,De=Br>>>13,Nr=S[8]|0,je=Nr&8191,Ue=Nr>>>13,Pr=S[9]|0,He=Pr&8191,We=Pr>>>13;y.negative=a.negative^d.negative,y.length=19,_=Math.imul(J,ae),u=Math.imul(J,ie),u=u+Math.imul(T,ae)|0,R=Math.imul(T,ie);var Kt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,_=Math.imul(W,ae),u=Math.imul(W,ie),u=u+Math.imul(Z,ae)|0,R=Math.imul(Z,ie),_=_+Math.imul(J,ne)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(T,ne)|0,R=R+Math.imul(T,Ie)|0;var Yt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,_=Math.imul(M,ae),u=Math.imul(M,ie),u=u+Math.imul(C,ae)|0,R=Math.imul(C,ie),_=_+Math.imul(W,ne)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(Z,ne)|0,R=R+Math.imul(Z,Ie)|0,_=_+Math.imul(J,xe)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(T,xe)|0,R=R+Math.imul(T,Ae)|0;var Qt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,_=Math.imul(G,ae),u=Math.imul(G,ie),u=u+Math.imul(se,ae)|0,R=Math.imul(se,ie),_=_+Math.imul(M,ne)|0,u=u+Math.imul(M,Ie)|0,u=u+Math.imul(C,ne)|0,R=R+Math.imul(C,Ie)|0,_=_+Math.imul(W,xe)|0,u=u+Math.imul(W,Ae)|0,u=u+Math.imul(Z,xe)|0,R=R+Math.imul(Z,Ae)|0,_=_+Math.imul(J,ke)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(T,ke)|0,R=R+Math.imul(T,Te)|0;var Xt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,_=Math.imul(re,ae),u=Math.imul(re,ie),u=u+Math.imul(be,ae)|0,R=Math.imul(be,ie),_=_+Math.imul(G,ne)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(se,ne)|0,R=R+Math.imul(se,Ie)|0,_=_+Math.imul(M,xe)|0,u=u+Math.imul(M,Ae)|0,u=u+Math.imul(C,xe)|0,R=R+Math.imul(C,Ae)|0,_=_+Math.imul(W,ke)|0,u=u+Math.imul(W,Te)|0,u=u+Math.imul(Z,ke)|0,R=R+Math.imul(Z,Te)|0,_=_+Math.imul(J,Be)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(T,Be)|0,R=R+Math.imul(T,Ne)|0;var er=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(er>>>26)|0,er&=67108863,_=Math.imul(Re,ae),u=Math.imul(Re,ie),u=u+Math.imul(Se,ae)|0,R=Math.imul(Se,ie),_=_+Math.imul(re,ne)|0,u=u+Math.imul(re,Ie)|0,u=u+Math.imul(be,ne)|0,R=R+Math.imul(be,Ie)|0,_=_+Math.imul(G,xe)|0,u=u+Math.imul(G,Ae)|0,u=u+Math.imul(se,xe)|0,R=R+Math.imul(se,Ae)|0,_=_+Math.imul(M,ke)|0,u=u+Math.imul(M,Te)|0,u=u+Math.imul(C,ke)|0,R=R+Math.imul(C,Te)|0,_=_+Math.imul(W,Be)|0,u=u+Math.imul(W,Ne)|0,u=u+Math.imul(Z,Be)|0,R=R+Math.imul(Z,Ne)|0,_=_+Math.imul(J,Pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(T,Pe)|0,R=R+Math.imul(T,Le)|0;var tr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,_=Math.imul(_e,ae),u=Math.imul(_e,ie),u=u+Math.imul(Me,ae)|0,R=Math.imul(Me,ie),_=_+Math.imul(Re,ne)|0,u=u+Math.imul(Re,Ie)|0,u=u+Math.imul(Se,ne)|0,R=R+Math.imul(Se,Ie)|0,_=_+Math.imul(re,xe)|0,u=u+Math.imul(re,Ae)|0,u=u+Math.imul(be,xe)|0,R=R+Math.imul(be,Ae)|0,_=_+Math.imul(G,ke)|0,u=u+Math.imul(G,Te)|0,u=u+Math.imul(se,ke)|0,R=R+Math.imul(se,Te)|0,_=_+Math.imul(M,Be)|0,u=u+Math.imul(M,Ne)|0,u=u+Math.imul(C,Be)|0,R=R+Math.imul(C,Ne)|0,_=_+Math.imul(W,Pe)|0,u=u+Math.imul(W,Le)|0,u=u+Math.imul(Z,Pe)|0,R=R+Math.imul(Z,Le)|0,_=_+Math.imul(J,Oe)|0,u=u+Math.imul(J,$e)|0,u=u+Math.imul(T,Oe)|0,R=R+Math.imul(T,$e)|0;var rr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(rr>>>26)|0,rr&=67108863,_=Math.imul(Ee,ae),u=Math.imul(Ee,ie),u=u+Math.imul(m,ae)|0,R=Math.imul(m,ie),_=_+Math.imul(_e,ne)|0,u=u+Math.imul(_e,Ie)|0,u=u+Math.imul(Me,ne)|0,R=R+Math.imul(Me,Ie)|0,_=_+Math.imul(Re,xe)|0,u=u+Math.imul(Re,Ae)|0,u=u+Math.imul(Se,xe)|0,R=R+Math.imul(Se,Ae)|0,_=_+Math.imul(re,ke)|0,u=u+Math.imul(re,Te)|0,u=u+Math.imul(be,ke)|0,R=R+Math.imul(be,Te)|0,_=_+Math.imul(G,Be)|0,u=u+Math.imul(G,Ne)|0,u=u+Math.imul(se,Be)|0,R=R+Math.imul(se,Ne)|0,_=_+Math.imul(M,Pe)|0,u=u+Math.imul(M,Le)|0,u=u+Math.imul(C,Pe)|0,R=R+Math.imul(C,Le)|0,_=_+Math.imul(W,Oe)|0,u=u+Math.imul(W,$e)|0,u=u+Math.imul(Z,Oe)|0,R=R+Math.imul(Z,$e)|0,_=_+Math.imul(J,Fe)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(T,Fe)|0,R=R+Math.imul(T,De)|0;var nr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(nr>>>26)|0,nr&=67108863,_=Math.imul(h,ae),u=Math.imul(h,ie),u=u+Math.imul(E,ae)|0,R=Math.imul(E,ie),_=_+Math.imul(Ee,ne)|0,u=u+Math.imul(Ee,Ie)|0,u=u+Math.imul(m,ne)|0,R=R+Math.imul(m,Ie)|0,_=_+Math.imul(_e,xe)|0,u=u+Math.imul(_e,Ae)|0,u=u+Math.imul(Me,xe)|0,R=R+Math.imul(Me,Ae)|0,_=_+Math.imul(Re,ke)|0,u=u+Math.imul(Re,Te)|0,u=u+Math.imul(Se,ke)|0,R=R+Math.imul(Se,Te)|0,_=_+Math.imul(re,Be)|0,u=u+Math.imul(re,Ne)|0,u=u+Math.imul(be,Be)|0,R=R+Math.imul(be,Ne)|0,_=_+Math.imul(G,Pe)|0,u=u+Math.imul(G,Le)|0,u=u+Math.imul(se,Pe)|0,R=R+Math.imul(se,Le)|0,_=_+Math.imul(M,Oe)|0,u=u+Math.imul(M,$e)|0,u=u+Math.imul(C,Oe)|0,R=R+Math.imul(C,$e)|0,_=_+Math.imul(W,Fe)|0,u=u+Math.imul(W,De)|0,u=u+Math.imul(Z,Fe)|0,R=R+Math.imul(Z,De)|0,_=_+Math.imul(J,je)|0,u=u+Math.imul(J,Ue)|0,u=u+Math.imul(T,je)|0,R=R+Math.imul(T,Ue)|0;var ir=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ir>>>26)|0,ir&=67108863,_=Math.imul(F,ae),u=Math.imul(F,ie),u=u+Math.imul(U,ae)|0,R=Math.imul(U,ie),_=_+Math.imul(h,ne)|0,u=u+Math.imul(h,Ie)|0,u=u+Math.imul(E,ne)|0,R=R+Math.imul(E,Ie)|0,_=_+Math.imul(Ee,xe)|0,u=u+Math.imul(Ee,Ae)|0,u=u+Math.imul(m,xe)|0,R=R+Math.imul(m,Ae)|0,_=_+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Te)|0,u=u+Math.imul(Me,ke)|0,R=R+Math.imul(Me,Te)|0,_=_+Math.imul(Re,Be)|0,u=u+Math.imul(Re,Ne)|0,u=u+Math.imul(Se,Be)|0,R=R+Math.imul(Se,Ne)|0,_=_+Math.imul(re,Pe)|0,u=u+Math.imul(re,Le)|0,u=u+Math.imul(be,Pe)|0,R=R+Math.imul(be,Le)|0,_=_+Math.imul(G,Oe)|0,u=u+Math.imul(G,$e)|0,u=u+Math.imul(se,Oe)|0,R=R+Math.imul(se,$e)|0,_=_+Math.imul(M,Fe)|0,u=u+Math.imul(M,De)|0,u=u+Math.imul(C,Fe)|0,R=R+Math.imul(C,De)|0,_=_+Math.imul(W,je)|0,u=u+Math.imul(W,Ue)|0,u=u+Math.imul(Z,je)|0,R=R+Math.imul(Z,Ue)|0,_=_+Math.imul(J,He)|0,u=u+Math.imul(J,We)|0,u=u+Math.imul(T,He)|0,R=R+Math.imul(T,We)|0;var sr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,_=Math.imul(F,ne),u=Math.imul(F,Ie),u=u+Math.imul(U,ne)|0,R=Math.imul(U,Ie),_=_+Math.imul(h,xe)|0,u=u+Math.imul(h,Ae)|0,u=u+Math.imul(E,xe)|0,R=R+Math.imul(E,Ae)|0,_=_+Math.imul(Ee,ke)|0,u=u+Math.imul(Ee,Te)|0,u=u+Math.imul(m,ke)|0,R=R+Math.imul(m,Te)|0,_=_+Math.imul(_e,Be)|0,u=u+Math.imul(_e,Ne)|0,u=u+Math.imul(Me,Be)|0,R=R+Math.imul(Me,Ne)|0,_=_+Math.imul(Re,Pe)|0,u=u+Math.imul(Re,Le)|0,u=u+Math.imul(Se,Pe)|0,R=R+Math.imul(Se,Le)|0,_=_+Math.imul(re,Oe)|0,u=u+Math.imul(re,$e)|0,u=u+Math.imul(be,Oe)|0,R=R+Math.imul(be,$e)|0,_=_+Math.imul(G,Fe)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(se,Fe)|0,R=R+Math.imul(se,De)|0,_=_+Math.imul(M,je)|0,u=u+Math.imul(M,Ue)|0,u=u+Math.imul(C,je)|0,R=R+Math.imul(C,Ue)|0,_=_+Math.imul(W,He)|0,u=u+Math.imul(W,We)|0,u=u+Math.imul(Z,He)|0,R=R+Math.imul(Z,We)|0;var or=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(or>>>26)|0,or&=67108863,_=Math.imul(F,xe),u=Math.imul(F,Ae),u=u+Math.imul(U,xe)|0,R=Math.imul(U,Ae),_=_+Math.imul(h,ke)|0,u=u+Math.imul(h,Te)|0,u=u+Math.imul(E,ke)|0,R=R+Math.imul(E,Te)|0,_=_+Math.imul(Ee,Be)|0,u=u+Math.imul(Ee,Ne)|0,u=u+Math.imul(m,Be)|0,R=R+Math.imul(m,Ne)|0,_=_+Math.imul(_e,Pe)|0,u=u+Math.imul(_e,Le)|0,u=u+Math.imul(Me,Pe)|0,R=R+Math.imul(Me,Le)|0,_=_+Math.imul(Re,Oe)|0,u=u+Math.imul(Re,$e)|0,u=u+Math.imul(Se,Oe)|0,R=R+Math.imul(Se,$e)|0,_=_+Math.imul(re,Fe)|0,u=u+Math.imul(re,De)|0,u=u+Math.imul(be,Fe)|0,R=R+Math.imul(be,De)|0,_=_+Math.imul(G,je)|0,u=u+Math.imul(G,Ue)|0,u=u+Math.imul(se,je)|0,R=R+Math.imul(se,Ue)|0,_=_+Math.imul(M,He)|0,u=u+Math.imul(M,We)|0,u=u+Math.imul(C,He)|0,R=R+Math.imul(C,We)|0;var ar=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,_=Math.imul(F,ke),u=Math.imul(F,Te),u=u+Math.imul(U,ke)|0,R=Math.imul(U,Te),_=_+Math.imul(h,Be)|0,u=u+Math.imul(h,Ne)|0,u=u+Math.imul(E,Be)|0,R=R+Math.imul(E,Ne)|0,_=_+Math.imul(Ee,Pe)|0,u=u+Math.imul(Ee,Le)|0,u=u+Math.imul(m,Pe)|0,R=R+Math.imul(m,Le)|0,_=_+Math.imul(_e,Oe)|0,u=u+Math.imul(_e,$e)|0,u=u+Math.imul(Me,Oe)|0,R=R+Math.imul(Me,$e)|0,_=_+Math.imul(Re,Fe)|0,u=u+Math.imul(Re,De)|0,u=u+Math.imul(Se,Fe)|0,R=R+Math.imul(Se,De)|0,_=_+Math.imul(re,je)|0,u=u+Math.imul(re,Ue)|0,u=u+Math.imul(be,je)|0,R=R+Math.imul(be,Ue)|0,_=_+Math.imul(G,He)|0,u=u+Math.imul(G,We)|0,u=u+Math.imul(se,He)|0,R=R+Math.imul(se,We)|0;var cr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,_=Math.imul(F,Be),u=Math.imul(F,Ne),u=u+Math.imul(U,Be)|0,R=Math.imul(U,Ne),_=_+Math.imul(h,Pe)|0,u=u+Math.imul(h,Le)|0,u=u+Math.imul(E,Pe)|0,R=R+Math.imul(E,Le)|0,_=_+Math.imul(Ee,Oe)|0,u=u+Math.imul(Ee,$e)|0,u=u+Math.imul(m,Oe)|0,R=R+Math.imul(m,$e)|0,_=_+Math.imul(_e,Fe)|0,u=u+Math.imul(_e,De)|0,u=u+Math.imul(Me,Fe)|0,R=R+Math.imul(Me,De)|0,_=_+Math.imul(Re,je)|0,u=u+Math.imul(Re,Ue)|0,u=u+Math.imul(Se,je)|0,R=R+Math.imul(Se,Ue)|0,_=_+Math.imul(re,He)|0,u=u+Math.imul(re,We)|0,u=u+Math.imul(be,He)|0,R=R+Math.imul(be,We)|0;var lr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,_=Math.imul(F,Pe),u=Math.imul(F,Le),u=u+Math.imul(U,Pe)|0,R=Math.imul(U,Le),_=_+Math.imul(h,Oe)|0,u=u+Math.imul(h,$e)|0,u=u+Math.imul(E,Oe)|0,R=R+Math.imul(E,$e)|0,_=_+Math.imul(Ee,Fe)|0,u=u+Math.imul(Ee,De)|0,u=u+Math.imul(m,Fe)|0,R=R+Math.imul(m,De)|0,_=_+Math.imul(_e,je)|0,u=u+Math.imul(_e,Ue)|0,u=u+Math.imul(Me,je)|0,R=R+Math.imul(Me,Ue)|0,_=_+Math.imul(Re,He)|0,u=u+Math.imul(Re,We)|0,u=u+Math.imul(Se,He)|0,R=R+Math.imul(Se,We)|0;var Bs=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,_=Math.imul(F,Oe),u=Math.imul(F,$e),u=u+Math.imul(U,Oe)|0,R=Math.imul(U,$e),_=_+Math.imul(h,Fe)|0,u=u+Math.imul(h,De)|0,u=u+Math.imul(E,Fe)|0,R=R+Math.imul(E,De)|0,_=_+Math.imul(Ee,je)|0,u=u+Math.imul(Ee,Ue)|0,u=u+Math.imul(m,je)|0,R=R+Math.imul(m,Ue)|0,_=_+Math.imul(_e,He)|0,u=u+Math.imul(_e,We)|0,u=u+Math.imul(Me,He)|0,R=R+Math.imul(Me,We)|0;var Ns=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,_=Math.imul(F,Fe),u=Math.imul(F,De),u=u+Math.imul(U,Fe)|0,R=Math.imul(U,De),_=_+Math.imul(h,je)|0,u=u+Math.imul(h,Ue)|0,u=u+Math.imul(E,je)|0,R=R+Math.imul(E,Ue)|0,_=_+Math.imul(Ee,He)|0,u=u+Math.imul(Ee,We)|0,u=u+Math.imul(m,He)|0,R=R+Math.imul(m,We)|0;var Ps=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,_=Math.imul(F,je),u=Math.imul(F,Ue),u=u+Math.imul(U,je)|0,R=Math.imul(U,Ue),_=_+Math.imul(h,He)|0,u=u+Math.imul(h,We)|0,u=u+Math.imul(E,He)|0,R=R+Math.imul(E,We)|0;var Ls=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,_=Math.imul(F,He),u=Math.imul(F,We),u=u+Math.imul(U,He)|0,R=Math.imul(U,We);var Os=(B+_|0)+((u&8191)<<13)|0;return B=(R+(u>>>13)|0)+(Os>>>26)|0,Os&=67108863,I[0]=Kt,I[1]=Yt,I[2]=Qt,I[3]=Xt,I[4]=er,I[5]=tr,I[6]=rr,I[7]=nr,I[8]=ir,I[9]=sr,I[10]=or,I[11]=ar,I[12]=cr,I[13]=lr,I[14]=Bs,I[15]=Ns,I[16]=Ps,I[17]=Ls,I[18]=Os,B!==0&&(I[19]=B,y.length++),y};Math.imul||(P=A);function $(x,a,d){d.negative=a.negative^x.negative,d.length=x.length+a.length;for(var y=0,w=0,S=0;S<d.length-1;S++){var I=w;w=0;for(var B=y&67108863,_=Math.min(S,a.length-1),u=Math.max(0,S-x.length+1);u<=_;u++){var R=S-u,K=x.words[R]|0,J=a.words[u]|0,T=K*J,L=T&67108863;I=I+(T/67108864|0)|0,L=L+B|0,B=L&67108863,I=I+(L>>>26)|0,w+=I>>>26,I&=67108863}d.words[S]=B,y=I,I=w}return y!==0?d.words[S]=y:d.length--,d._strip()}function V(x,a,d){return $(x,a,d)}s.prototype.mulTo=function(a,d){var y,w=this.length+a.length;return this.length===10&&a.length===10?y=P(this,a,d):w<63?y=A(this,a,d):w<1024?y=$(this,a,d):y=V(this,a,d),y},s.prototype.mul=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),this.mulTo(a,d)},s.prototype.mulf=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),V(this,a,d)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){var d=a<0;d&&(a=-a),n(typeof a=="number"),n(a<67108864);for(var y=0,w=0;w<this.length;w++){var S=(this.words[w]|0)*a,I=(S&67108863)+(y&67108863);y>>=26,y+=S/67108864|0,y+=I>>>26,this.words[w]=I&67108863}return y!==0&&(this.words[w]=y,this.length++),this.length=a===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var d=H(a);if(d.length===0)return new s(1);for(var y=this,w=0;w<d.length&&d[w]===0;w++,y=y.sqr());if(++w<d.length)for(var S=y.sqr();w<d.length;w++,S=S.sqr())d[w]!==0&&(y=y.mul(S));return y},s.prototype.iushln=function(a){n(typeof a=="number"&&a>=0);var d=a%26,y=(a-d)/26,w=67108863>>>26-d<<26-d,S;if(d!==0){var I=0;for(S=0;S<this.length;S++){var B=this.words[S]&w,_=(this.words[S]|0)-B<<d;this.words[S]=_|I,I=B>>>26-d}I&&(this.words[S]=I,this.length++)}if(y!==0){for(S=this.length-1;S>=0;S--)this.words[S+y]=this.words[S];for(S=0;S<y;S++)this.words[S]=0;this.length+=y}return this._strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,d,y){n(typeof a=="number"&&a>=0);var w;d?w=(d-d%26)/26:w=0;var S=a%26,I=Math.min((a-S)/26,this.length),B=67108863^67108863>>>S<<S,_=y;if(w-=I,w=Math.max(0,w),_){for(var u=0;u<I;u++)_.words[u]=this.words[u];_.length=I}if(I!==0)if(this.length>I)for(this.length-=I,u=0;u<this.length;u++)this.words[u]=this.words[u+I];else this.words[0]=0,this.length=1;var R=0;for(u=this.length-1;u>=0&&(R!==0||u>=w);u--){var K=this.words[u]|0;this.words[u]=R<<26-S|K>>>S,R=K&B}return _&&R!==0&&(_.words[_.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(a,d,y){return n(this.negative===0),this.iushrn(a,d,y)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a=="number"&&a>=0);var d=a%26,y=(a-d)/26,w=1<<d;if(this.length<=y)return!1;var S=this.words[y];return!!(S&w)},s.prototype.imaskn=function(a){n(typeof a=="number"&&a>=0);var d=a%26,y=(a-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0&&y++,this.length=Math.min(y,this.length),d!==0){var w=67108863^67108863>>>d<<d;this.words[this.length-1]&=w}return this._strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){return n(typeof a=="number"),n(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<=a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(a){if(n(typeof a=="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(a){return this.clone().iaddn(a)},s.prototype.subn=function(a){return this.clone().isubn(a)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(a,d,y){var w=a.length+y,S;this._expand(w);var I,B=0;for(S=0;S<a.length;S++){I=(this.words[S+y]|0)+B;var _=(a.words[S]|0)*d;I-=_&67108863,B=(I>>26)-(_/67108864|0),this.words[S+y]=I&67108863}for(;S<this.length-y;S++)I=(this.words[S+y]|0)+B,B=I>>26,this.words[S+y]=I&67108863;if(B===0)return this._strip();for(n(B===-1),B=0,S=0;S<this.length;S++)I=-(this.words[S]|0)+B,B=I>>26,this.words[S]=I&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(a,d){var y=this.length-a.length,w=this.clone(),S=a,I=S.words[S.length-1]|0,B=this._countBits(I);y=26-B,y!==0&&(S=S.ushln(y),w.iushln(y),I=S.words[S.length-1]|0);var _=w.length-S.length,u;if(d!=="mod"){u=new s(null),u.length=_+1,u.words=new Array(u.length);for(var R=0;R<u.length;R++)u.words[R]=0}var K=w.clone()._ishlnsubmul(S,1,_);K.negative===0&&(w=K,u&&(u.words[_]=1));for(var J=_-1;J>=0;J--){var T=(w.words[S.length+J]|0)*67108864+(w.words[S.length+J-1]|0);for(T=Math.min(T/I|0,67108863),w._ishlnsubmul(S,T,J);w.negative!==0;)T--,w.negative=0,w._ishlnsubmul(S,1,J),w.isZero()||(w.negative^=1);u&&(u.words[J]=T)}return u&&u._strip(),w._strip(),d!=="div"&&y!==0&&w.iushrn(y),{div:u||null,mod:w}},s.prototype.divmod=function(a,d,y){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var w,S,I;return this.negative!==0&&a.negative===0?(I=this.neg().divmod(a,d),d!=="mod"&&(w=I.div.neg()),d!=="div"&&(S=I.mod.neg(),y&&S.negative!==0&&S.iadd(a)),{div:w,mod:S}):this.negative===0&&a.negative!==0?(I=this.divmod(a.neg(),d),d!=="mod"&&(w=I.div.neg()),{div:w,mod:I.mod}):this.negative&a.negative?(I=this.neg().divmod(a.neg(),d),d!=="div"&&(S=I.mod.neg(),y&&S.negative!==0&&S.isub(a)),{div:I.div,mod:S}):a.length>this.length||this.cmp(a)<0?{div:new s(0),mod:this}:a.length===1?d==="div"?{div:this.divn(a.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new s(this.modrn(a.words[0]))}:this._wordDiv(a,d)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var d=this.divmod(a);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(a):d.mod,w=a.ushrn(1),S=a.andln(1),I=y.cmp(w);return I<0||S===1&&I===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var y=(1<<26)%a,w=0,S=this.length-1;S>=0;S--)w=(y*w+(this.words[S]|0))%a;return d?-w:w},s.prototype.modn=function(a){return this.modrn(a)},s.prototype.idivn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var y=0,w=this.length-1;w>=0;w--){var S=(this.words[w]|0)+y*67108864;this.words[w]=S/a|0,y=S%a}return this._strip(),d?this.ineg():this},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var d=this,y=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var w=new s(1),S=new s(0),I=new s(0),B=new s(1),_=0;d.isEven()&&y.isEven();)d.iushrn(1),y.iushrn(1),++_;for(var u=y.clone(),R=d.clone();!d.isZero();){for(var K=0,J=1;!(d.words[0]&J)&&K<26;++K,J<<=1);if(K>0)for(d.iushrn(K);K-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(u),S.isub(R)),w.iushrn(1),S.iushrn(1);for(var T=0,L=1;!(y.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(y.iushrn(T);T-- >0;)(I.isOdd()||B.isOdd())&&(I.iadd(u),B.isub(R)),I.iushrn(1),B.iushrn(1);d.cmp(y)>=0?(d.isub(y),w.isub(I),S.isub(B)):(y.isub(d),I.isub(w),B.isub(S))}return{a:I,b:B,gcd:y.iushln(_)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var d=this,y=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var w=new s(1),S=new s(0),I=y.clone();d.cmpn(1)>0&&y.cmpn(1)>0;){for(var B=0,_=1;!(d.words[0]&_)&&B<26;++B,_<<=1);if(B>0)for(d.iushrn(B);B-- >0;)w.isOdd()&&w.iadd(I),w.iushrn(1);for(var u=0,R=1;!(y.words[0]&R)&&u<26;++u,R<<=1);if(u>0)for(y.iushrn(u);u-- >0;)S.isOdd()&&S.iadd(I),S.iushrn(1);d.cmp(y)>=0?(d.isub(y),w.isub(S)):(y.isub(d),S.isub(w))}var K;return d.cmpn(1)===0?K=w:K=S,K.cmpn(0)<0&&K.iadd(a),K},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var d=this.clone(),y=a.clone();d.negative=0,y.negative=0;for(var w=0;d.isEven()&&y.isEven();w++)d.iushrn(1),y.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;y.isEven();)y.iushrn(1);var S=d.cmp(y);if(S<0){var I=d;d=y,y=I}else if(S===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(w)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a=="number");var d=a%26,y=(a-d)/26,w=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var S=w,I=y;S!==0&&I<this.length;I++){var B=this.words[I]|0;B+=S,S=B>>>26,B&=67108863,this.words[I]=B}return S!==0&&(this.words[I]=S,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var d=a<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{d&&(a=-a),n(a<=67108863,"Number is too big");var w=this.words[0]|0;y=w===a?0:w<a?-1:1}return this.negative!==0?-y|0:y},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var d=this.ucmp(a);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var d=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,S=a.words[y]|0;if(w!==S){w<S?d=-1:w>S&&(d=1);break}}return d},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new oe(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},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(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var D={k256:null,p224:null,p192:null,p25519:null};function z(x,a){this.name=x,this.p=new s(a,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var a=new s(null);return a.words=new Array(Math.ceil(this.n/13)),a},z.prototype.ireduce=function(a){var d=a,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var w=y<this.n?-1:d.ucmp(this.p);return w===0?(d.words[0]=0,d.length=1):w>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},z.prototype.split=function(a,d){a.iushrn(this.n,0,d)},z.prototype.imulK=function(a){return a.imul(this.k)};function te(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(te,z),te.prototype.split=function(a,d){for(var y=4194303,w=Math.min(a.length,9),S=0;S<w;S++)d.words[S]=a.words[S];if(d.length=w,a.length<=9){a.words[0]=0,a.length=1;return}var I=a.words[9];for(d.words[d.length++]=I&y,S=10;S<a.length;S++){var B=a.words[S]|0;a.words[S-10]=(B&y)<<4|I>>>22,I=B}I>>>=22,a.words[S-10]=I,I===0&&a.length>10?a.length-=10:a.length-=9},te.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var d=0,y=0;y<a.length;y++){var w=a.words[y]|0;d+=w*977,a.words[y]=d&67108863,d=w*64+(d/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function Q(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Q,z);function Y(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(Y,z);function de(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(de,z),de.prototype.imulK=function(a){for(var d=0,y=0;y<a.length;y++){var w=(a.words[y]|0)*19+d,S=w&67108863;w>>>=26,a.words[y]=S,d=w}return d!==0&&(a.words[a.length++]=d),a},s._prime=function(a){if(D[a])return D[a];var d;if(a==="k256")d=new te;else if(a==="p224")d=new Q;else if(a==="p192")d=new Y;else if(a==="p25519")d=new de;else throw new Error("Unknown prime "+a);return D[a]=d,d};function oe(x){if(typeof x=="string"){var a=s._prime(x);this.m=a.p,this.prime=a}else n(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}oe.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},oe.prototype._verify2=function(a,d){n((a.negative|d.negative)===0,"red works only with positives"),n(a.red&&a.red===d.red,"red works only with red numbers")},oe.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(p(a,a.umod(this.m)._forceRed(this)),a)},oe.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},oe.prototype.add=function(a,d){this._verify2(a,d);var y=a.add(d);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},oe.prototype.iadd=function(a,d){this._verify2(a,d);var y=a.iadd(d);return y.cmp(this.m)>=0&&y.isub(this.m),y},oe.prototype.sub=function(a,d){this._verify2(a,d);var y=a.sub(d);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},oe.prototype.isub=function(a,d){this._verify2(a,d);var y=a.isub(d);return y.cmpn(0)<0&&y.iadd(this.m),y},oe.prototype.shl=function(a,d){return this._verify1(a),this.imod(a.ushln(d))},oe.prototype.imul=function(a,d){return this._verify2(a,d),this.imod(a.imul(d))},oe.prototype.mul=function(a,d){return this._verify2(a,d),this.imod(a.mul(d))},oe.prototype.isqr=function(a){return this.imul(a,a.clone())},oe.prototype.sqr=function(a){return this.mul(a,a)},oe.prototype.sqrt=function(a){if(a.isZero())return a.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var y=this.m.add(new s(1)).iushrn(2);return this.pow(a,y)}for(var w=this.m.subn(1),S=0;!w.isZero()&&w.andln(1)===0;)S++,w.iushrn(1);n(!w.isZero());var I=new s(1).toRed(this),B=I.redNeg(),_=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,_).cmp(B)!==0;)u.redIAdd(B);for(var R=this.pow(u,w),K=this.pow(a,w.addn(1).iushrn(1)),J=this.pow(a,w),T=S;J.cmp(I)!==0;){for(var L=J,W=0;L.cmp(I)!==0;W++)L=L.redSqr();n(W<T);var Z=this.pow(R,new s(1).iushln(T-W-1));K=K.redMul(Z),R=Z.redSqr(),J=J.redMul(R),T=W}return K},oe.prototype.invm=function(a){var d=a._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},oe.prototype.pow=function(a,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return a.clone();var y=4,w=new Array(1<<y);w[0]=new s(1).toRed(this),w[1]=a;for(var S=2;S<w.length;S++)w[S]=this.mul(w[S-1],a);var I=w[0],B=0,_=0,u=d.bitLength()%26;for(u===0&&(u=26),S=d.length-1;S>=0;S--){for(var R=d.words[S],K=u-1;K>=0;K--){var J=R>>K&1;if(I!==w[0]&&(I=this.sqr(I)),J===0&&B===0){_=0;continue}B<<=1,B|=J,_++,!(_!==y&&(S!==0||K!==0))&&(I=this.mul(I,w[B]),_=0,B=0)}u=26}return I},oe.prototype.convertTo=function(a){var d=a.umod(this.m);return d===a?d.clone():d},oe.prototype.convertFrom=function(a){var d=a.clone();return d.red=null,d},s.mont=function(a){return new pe(a)};function pe(x){oe.call(this,x),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(pe,oe),pe.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},pe.prototype.convertFrom=function(a){var d=this.imod(a.mul(this.rinv));return d.red=null,d},pe.prototype.imul=function(a,d){if(a.isZero()||d.isZero())return a.words[0]=0,a.length=1,a;var y=a.imul(d),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=y.isub(w).iushrn(this.shift),I=S;return S.cmp(this.m)>=0?I=S.isub(this.m):S.cmpn(0)<0&&(I=S.iadd(this.m)),I._forceRed(this)},pe.prototype.mul=function(a,d){if(a.isZero()||d.isZero())return new s(0)._forceRed(this);var y=a.mul(d),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=y.isub(w).iushrn(this.shift),I=S;return S.cmp(this.m)>=0?I=S.isub(this.m):S.cmpn(0)<0&&(I=S.iadd(this.m)),I._forceRed(this)},pe.prototype.invm=function(a){var d=this.imod(a._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,ee)})(qo);var $i=qo.exports,Bn={},Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.errorValues=Ut.standardErrorCodes=void 0;Ut.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}};Ut.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 Fi={},Di={};(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=Ut,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(b,k=r){if(b&&Number.isInteger(b)){const j=b.toString();if(p(t.errorValues,j))return t.errorValues[j].message;if(f(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=n;function i(b){if(!Number.isInteger(b))return!1;const k=b.toString();return!!(t.errorValues[k]||f(b))}e.isValidCode=i;function s(b){var k;if(typeof b=="number")return b;if(c(b))return(k=b.code)!==null&&k!==void 0?k:b.errorCode}e.getErrorCode=s;function c(b){return typeof b=="object"&&b!==null&&(typeof b.code=="number"||typeof b.errorCode=="number")}function o(b,{shouldIncludeStack:k=!1}={}){const j={};if(b&&typeof b=="object"&&!Array.isArray(b)&&p(b,"code")&&i(b.code)){const O=b;j.code=O.code,O.message&&typeof O.message=="string"?(j.message=O.message,p(O,"data")&&(j.data=O.data)):(j.message=n(j.code),j.data={originalError:g(b)})}else j.code=t.standardErrorCodes.rpc.internal,j.message=v(b,"message")?b.message:r,j.data={originalError:g(b)};return k&&(j.stack=v(b,"stack")?b.stack:void 0),j}e.serialize=o;function f(b){return b>=-32099&&b<=-32e3}function g(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function p(b,k){return Object.prototype.hasOwnProperty.call(b,k)}function v(b,k){return typeof b=="object"&&b!==null&&k in b&&typeof b[k]=="string"}})(Di);Object.defineProperty(Fi,"__esModule",{value:!0});Fi.standardErrors=void 0;const rt=Ut,Ql=Di;Fi.standardErrors={rpc:{parse:e=>gt(rt.standardErrorCodes.rpc.parse,e),invalidRequest:e=>gt(rt.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>gt(rt.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>gt(rt.standardErrorCodes.rpc.methodNotFound,e),internal:e=>gt(rt.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return gt(t,e)},invalidInput:e=>gt(rt.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>gt(rt.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>gt(rt.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>gt(rt.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>gt(rt.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>gt(rt.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>$r(rt.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>$r(rt.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>$r(rt.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>$r(rt.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>$r(rt.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>$r(rt.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 tu(t,r,n)}}};function gt(e,t){const[r,n]=Xl(t);return new eu(e,r||(0,Ql.getMessageFromCode)(e),n)}function $r(e,t){const[r,n]=Xl(t);return new tu(e,r||(0,Ql.getMessageFromCode)(e),n)}function Xl(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 eu=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)}},tu=class extends eu{constructor(t,r,n){if(!r0(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function r0(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ji={},cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.isErrorResponse=void 0;function n0(e){return e.errorMessage!==void 0}cn.isErrorResponse=n0;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.LIB_VERSION=void 0;ln.LIB_VERSION="3.9.3";Object.defineProperty(ji,"__esModule",{value:!0});ji.serializeError=void 0;const i0=cn,s0=ln,o0=Ut,a0=Di;function c0(e,t){const r=(0,a0.serialize)(l0(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",s0.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=u0(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ji.serializeError=c0;function l0(e){return typeof e=="string"?{message:e,code:o0.standardErrorCodes.rpc.internal}:(0,i0.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function u0(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Ut;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Fi;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ji;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Di;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Bn);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.ProviderType=Ke.RegExpString=Ke.IntNumber=Ke.BigIntString=Ke.AddressString=Ke.HexString=Ke.OpaqueType=void 0;function Nn(){return e=>e}Ke.OpaqueType=Nn;Ke.HexString=Nn();Ke.AddressString=Nn();Ke.BigIntString=Nn();function h0(e){return Math.floor(e)}Ke.IntNumber=h0;Ke.RegExpString=Nn();var Ya;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Ya||(Ke.ProviderType=Ya={}));var f0=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.isMobileWeb=X.getLocation=X.isInIFrame=X.createQrUrl=X.getFavicon=X.range=X.isBigNumber=X.ensureParsedJSONObject=X.ensureBN=X.ensureRegExpString=X.ensureIntNumber=X.ensureBuffer=X.ensureAddressString=X.ensureEvenLengthHexString=X.ensureHexString=X.isHexString=X.prepend0x=X.strip0x=X.has0xPrefix=X.hexStringFromIntNumber=X.intNumberFromHexString=X.bigIntStringFromBN=X.hexStringFromBuffer=X.hexStringToUint8Array=X.uint8ArrayToHex=X.randomBytesHex=void 0;const zt=f0($i),Sr=Bn,bt=Ke,ru=/^[0-9]*$/,nu=/^[a-f0-9]*$/;function d0(e){return iu(crypto.getRandomValues(new Uint8Array(e)))}X.randomBytesHex=d0;function iu(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=iu;function p0(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}X.hexStringToUint8Array=p0;function g0(e,t=!1){const r=e.toString("hex");return(0,bt.HexString)(t?`0x${r}`:r)}X.hexStringFromBuffer=g0;function m0(e){return(0,bt.BigIntString)(e.toString(10))}X.bigIntStringFromBN=m0;function y0(e){return(0,bt.IntNumber)(new zt.default(Ln(e,!1),16).toNumber())}X.intNumberFromHexString=y0;function v0(e){return(0,bt.HexString)(`0x${new zt.default(e).toString(16)}`)}X.hexStringFromIntNumber=v0;function zo(e){return e.startsWith("0x")||e.startsWith("0X")}X.has0xPrefix=zo;function Ui(e){return zo(e)?e.slice(2):e}X.strip0x=Ui;function su(e){return zo(e)?`0x${e.slice(2)}`:`0x${e}`}X.prepend0x=su;function Pn(e){if(typeof e!="string")return!1;const t=Ui(e).toLowerCase();return nu.test(t)}X.isHexString=Pn;function ou(e,t=!1){if(typeof e=="string"){const r=Ui(e).toLowerCase();if(nu.test(r))return(0,bt.HexString)(t?`0x${r}`:r)}throw Sr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}X.ensureHexString=ou;function Ln(e,t=!1){let r=ou(e,!1);return r.length%2===1&&(r=(0,bt.HexString)(`0${r}`)),t?(0,bt.HexString)(`0x${r}`):r}X.ensureEvenLengthHexString=Ln;function w0(e){if(typeof e=="string"){const t=Ui(e).toLowerCase();if(Pn(t)&&t.length===40)return(0,bt.AddressString)(su(t))}throw Sr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}X.ensureAddressString=w0;function b0(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(Pn(e)){const t=Ln(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw Sr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}X.ensureBuffer=b0;function au(e){if(typeof e=="number"&&Number.isInteger(e))return(0,bt.IntNumber)(e);if(typeof e=="string"){if(ru.test(e))return(0,bt.IntNumber)(Number(e));if(Pn(e))return(0,bt.IntNumber)(new zt.default(Ln(e,!1),16).toNumber())}throw Sr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureIntNumber=au;function _0(e){if(e instanceof RegExp)return(0,bt.RegExpString)(e.toString());throw Sr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}X.ensureRegExpString=_0;function E0(e){if(e!==null&&(zt.default.isBN(e)||cu(e)))return new zt.default(e.toString(10),10);if(typeof e=="number")return new zt.default(au(e));if(typeof e=="string"){if(ru.test(e))return new zt.default(e,10);if(Pn(e))return new zt.default(Ln(e,!1),16)}throw Sr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureBN=E0;function S0(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw Sr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}X.ensureParsedJSONObject=S0;function cu(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}X.isBigNumber=cu;function R0(e,t){return Array.from({length:t-e},(r,n)=>e+n)}X.range=R0;function M0(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}X.getFavicon=M0;function C0(e,t,r,n,i,s){const c=n?"parent-id":"id",o=new URLSearchParams({[c]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${o}`}X.createQrUrl=C0;function lu(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=lu;function I0(){try{return lu()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=I0;function x0(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}X.isMobileWeb=x0;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ScopedLocalStorage=void 0;class A0{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}`}}Hi.ScopedLocalStorage=A0;var Xr={};const k0=an(Kh);var On={},$n={},un={};Object.defineProperty(un,"__esModule",{value:!0});un.EVENTS=void 0;un.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.RelayAbstract=wt.APP_VERSION_KEY=wt.LOCAL_STORAGE_ADDRESSES_KEY=wt.WALLET_USER_NAME_KEY=void 0;const Qa=Bn;wt.WALLET_USER_NAME_KEY="walletUsername";wt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";wt.APP_VERSION_KEY="AppVersion";class T0{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 Qa.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Qa.serializeError)(s,t.method);return i})}}wt.RelayAbstract=T0;var hn={},uu={exports:{}},No={exports:{}};typeof Object.create=="function"?No.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:No.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var Ct=No.exports,Po={exports:{}},Fn={},Wi={};Wi.byteLength=P0;Wi.toByteArray=O0;Wi.fromByteArray=D0;var Pt=[],vt=[],B0=typeof Uint8Array<"u"?Uint8Array:Array,Gs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Fr=0,N0=Gs.length;Fr<N0;++Fr)Pt[Fr]=Gs[Fr],vt[Gs.charCodeAt(Fr)]=Fr;vt[45]=62;vt[95]=63;function hu(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function P0(e){var t=hu(e),r=t[0],n=t[1];return(r+n)*3/4-n}function L0(e,t,r){return(t+r)*3/4-r}function O0(e){var t,r=hu(e),n=r[0],i=r[1],s=new B0(L0(e,n,i)),c=0,o=i>0?n-4:n,f;for(f=0;f<o;f+=4)t=vt[e.charCodeAt(f)]<<18|vt[e.charCodeAt(f+1)]<<12|vt[e.charCodeAt(f+2)]<<6|vt[e.charCodeAt(f+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=t&255;return i===2&&(t=vt[e.charCodeAt(f)]<<2|vt[e.charCodeAt(f+1)]>>4,s[c++]=t&255),i===1&&(t=vt[e.charCodeAt(f)]<<10|vt[e.charCodeAt(f+1)]<<4|vt[e.charCodeAt(f+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function $0(e){return Pt[e>>18&63]+Pt[e>>12&63]+Pt[e>>6&63]+Pt[e&63]}function F0(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push($0(n));return i.join("")}function D0(e){for(var t,r=e.length,n=r%3,i=[],s=16383,c=0,o=r-n;c<o;c+=s)i.push(F0(e,c,c+s>o?o:c+s));return n===1?(t=e[r-1],i.push(Pt[t>>2]+Pt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Pt[t>>10]+Pt[t>>4&63]+Pt[t<<2&63]+"=")),i.join("")}var Go={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Go.read=function(e,t,r,n,i){var s,c,o=i*8-n-1,f=(1<<o)-1,g=f>>1,p=-7,v=r?i-1:0,b=r?-1:1,k=e[t+v];for(v+=b,s=k&(1<<-p)-1,k>>=-p,p+=o;p>0;s=s*256+e[t+v],v+=b,p-=8);for(c=s&(1<<-p)-1,s>>=-p,p+=n;p>0;c=c*256+e[t+v],v+=b,p-=8);if(s===0)s=1-g;else{if(s===f)return c?NaN:(k?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-g}return(k?-1:1)*c*Math.pow(2,s-n)};Go.write=function(e,t,r,n,i,s){var c,o,f,g=s*8-i-1,p=(1<<g)-1,v=p>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:s-1,j=n?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,c=p):(c=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-c))<1&&(c--,f*=2),c+v>=1?t+=b/f:t+=b*Math.pow(2,1-v),t*f>=2&&(c++,f/=2),c+v>=p?(o=0,c=p):c+v>=1?(o=(t*f-1)*Math.pow(2,i),c=c+v):(o=t*Math.pow(2,v-1)*Math.pow(2,i),c=0));i>=8;e[r+k]=o&255,k+=j,o/=256,i-=8);for(c=c<<i|o,g+=i;g>0;e[r+k]=c&255,k+=j,c/=256,g-=8);e[r+k-j]|=O*128};/*!
1
+ import{bH as Aa,f as ee,bN as br,h as an,bO as qh,i as zh}from"./index-m9AvnFPE.js";import{i as Mt}from"./inherits_browser-BlmhoU4v.js";import{p as Gh,a as Jh}from"./hooks.module-Dz_XB4AG.js";const Zh=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:Aa,default:Aa},Symbol.toStringTag,{value:"Module"}));var Co={exports:{}},$s,ka;function Kh(){if(ka)return $s;ka=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;$s=function(p,v){v=v||{};var b=typeof p;if(b==="string"&&p.length>0)return c(p);if(b==="number"&&isFinite(p))return v.long?f(p):o(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function c(p){if(p=String(p),!(p.length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(v){var b=parseFloat(v[1]),k=(v[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return b*s;case"weeks":case"week":case"w":return b*i;case"days":case"day":case"d":return b*n;case"hours":case"hour":case"hrs":case"hr":case"h":return b*r;case"minutes":case"minute":case"mins":case"min":case"m":return b*t;case"seconds":case"second":case"secs":case"sec":case"s":return b*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function o(p){var v=Math.abs(p);return v>=n?Math.round(p/n)+"d":v>=r?Math.round(p/r)+"h":v>=t?Math.round(p/t)+"m":v>=e?Math.round(p/e)+"s":p+"ms"}function f(p){var v=Math.abs(p);return v>=n?g(p,v,n,"day"):v>=r?g(p,v,r,"hour"):v>=t?g(p,v,t,"minute"):v>=e?g(p,v,e,"second"):p+" ms"}function g(p,v,b,k){var j=v>=b*1.5;return Math.round(p/b)+" "+k+(j?"s":"")}return $s}function Yh(e){r.debug=r,r.default=r,r.coerce=f,r.disable=s,r.enable=i,r.enabled=c,r.humanize=Kh(),r.destroy=g,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let v=0;for(let b=0;b<p.length;b++)v=(v<<5)-v+p.charCodeAt(b),v|=0;return r.colors[Math.abs(v)%r.colors.length]}r.selectColor=t;function r(p){let v,b=null,k,j;function O(...H){if(!O.enabled)return;const A=O,P=Number(new Date),$=P-(v||P);A.diff=$,A.prev=v,A.curr=P,v=P,H[0]=r.coerce(H[0]),typeof H[0]!="string"&&H.unshift("%O");let V=0;H[0]=H[0].replace(/%([a-zA-Z%])/g,(z,te)=>{if(z==="%%")return"%";V++;const Q=r.formatters[te];if(typeof Q=="function"){const Y=H[V];z=Q.call(A,Y),H.splice(V,1),V--}return z}),r.formatArgs.call(A,H),(A.log||r.log).apply(A,H)}return O.namespace=p,O.useColors=r.useColors(),O.color=r.selectColor(p),O.extend=n,O.destroy=r.destroy,Object.defineProperty(O,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(k!==r.namespaces&&(k=r.namespaces,j=r.enabled(p)),j),set:H=>{b=H}}),typeof r.init=="function"&&r.init(O),O}function n(p,v){const b=r(this.namespace+(typeof v>"u"?":":v)+p);return b.log=this.log,b}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let v;const b=(typeof p=="string"?p:"").split(/[\s,]+/),k=b.length;for(v=0;v<k;v++)b[v]&&(p=b[v].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function s(){const p=[...r.names.map(o),...r.skips.map(o).map(v=>"-"+v)].join(",");return r.enable(""),p}function c(p){if(p[p.length-1]==="*")return!0;let v,b;for(v=0,b=r.skips.length;v<b;v++)if(r.skips[v].test(p))return!1;for(v=0,b=r.names.length;v<b;v++)if(r.names[v].test(p))return!0;return!1}function o(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function f(p){return p instanceof Error?p.stack||p.message:p}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Qh=Yh;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=c,t.useColors=n,t.storage=o(),t.destroy=(()=>{let g=!1;return()=>{g||(g=!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(g){if(g[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+g[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;g.splice(1,0,p,"color: inherit");let v=0,b=0;g[0].replace(/%[a-zA-Z%]/g,k=>{k!=="%%"&&(v++,k==="%c"&&(b=v))}),g.splice(b,0,p)}t.log=console.debug||console.log||(()=>{});function s(g){try{g?t.storage.setItem("debug",g):t.storage.removeItem("debug")}catch{}}function c(){let g;try{g=t.storage.getItem("debug")}catch{}return!g&&typeof process<"u"&&"env"in process&&(g=r.DEBUG),g}function o(){try{return localStorage}catch{}}e.exports=Qh(t);const{formatters:f}=e.exports;f.j=function(g){try{return JSON.stringify(g)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(Co,Co.exports);var Xh=Co.exports,ef=En;En.default=En;En.stable=xl;En.stableStringify=xl;var Ii="[...]",Ml="[Circular]",_r=[],mr=[];function Il(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function En(e,t,r,n){typeof n>"u"&&(n=Il()),Mo(e,"",0,[],void 0,0,n);var i;try{mr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Al(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var s=_r.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Gr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),_r.push([n,r,t,i])):mr.push([t,r,e]):(n[r]=e,_r.push([n,r,t]))}function Mo(e,t,r,n,i,s,c){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){Gr(Ml,e,t,i);return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Gr(Ii,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Gr(Ii,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)Mo(e[o],o,o,n,e,s,c);else{var f=Object.keys(e);for(o=0;o<f.length;o++){var g=f[o];Mo(e[g],g,o,n,e,s,c)}}n.pop()}}function tf(e,t){return e<t?-1:e>t?1:0}function xl(e,t,r,n){typeof n>"u"&&(n=Il());var i=Io(e,"",0,[],void 0,0,n)||e,s;try{mr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Al(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var c=_r.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function Io(e,t,r,n,i,s,c){s+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){Gr(Ml,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Gr(Ii,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Gr(Ii,e,t,i);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)Io(e[o],o,o,n,e,s,c);else{var f={},g=Object.keys(e).sort(tf);for(o=0;o<g.length;o++){var p=g[o];Io(e[p],p,o,n,e,s,c),f[p]=e[p]}if(typeof i<"u")_r.push([i,t,e]),i[t]=f;else return f}n.pop()}}function Al(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(mr.length>0)for(var n=0;n<mr.length;n++){var i=mr[n];if(i[1]===t&&i[0]===r){r=i[2],mr.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,kl=SyntaxError,In=TypeError,rf=Object.getOwnPropertyDescriptor,_i=rf;if(_i)try{_i([],"length")}catch{_i=null}var xn=_i,Ta=Pi,nf=kl,Lr=In,Ba=xn,sf=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Lr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Lr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Lr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Lr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Lr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Lr("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,f=!!Ba&&Ba(t,r);if(Ta)Ta(t,r,{configurable:c===null&&f?f.configurable:!c,enumerable:i===null&&f?f.enumerable:!i,value:n,writable:s===null&&f?f.writable:!s});else if(o||!i&&!s&&!c)t[r]=n;else throw new nf("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},xo=Pi,Tl=function(){return!!xo};Tl.hasArrayLengthDefineBug=function(){if(!xo)return null;try{return xo([],"length",{value:1}).length!==1}catch{return!0}};var of=Tl,Bl={exports:{}},Nl=Object,af=Error,cf=EvalError,lf=RangeError,uf=ReferenceError,hf=URIError,ff=Math.abs,df=Math.floor,pf=Math.max,gf=Math.min,mf=Math.pow,yf=Math.round,vf=Number.isNaN||function(t){return t!==t},wf=vf,bf=function(t){return wf(t)||t===0?t:t<0?-1:1},Pl=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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Na=typeof Symbol<"u"&&Symbol,_f=Pl,Ef=function(){return typeof Na!="function"||typeof Symbol!="function"||typeof Na("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_f()},Ll=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,Sf=Nl,Ol=Sf.getPrototypeOf||null,Fs,Pa;function Rf(){if(Pa)return Fs;Pa=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(f,g){for(var p=[],v=0;v<f.length;v+=1)p[v]=f[v];for(var b=0;b<g.length;b+=1)p[b+f.length]=g[b];return p},s=function(f,g){for(var p=[],v=g,b=0;v<f.length;v+=1,b+=1)p[b]=f[v];return p},c=function(o,f){for(var g="",p=0;p<o.length;p+=1)g+=o[p],p+1<o.length&&(g+=f);return g};return Fs=function(f){var g=this;if(typeof g!="function"||t.apply(g)!==n)throw new TypeError(e+g);for(var p=s(arguments,1),v,b=function(){if(this instanceof v){var A=g.apply(this,i(p,arguments));return Object(A)===A?A:this}return g.apply(f,i(p,arguments))},k=r(0,g.length-p.length),j=[],O=0;O<k;O++)j[O]="$"+O;if(v=Function("binder","return function ("+c(j,",")+"){ return binder.apply(this,arguments); }")(b),g.prototype){var H=function(){};H.prototype=g.prototype,v.prototype=new H,H.prototype=null}return v},Fs}var Ds,La;function An(){if(La)return Ds;La=1;var e=Rf();return Ds=Function.prototype.bind||e,Ds}var js,Oa;function Do(){return Oa||(Oa=1,js=Function.prototype.call),js}var Us,$a;function jo(){return $a||($a=1,Us=Function.prototype.apply),Us}var Cf=typeof Reflect<"u"&&Reflect&&Reflect.apply,Mf=An(),If=jo(),xf=Do(),Af=Cf,$l=Af||Mf.call(xf,If),kf=An(),Tf=In,Bf=Do(),Nf=$l,Uo=function(t){if(t.length<1||typeof t[0]!="function")throw new Tf("a function is required");return Nf(kf,Bf,t)},Pf=Uo,Fa=xn,Fl;try{Fl=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Hs=!!Fl&&Fa&&Fa(Object.prototype,"__proto__"),Dl=Object,Da=Dl.getPrototypeOf,Lf=Hs&&typeof Hs.get=="function"?Pf([Hs.get]):typeof Da=="function"?function(t){return Da(t==null?t:Dl(t))}:!1,ja=Ll,Ua=Ol,Ha=Lf,jl=ja?function(t){return ja(t)}:Ua?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ua(t)}:Ha?function(t){return Ha(t)}:null,Of=Function.prototype.call,$f=Object.prototype.hasOwnProperty,Ff=An(),Df=Ff.call(Of,$f),me,jf=Nl,Uf=af,Hf=cf,Wf=lf,Vf=uf,Qr=kl,Jr=In,qf=hf,zf=ff,Gf=df,Jf=pf,Zf=gf,Kf=mf,Yf=yf,Qf=bf,Ul=Function,Ws=function(e){try{return Ul('"use strict"; return ('+e+").constructor;")()}catch{}},Sn=xn,Xf=Pi,Vs=function(){throw new Jr},ed=Sn?function(){try{return arguments.callee,Vs}catch{try{return Sn(arguments,"callee").get}catch{return Vs}}}():Vs,Or=Ef(),et=jl,td=Ol,rd=Ll,Hl=jo(),kn=Do(),Wr={},nd=typeof Uint8Array>"u"||!et?me:et(Uint8Array),vr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":Or&&et?et([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":Wr,"%AsyncGenerator%":Wr,"%AsyncGeneratorFunction%":Wr,"%AsyncIteratorPrototype%":Wr,"%Atomics%":typeof Atomics>"u"?me:Atomics,"%BigInt%":typeof BigInt>"u"?me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Uf,"%eval%":eval,"%EvalError%":Hf,"%Float16Array%":typeof Float16Array>"u"?me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?me:FinalizationRegistry,"%Function%":Ul,"%GeneratorFunction%":Wr,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Or&&et?et(et([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Or||!et?me:et(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":jf,"%Object.getOwnPropertyDescriptor%":Sn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":Wf,"%ReferenceError%":Vf,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Or||!et?me:et(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Or&&et?et(""[Symbol.iterator]()):me,"%Symbol%":Or?Symbol:me,"%SyntaxError%":Qr,"%ThrowTypeError%":ed,"%TypedArray%":nd,"%TypeError%":Jr,"%Uint8Array%":typeof Uint8Array>"u"?me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?me:Uint32Array,"%URIError%":qf,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":kn,"%Function.prototype.apply%":Hl,"%Object.defineProperty%":Xf,"%Object.getPrototypeOf%":td,"%Math.abs%":zf,"%Math.floor%":Gf,"%Math.max%":Jf,"%Math.min%":Zf,"%Math.pow%":Kf,"%Math.round%":Yf,"%Math.sign%":Qf,"%Reflect.getPrototypeOf%":rd};if(et)try{null.error}catch(e){var id=et(et(e));vr["%Error.prototype%"]=id}var sd=function e(t){var r;if(t==="%AsyncFunction%")r=Ws("async function () {}");else if(t==="%GeneratorFunction%")r=Ws("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Ws("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&et&&(r=et(i.prototype))}return vr[t]=r,r},Wa={__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"]},Tn=An(),xi=Df,od=Tn.call(kn,Array.prototype.concat),ad=Tn.call(Hl,Array.prototype.splice),Va=Tn.call(kn,String.prototype.replace),Ai=Tn.call(kn,String.prototype.slice),cd=Tn.call(kn,RegExp.prototype.exec),ld=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ud=/\\(\\)?/g,hd=function(t){var r=Ai(t,0,1),n=Ai(t,-1);if(r==="%"&&n!=="%")throw new Qr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Qr("invalid intrinsic syntax, expected opening `%`");var i=[];return Va(t,ld,function(s,c,o,f){i[i.length]=o?Va(f,ud,"$1"):c||s}),i},fd=function(t,r){var n=t,i;if(xi(Wa,n)&&(i=Wa[n],n="%"+i[0]+"%"),xi(vr,n)){var s=vr[n];if(s===Wr&&(s=sd(n)),typeof s>"u"&&!r)throw new Jr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Qr("intrinsic "+t+" does not exist!")},Wl=function(t,r){if(typeof t!="string"||t.length===0)throw new Jr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Jr('"allowMissing" argument must be a boolean');if(cd(/^%?[^%]*%?$/,t)===null)throw new Qr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=hd(t),i=n.length>0?n[0]:"",s=fd("%"+i+"%",r),c=s.name,o=s.value,f=!1,g=s.alias;g&&(i=g[0],ad(n,od([0,1],g)));for(var p=1,v=!0;p<n.length;p+=1){var b=n[p],k=Ai(b,0,1),j=Ai(b,-1);if((k==='"'||k==="'"||k==="`"||j==='"'||j==="'"||j==="`")&&k!==j)throw new Qr("property names with quotes must have matching quotes");if((b==="constructor"||!v)&&(f=!0),i+="."+b,c="%"+i+"%",xi(vr,c))o=vr[c];else if(o!=null){if(!(b in o)){if(!r)throw new Jr("base intrinsic for "+t+" exists, but the property is not available.");return}if(Sn&&p+1>=n.length){var O=Sn(o,b);v=!!O,v&&"get"in O&&!("originalValue"in O.get)?o=O.get:o=o[b]}else v=xi(o,b),o=o[b];v&&!f&&(vr[c]=o)}}return o},dd=Wl,qa=sf,pd=of(),za=xn,Ga=In,gd=dd("%Math.floor%"),md=function(t,r){if(typeof t!="function")throw new Ga("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||gd(r)!==r)throw new Ga("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&za){var c=za(t,"length");c&&!c.configurable&&(i=!1),c&&!c.writable&&(s=!1)}return(i||s||!n)&&(pd?qa(t,"length",r,!0,!0):qa(t,"length",r)),t},yd=An(),vd=jo(),wd=$l,bd=function(){return wd(yd,vd,arguments)};(function(e){var t=md,r=Pi,n=Uo,i=bd;e.exports=function(c){var o=n(arguments),f=c.length-(arguments.length-1);return t(o,1+(f>0?f:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i})(Bl);var _d=Bl.exports,Vl=Wl,ql=Uo,Ed=ql([Vl("%String.prototype.indexOf%")]),zl=function(t,r){var n=Vl(t,!!r);return typeof n=="function"&&Ed(t,".prototype.")>-1?ql([n]):n},Sd=Pl,Rd=function(){return Sd()&&!!Symbol.toStringTag},Cd={}.toString,Md=Array.isArray||function(e){return Cd.call(e)=="[object Array]"},Gl=Function.prototype.toString,qr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ao,Ei;if(typeof qr=="function"&&typeof Object.defineProperty=="function")try{Ao=Object.defineProperty({},"length",{get:function(){throw Ei}}),Ei={},qr(function(){throw 42},null,Ao)}catch(e){e!==Ei&&(qr=null)}else qr=null;var Id=/^\s*class\b/,ko=function(t){try{var r=Gl.call(t);return Id.test(r)}catch{return!1}},qs=function(t){try{return ko(t)?!1:(Gl.call(t),!0)}catch{return!1}},Si=Object.prototype.toString,xd="[object Object]",Ad="[object Function]",kd="[object GeneratorFunction]",Td="[object HTMLAllCollection]",Bd="[object HTML document.all class]",Nd="[object HTMLCollection]",Pd=typeof Symbol=="function"&&!!Symbol.toStringTag,Ld=!(0 in[,]),To=function(){return!1};if(typeof document=="object"){var Od=document.all;Si.call(Od)===Si.call(document.all)&&(To=function(t){if((Ld||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=Si.call(t);return(r===Td||r===Bd||r===Nd||r===xd)&&t("")==null}catch{}return!1})}var $d=qr?function(t){if(To(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{qr(t,null,Ao)}catch(r){if(r!==Ei)return!1}return!ko(t)&&qs(t)}:function(t){if(To(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(Pd)return qs(t);if(ko(t))return!1;var r=Si.call(t);return r!==Ad&&r!==kd&&!/^\[object HTML/.test(r)?!1:qs(t)},Fd=$d,Dd=Object.prototype.toString,Jl=Object.prototype.hasOwnProperty,jd=function(t,r,n){for(var i=0,s=t.length;i<s;i++)Jl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))},Ud=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)},Hd=function(t,r,n){for(var i in t)Jl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))};function Wd(e){return Dd.call(e)==="[object Array]"}var Vd=function(t,r,n){if(!Fd(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Wd(t)?jd(t,r,i):typeof t=="string"?Ud(t,r,i):Hd(t,r,i)},qd=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],zs=qd,zd=typeof globalThis>"u"?ee:globalThis,Gd=function(){for(var t=[],r=0;r<zs.length;r++)typeof zd[zs[r]]=="function"&&(t[t.length]=zs[r]);return t},ki=Vd,Jd=Gd,Ja=_d,Ho=zl,Ri=xn,ii=jl,Zd=Ho("Object.prototype.toString"),Zl=Rd(),Za=typeof globalThis>"u"?ee:globalThis,Bo=Jd(),Wo=Ho("String.prototype.slice"),Kd=Ho("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},Ti={__proto__:null};Zl&&Ri&&ii?ki(Bo,function(e){var t=new Za[e];if(Symbol.toStringTag in t&&ii){var r=ii(t),n=Ri(r,Symbol.toStringTag);if(!n&&r){var i=ii(r);n=Ri(i,Symbol.toStringTag)}Ti["$"+e]=Ja(n.get)}}):ki(Bo,function(e){var t=new Za[e],r=t.slice||t.set;r&&(Ti["$"+e]=Ja(r))});var Yd=function(t){var r=!1;return ki(Ti,function(n,i){if(!r)try{"$"+n(t)===i&&(r=Wo(i,1))}catch{}}),r},Qd=function(t){var r=!1;return ki(Ti,function(n,i){if(!r)try{n(t),r=Wo(i,1)}catch{}}),r},Xd=function(t){if(!t||typeof t!="object")return!1;if(!Zl){var r=Wo(Zd(t),8,-1);return Kd(Bo,r)>-1?r:r!=="Object"?!1:Qd(t)}return Ri?Yd(t):null},Kl={},Rn={},Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.walletLogo=void 0;const e0=(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=e0;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.LINK_API_URL=void 0;Oi.LINK_API_URL="https://www.walletlink.org";var X={},Vo={exports:{}};Vo.exports;(function(e){(function(t,r){function n(x,a){if(!x)throw new Error(a||"Assertion failed")}function i(x,a){x.super_=a;var d=function(){};d.prototype=a.prototype,x.prototype=new d,x.prototype.constructor=x}function s(x,a,d){if(s.isBN(x))return x;this.negative=0,this.words=null,this.length=0,this.red=null,x!==null&&((a==="le"||a==="be")&&(d=a,a=10),this._init(x||0,a||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=br.Buffer}catch{}s.isBN=function(a){return a instanceof s?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,d){return a.cmp(d)>0?a:d},s.min=function(a,d){return a.cmp(d)<0?a:d},s.prototype._init=function(a,d,y){if(typeof a=="number")return this._initNumber(a,d,y);if(typeof a=="object")return this._initArray(a,d,y);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),a=a.toString().replace(/\s+/g,"");var w=0;a[0]==="-"&&(w++,this.negative=1),w<a.length&&(d===16?this._parseHex(a,w,y):(this._parseBase(a,d,w),y==="le"&&this._initArray(this.toArray(),d,y)))},s.prototype._initNumber=function(a,d,y){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),d,y)},s.prototype._initArray=function(a,d,y){if(n(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var S,I,B=0;if(y==="be")for(w=a.length-1,S=0;w>=0;w-=3)I=a[w]|a[w-1]<<8|a[w-2]<<16,this.words[S]|=I<<B&67108863,this.words[S+1]=I>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);else if(y==="le")for(w=0,S=0;w<a.length;w+=3)I=a[w]|a[w+1]<<8|a[w+2]<<16,this.words[S]|=I<<B&67108863,this.words[S+1]=I>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);return this._strip()};function o(x,a){var d=x.charCodeAt(a);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+x)}function f(x,a,d){var y=o(x,d);return d-1>=a&&(y|=o(x,d-1)<<4),y}s.prototype._parseHex=function(a,d,y){this.length=Math.ceil((a.length-d)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var S=0,I=0,B;if(y==="be")for(w=a.length-1;w>=d;w-=2)B=f(a,d,w)<<S,this.words[I]|=B&67108863,S>=18?(S-=18,I+=1,this.words[I]|=B>>>26):S+=8;else{var _=a.length-d;for(w=_%2===0?d+1:d;w<a.length;w+=2)B=f(a,d,w)<<S,this.words[I]|=B&67108863,S>=18?(S-=18,I+=1,this.words[I]|=B>>>26):S+=8}this._strip()};function g(x,a,d,y){for(var w=0,S=0,I=Math.min(x.length,d),B=a;B<I;B++){var _=x.charCodeAt(B)-48;w*=y,_>=49?S=_-49+10:_>=17?S=_-17+10:S=_,n(_>=0&&S<y,"Invalid character"),w+=S}return w}s.prototype._parseBase=function(a,d,y){this.words=[0],this.length=1;for(var w=0,S=1;S<=67108863;S*=d)w++;w--,S=S/d|0;for(var I=a.length-y,B=I%w,_=Math.min(I,I-B)+y,u=0,R=y;R<_;R+=w)u=g(a,R,R+w,d),this.imuln(S),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(B!==0){var K=1;for(u=g(a,R,a.length,d),R=0;R<B;R++)K*=d;this.imuln(K),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},s.prototype.copy=function(a){a.words=new Array(this.length);for(var d=0;d<this.length;d++)a.words[d]=this.words[d];a.length=this.length,a.negative=this.negative,a.red=this.red};function p(x,a){x.words=a.words,x.length=a.length,x.negative=a.negative,x.red=a.red}if(s.prototype._move=function(a){p(a,this)},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){for(;this.length<a;)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")]=v}catch{s.prototype.inspect=v}else s.prototype.inspect=v;function v(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],k=[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],j=[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(a,d){a=a||10,d=d|0||1;var y;if(a===16||a==="hex"){y="";for(var w=0,S=0,I=0;I<this.length;I++){var B=this.words[I],_=((B<<w|S)&16777215).toString(16);S=B>>>24-w&16777215,w+=2,w>=26&&(w-=26,I--),S!==0||I!==this.length-1?y=b[6-_.length]+_+y:y=_+y}for(S!==0&&(y=S.toString(16)+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(a===(a|0)&&a>=2&&a<=36){var u=k[a],R=j[a];y="";var K=this.clone();for(K.negative=0;!K.isZero();){var J=K.modrn(R).toString(a);K=K.idivn(R),K.isZero()?y=J+y:y=b[u-J.length]+J+y}for(this.isZero()&&(y="0"+y);y.length%d!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16,2)},c&&(s.prototype.toBuffer=function(a,d){return this.toArrayLike(c,a,d)}),s.prototype.toArray=function(a,d){return this.toArrayLike(Array,a,d)};var O=function(a,d){return a.allocUnsafe?a.allocUnsafe(d):new a(d)};s.prototype.toArrayLike=function(a,d,y){this._strip();var w=this.byteLength(),S=y||Math.max(1,w);n(w<=S,"byte array longer than desired length"),n(S>0,"Requested array length <= 0");var I=O(a,S),B=d==="le"?"LE":"BE";return this["_toArrayLike"+B](I,w),I},s.prototype._toArrayLikeLE=function(a,d){for(var y=0,w=0,S=0,I=0;S<this.length;S++){var B=this.words[S]<<I|w;a[y++]=B&255,y<a.length&&(a[y++]=B>>8&255),y<a.length&&(a[y++]=B>>16&255),I===6?(y<a.length&&(a[y++]=B>>24&255),w=0,I=0):(w=B>>>24,I+=2)}if(y<a.length)for(a[y++]=w;y<a.length;)a[y++]=0},s.prototype._toArrayLikeBE=function(a,d){for(var y=a.length-1,w=0,S=0,I=0;S<this.length;S++){var B=this.words[S]<<I|w;a[y--]=B&255,y>=0&&(a[y--]=B>>8&255),y>=0&&(a[y--]=B>>16&255),I===6?(y>=0&&(a[y--]=B>>24&255),w=0,I=0):(w=B>>>24,I+=2)}if(y>=0)for(a[y--]=w;y>=0;)a[y--]=0},Math.clz32?s.prototype._countBits=function(a){return 32-Math.clz32(a)}:s.prototype._countBits=function(a){var d=a,y=0;return d>=4096&&(y+=13,d>>>=13),d>=64&&(y+=7,d>>>=7),d>=8&&(y+=4,d>>>=4),d>=2&&(y+=2,d>>>=2),y+d},s.prototype._zeroBits=function(a){if(a===0)return 26;var d=a,y=0;return d&8191||(y+=13,d>>>=13),d&127||(y+=7,d>>>=7),d&15||(y+=4,d>>>=4),d&3||(y+=2,d>>>=2),d&1||y++,y},s.prototype.bitLength=function(){var a=this.words[this.length-1],d=this._countBits(a);return(this.length-1)*26+d};function H(x){for(var a=new Array(x.bitLength()),d=0;d<a.length;d++){var y=d/26|0,w=d%26;a[d]=x.words[y]>>>w&1}return a}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(a+=y,y!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},s.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).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(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var d=0;d<a.length;d++)this.words[d]=this.words[d]|a.words[d];return this._strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},s.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},s.prototype.iuand=function(a){var d;this.length>a.length?d=a:d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&a.words[y];return this.length=d.length,this._strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},s.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},s.prototype.iuxor=function(a){var d,y;this.length>a.length?(d=this,y=a):(d=a,y=this);for(var w=0;w<y.length;w++)this.words[w]=d.words[w]^y.words[w];if(this!==d)for(;w<d.length;w++)this.words[w]=d.words[w];return this.length=d.length,this._strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},s.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a=="number"&&a>=0);var d=Math.ceil(a/26)|0,y=a%26;this._expand(d),y>0&&d--;for(var w=0;w<d;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this._strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,d){n(typeof a=="number"&&a>=0);var y=a/26|0,w=a%26;return this._expand(y+1),d?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this._strip()},s.prototype.iadd=function(a){var d;if(this.negative!==0&&a.negative===0)return this.negative=0,d=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,d=this.isub(a),a.negative=1,d._normSign();var y,w;this.length>a.length?(y=this,w=a):(y=a,w=this);for(var S=0,I=0;I<w.length;I++)d=(y.words[I]|0)+(w.words[I]|0)+S,this.words[I]=d&67108863,S=d>>>26;for(;S!==0&&I<y.length;I++)d=(y.words[I]|0)+S,this.words[I]=d&67108863,S=d>>>26;if(this.length=y.length,S!==0)this.words[this.length]=S,this.length++;else if(y!==this)for(;I<y.length;I++)this.words[I]=y.words[I];return this},s.prototype.add=function(a){var d;return a.negative!==0&&this.negative===0?(a.negative=0,d=this.sub(a),a.negative^=1,d):a.negative===0&&this.negative!==0?(this.negative=0,d=a.sub(this),this.negative=1,d):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var d=this.iadd(a);return a.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var y=this.cmp(a);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,S;y>0?(w=this,S=a):(w=a,S=this);for(var I=0,B=0;B<S.length;B++)d=(w.words[B]|0)-(S.words[B]|0)+I,I=d>>26,this.words[B]=d&67108863;for(;I!==0&&B<w.length;B++)d=(w.words[B]|0)+I,I=d>>26,this.words[B]=d&67108863;if(I===0&&B<w.length&&w!==this)for(;B<w.length;B++)this.words[B]=w.words[B];return this.length=Math.max(this.length,B),w!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function A(x,a,d){d.negative=a.negative^x.negative;var y=x.length+a.length|0;d.length=y,y=y-1|0;var w=x.words[0]|0,S=a.words[0]|0,I=w*S,B=I&67108863,_=I/67108864|0;d.words[0]=B;for(var u=1;u<y;u++){for(var R=_>>>26,K=_&67108863,J=Math.min(u,a.length-1),T=Math.max(0,u-x.length+1);T<=J;T++){var L=u-T|0;w=x.words[L]|0,S=a.words[T]|0,I=w*S+K,R+=I/67108864|0,K=I&67108863}d.words[u]=K|0,_=R|0}return _!==0?d.words[u]=_|0:d.length--,d._strip()}var P=function(a,d,y){var w=a.words,S=d.words,I=y.words,B=0,_,u,R,K=w[0]|0,J=K&8191,T=K>>>13,L=w[1]|0,W=L&8191,Z=L>>>13,le=w[2]|0,C=le&8191,M=le>>>13,q=w[3]|0,G=q&8191,se=q>>>13,ue=w[4]|0,re=ue&8191,be=ue>>>13,pt=w[5]|0,Re=pt&8191,Se=pt>>>13,Ze=w[6]|0,_e=Ze&8191,Ce=Ze>>>13,Qe=w[7]|0,Ee=Qe&8191,m=Qe>>>13,l=w[8]|0,h=l&8191,E=l>>>13,N=w[9]|0,F=N&8191,U=N>>>13,he=S[0]|0,ae=he&8191,ie=he>>>13,Me=S[1]|0,ne=Me&8191,Ie=Me>>>13,Ir=S[2]|0,xe=Ir&8191,Ae=Ir>>>13,xr=S[3]|0,ke=xr&8191,Te=xr>>>13,Ar=S[4]|0,Be=Ar&8191,Ne=Ar>>>13,kr=S[5]|0,Pe=kr&8191,Le=kr>>>13,Tr=S[6]|0,Oe=Tr&8191,$e=Tr>>>13,Br=S[7]|0,Fe=Br&8191,De=Br>>>13,Nr=S[8]|0,je=Nr&8191,Ue=Nr>>>13,Pr=S[9]|0,He=Pr&8191,We=Pr>>>13;y.negative=a.negative^d.negative,y.length=19,_=Math.imul(J,ae),u=Math.imul(J,ie),u=u+Math.imul(T,ae)|0,R=Math.imul(T,ie);var Kt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,_=Math.imul(W,ae),u=Math.imul(W,ie),u=u+Math.imul(Z,ae)|0,R=Math.imul(Z,ie),_=_+Math.imul(J,ne)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(T,ne)|0,R=R+Math.imul(T,Ie)|0;var Yt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,_=Math.imul(C,ae),u=Math.imul(C,ie),u=u+Math.imul(M,ae)|0,R=Math.imul(M,ie),_=_+Math.imul(W,ne)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(Z,ne)|0,R=R+Math.imul(Z,Ie)|0,_=_+Math.imul(J,xe)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(T,xe)|0,R=R+Math.imul(T,Ae)|0;var Qt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,_=Math.imul(G,ae),u=Math.imul(G,ie),u=u+Math.imul(se,ae)|0,R=Math.imul(se,ie),_=_+Math.imul(C,ne)|0,u=u+Math.imul(C,Ie)|0,u=u+Math.imul(M,ne)|0,R=R+Math.imul(M,Ie)|0,_=_+Math.imul(W,xe)|0,u=u+Math.imul(W,Ae)|0,u=u+Math.imul(Z,xe)|0,R=R+Math.imul(Z,Ae)|0,_=_+Math.imul(J,ke)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(T,ke)|0,R=R+Math.imul(T,Te)|0;var Xt=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,_=Math.imul(re,ae),u=Math.imul(re,ie),u=u+Math.imul(be,ae)|0,R=Math.imul(be,ie),_=_+Math.imul(G,ne)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(se,ne)|0,R=R+Math.imul(se,Ie)|0,_=_+Math.imul(C,xe)|0,u=u+Math.imul(C,Ae)|0,u=u+Math.imul(M,xe)|0,R=R+Math.imul(M,Ae)|0,_=_+Math.imul(W,ke)|0,u=u+Math.imul(W,Te)|0,u=u+Math.imul(Z,ke)|0,R=R+Math.imul(Z,Te)|0,_=_+Math.imul(J,Be)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(T,Be)|0,R=R+Math.imul(T,Ne)|0;var er=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(er>>>26)|0,er&=67108863,_=Math.imul(Re,ae),u=Math.imul(Re,ie),u=u+Math.imul(Se,ae)|0,R=Math.imul(Se,ie),_=_+Math.imul(re,ne)|0,u=u+Math.imul(re,Ie)|0,u=u+Math.imul(be,ne)|0,R=R+Math.imul(be,Ie)|0,_=_+Math.imul(G,xe)|0,u=u+Math.imul(G,Ae)|0,u=u+Math.imul(se,xe)|0,R=R+Math.imul(se,Ae)|0,_=_+Math.imul(C,ke)|0,u=u+Math.imul(C,Te)|0,u=u+Math.imul(M,ke)|0,R=R+Math.imul(M,Te)|0,_=_+Math.imul(W,Be)|0,u=u+Math.imul(W,Ne)|0,u=u+Math.imul(Z,Be)|0,R=R+Math.imul(Z,Ne)|0,_=_+Math.imul(J,Pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(T,Pe)|0,R=R+Math.imul(T,Le)|0;var tr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,_=Math.imul(_e,ae),u=Math.imul(_e,ie),u=u+Math.imul(Ce,ae)|0,R=Math.imul(Ce,ie),_=_+Math.imul(Re,ne)|0,u=u+Math.imul(Re,Ie)|0,u=u+Math.imul(Se,ne)|0,R=R+Math.imul(Se,Ie)|0,_=_+Math.imul(re,xe)|0,u=u+Math.imul(re,Ae)|0,u=u+Math.imul(be,xe)|0,R=R+Math.imul(be,Ae)|0,_=_+Math.imul(G,ke)|0,u=u+Math.imul(G,Te)|0,u=u+Math.imul(se,ke)|0,R=R+Math.imul(se,Te)|0,_=_+Math.imul(C,Be)|0,u=u+Math.imul(C,Ne)|0,u=u+Math.imul(M,Be)|0,R=R+Math.imul(M,Ne)|0,_=_+Math.imul(W,Pe)|0,u=u+Math.imul(W,Le)|0,u=u+Math.imul(Z,Pe)|0,R=R+Math.imul(Z,Le)|0,_=_+Math.imul(J,Oe)|0,u=u+Math.imul(J,$e)|0,u=u+Math.imul(T,Oe)|0,R=R+Math.imul(T,$e)|0;var rr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(rr>>>26)|0,rr&=67108863,_=Math.imul(Ee,ae),u=Math.imul(Ee,ie),u=u+Math.imul(m,ae)|0,R=Math.imul(m,ie),_=_+Math.imul(_e,ne)|0,u=u+Math.imul(_e,Ie)|0,u=u+Math.imul(Ce,ne)|0,R=R+Math.imul(Ce,Ie)|0,_=_+Math.imul(Re,xe)|0,u=u+Math.imul(Re,Ae)|0,u=u+Math.imul(Se,xe)|0,R=R+Math.imul(Se,Ae)|0,_=_+Math.imul(re,ke)|0,u=u+Math.imul(re,Te)|0,u=u+Math.imul(be,ke)|0,R=R+Math.imul(be,Te)|0,_=_+Math.imul(G,Be)|0,u=u+Math.imul(G,Ne)|0,u=u+Math.imul(se,Be)|0,R=R+Math.imul(se,Ne)|0,_=_+Math.imul(C,Pe)|0,u=u+Math.imul(C,Le)|0,u=u+Math.imul(M,Pe)|0,R=R+Math.imul(M,Le)|0,_=_+Math.imul(W,Oe)|0,u=u+Math.imul(W,$e)|0,u=u+Math.imul(Z,Oe)|0,R=R+Math.imul(Z,$e)|0,_=_+Math.imul(J,Fe)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(T,Fe)|0,R=R+Math.imul(T,De)|0;var nr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(nr>>>26)|0,nr&=67108863,_=Math.imul(h,ae),u=Math.imul(h,ie),u=u+Math.imul(E,ae)|0,R=Math.imul(E,ie),_=_+Math.imul(Ee,ne)|0,u=u+Math.imul(Ee,Ie)|0,u=u+Math.imul(m,ne)|0,R=R+Math.imul(m,Ie)|0,_=_+Math.imul(_e,xe)|0,u=u+Math.imul(_e,Ae)|0,u=u+Math.imul(Ce,xe)|0,R=R+Math.imul(Ce,Ae)|0,_=_+Math.imul(Re,ke)|0,u=u+Math.imul(Re,Te)|0,u=u+Math.imul(Se,ke)|0,R=R+Math.imul(Se,Te)|0,_=_+Math.imul(re,Be)|0,u=u+Math.imul(re,Ne)|0,u=u+Math.imul(be,Be)|0,R=R+Math.imul(be,Ne)|0,_=_+Math.imul(G,Pe)|0,u=u+Math.imul(G,Le)|0,u=u+Math.imul(se,Pe)|0,R=R+Math.imul(se,Le)|0,_=_+Math.imul(C,Oe)|0,u=u+Math.imul(C,$e)|0,u=u+Math.imul(M,Oe)|0,R=R+Math.imul(M,$e)|0,_=_+Math.imul(W,Fe)|0,u=u+Math.imul(W,De)|0,u=u+Math.imul(Z,Fe)|0,R=R+Math.imul(Z,De)|0,_=_+Math.imul(J,je)|0,u=u+Math.imul(J,Ue)|0,u=u+Math.imul(T,je)|0,R=R+Math.imul(T,Ue)|0;var ir=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ir>>>26)|0,ir&=67108863,_=Math.imul(F,ae),u=Math.imul(F,ie),u=u+Math.imul(U,ae)|0,R=Math.imul(U,ie),_=_+Math.imul(h,ne)|0,u=u+Math.imul(h,Ie)|0,u=u+Math.imul(E,ne)|0,R=R+Math.imul(E,Ie)|0,_=_+Math.imul(Ee,xe)|0,u=u+Math.imul(Ee,Ae)|0,u=u+Math.imul(m,xe)|0,R=R+Math.imul(m,Ae)|0,_=_+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Te)|0,u=u+Math.imul(Ce,ke)|0,R=R+Math.imul(Ce,Te)|0,_=_+Math.imul(Re,Be)|0,u=u+Math.imul(Re,Ne)|0,u=u+Math.imul(Se,Be)|0,R=R+Math.imul(Se,Ne)|0,_=_+Math.imul(re,Pe)|0,u=u+Math.imul(re,Le)|0,u=u+Math.imul(be,Pe)|0,R=R+Math.imul(be,Le)|0,_=_+Math.imul(G,Oe)|0,u=u+Math.imul(G,$e)|0,u=u+Math.imul(se,Oe)|0,R=R+Math.imul(se,$e)|0,_=_+Math.imul(C,Fe)|0,u=u+Math.imul(C,De)|0,u=u+Math.imul(M,Fe)|0,R=R+Math.imul(M,De)|0,_=_+Math.imul(W,je)|0,u=u+Math.imul(W,Ue)|0,u=u+Math.imul(Z,je)|0,R=R+Math.imul(Z,Ue)|0,_=_+Math.imul(J,He)|0,u=u+Math.imul(J,We)|0,u=u+Math.imul(T,He)|0,R=R+Math.imul(T,We)|0;var sr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,_=Math.imul(F,ne),u=Math.imul(F,Ie),u=u+Math.imul(U,ne)|0,R=Math.imul(U,Ie),_=_+Math.imul(h,xe)|0,u=u+Math.imul(h,Ae)|0,u=u+Math.imul(E,xe)|0,R=R+Math.imul(E,Ae)|0,_=_+Math.imul(Ee,ke)|0,u=u+Math.imul(Ee,Te)|0,u=u+Math.imul(m,ke)|0,R=R+Math.imul(m,Te)|0,_=_+Math.imul(_e,Be)|0,u=u+Math.imul(_e,Ne)|0,u=u+Math.imul(Ce,Be)|0,R=R+Math.imul(Ce,Ne)|0,_=_+Math.imul(Re,Pe)|0,u=u+Math.imul(Re,Le)|0,u=u+Math.imul(Se,Pe)|0,R=R+Math.imul(Se,Le)|0,_=_+Math.imul(re,Oe)|0,u=u+Math.imul(re,$e)|0,u=u+Math.imul(be,Oe)|0,R=R+Math.imul(be,$e)|0,_=_+Math.imul(G,Fe)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(se,Fe)|0,R=R+Math.imul(se,De)|0,_=_+Math.imul(C,je)|0,u=u+Math.imul(C,Ue)|0,u=u+Math.imul(M,je)|0,R=R+Math.imul(M,Ue)|0,_=_+Math.imul(W,He)|0,u=u+Math.imul(W,We)|0,u=u+Math.imul(Z,He)|0,R=R+Math.imul(Z,We)|0;var or=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(or>>>26)|0,or&=67108863,_=Math.imul(F,xe),u=Math.imul(F,Ae),u=u+Math.imul(U,xe)|0,R=Math.imul(U,Ae),_=_+Math.imul(h,ke)|0,u=u+Math.imul(h,Te)|0,u=u+Math.imul(E,ke)|0,R=R+Math.imul(E,Te)|0,_=_+Math.imul(Ee,Be)|0,u=u+Math.imul(Ee,Ne)|0,u=u+Math.imul(m,Be)|0,R=R+Math.imul(m,Ne)|0,_=_+Math.imul(_e,Pe)|0,u=u+Math.imul(_e,Le)|0,u=u+Math.imul(Ce,Pe)|0,R=R+Math.imul(Ce,Le)|0,_=_+Math.imul(Re,Oe)|0,u=u+Math.imul(Re,$e)|0,u=u+Math.imul(Se,Oe)|0,R=R+Math.imul(Se,$e)|0,_=_+Math.imul(re,Fe)|0,u=u+Math.imul(re,De)|0,u=u+Math.imul(be,Fe)|0,R=R+Math.imul(be,De)|0,_=_+Math.imul(G,je)|0,u=u+Math.imul(G,Ue)|0,u=u+Math.imul(se,je)|0,R=R+Math.imul(se,Ue)|0,_=_+Math.imul(C,He)|0,u=u+Math.imul(C,We)|0,u=u+Math.imul(M,He)|0,R=R+Math.imul(M,We)|0;var ar=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,_=Math.imul(F,ke),u=Math.imul(F,Te),u=u+Math.imul(U,ke)|0,R=Math.imul(U,Te),_=_+Math.imul(h,Be)|0,u=u+Math.imul(h,Ne)|0,u=u+Math.imul(E,Be)|0,R=R+Math.imul(E,Ne)|0,_=_+Math.imul(Ee,Pe)|0,u=u+Math.imul(Ee,Le)|0,u=u+Math.imul(m,Pe)|0,R=R+Math.imul(m,Le)|0,_=_+Math.imul(_e,Oe)|0,u=u+Math.imul(_e,$e)|0,u=u+Math.imul(Ce,Oe)|0,R=R+Math.imul(Ce,$e)|0,_=_+Math.imul(Re,Fe)|0,u=u+Math.imul(Re,De)|0,u=u+Math.imul(Se,Fe)|0,R=R+Math.imul(Se,De)|0,_=_+Math.imul(re,je)|0,u=u+Math.imul(re,Ue)|0,u=u+Math.imul(be,je)|0,R=R+Math.imul(be,Ue)|0,_=_+Math.imul(G,He)|0,u=u+Math.imul(G,We)|0,u=u+Math.imul(se,He)|0,R=R+Math.imul(se,We)|0;var cr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,_=Math.imul(F,Be),u=Math.imul(F,Ne),u=u+Math.imul(U,Be)|0,R=Math.imul(U,Ne),_=_+Math.imul(h,Pe)|0,u=u+Math.imul(h,Le)|0,u=u+Math.imul(E,Pe)|0,R=R+Math.imul(E,Le)|0,_=_+Math.imul(Ee,Oe)|0,u=u+Math.imul(Ee,$e)|0,u=u+Math.imul(m,Oe)|0,R=R+Math.imul(m,$e)|0,_=_+Math.imul(_e,Fe)|0,u=u+Math.imul(_e,De)|0,u=u+Math.imul(Ce,Fe)|0,R=R+Math.imul(Ce,De)|0,_=_+Math.imul(Re,je)|0,u=u+Math.imul(Re,Ue)|0,u=u+Math.imul(Se,je)|0,R=R+Math.imul(Se,Ue)|0,_=_+Math.imul(re,He)|0,u=u+Math.imul(re,We)|0,u=u+Math.imul(be,He)|0,R=R+Math.imul(be,We)|0;var lr=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,_=Math.imul(F,Pe),u=Math.imul(F,Le),u=u+Math.imul(U,Pe)|0,R=Math.imul(U,Le),_=_+Math.imul(h,Oe)|0,u=u+Math.imul(h,$e)|0,u=u+Math.imul(E,Oe)|0,R=R+Math.imul(E,$e)|0,_=_+Math.imul(Ee,Fe)|0,u=u+Math.imul(Ee,De)|0,u=u+Math.imul(m,Fe)|0,R=R+Math.imul(m,De)|0,_=_+Math.imul(_e,je)|0,u=u+Math.imul(_e,Ue)|0,u=u+Math.imul(Ce,je)|0,R=R+Math.imul(Ce,Ue)|0,_=_+Math.imul(Re,He)|0,u=u+Math.imul(Re,We)|0,u=u+Math.imul(Se,He)|0,R=R+Math.imul(Se,We)|0;var Bs=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,_=Math.imul(F,Oe),u=Math.imul(F,$e),u=u+Math.imul(U,Oe)|0,R=Math.imul(U,$e),_=_+Math.imul(h,Fe)|0,u=u+Math.imul(h,De)|0,u=u+Math.imul(E,Fe)|0,R=R+Math.imul(E,De)|0,_=_+Math.imul(Ee,je)|0,u=u+Math.imul(Ee,Ue)|0,u=u+Math.imul(m,je)|0,R=R+Math.imul(m,Ue)|0,_=_+Math.imul(_e,He)|0,u=u+Math.imul(_e,We)|0,u=u+Math.imul(Ce,He)|0,R=R+Math.imul(Ce,We)|0;var Ns=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Ns>>>26)|0,Ns&=67108863,_=Math.imul(F,Fe),u=Math.imul(F,De),u=u+Math.imul(U,Fe)|0,R=Math.imul(U,De),_=_+Math.imul(h,je)|0,u=u+Math.imul(h,Ue)|0,u=u+Math.imul(E,je)|0,R=R+Math.imul(E,Ue)|0,_=_+Math.imul(Ee,He)|0,u=u+Math.imul(Ee,We)|0,u=u+Math.imul(m,He)|0,R=R+Math.imul(m,We)|0;var Ps=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Ps>>>26)|0,Ps&=67108863,_=Math.imul(F,je),u=Math.imul(F,Ue),u=u+Math.imul(U,je)|0,R=Math.imul(U,Ue),_=_+Math.imul(h,He)|0,u=u+Math.imul(h,We)|0,u=u+Math.imul(E,He)|0,R=R+Math.imul(E,We)|0;var Ls=(B+_|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,_=Math.imul(F,He),u=Math.imul(F,We),u=u+Math.imul(U,He)|0,R=Math.imul(U,We);var Os=(B+_|0)+((u&8191)<<13)|0;return B=(R+(u>>>13)|0)+(Os>>>26)|0,Os&=67108863,I[0]=Kt,I[1]=Yt,I[2]=Qt,I[3]=Xt,I[4]=er,I[5]=tr,I[6]=rr,I[7]=nr,I[8]=ir,I[9]=sr,I[10]=or,I[11]=ar,I[12]=cr,I[13]=lr,I[14]=Bs,I[15]=Ns,I[16]=Ps,I[17]=Ls,I[18]=Os,B!==0&&(I[19]=B,y.length++),y};Math.imul||(P=A);function $(x,a,d){d.negative=a.negative^x.negative,d.length=x.length+a.length;for(var y=0,w=0,S=0;S<d.length-1;S++){var I=w;w=0;for(var B=y&67108863,_=Math.min(S,a.length-1),u=Math.max(0,S-x.length+1);u<=_;u++){var R=S-u,K=x.words[R]|0,J=a.words[u]|0,T=K*J,L=T&67108863;I=I+(T/67108864|0)|0,L=L+B|0,B=L&67108863,I=I+(L>>>26)|0,w+=I>>>26,I&=67108863}d.words[S]=B,y=I,I=w}return y!==0?d.words[S]=y:d.length--,d._strip()}function V(x,a,d){return $(x,a,d)}s.prototype.mulTo=function(a,d){var y,w=this.length+a.length;return this.length===10&&a.length===10?y=P(this,a,d):w<63?y=A(this,a,d):w<1024?y=$(this,a,d):y=V(this,a,d),y},s.prototype.mul=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),this.mulTo(a,d)},s.prototype.mulf=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),V(this,a,d)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){var d=a<0;d&&(a=-a),n(typeof a=="number"),n(a<67108864);for(var y=0,w=0;w<this.length;w++){var S=(this.words[w]|0)*a,I=(S&67108863)+(y&67108863);y>>=26,y+=S/67108864|0,y+=I>>>26,this.words[w]=I&67108863}return y!==0&&(this.words[w]=y,this.length++),this.length=a===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var d=H(a);if(d.length===0)return new s(1);for(var y=this,w=0;w<d.length&&d[w]===0;w++,y=y.sqr());if(++w<d.length)for(var S=y.sqr();w<d.length;w++,S=S.sqr())d[w]!==0&&(y=y.mul(S));return y},s.prototype.iushln=function(a){n(typeof a=="number"&&a>=0);var d=a%26,y=(a-d)/26,w=67108863>>>26-d<<26-d,S;if(d!==0){var I=0;for(S=0;S<this.length;S++){var B=this.words[S]&w,_=(this.words[S]|0)-B<<d;this.words[S]=_|I,I=B>>>26-d}I&&(this.words[S]=I,this.length++)}if(y!==0){for(S=this.length-1;S>=0;S--)this.words[S+y]=this.words[S];for(S=0;S<y;S++)this.words[S]=0;this.length+=y}return this._strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,d,y){n(typeof a=="number"&&a>=0);var w;d?w=(d-d%26)/26:w=0;var S=a%26,I=Math.min((a-S)/26,this.length),B=67108863^67108863>>>S<<S,_=y;if(w-=I,w=Math.max(0,w),_){for(var u=0;u<I;u++)_.words[u]=this.words[u];_.length=I}if(I!==0)if(this.length>I)for(this.length-=I,u=0;u<this.length;u++)this.words[u]=this.words[u+I];else this.words[0]=0,this.length=1;var R=0;for(u=this.length-1;u>=0&&(R!==0||u>=w);u--){var K=this.words[u]|0;this.words[u]=R<<26-S|K>>>S,R=K&B}return _&&R!==0&&(_.words[_.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(a,d,y){return n(this.negative===0),this.iushrn(a,d,y)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a=="number"&&a>=0);var d=a%26,y=(a-d)/26,w=1<<d;if(this.length<=y)return!1;var S=this.words[y];return!!(S&w)},s.prototype.imaskn=function(a){n(typeof a=="number"&&a>=0);var d=a%26,y=(a-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0&&y++,this.length=Math.min(y,this.length),d!==0){var w=67108863^67108863>>>d<<d;this.words[this.length-1]&=w}return this._strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){return n(typeof a=="number"),n(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<=a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(a){if(n(typeof a=="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(a){return this.clone().iaddn(a)},s.prototype.subn=function(a){return this.clone().isubn(a)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(a,d,y){var w=a.length+y,S;this._expand(w);var I,B=0;for(S=0;S<a.length;S++){I=(this.words[S+y]|0)+B;var _=(a.words[S]|0)*d;I-=_&67108863,B=(I>>26)-(_/67108864|0),this.words[S+y]=I&67108863}for(;S<this.length-y;S++)I=(this.words[S+y]|0)+B,B=I>>26,this.words[S+y]=I&67108863;if(B===0)return this._strip();for(n(B===-1),B=0,S=0;S<this.length;S++)I=-(this.words[S]|0)+B,B=I>>26,this.words[S]=I&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(a,d){var y=this.length-a.length,w=this.clone(),S=a,I=S.words[S.length-1]|0,B=this._countBits(I);y=26-B,y!==0&&(S=S.ushln(y),w.iushln(y),I=S.words[S.length-1]|0);var _=w.length-S.length,u;if(d!=="mod"){u=new s(null),u.length=_+1,u.words=new Array(u.length);for(var R=0;R<u.length;R++)u.words[R]=0}var K=w.clone()._ishlnsubmul(S,1,_);K.negative===0&&(w=K,u&&(u.words[_]=1));for(var J=_-1;J>=0;J--){var T=(w.words[S.length+J]|0)*67108864+(w.words[S.length+J-1]|0);for(T=Math.min(T/I|0,67108863),w._ishlnsubmul(S,T,J);w.negative!==0;)T--,w.negative=0,w._ishlnsubmul(S,1,J),w.isZero()||(w.negative^=1);u&&(u.words[J]=T)}return u&&u._strip(),w._strip(),d!=="div"&&y!==0&&w.iushrn(y),{div:u||null,mod:w}},s.prototype.divmod=function(a,d,y){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var w,S,I;return this.negative!==0&&a.negative===0?(I=this.neg().divmod(a,d),d!=="mod"&&(w=I.div.neg()),d!=="div"&&(S=I.mod.neg(),y&&S.negative!==0&&S.iadd(a)),{div:w,mod:S}):this.negative===0&&a.negative!==0?(I=this.divmod(a.neg(),d),d!=="mod"&&(w=I.div.neg()),{div:w,mod:I.mod}):this.negative&a.negative?(I=this.neg().divmod(a.neg(),d),d!=="div"&&(S=I.mod.neg(),y&&S.negative!==0&&S.isub(a)),{div:I.div,mod:S}):a.length>this.length||this.cmp(a)<0?{div:new s(0),mod:this}:a.length===1?d==="div"?{div:this.divn(a.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new s(this.modrn(a.words[0]))}:this._wordDiv(a,d)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var d=this.divmod(a);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(a):d.mod,w=a.ushrn(1),S=a.andln(1),I=y.cmp(w);return I<0||S===1&&I===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var y=(1<<26)%a,w=0,S=this.length-1;S>=0;S--)w=(y*w+(this.words[S]|0))%a;return d?-w:w},s.prototype.modn=function(a){return this.modrn(a)},s.prototype.idivn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var y=0,w=this.length-1;w>=0;w--){var S=(this.words[w]|0)+y*67108864;this.words[w]=S/a|0,y=S%a}return this._strip(),d?this.ineg():this},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var d=this,y=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var w=new s(1),S=new s(0),I=new s(0),B=new s(1),_=0;d.isEven()&&y.isEven();)d.iushrn(1),y.iushrn(1),++_;for(var u=y.clone(),R=d.clone();!d.isZero();){for(var K=0,J=1;!(d.words[0]&J)&&K<26;++K,J<<=1);if(K>0)for(d.iushrn(K);K-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(u),S.isub(R)),w.iushrn(1),S.iushrn(1);for(var T=0,L=1;!(y.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(y.iushrn(T);T-- >0;)(I.isOdd()||B.isOdd())&&(I.iadd(u),B.isub(R)),I.iushrn(1),B.iushrn(1);d.cmp(y)>=0?(d.isub(y),w.isub(I),S.isub(B)):(y.isub(d),I.isub(w),B.isub(S))}return{a:I,b:B,gcd:y.iushln(_)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var d=this,y=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var w=new s(1),S=new s(0),I=y.clone();d.cmpn(1)>0&&y.cmpn(1)>0;){for(var B=0,_=1;!(d.words[0]&_)&&B<26;++B,_<<=1);if(B>0)for(d.iushrn(B);B-- >0;)w.isOdd()&&w.iadd(I),w.iushrn(1);for(var u=0,R=1;!(y.words[0]&R)&&u<26;++u,R<<=1);if(u>0)for(y.iushrn(u);u-- >0;)S.isOdd()&&S.iadd(I),S.iushrn(1);d.cmp(y)>=0?(d.isub(y),w.isub(S)):(y.isub(d),S.isub(w))}var K;return d.cmpn(1)===0?K=w:K=S,K.cmpn(0)<0&&K.iadd(a),K},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var d=this.clone(),y=a.clone();d.negative=0,y.negative=0;for(var w=0;d.isEven()&&y.isEven();w++)d.iushrn(1),y.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;y.isEven();)y.iushrn(1);var S=d.cmp(y);if(S<0){var I=d;d=y,y=I}else if(S===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(w)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a=="number");var d=a%26,y=(a-d)/26,w=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var S=w,I=y;S!==0&&I<this.length;I++){var B=this.words[I]|0;B+=S,S=B>>>26,B&=67108863,this.words[I]=B}return S!==0&&(this.words[I]=S,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var d=a<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{d&&(a=-a),n(a<=67108863,"Number is too big");var w=this.words[0]|0;y=w===a?0:w<a?-1:1}return this.negative!==0?-y|0:y},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var d=this.ucmp(a);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var d=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,S=a.words[y]|0;if(w!==S){w<S?d=-1:w>S&&(d=1);break}}return d},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new oe(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},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(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var D={k256:null,p224:null,p192:null,p25519:null};function z(x,a){this.name=x,this.p=new s(a,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var a=new s(null);return a.words=new Array(Math.ceil(this.n/13)),a},z.prototype.ireduce=function(a){var d=a,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var w=y<this.n?-1:d.ucmp(this.p);return w===0?(d.words[0]=0,d.length=1):w>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},z.prototype.split=function(a,d){a.iushrn(this.n,0,d)},z.prototype.imulK=function(a){return a.imul(this.k)};function te(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(te,z),te.prototype.split=function(a,d){for(var y=4194303,w=Math.min(a.length,9),S=0;S<w;S++)d.words[S]=a.words[S];if(d.length=w,a.length<=9){a.words[0]=0,a.length=1;return}var I=a.words[9];for(d.words[d.length++]=I&y,S=10;S<a.length;S++){var B=a.words[S]|0;a.words[S-10]=(B&y)<<4|I>>>22,I=B}I>>>=22,a.words[S-10]=I,I===0&&a.length>10?a.length-=10:a.length-=9},te.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var d=0,y=0;y<a.length;y++){var w=a.words[y]|0;d+=w*977,a.words[y]=d&67108863,d=w*64+(d/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function Q(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Q,z);function Y(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(Y,z);function de(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(de,z),de.prototype.imulK=function(a){for(var d=0,y=0;y<a.length;y++){var w=(a.words[y]|0)*19+d,S=w&67108863;w>>>=26,a.words[y]=S,d=w}return d!==0&&(a.words[a.length++]=d),a},s._prime=function(a){if(D[a])return D[a];var d;if(a==="k256")d=new te;else if(a==="p224")d=new Q;else if(a==="p192")d=new Y;else if(a==="p25519")d=new de;else throw new Error("Unknown prime "+a);return D[a]=d,d};function oe(x){if(typeof x=="string"){var a=s._prime(x);this.m=a.p,this.prime=a}else n(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}oe.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},oe.prototype._verify2=function(a,d){n((a.negative|d.negative)===0,"red works only with positives"),n(a.red&&a.red===d.red,"red works only with red numbers")},oe.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(p(a,a.umod(this.m)._forceRed(this)),a)},oe.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},oe.prototype.add=function(a,d){this._verify2(a,d);var y=a.add(d);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},oe.prototype.iadd=function(a,d){this._verify2(a,d);var y=a.iadd(d);return y.cmp(this.m)>=0&&y.isub(this.m),y},oe.prototype.sub=function(a,d){this._verify2(a,d);var y=a.sub(d);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},oe.prototype.isub=function(a,d){this._verify2(a,d);var y=a.isub(d);return y.cmpn(0)<0&&y.iadd(this.m),y},oe.prototype.shl=function(a,d){return this._verify1(a),this.imod(a.ushln(d))},oe.prototype.imul=function(a,d){return this._verify2(a,d),this.imod(a.imul(d))},oe.prototype.mul=function(a,d){return this._verify2(a,d),this.imod(a.mul(d))},oe.prototype.isqr=function(a){return this.imul(a,a.clone())},oe.prototype.sqr=function(a){return this.mul(a,a)},oe.prototype.sqrt=function(a){if(a.isZero())return a.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var y=this.m.add(new s(1)).iushrn(2);return this.pow(a,y)}for(var w=this.m.subn(1),S=0;!w.isZero()&&w.andln(1)===0;)S++,w.iushrn(1);n(!w.isZero());var I=new s(1).toRed(this),B=I.redNeg(),_=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,_).cmp(B)!==0;)u.redIAdd(B);for(var R=this.pow(u,w),K=this.pow(a,w.addn(1).iushrn(1)),J=this.pow(a,w),T=S;J.cmp(I)!==0;){for(var L=J,W=0;L.cmp(I)!==0;W++)L=L.redSqr();n(W<T);var Z=this.pow(R,new s(1).iushln(T-W-1));K=K.redMul(Z),R=Z.redSqr(),J=J.redMul(R),T=W}return K},oe.prototype.invm=function(a){var d=a._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},oe.prototype.pow=function(a,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return a.clone();var y=4,w=new Array(1<<y);w[0]=new s(1).toRed(this),w[1]=a;for(var S=2;S<w.length;S++)w[S]=this.mul(w[S-1],a);var I=w[0],B=0,_=0,u=d.bitLength()%26;for(u===0&&(u=26),S=d.length-1;S>=0;S--){for(var R=d.words[S],K=u-1;K>=0;K--){var J=R>>K&1;if(I!==w[0]&&(I=this.sqr(I)),J===0&&B===0){_=0;continue}B<<=1,B|=J,_++,!(_!==y&&(S!==0||K!==0))&&(I=this.mul(I,w[B]),_=0,B=0)}u=26}return I},oe.prototype.convertTo=function(a){var d=a.umod(this.m);return d===a?d.clone():d},oe.prototype.convertFrom=function(a){var d=a.clone();return d.red=null,d},s.mont=function(a){return new pe(a)};function pe(x){oe.call(this,x),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(pe,oe),pe.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},pe.prototype.convertFrom=function(a){var d=this.imod(a.mul(this.rinv));return d.red=null,d},pe.prototype.imul=function(a,d){if(a.isZero()||d.isZero())return a.words[0]=0,a.length=1,a;var y=a.imul(d),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=y.isub(w).iushrn(this.shift),I=S;return S.cmp(this.m)>=0?I=S.isub(this.m):S.cmpn(0)<0&&(I=S.iadd(this.m)),I._forceRed(this)},pe.prototype.mul=function(a,d){if(a.isZero()||d.isZero())return new s(0)._forceRed(this);var y=a.mul(d),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=y.isub(w).iushrn(this.shift),I=S;return S.cmp(this.m)>=0?I=S.isub(this.m):S.cmpn(0)<0&&(I=S.iadd(this.m)),I._forceRed(this)},pe.prototype.invm=function(a){var d=this.imod(a._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,ee)})(Vo);var $i=Vo.exports,Bn={},Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.errorValues=Ut.standardErrorCodes=void 0;Ut.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}};Ut.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 Fi={},Di={};(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=Ut,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(b,k=r){if(b&&Number.isInteger(b)){const j=b.toString();if(p(t.errorValues,j))return t.errorValues[j].message;if(f(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=n;function i(b){if(!Number.isInteger(b))return!1;const k=b.toString();return!!(t.errorValues[k]||f(b))}e.isValidCode=i;function s(b){var k;if(typeof b=="number")return b;if(c(b))return(k=b.code)!==null&&k!==void 0?k:b.errorCode}e.getErrorCode=s;function c(b){return typeof b=="object"&&b!==null&&(typeof b.code=="number"||typeof b.errorCode=="number")}function o(b,{shouldIncludeStack:k=!1}={}){const j={};if(b&&typeof b=="object"&&!Array.isArray(b)&&p(b,"code")&&i(b.code)){const O=b;j.code=O.code,O.message&&typeof O.message=="string"?(j.message=O.message,p(O,"data")&&(j.data=O.data)):(j.message=n(j.code),j.data={originalError:g(b)})}else j.code=t.standardErrorCodes.rpc.internal,j.message=v(b,"message")?b.message:r,j.data={originalError:g(b)};return k&&(j.stack=v(b,"stack")?b.stack:void 0),j}e.serialize=o;function f(b){return b>=-32099&&b<=-32e3}function g(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function p(b,k){return Object.prototype.hasOwnProperty.call(b,k)}function v(b,k){return typeof b=="object"&&b!==null&&k in b&&typeof b[k]=="string"}})(Di);Object.defineProperty(Fi,"__esModule",{value:!0});Fi.standardErrors=void 0;const rt=Ut,Yl=Di;Fi.standardErrors={rpc:{parse:e=>gt(rt.standardErrorCodes.rpc.parse,e),invalidRequest:e=>gt(rt.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>gt(rt.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>gt(rt.standardErrorCodes.rpc.methodNotFound,e),internal:e=>gt(rt.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return gt(t,e)},invalidInput:e=>gt(rt.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>gt(rt.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>gt(rt.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>gt(rt.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>gt(rt.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>gt(rt.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>$r(rt.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>$r(rt.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>$r(rt.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>$r(rt.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>$r(rt.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>$r(rt.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 eu(t,r,n)}}};function gt(e,t){const[r,n]=Ql(t);return new Xl(e,r||(0,Yl.getMessageFromCode)(e),n)}function $r(e,t){const[r,n]=Ql(t);return new eu(e,r||(0,Yl.getMessageFromCode)(e),n)}function Ql(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 Xl=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)}},eu=class extends Xl{constructor(t,r,n){if(!t0(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function t0(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ji={},cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.isErrorResponse=void 0;function r0(e){return e.errorMessage!==void 0}cn.isErrorResponse=r0;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.LIB_VERSION=void 0;ln.LIB_VERSION="3.9.3";Object.defineProperty(ji,"__esModule",{value:!0});ji.serializeError=void 0;const n0=cn,i0=ln,s0=Ut,o0=Di;function a0(e,t){const r=(0,o0.serialize)(c0(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",i0.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=l0(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ji.serializeError=a0;function c0(e){return typeof e=="string"?{message:e,code:s0.standardErrorCodes.rpc.internal}:(0,n0.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function l0(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Ut;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Fi;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ji;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Di;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Bn);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.ProviderType=Ke.RegExpString=Ke.IntNumber=Ke.BigIntString=Ke.AddressString=Ke.HexString=Ke.OpaqueType=void 0;function Nn(){return e=>e}Ke.OpaqueType=Nn;Ke.HexString=Nn();Ke.AddressString=Nn();Ke.BigIntString=Nn();function u0(e){return Math.floor(e)}Ke.IntNumber=u0;Ke.RegExpString=Nn();var Ka;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Ka||(Ke.ProviderType=Ka={}));var h0=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.isMobileWeb=X.getLocation=X.isInIFrame=X.createQrUrl=X.getFavicon=X.range=X.isBigNumber=X.ensureParsedJSONObject=X.ensureBN=X.ensureRegExpString=X.ensureIntNumber=X.ensureBuffer=X.ensureAddressString=X.ensureEvenLengthHexString=X.ensureHexString=X.isHexString=X.prepend0x=X.strip0x=X.has0xPrefix=X.hexStringFromIntNumber=X.intNumberFromHexString=X.bigIntStringFromBN=X.hexStringFromBuffer=X.hexStringToUint8Array=X.uint8ArrayToHex=X.randomBytesHex=void 0;const zt=h0($i),Sr=Bn,bt=Ke,tu=/^[0-9]*$/,ru=/^[a-f0-9]*$/;function f0(e){return nu(crypto.getRandomValues(new Uint8Array(e)))}X.randomBytesHex=f0;function nu(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=nu;function d0(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}X.hexStringToUint8Array=d0;function p0(e,t=!1){const r=e.toString("hex");return(0,bt.HexString)(t?`0x${r}`:r)}X.hexStringFromBuffer=p0;function g0(e){return(0,bt.BigIntString)(e.toString(10))}X.bigIntStringFromBN=g0;function m0(e){return(0,bt.IntNumber)(new zt.default(Ln(e,!1),16).toNumber())}X.intNumberFromHexString=m0;function y0(e){return(0,bt.HexString)(`0x${new zt.default(e).toString(16)}`)}X.hexStringFromIntNumber=y0;function qo(e){return e.startsWith("0x")||e.startsWith("0X")}X.has0xPrefix=qo;function Ui(e){return qo(e)?e.slice(2):e}X.strip0x=Ui;function iu(e){return qo(e)?`0x${e.slice(2)}`:`0x${e}`}X.prepend0x=iu;function Pn(e){if(typeof e!="string")return!1;const t=Ui(e).toLowerCase();return ru.test(t)}X.isHexString=Pn;function su(e,t=!1){if(typeof e=="string"){const r=Ui(e).toLowerCase();if(ru.test(r))return(0,bt.HexString)(t?`0x${r}`:r)}throw Sr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}X.ensureHexString=su;function Ln(e,t=!1){let r=su(e,!1);return r.length%2===1&&(r=(0,bt.HexString)(`0${r}`)),t?(0,bt.HexString)(`0x${r}`):r}X.ensureEvenLengthHexString=Ln;function v0(e){if(typeof e=="string"){const t=Ui(e).toLowerCase();if(Pn(t)&&t.length===40)return(0,bt.AddressString)(iu(t))}throw Sr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}X.ensureAddressString=v0;function w0(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(Pn(e)){const t=Ln(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw Sr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}X.ensureBuffer=w0;function ou(e){if(typeof e=="number"&&Number.isInteger(e))return(0,bt.IntNumber)(e);if(typeof e=="string"){if(tu.test(e))return(0,bt.IntNumber)(Number(e));if(Pn(e))return(0,bt.IntNumber)(new zt.default(Ln(e,!1),16).toNumber())}throw Sr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureIntNumber=ou;function b0(e){if(e instanceof RegExp)return(0,bt.RegExpString)(e.toString());throw Sr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}X.ensureRegExpString=b0;function _0(e){if(e!==null&&(zt.default.isBN(e)||au(e)))return new zt.default(e.toString(10),10);if(typeof e=="number")return new zt.default(ou(e));if(typeof e=="string"){if(tu.test(e))return new zt.default(e,10);if(Pn(e))return new zt.default(Ln(e,!1),16)}throw Sr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureBN=_0;function E0(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw Sr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}X.ensureParsedJSONObject=E0;function au(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}X.isBigNumber=au;function S0(e,t){return Array.from({length:t-e},(r,n)=>e+n)}X.range=S0;function R0(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}X.getFavicon=R0;function C0(e,t,r,n,i,s){const c=n?"parent-id":"id",o=new URLSearchParams({[c]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${o}`}X.createQrUrl=C0;function cu(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=cu;function M0(){try{return cu()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=M0;function I0(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}X.isMobileWeb=I0;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ScopedLocalStorage=void 0;class x0{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}`}}Hi.ScopedLocalStorage=x0;var Xr={};const A0=an(Zh);var On={},$n={},un={};Object.defineProperty(un,"__esModule",{value:!0});un.EVENTS=void 0;un.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.RelayAbstract=wt.APP_VERSION_KEY=wt.LOCAL_STORAGE_ADDRESSES_KEY=wt.WALLET_USER_NAME_KEY=void 0;const Ya=Bn;wt.WALLET_USER_NAME_KEY="walletUsername";wt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";wt.APP_VERSION_KEY="AppVersion";class k0{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 Ya.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Ya.serializeError)(s,t.method);return i})}}wt.RelayAbstract=k0;var hn={},lu={exports:{}},No={exports:{}},Fn={},Wi={};Wi.byteLength=N0;Wi.toByteArray=L0;Wi.fromByteArray=F0;var Pt=[],vt=[],T0=typeof Uint8Array<"u"?Uint8Array:Array,Gs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Fr=0,B0=Gs.length;Fr<B0;++Fr)Pt[Fr]=Gs[Fr],vt[Gs.charCodeAt(Fr)]=Fr;vt[45]=62;vt[95]=63;function uu(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function N0(e){var t=uu(e),r=t[0],n=t[1];return(r+n)*3/4-n}function P0(e,t,r){return(t+r)*3/4-r}function L0(e){var t,r=uu(e),n=r[0],i=r[1],s=new T0(P0(e,n,i)),c=0,o=i>0?n-4:n,f;for(f=0;f<o;f+=4)t=vt[e.charCodeAt(f)]<<18|vt[e.charCodeAt(f+1)]<<12|vt[e.charCodeAt(f+2)]<<6|vt[e.charCodeAt(f+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=t&255;return i===2&&(t=vt[e.charCodeAt(f)]<<2|vt[e.charCodeAt(f+1)]>>4,s[c++]=t&255),i===1&&(t=vt[e.charCodeAt(f)]<<10|vt[e.charCodeAt(f+1)]<<4|vt[e.charCodeAt(f+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function O0(e){return Pt[e>>18&63]+Pt[e>>12&63]+Pt[e>>6&63]+Pt[e&63]}function $0(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(O0(n));return i.join("")}function F0(e){for(var t,r=e.length,n=r%3,i=[],s=16383,c=0,o=r-n;c<o;c+=s)i.push($0(e,c,c+s>o?o:c+s));return n===1?(t=e[r-1],i.push(Pt[t>>2]+Pt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Pt[t>>10]+Pt[t>>4&63]+Pt[t<<2&63]+"=")),i.join("")}var zo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */zo.read=function(e,t,r,n,i){var s,c,o=i*8-n-1,f=(1<<o)-1,g=f>>1,p=-7,v=r?i-1:0,b=r?-1:1,k=e[t+v];for(v+=b,s=k&(1<<-p)-1,k>>=-p,p+=o;p>0;s=s*256+e[t+v],v+=b,p-=8);for(c=s&(1<<-p)-1,s>>=-p,p+=n;p>0;c=c*256+e[t+v],v+=b,p-=8);if(s===0)s=1-g;else{if(s===f)return c?NaN:(k?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-g}return(k?-1:1)*c*Math.pow(2,s-n)};zo.write=function(e,t,r,n,i,s){var c,o,f,g=s*8-i-1,p=(1<<g)-1,v=p>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:s-1,j=n?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,c=p):(c=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-c))<1&&(c--,f*=2),c+v>=1?t+=b/f:t+=b*Math.pow(2,1-v),t*f>=2&&(c++,f/=2),c+v>=p?(o=0,c=p):c+v>=1?(o=(t*f-1)*Math.pow(2,i),c=c+v):(o=t*Math.pow(2,v-1)*Math.pow(2,i),c=0));i>=8;e[r+k]=o&255,k+=j,o/=256,i-=8);for(c=c<<i|o,g+=i;g>0;e[r+k]=c&255,k+=j,c/=256,g-=8);e[r+k-j]|=O*128};/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(e){const t=Wi,r=Go,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const m=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(m,l),m.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function c(m){if(m>i)throw new RangeError('The value "'+m+'" is invalid for option "size"');const l=new Uint8Array(m);return Object.setPrototypeOf(l,o.prototype),l}function o(m,l,h){if(typeof m=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(m)}return f(m,l,h)}o.poolSize=8192;function f(m,l,h){if(typeof m=="string")return b(m,l);if(ArrayBuffer.isView(m))return j(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(Ze(m,ArrayBuffer)||m&&Ze(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ze(m,SharedArrayBuffer)||m&&Ze(m.buffer,SharedArrayBuffer)))return O(m,l,h);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const E=m.valueOf&&m.valueOf();if(E!=null&&E!==m)return o.from(E,l,h);const N=H(m);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return o.from(m[Symbol.toPrimitive]("string"),l,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}o.from=function(m,l,h){return f(m,l,h)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function g(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function p(m,l,h){return g(m),m<=0?c(m):l!==void 0?typeof h=="string"?c(m).fill(l,h):c(m).fill(l):c(m)}o.alloc=function(m,l,h){return p(m,l,h)};function v(m){return g(m),c(m<0?0:A(m)|0)}o.allocUnsafe=function(m){return v(m)},o.allocUnsafeSlow=function(m){return v(m)};function b(m,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const h=$(m,l)|0;let E=c(h);const N=E.write(m,l);return N!==h&&(E=E.slice(0,N)),E}function k(m){const l=m.length<0?0:A(m.length)|0,h=c(l);for(let E=0;E<l;E+=1)h[E]=m[E]&255;return h}function j(m){if(Ze(m,Uint8Array)){const l=new Uint8Array(m);return O(l.buffer,l.byteOffset,l.byteLength)}return k(m)}function O(m,l,h){if(l<0||m.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<l+(h||0))throw new RangeError('"length" is outside of buffer bounds');let E;return l===void 0&&h===void 0?E=new Uint8Array(m):h===void 0?E=new Uint8Array(m,l):E=new Uint8Array(m,l,h),Object.setPrototypeOf(E,o.prototype),E}function H(m){if(o.isBuffer(m)){const l=A(m.length)|0,h=c(l);return h.length===0||m.copy(h,0,0,l),h}if(m.length!==void 0)return typeof m.length!="number"||_e(m.length)?c(0):k(m);if(m.type==="Buffer"&&Array.isArray(m.data))return k(m.data)}function A(m){if(m>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return m|0}function P(m){return+m!=m&&(m=0),o.alloc(+m)}o.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==o.prototype},o.compare=function(l,h){if(Ze(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),Ze(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),!o.isBuffer(l)||!o.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===h)return 0;let E=l.length,N=h.length;for(let F=0,U=Math.min(E,N);F<U;++F)if(l[F]!==h[F]){E=l[F],N=h[F];break}return E<N?-1:N<E?1:0},o.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(l,h){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return o.alloc(0);let E;if(h===void 0)for(h=0,E=0;E<l.length;++E)h+=l[E].length;const N=o.allocUnsafe(h);let F=0;for(E=0;E<l.length;++E){let U=l[E];if(Ze(U,Uint8Array))F+U.length>N.length?(o.isBuffer(U)||(U=o.from(U)),U.copy(N,F)):Uint8Array.prototype.set.call(N,U,F);else if(o.isBuffer(U))U.copy(N,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=U.length}return N};function $(m,l){if(o.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||Ze(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);const h=m.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&h===0)return 0;let N=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return re(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Re(m).length;default:if(N)return E?-1:re(m).length;l=(""+l).toLowerCase(),N=!0}}o.byteLength=$;function V(m,l,h){let E=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,l>>>=0,h<=l))return"";for(m||(m="utf8");;)switch(m){case"hex":return I(this,l,h);case"utf8":case"utf-8":return a(this,l,h);case"ascii":return w(this,l,h);case"latin1":case"binary":return S(this,l,h);case"base64":return x(this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,l,h);default:if(E)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function D(m,l,h){const E=m[l];m[l]=m[h],m[h]=E}o.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<l;h+=2)D(this,h,h+1);return this},o.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<l;h+=4)D(this,h,h+3),D(this,h+1,h+2);return this},o.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<l;h+=8)D(this,h,h+7),D(this,h+1,h+6),D(this,h+2,h+5),D(this,h+3,h+4);return this},o.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?a(this,0,l):V.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(l){if(!o.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:o.compare(this,l)===0},o.prototype.inspect=function(){let l="";const h=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(l+=" ... "),"<Buffer "+l+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(l,h,E,N,F){if(Ze(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(h===void 0&&(h=0),E===void 0&&(E=l?l.length:0),N===void 0&&(N=0),F===void 0&&(F=this.length),h<0||E>l.length||N<0||F>this.length)throw new RangeError("out of range index");if(N>=F&&h>=E)return 0;if(N>=F)return-1;if(h>=E)return 1;if(h>>>=0,E>>>=0,N>>>=0,F>>>=0,this===l)return 0;let U=F-N,he=E-h;const ae=Math.min(U,he),ie=this.slice(N,F),Ce=l.slice(h,E);for(let ne=0;ne<ae;++ne)if(ie[ne]!==Ce[ne]){U=ie[ne],he=Ce[ne];break}return U<he?-1:he<U?1:0};function z(m,l,h,E,N){if(m.length===0)return-1;if(typeof h=="string"?(E=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,_e(h)&&(h=N?0:m.length-1),h<0&&(h=m.length+h),h>=m.length){if(N)return-1;h=m.length-1}else if(h<0)if(N)h=0;else return-1;if(typeof l=="string"&&(l=o.from(l,E)),o.isBuffer(l))return l.length===0?-1:te(m,l,h,E,N);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(m,l,h):Uint8Array.prototype.lastIndexOf.call(m,l,h):te(m,[l],h,E,N);throw new TypeError("val must be string, number or Buffer")}function te(m,l,h,E,N){let F=1,U=m.length,he=l.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(m.length<2||l.length<2)return-1;F=2,U/=2,he/=2,h/=2}function ae(Ce,ne){return F===1?Ce[ne]:Ce.readUInt16BE(ne*F)}let ie;if(N){let Ce=-1;for(ie=h;ie<U;ie++)if(ae(m,ie)===ae(l,Ce===-1?0:ie-Ce)){if(Ce===-1&&(Ce=ie),ie-Ce+1===he)return Ce*F}else Ce!==-1&&(ie-=ie-Ce),Ce=-1}else for(h+he>U&&(h=U-he),ie=h;ie>=0;ie--){let Ce=!0;for(let ne=0;ne<he;ne++)if(ae(m,ie+ne)!==ae(l,ne)){Ce=!1;break}if(Ce)return ie}return-1}o.prototype.includes=function(l,h,E){return this.indexOf(l,h,E)!==-1},o.prototype.indexOf=function(l,h,E){return z(this,l,h,E,!0)},o.prototype.lastIndexOf=function(l,h,E){return z(this,l,h,E,!1)};function Q(m,l,h,E){h=Number(h)||0;const N=m.length-h;E?(E=Number(E),E>N&&(E=N)):E=N;const F=l.length;E>F/2&&(E=F/2);let U;for(U=0;U<E;++U){const he=parseInt(l.substr(U*2,2),16);if(_e(he))return U;m[h+U]=he}return U}function Y(m,l,h,E){return Se(re(l,m.length-h),m,h,E)}function de(m,l,h,E){return Se(be(l),m,h,E)}function oe(m,l,h,E){return Se(Re(l),m,h,E)}function pe(m,l,h,E){return Se(pt(l,m.length-h),m,h,E)}o.prototype.write=function(l,h,E,N){if(h===void 0)N="utf8",E=this.length,h=0;else if(E===void 0&&typeof h=="string")N=h,E=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(E)?(E=E>>>0,N===void 0&&(N="utf8")):(N=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const F=this.length-h;if((E===void 0||E>F)&&(E=F),l.length>0&&(E<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");let U=!1;for(;;)switch(N){case"hex":return Q(this,l,h,E);case"utf8":case"utf-8":return Y(this,l,h,E);case"ascii":case"latin1":case"binary":return de(this,l,h,E);case"base64":return oe(this,l,h,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,l,h,E);default:if(U)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),U=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(m,l,h){return l===0&&h===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(l,h))}function a(m,l,h){h=Math.min(m.length,h);const E=[];let N=l;for(;N<h;){const F=m[N];let U=null,he=F>239?4:F>223?3:F>191?2:1;if(N+he<=h){let ae,ie,Ce,ne;switch(he){case 1:F<128&&(U=F);break;case 2:ae=m[N+1],(ae&192)===128&&(ne=(F&31)<<6|ae&63,ne>127&&(U=ne));break;case 3:ae=m[N+1],ie=m[N+2],(ae&192)===128&&(ie&192)===128&&(ne=(F&15)<<12|(ae&63)<<6|ie&63,ne>2047&&(ne<55296||ne>57343)&&(U=ne));break;case 4:ae=m[N+1],ie=m[N+2],Ce=m[N+3],(ae&192)===128&&(ie&192)===128&&(Ce&192)===128&&(ne=(F&15)<<18|(ae&63)<<12|(ie&63)<<6|Ce&63,ne>65535&&ne<1114112&&(U=ne))}}U===null?(U=65533,he=1):U>65535&&(U-=65536,E.push(U>>>10&1023|55296),U=56320|U&1023),E.push(U),N+=he}return y(E)}const d=4096;function y(m){const l=m.length;if(l<=d)return String.fromCharCode.apply(String,m);let h="",E=0;for(;E<l;)h+=String.fromCharCode.apply(String,m.slice(E,E+=d));return h}function w(m,l,h){let E="";h=Math.min(m.length,h);for(let N=l;N<h;++N)E+=String.fromCharCode(m[N]&127);return E}function S(m,l,h){let E="";h=Math.min(m.length,h);for(let N=l;N<h;++N)E+=String.fromCharCode(m[N]);return E}function I(m,l,h){const E=m.length;(!l||l<0)&&(l=0),(!h||h<0||h>E)&&(h=E);let N="";for(let F=l;F<h;++F)N+=Me[m[F]];return N}function B(m,l,h){const E=m.slice(l,h);let N="";for(let F=0;F<E.length-1;F+=2)N+=String.fromCharCode(E[F]+E[F+1]*256);return N}o.prototype.slice=function(l,h){const E=this.length;l=~~l,h=h===void 0?E:~~h,l<0?(l+=E,l<0&&(l=0)):l>E&&(l=E),h<0?(h+=E,h<0&&(h=0)):h>E&&(h=E),h<l&&(h=l);const N=this.subarray(l,h);return Object.setPrototypeOf(N,o.prototype),N};function _(m,l,h){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+l>h)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=this[l],F=1,U=0;for(;++U<h&&(F*=256);)N+=this[l+U]*F;return N},o.prototype.readUintBE=o.prototype.readUIntBE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=this[l+--h],F=1;for(;h>0&&(F*=256);)N+=this[l+--h]*F;return N},o.prototype.readUint8=o.prototype.readUInt8=function(l,h){return l=l>>>0,h||_(l,1,this.length),this[l]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(l,h){return l=l>>>0,h||_(l,2,this.length),this[l]|this[l+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(l,h){return l=l>>>0,h||_(l,2,this.length),this[l]<<8|this[l+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(l,h){return l=l>>>0,h||_(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(l,h){return l=l>>>0,h||_(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},o.prototype.readBigUInt64LE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,F=this[++l]+this[++l]*2**8+this[++l]*2**16+E*2**24;return BigInt(N)+(BigInt(F)<<BigInt(32))}),o.prototype.readBigUInt64BE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=h*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],F=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+E;return(BigInt(N)<<BigInt(32))+BigInt(F)}),o.prototype.readIntLE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=this[l],F=1,U=0;for(;++U<h&&(F*=256);)N+=this[l+U]*F;return F*=128,N>=F&&(N-=Math.pow(2,8*h)),N},o.prototype.readIntBE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=h,F=1,U=this[l+--N];for(;N>0&&(F*=256);)U+=this[l+--N]*F;return F*=128,U>=F&&(U-=Math.pow(2,8*h)),U},o.prototype.readInt8=function(l,h){return l=l>>>0,h||_(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},o.prototype.readInt16LE=function(l,h){l=l>>>0,h||_(l,2,this.length);const E=this[l]|this[l+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(l,h){l=l>>>0,h||_(l,2,this.length);const E=this[l+1]|this[l]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(l,h){return l=l>>>0,h||_(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},o.prototype.readInt32BE=function(l,h){return l=l>>>0,h||_(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},o.prototype.readBigInt64LE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(E<<24);return(BigInt(N)<<BigInt(32))+BigInt(h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),o.prototype.readBigInt64BE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=(h<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(N)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+E)}),o.prototype.readFloatLE=function(l,h){return l=l>>>0,h||_(l,4,this.length),r.read(this,l,!0,23,4)},o.prototype.readFloatBE=function(l,h){return l=l>>>0,h||_(l,4,this.length),r.read(this,l,!1,23,4)},o.prototype.readDoubleLE=function(l,h){return l=l>>>0,h||_(l,8,this.length),r.read(this,l,!0,52,8)},o.prototype.readDoubleBE=function(l,h){return l=l>>>0,h||_(l,8,this.length),r.read(this,l,!1,52,8)};function u(m,l,h,E,N,F){if(!o.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>N||l<F)throw new RangeError('"value" argument is out of bounds');if(h+E>m.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(l,h,E,N){if(l=+l,h=h>>>0,E=E>>>0,!N){const he=Math.pow(2,8*E)-1;u(this,l,h,E,he,0)}let F=1,U=0;for(this[h]=l&255;++U<E&&(F*=256);)this[h+U]=l/F&255;return h+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(l,h,E,N){if(l=+l,h=h>>>0,E=E>>>0,!N){const he=Math.pow(2,8*E)-1;u(this,l,h,E,he,0)}let F=E-1,U=1;for(this[h+F]=l&255;--F>=0&&(U*=256);)this[h+F]=l/U&255;return h+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,1,255,0),this[h]=l&255,h+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,65535,0),this[h]=l&255,this[h+1]=l>>>8,h+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,65535,0),this[h]=l>>>8,this[h+1]=l&255,h+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,4294967295,0),this[h+3]=l>>>24,this[h+2]=l>>>16,this[h+1]=l>>>8,this[h]=l&255,h+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,4294967295,0),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4};function R(m,l,h,E,N){C(l,E,N,m,h,7);let F=Number(l&BigInt(4294967295));m[h++]=F,F=F>>8,m[h++]=F,F=F>>8,m[h++]=F,F=F>>8,m[h++]=F;let U=Number(l>>BigInt(32)&BigInt(4294967295));return m[h++]=U,U=U>>8,m[h++]=U,U=U>>8,m[h++]=U,U=U>>8,m[h++]=U,h}function K(m,l,h,E,N){C(l,E,N,m,h,7);let F=Number(l&BigInt(4294967295));m[h+7]=F,F=F>>8,m[h+6]=F,F=F>>8,m[h+5]=F,F=F>>8,m[h+4]=F;let U=Number(l>>BigInt(32)&BigInt(4294967295));return m[h+3]=U,U=U>>8,m[h+2]=U,U=U>>8,m[h+1]=U,U=U>>8,m[h]=U,h+8}o.prototype.writeBigUInt64LE=Qe(function(l,h=0){return R(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Qe(function(l,h=0){return K(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(l,h,E,N){if(l=+l,h=h>>>0,!N){const ae=Math.pow(2,8*E-1);u(this,l,h,E,ae-1,-ae)}let F=0,U=1,he=0;for(this[h]=l&255;++F<E&&(U*=256);)l<0&&he===0&&this[h+F-1]!==0&&(he=1),this[h+F]=(l/U>>0)-he&255;return h+E},o.prototype.writeIntBE=function(l,h,E,N){if(l=+l,h=h>>>0,!N){const ae=Math.pow(2,8*E-1);u(this,l,h,E,ae-1,-ae)}let F=E-1,U=1,he=0;for(this[h+F]=l&255;--F>=0&&(U*=256);)l<0&&he===0&&this[h+F+1]!==0&&(he=1),this[h+F]=(l/U>>0)-he&255;return h+E},o.prototype.writeInt8=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,1,127,-128),l<0&&(l=255+l+1),this[h]=l&255,h+1},o.prototype.writeInt16LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,32767,-32768),this[h]=l&255,this[h+1]=l>>>8,h+2},o.prototype.writeInt16BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,32767,-32768),this[h]=l>>>8,this[h+1]=l&255,h+2},o.prototype.writeInt32LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,2147483647,-2147483648),this[h]=l&255,this[h+1]=l>>>8,this[h+2]=l>>>16,this[h+3]=l>>>24,h+4},o.prototype.writeInt32BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4},o.prototype.writeBigInt64LE=Qe(function(l,h=0){return R(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Qe(function(l,h=0){return K(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(m,l,h,E,N,F){if(h+E>m.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function T(m,l,h,E,N){return l=+l,h=h>>>0,N||J(m,l,h,4),r.write(m,l,h,E,23,4),h+4}o.prototype.writeFloatLE=function(l,h,E){return T(this,l,h,!0,E)},o.prototype.writeFloatBE=function(l,h,E){return T(this,l,h,!1,E)};function L(m,l,h,E,N){return l=+l,h=h>>>0,N||J(m,l,h,8),r.write(m,l,h,E,52,8),h+8}o.prototype.writeDoubleLE=function(l,h,E){return L(this,l,h,!0,E)},o.prototype.writeDoubleBE=function(l,h,E){return L(this,l,h,!1,E)},o.prototype.copy=function(l,h,E,N){if(!o.isBuffer(l))throw new TypeError("argument should be a Buffer");if(E||(E=0),!N&&N!==0&&(N=this.length),h>=l.length&&(h=l.length),h||(h=0),N>0&&N<E&&(N=E),N===E||l.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),l.length-h<N-E&&(N=l.length-h+E);const F=N-E;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,E,N):Uint8Array.prototype.set.call(l,this.subarray(E,N),h),F},o.prototype.fill=function(l,h,E,N){if(typeof l=="string"){if(typeof h=="string"?(N=h,h=0,E=this.length):typeof E=="string"&&(N=E,E=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!o.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(l.length===1){const U=l.charCodeAt(0);(N==="utf8"&&U<128||N==="latin1")&&(l=U)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(h<0||this.length<h||this.length<E)throw new RangeError("Out of range index");if(E<=h)return this;h=h>>>0,E=E===void 0?this.length:E>>>0,l||(l=0);let F;if(typeof l=="number")for(F=h;F<E;++F)this[F]=l;else{const U=o.isBuffer(l)?l:o.from(l,N),he=U.length;if(he===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(F=0;F<E-h;++F)this[F+h]=U[F%he]}return this};const W={};function Z(m,l,h){W[m]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(N){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:N,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(m,l){return`The "${m}" argument must be of type number. Received type ${typeof l}`},TypeError),Z("ERR_OUT_OF_RANGE",function(m,l,h){let E=`The value of "${m}" is out of range.`,N=h;return Number.isInteger(h)&&Math.abs(h)>2**32?N=le(String(h)):typeof h=="bigint"&&(N=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(N=le(N)),N+="n"),E+=` It must be ${l}. Received ${N}`,E},RangeError);function le(m){let l="",h=m.length;const E=m[0]==="-"?1:0;for(;h>=E+4;h-=3)l=`_${m.slice(h-3,h)}${l}`;return`${m.slice(0,h)}${l}`}function M(m,l,h){q(l,"offset"),(m[l]===void 0||m[l+h]===void 0)&&G(l,m.length-(h+1))}function C(m,l,h,E,N,F){if(m>h||m<l){const U=typeof l=="bigint"?"n":"";let he;throw l===0||l===BigInt(0)?he=`>= 0${U} and < 2${U} ** ${(F+1)*8}${U}`:he=`>= -(2${U} ** ${(F+1)*8-1}${U}) and < 2 ** ${(F+1)*8-1}${U}`,new W.ERR_OUT_OF_RANGE("value",he,m)}M(E,N,F)}function q(m,l){if(typeof m!="number")throw new W.ERR_INVALID_ARG_TYPE(l,"number",m)}function G(m,l,h){throw Math.floor(m)!==m?(q(m,h),new W.ERR_OUT_OF_RANGE("offset","an integer",m)):l<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,m)}const se=/[^+/0-9A-Za-z-_]/g;function ue(m){if(m=m.split("=")[0],m=m.trim().replace(se,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function re(m,l){l=l||1/0;let h;const E=m.length;let N=null;const F=[];for(let U=0;U<E;++U){if(h=m.charCodeAt(U),h>55295&&h<57344){if(!N){if(h>56319){(l-=3)>-1&&F.push(239,191,189);continue}else if(U+1===E){(l-=3)>-1&&F.push(239,191,189);continue}N=h;continue}if(h<56320){(l-=3)>-1&&F.push(239,191,189),N=h;continue}h=(N-55296<<10|h-56320)+65536}else N&&(l-=3)>-1&&F.push(239,191,189);if(N=null,h<128){if((l-=1)<0)break;F.push(h)}else if(h<2048){if((l-=2)<0)break;F.push(h>>6|192,h&63|128)}else if(h<65536){if((l-=3)<0)break;F.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((l-=4)<0)break;F.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return F}function be(m){const l=[];for(let h=0;h<m.length;++h)l.push(m.charCodeAt(h)&255);return l}function pt(m,l){let h,E,N;const F=[];for(let U=0;U<m.length&&!((l-=2)<0);++U)h=m.charCodeAt(U),E=h>>8,N=h%256,F.push(N),F.push(E);return F}function Re(m){return t.toByteArray(ue(m))}function Se(m,l,h,E){let N;for(N=0;N<E&&!(N+h>=l.length||N>=m.length);++N)l[N+h]=m[N];return N}function Ze(m,l){return m instanceof l||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===l.name}function _e(m){return m!==m}const Me=function(){const m="0123456789abcdef",l=new Array(256);for(let h=0;h<16;++h){const E=h*16;for(let N=0;N<16;++N)l[E+N]=m[h]+m[N]}return l}();function Qe(m){return typeof BigInt>"u"?Ee:m}function Ee(){throw new Error("BigInt not supported")}})(Fn);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Fn,n=r.Buffer;function i(c,o){for(var f in c)o[f]=c[f]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(c,o,f){return n(c,o,f)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(c,o,f){if(typeof c=="number")throw new TypeError("Argument must not be a number");return n(c,o,f)},s.alloc=function(c,o,f){if(typeof c!="number")throw new TypeError("Argument must be a number");var g=n(c);return o!==void 0?typeof f=="string"?g.fill(o,f):g.fill(o):g.fill(0),g},s.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n(c)},s.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(Po,Po.exports);var Wt=Po.exports,Js,Xa;function j0(){if(Xa)return Js;Xa=1;var e=e0;return Js=function(r){return!!e(r)},Js}var U0=In,H0=Gl,W0=H0("TypedArray.prototype.buffer",!0),V0=j0(),q0=W0||function(t){if(!V0(t))throw new U0("Not a Typed Array");return t.buffer},Mt=Wt.Buffer,z0=Id,G0=q0,J0=ArrayBuffer.isView||function(t){try{return G0(t),!0}catch{return!1}},Z0=typeof Uint8Array<"u",fu=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",K0=fu&&(Mt.prototype instanceof Uint8Array||Mt.TYPED_ARRAY_SUPPORT),Y0=function(t,r){if(Mt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Mt.from(t):t;if(typeof t=="string")return Mt.from(t,r);if(fu&&J0(t)){if(t.byteLength===0)return Mt.alloc(0);if(K0){var n=Mt.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=Mt.from(i);if(s.length===t.byteLength)return s}if(Z0&&t instanceof Uint8Array)return Mt.from(t);var c=z0(t);if(c)for(var o=0;o<t.length;o+=1){var f=t[o];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(c||Mt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Mt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Q0=Wt.Buffer,X0=Y0;function Vi(e,t){this._block=Q0.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Vi.prototype.update=function(e,t){e=X0(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,c=0;c<i;){for(var o=s%n,f=Math.min(i-c,n-o),g=0;g<f;g++)r[o+g]=e[c+g];s+=f,c+=f,s%n===0&&this._update(r)}return this._len+=i,this};Vi.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};Vi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var fn=Vi,ep=Ct,du=fn,tp=Wt.Buffer,rp=[1518500249,1859775393,-1894007588,-899497514],np=new Array(80);function Dn(){this.init(),this._w=np,du.call(this,64,56)}ep(Dn,du);Dn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ip(e){return e<<5|e>>>27}function sp(e){return e<<30|e>>>2}function op(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,c=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=t[o-3]^t[o-8]^t[o-14]^t[o-16];for(var f=0;f<80;++f){var g=~~(f/20),p=ip(r)+op(g,n,i,s)+c+t[f]+rp[g]|0;c=s,s=i,i=sp(n),n=r,r=p}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=c+this._e|0};Dn.prototype._hash=function(){var e=tp.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 ap=Dn,cp=Ct,pu=fn,lp=Wt.Buffer,up=[1518500249,1859775393,-1894007588,-899497514],hp=new Array(80);function jn(){this.init(),this._w=hp,pu.call(this,64,56)}cp(jn,pu);jn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function fp(e){return e<<1|e>>>31}function dp(e){return e<<5|e>>>27}function pp(e){return e<<30|e>>>2}function gp(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}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,c=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=fp(t[o-3]^t[o-8]^t[o-14]^t[o-16]);for(var f=0;f<80;++f){var g=~~(f/20),p=dp(r)+gp(g,n,i,s)+c+t[f]+up[g]|0;c=s,s=i,i=pp(n),n=r,r=p}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=c+this._e|0};jn.prototype._hash=function(){var e=lp.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 mp=jn,yp=Ct,gu=fn,vp=Wt.Buffer,wp=[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],bp=new Array(64);function Un(){this.init(),this._w=bp,gu.call(this,64,56)}yp(Un,gu);Un.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 _p(e,t,r){return r^e&(t^r)}function Ep(e,t,r){return e&t|r&(e|t)}function Sp(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Rp(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Mp(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Cp(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Un.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,c=this._e|0,o=this._f|0,f=this._g|0,g=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=Cp(t[p-2])+t[p-7]+Mp(t[p-15])+t[p-16]|0;for(var v=0;v<64;++v){var b=g+Rp(c)+_p(c,o,f)+wp[v]+t[v]|0,k=Sp(r)+Ep(r,n,i)|0;g=f,f=o,o=c,c=s+b|0,s=i,i=n,n=r,r=b+k|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=c+this._e|0,this._f=o+this._f|0,this._g=f+this._g|0,this._h=g+this._h|0};Un.prototype._hash=function(){var e=vp.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 mu=Un,Ip=Ct,xp=mu,Ap=fn,kp=Wt.Buffer,Tp=new Array(64);function qi(){this.init(),this._w=Tp,Ap.call(this,64,56)}Ip(qi,xp);qi.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};qi.prototype._hash=function(){var e=kp.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=qi,Np=Ct,yu=fn,Pp=Wt.Buffer,ec=[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],Lp=new Array(160);function Hn(){this.init(),this._w=Lp,yu.call(this,128,112)}Np(Hn,yu);Hn.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 tc(e,t,r){return r^e&(t^r)}function rc(e,t,r){return e&t|r&(e|t)}function nc(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ic(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Op(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function $p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Fp(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Dp(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Xe(e,t){return e>>>0<t>>>0?1:0}Hn.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,c=this._eh|0,o=this._fh|0,f=this._gh|0,g=this._hh|0,p=this._al|0,v=this._bl|0,b=this._cl|0,k=this._dl|0,j=this._el|0,O=this._fl|0,H=this._gl|0,A=this._hl|0,P=0;P<32;P+=2)t[P]=e.readInt32BE(P*4),t[P+1]=e.readInt32BE(P*4+4);for(;P<160;P+=2){var $=t[P-30],V=t[P-15*2+1],D=Op($,V),z=$p(V,$);$=t[P-2*2],V=t[P-2*2+1];var te=Fp($,V),Q=Dp(V,$),Y=t[P-7*2],de=t[P-7*2+1],oe=t[P-16*2],pe=t[P-16*2+1],x=z+de|0,a=D+Y+Xe(x,z)|0;x=x+Q|0,a=a+te+Xe(x,Q)|0,x=x+pe|0,a=a+oe+Xe(x,pe)|0,t[P]=a,t[P+1]=x}for(var d=0;d<160;d+=2){a=t[d],x=t[d+1];var y=rc(r,n,i),w=rc(p,v,b),S=nc(r,p),I=nc(p,r),B=ic(c,j),_=ic(j,c),u=ec[d],R=ec[d+1],K=tc(c,o,f),J=tc(j,O,H),T=A+_|0,L=g+B+Xe(T,A)|0;T=T+J|0,L=L+K+Xe(T,J)|0,T=T+R|0,L=L+u+Xe(T,R)|0,T=T+x|0,L=L+a+Xe(T,x)|0;var W=I+w|0,Z=S+y+Xe(W,I)|0;g=f,A=H,f=o,H=O,o=c,O=j,j=k+T|0,c=s+L+Xe(j,k)|0,s=i,k=b,i=n,b=v,n=r,v=p,p=T+W|0,r=L+Z+Xe(p,T)|0}this._al=this._al+p|0,this._bl=this._bl+v|0,this._cl=this._cl+b|0,this._dl=this._dl+k|0,this._el=this._el+j|0,this._fl=this._fl+O|0,this._gl=this._gl+H|0,this._hl=this._hl+A|0,this._ah=this._ah+r+Xe(this._al,p)|0,this._bh=this._bh+n+Xe(this._bl,v)|0,this._ch=this._ch+i+Xe(this._cl,b)|0,this._dh=this._dh+s+Xe(this._dl,k)|0,this._eh=this._eh+c+Xe(this._el,j)|0,this._fh=this._fh+o+Xe(this._fl,O)|0,this._gh=this._gh+f+Xe(this._gl,H)|0,this._hh=this._hh+g+Xe(this._hl,A)|0};Hn.prototype._hash=function(){var e=Pp.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 vu=Hn,jp=Ct,Up=vu,Hp=fn,Wp=Wt.Buffer,Vp=new Array(160);function zi(){this.init(),this._w=Vp,Hp.call(this,128,112)}jp(zi,Up);zi.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};zi.prototype._hash=function(){var e=Wp.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 qp=zi;(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=ap,e.exports.sha1=mp,e.exports.sha224=Bp,e.exports.sha256=mu,e.exports.sha384=qp,e.exports.sha512=vu})(uu);var zp=uu.exports;Object.defineProperty(hn,"__esModule",{value:!0});hn.Session=void 0;const sc=zp,oc=X,ac="session:id",cc="session:secret",lc="session:linked";class Jo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,oc.randomBytesHex)(16),this._secret=n||(0,oc.randomBytesHex)(32),this._key=new sc.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(ac),n=t.getItem(lc),i=t.getItem(cc);return r&&i?new Jo(t,r,i,n==="1"):null}static hash(t){return new sc.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(ac,this._id),this._storage.setItem(cc,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(lc,this._linked?"1":"0")}}hn.Session=Jo;var Gi={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Cipher=void 0;const si=X;class Gp{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,si.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),o=16,f=c.slice(c.byteLength-o),g=c.slice(0,c.byteLength-o),p=new Uint8Array(f),v=new Uint8Array(g),b=new Uint8Array([...n,...p,...v]);return(0,si.uint8ArrayToHex)(b)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,si.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,si.hexStringToUint8Array)(t),o=c.slice(0,12),f=c.slice(12,28),g=c.slice(28),p=new Uint8Array([...g,...f]),v={name:"AES-GCM",iv:new Uint8Array(o)};try{const b=await window.crypto.subtle.decrypt(v,s,p),k=new TextDecoder;n(k.decode(b))}catch(b){i(b)}})()})}}Ji.Cipher=Gp;var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.WalletLinkHTTP=void 0;class Jp{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(c=>c.event==="Web3Response").map(c=>({type:"Event",sessionId:this.sessionId,eventId:c.id,event:c.event,data:c.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Zi.WalletLinkHTTP=Jp;var en={};Object.defineProperty(en,"__esModule",{value:!0});en.WalletLinkWebSocket=en.ConnectionState=void 0;var zr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(zr||(en.ConnectionState=zr={}));class Zp{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,zr.CONNECTING),i.onclose=s=>{var c;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,zr.DISCONNECTED)},i.onopen=s=>{var c;t(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,zr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},i.onmessage=s=>{var c,o;if(s.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(s.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,f)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,zr.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=Zp;Object.defineProperty(Gi,"__esModule",{value:!0});Gi.WalletLinkConnection=void 0;const Dr=Ke,Kp=Ji,At=un,uc=wt,jr=hn,Yp=Zi,oi=en,hc=1e4,Qp=6e4;class Xp{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Dr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=o=>{if(!o)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",g=>o.JsonRpcUrl&&this.handleChainUpdated(g,o.JsonRpcUrl)]]).forEach((g,p)=>{const v=o[p];v!==void 0&&g(v)})},this.handleDestroyed=o=>{var f,g;o==="1"&&((f=this.listener)===null||f===void 0||f.resetAndReload(),(g=this.diagnostic)===null||g===void 0||g.log(At.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:jr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async o=>{var f,g;try{const p=await this.cipher.decrypt(o);(f=this.listener)===null||f===void 0||f.accountUpdated(p)}catch{(g=this.diagnostic)===null||g===void 0||g.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(o,f)=>{var g,p;try{const v=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.metadataUpdated(o,v)}catch{(p=this.diagnostic)===null||p===void 0||p.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:o})}},this.handleWalletUsernameUpdated=async o=>{this.handleMetadataUpdated(uc.WALLET_USER_NAME_KEY,o)},this.handleAppVersionUpdated=async o=>{this.handleMetadataUpdated(uc.APP_VERSION_KEY,o)},this.handleChainUpdated=async(o,f)=>{var g,p;try{const v=await this.cipher.decrypt(o),b=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.chainUpdated(v,b)}catch{(p=this.diagnostic)===null||p===void 0||p.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Kp.Cipher(t.secret),this.diagnostic=i,this.listener=n;const c=new oi.WalletLinkWebSocket(`${r}/rpc`,s);c.setConnectionStateListener(async o=>{var f;(f=this.diagnostic)===null||f===void 0||f.log(At.EVENTS.CONNECTED_STATE_CHANGE,{state:o,sessionIdHash:jr.Session.hash(t.id)});let g=!1;switch(o){case oi.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(v=>setTimeout(v,5e3)),this.destroyed||c.connect().catch(()=>{p()})};p()}break;case oi.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),g=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},hc),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case oi.ConnectionState.CONNECTING:break}this.connected!==g&&(this.connected=g)}),c.setIncomingDataListener(o=>{var f,g,p;switch(o.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const v=o.type==="IsLinkedOK"?o.linked:void 0;(f=this.diagnostic)===null||f===void 0||f.log(At.EVENTS.LINKED,{sessionIdHash:jr.Session.hash(t.id),linked:v,type:o.type,onlineGuests:o.onlineGuests}),this.linked=v||o.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(g=this.diagnostic)===null||g===void 0||g.log(At.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:jr.Session.hash(t.id),metadata_keys:o&&o.metadata?Object.keys(o.metadata):void 0}),this.handleSessionMetadataUpdated(o.metadata);break}case"Event":{this.handleIncomingEvent(o);break}}o.id!==void 0&&((p=this.requestResolutions.get(o.id))===null||p===void 0||p(o))}),this.ws=c,this.http=new Yp.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(At.EVENTS.STARTED_CONNECTING,{sessionIdHash:jr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(At.EVENTS.DISCONNECTED,{sessionIdHash:jr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const c=await this.makeRequest(s);if(c.type==="Fail")throw new Error(c.error||"failed to publish event");return c.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>hc*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Qp){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,c)=>{i=window.setTimeout(()=>{c(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,c=>{clearTimeout(i),s(c),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Gi.WalletLinkConnection=Xp;var Wn={},Vn={},Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.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 e1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.injectCssReset=void 0;const t1=e1(Zo);function r1(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(t1.default)),document.documentElement.appendChild(e)}Vn.injectCssReset=r1;var Ki={};const lt=an(Jh);var Yi={};function wu(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=wu(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function fc(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=wu(e))&&(n&&(n+=" "),n+=t);return n}const n1=Object.freeze(Object.defineProperty({__proto__:null,clsx:fc,default:fc},Symbol.toStringTag,{value:"Module"})),qn=an(n1),Qi=an(Zh);var tn={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.CloseIcon=void 0;const dc=lt;function i1(e){return(0,dc.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,dc.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"}))}Xi.CloseIcon=i1;var es={};Object.defineProperty(es,"__esModule",{value:!0});es.CoinbaseWalletRound=void 0;const ai=lt;function s1(e){return(0,ai.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ai.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,ai.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,ai.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"}))}es.CoinbaseWalletRound=s1;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.QRCodeIcon=void 0;const yn=lt;function o1(e){return(0,yn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,yn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,yn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,yn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,yn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}ts.QRCodeIcon=o1;var rs={};function bu(e){this.mode=ft.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}bu.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Ot(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Ot.prototype={addData:function(e){var t=new bu(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Ot.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=qe.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var c=s*i,o=0;o<this.modules[s].length;o++){var f=o*i,g=this.modules[s][o];g&&(n.beginFill(0,100),n.moveTo(f,c),n.lineTo(f+i,c),n.lineTo(f+i,c+i),n.lineTo(f,c+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=qe.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var c=-2;c<=2;c++)s==-2||s==2||c==-2||c==2||s==0&&c==0?this.modules[n+s][i+c]=!0:this.modules[n+s][i+c]=!1}},setupTypeNumber:function(e){for(var t=qe.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=qe.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,c=this.moduleCount-1;c>0;c-=2)for(c==6&&c--;;){for(var o=0;o<2;o++)if(this.modules[n][c-o]==null){var f=!1;s<e.length&&(f=(e[s]>>>i&1)==1);var g=qe.getMask(t,n,c-o);g&&(f=!f),this.modules[n][c-o]=f,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Ot.PAD0=236;Ot.PAD1=17;Ot.createData=function(e,t,r){for(var n=Lt.getRSBlocks(e,t),i=new _u,s=0;s<r.length;s++){var c=r[s];i.put(c.mode,4),i.put(c.getLength(),qe.getLengthInBits(c.mode,e)),c.write(i)}for(var o=0,s=0;s<n.length;s++)o+=n[s].dataCount;if(i.getLengthInBits()>o*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(Ot.PAD0,8),i.getLengthInBits()>=o*8));)i.put(Ot.PAD1,8);return Ot.createBytes(i,n)};Ot.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),c=new Array(t.length),o=0;o<t.length;o++){var f=t[o].dataCount,g=t[o].totalCount-f;n=Math.max(n,f),i=Math.max(i,g),s[o]=new Array(f);for(var p=0;p<s[o].length;p++)s[o][p]=255&e.buffer[p+r];r+=f;var v=qe.getErrorCorrectPolynomial(g),b=new Zr(s[o],v.getLength()-1),k=b.mod(v);c[o]=new Array(v.getLength()-1);for(var p=0;p<c[o].length;p++){var j=p+k.getLength()-c[o].length;c[o][p]=j>=0?k.get(j):0}}for(var O=0,p=0;p<t.length;p++)O+=t[p].totalCount;for(var H=new Array(O),A=0,p=0;p<n;p++)for(var o=0;o<t.length;o++)p<s[o].length&&(H[A++]=s[o][p]);for(var p=0;p<i;p++)for(var o=0;o<t.length;o++)p<c[o].length&&(H[A++]=c[o][p]);return H};var ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Gt={L:1,M:0,Q:3,H:2},Vt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},qe={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15)>=0;)t^=qe.G15<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15);return(e<<10|t)^qe.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18)>=0;)t^=qe.G18<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return qe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Vt.PATTERN000:return(t+r)%2==0;case Vt.PATTERN001:return t%2==0;case Vt.PATTERN010:return r%3==0;case Vt.PATTERN011:return(t+r)%3==0;case Vt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Vt.PATTERN101:return t*r%2+t*r%3==0;case Vt.PATTERN110:return(t*r%2+t*r%3)%2==0;case Vt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Zr([1],0),r=0;r<e;r++)t=t.multiply(new Zr([1,tt.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ft.MODE_NUMBER:return 10;case ft.MODE_ALPHA_NUM:return 9;case ft.MODE_8BIT_BYTE:return 8;case ft.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ft.MODE_NUMBER:return 12;case ft.MODE_ALPHA_NUM:return 11;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ft.MODE_NUMBER:return 14;case ft.MODE_ALPHA_NUM:return 13;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,c=e.isDark(n,i),o=-1;o<=1;o++)if(!(n+o<0||t<=n+o))for(var f=-1;f<=1;f++)i+f<0||t<=i+f||o==0&&f==0||c==e.isDark(n+o,i+f)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var g=0;e.isDark(n,i)&&g++,e.isDark(n+1,i)&&g++,e.isDark(n,i+1)&&g++,e.isDark(n+1,i+1)&&g++,(g==0||g==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 p=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&p++;var v=Math.abs(100*p/t/t-50)/5;return r+=v*10,r}},tt={glog:function(e){if(e<1)throw new Error("glog("+e+")");return tt.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return tt.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var nt=0;nt<8;nt++)tt.EXP_TABLE[nt]=1<<nt;for(var nt=8;nt<256;nt++)tt.EXP_TABLE[nt]=tt.EXP_TABLE[nt-4]^tt.EXP_TABLE[nt-5]^tt.EXP_TABLE[nt-6]^tt.EXP_TABLE[nt-8];for(var nt=0;nt<255;nt++)tt.LOG_TABLE[tt.EXP_TABLE[nt]]=nt;function Zr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Zr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=tt.gexp(tt.glog(this.get(r))+tt.glog(e.get(n)));return new Zr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=tt.glog(this.get(0))-tt.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]^=tt.gexp(tt.glog(e.get(n))+t);return new Zr(r,0).mod(e)}};function Lt(e,t){this.totalCount=e,this.dataCount=t}Lt.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Lt.getRSBlocks=function(e,t){var r=Lt.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var c=r[s*3+0],o=r[s*3+1],f=r[s*3+2],g=0;g<c;g++)i.push(new Lt(o,f));return i};Lt.getRsBlockTable=function(e,t){switch(t){case Gt.L:return Lt.RS_BLOCK_TABLE[(e-1)*4+0];case Gt.M:return Lt.RS_BLOCK_TABLE[(e-1)*4+1];case Gt.Q:return Lt.RS_BLOCK_TABLE[(e-1)*4+2];case Gt.H:return Lt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function _u(){this.buffer=[],this.length=0}_u.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 Eu(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(f){switch(f){case"L":return Gt.L;case"M":return Gt.M;case"Q":return Gt.Q;case"H":return Gt.H;default:throw new Error("Unknwon error correction level: "+f)}}function n(f,g){for(var p=i(f),v=1,b=0,k=0,j=Zs.length;k<=j;k++){var O=Zs[k];if(!O)throw new Error("Content too long: expected "+b+" but got "+p);switch(g){case"L":b=O[0];break;case"M":b=O[1];break;case"Q":b=O[2];break;case"H":b=O[3];break;default:throw new Error("Unknwon error correction level: "+g)}if(p<=b)break;v++}if(v>Zs.length)throw new Error("Content too long");return v}function i(f){var g=encodeURI(f).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return g.length+(g.length!=f?3:0)}var s=this.options.content,c=n(s,this.options.ecl),o=r(this.options.ecl);this.qrcode=new Ot(c,o),this.qrcode.addData(s),this.qrcode.make()}Eu.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r
7
- `:"",c=t.width,o=t.height,f=r.length,g=c/(f+2*t.padding),p=o/(f+2*t.padding),v=typeof t.join<"u"?!!t.join:!1,b=typeof t.swap<"u"?!!t.swap:!1,k=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,j=typeof t.predefined<"u"?!!t.predefined:!1,O=j?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+g+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",H=i+'<rect x="0" y="0" width="'+c+'" height="'+o+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,A="",P="",$=0;$<f;$++)for(var V=0;V<f;V++){var D=r[V][$];if(D){var z=V*g+t.padding*g,te=$*p+t.padding*p;if(b){var Q=z;z=te,te=Q}if(v){var Y=g+z,de=p+te;z=Number.isInteger(z)?Number(z):z.toFixed(2),te=Number.isInteger(te)?Number(te):te.toFixed(2),Y=Number.isInteger(Y)?Number(Y):Y.toFixed(2),de=Number.isInteger(de)?Number(de):de.toFixed(2),P+="M"+z+","+te+" V"+de+" H"+Y+" V"+te+" H"+z+" Z "}else j?A+=i+'<use x="'+z.toString()+'" y="'+te.toString()+'" href="#qrmodule" />'+s:A+=i+'<rect x="'+z.toString()+'" y="'+te.toString()+'" width="'+g+'" height="'+p+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}v&&(A=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+P+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const x=c*this.options.image.width/100,a=o*this.options.image.height/100,d=c/2-x/2,y=o/2-a/2;oe+=`<svg x="${d}" y="${y}" width="${x}" height="${a}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,oe+=this.options.image.svg+s,oe+="</svg>"}var pe="";switch(e.container){case"svg":k&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+c+'" height="'+o+'">'+s,pe+=O+H+A,pe+=oe,pe+="</svg>";break;case"svg-viewbox":k&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+c+" "+o+'">'+s,pe+=O+H+A,pe+=oe,pe+="</svg>";break;case"g":pe+='<g width="'+c+'" height="'+o+'">'+s,pe+=O+H+A,pe+=oe,pe+="</g>";break;default:pe+=(O+H+A+oe).replace(/^\s+/,"");break}return pe};var a1=Eu,c1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rs,"__esModule",{value:!0});rs.QRCode=void 0;const l1=lt,pc=Qi,u1=c1(a1),h1=e=>{const[t,r]=(0,pc.useState)("");return(0,pc.useEffect)(()=>{var n,i;const s=new u1.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}),c=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${c}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,l1.h)("img",{src:t,alt:"QR Code"}):null};rs.QRCode=h1;var ns={},Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.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 f1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ns,"__esModule",{value:!0});ns.Spinner=void 0;const ci=lt,d1=f1(Ko),p1=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,ci.h)("div",{class:"-cbwsdk-spinner"},(0,ci.h)("style",null,d1.default),(0,ci.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ci.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ns.Spinner=p1;var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.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 Su=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.CoinbaseWalletSteps=tn.ConnectContent=void 0;const wr=Su(qn),ve=lt,g1=X,m1=ln,y1=Xi,v1=es,w1=ts,b1=rs,_1=ns,E1=Su(Yo),Ks={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Ru},S1=e=>e==="light"?"#FFFFFF":"#0A0B0D";function R1(e){const{theme:t}=e,r=(0,g1.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Ks.steps;return(0,ve.h)("div",{"data-testid":"connect-content",className:(0,wr.default)("-cbwsdk-connect-content",t)},(0,ve.h)("style",null,E1.default),(0,ve.h)("div",{className:"-cbwsdk-connect-content-header"},(0,ve.h)("h2",{className:(0,wr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,ve.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,ve.h)(y1.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ve.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,ve.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,ve.h)(M1,{title:Ks.title,description:Ks.description,theme:t})),(0,ve.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,ve.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,ve.h)(b1.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,ve.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:m1.LIB_VERSION}),(0,ve.h)("input",{type:"hidden",value:r})),(0,ve.h)(n,{theme:t}),!e.isConnected&&(0,ve.h)("div",{"data-testid":"connecting-spinner",className:(0,wr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,ve.h)(_1.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,ve.h)("p",null,"Connecting...")))))}tn.ConnectContent=R1;function M1({title:e,description:t,theme:r}){return(0,ve.h)("div",{className:(0,wr.default)("-cbwsdk-connect-item",r)},(0,ve.h)("div",null,(0,ve.h)(v1.CoinbaseWalletRound,null)),(0,ve.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,ve.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,ve.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Ru({theme:e}){return(0,ve.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,ve.h)("li",{className:(0,wr.default)("-cbwsdk-wallet-steps-item",e)},(0,ve.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,ve.h)("li",{className:(0,wr.default)("-cbwsdk-wallet-steps-item",e)},(0,ve.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,ve.h)("span",null,"Tap ",(0,ve.h)("strong",null,"Scan")," "),(0,ve.h)("span",{className:(0,wr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,ve.h)(w1.QRCodeIcon,{fill:S1(e)})))))}tn.CoinbaseWalletSteps=Ru;var is={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.ArrowLeftIcon=void 0;const gc=lt;function C1(e){return(0,gc.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,gc.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"}))}ss.ArrowLeftIcon=C1;var os={};Object.defineProperty(os,"__esModule",{value:!0});os.LaptopIcon=void 0;const Ys=lt;function I1(e){return(0,Ys.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ys.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ys.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"}))}os.LaptopIcon=I1;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.SafeIcon=void 0;const mc=lt;function x1(e){return(0,mc.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,mc.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"}))}as.SafeIcon=x1;var Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Mu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(is,"__esModule",{value:!0});is.TryExtensionContent=void 0;const ur=Mu(qn),Je=lt,Qs=Qi,A1=ss,k1=os,T1=as,B1=Mu(Qo);function N1({theme:e}){const[t,r]=(0,Qs.useState)(!1),n=(0,Qs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Qs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Je.h)("div",{class:(0,ur.default)("-cbwsdk-try-extension",e)},(0,Je.h)("style",null,B1.default),(0,Je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Je.h)("h3",{class:(0,ur.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Je.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Je.h)("button",{class:(0,ur.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Je.h)("div",null,!t&&(0,Je.h)(A1.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Je.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Je.h)("span",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Je.h)(k1.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Je.h)("div",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Je.h)("span",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Je.h)(T1.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Je.h)("div",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}is.TryExtensionContent=N1;var Xo={};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.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 Cu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConnectDialog=void 0;const Xs=Cu(qn),hr=lt,eo=Qi,P1=tn,L1=is,O1=Cu(Xo),$1=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,eo.useState)(!t),[s,c]=(0,eo.useState)(!t);(0,eo.useEffect)(()=>{const f=[window.setTimeout(()=>{c(!t)},10)];return t?i(!1):f.push(window.setTimeout(()=>{i(!0)},360)),()=>{f.forEach(window.clearTimeout)}},[t]);const o=r?"dark":"light";return(0,hr.h)("div",{class:(0,Xs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,hr.h)("style",null,O1.default),(0,hr.h)("div",{class:(0,Xs.default)("-cbwsdk-connect-dialog-backdrop",o,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,hr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,hr.h)("div",{class:(0,Xs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,hr.h)(P1.ConnectContent,{theme:o,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,hr.h)(L1.TryExtensionContent,{theme:o}))))};Yi.ConnectDialog=$1;Object.defineProperty(Ki,"__esModule",{value:!0});Ki.LinkFlow=void 0;const to=lt,F1=Yi;class D1{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,to.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,to.render)((0,to.h)(F1.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)}}Ki.LinkFlow=D1;var ea={},ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.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=ee&&ee.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(qn),n=lt,i=Qi,s=t(ta),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class f{constructor(b){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=b.darkMode}attach(b){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",b.appendChild(this.root),this.render()}presentItem(b){const k=this.nextItemKey++;return this.items.set(k,b),this.render(),()=>{this.items.delete(k),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([b,k])=>(0,n.h)(e.SnackbarInstance,Object.assign({},k,{key:b}))))),this.root)}}e.Snackbar=f;const g=v=>(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"},v.children));e.SnackbarContainer=g;const p=({autoExpand:v,message:b,menuItems:k})=>{const[j,O]=(0,i.useState)(!0),[H,A]=(0,i.useState)(v??!1);(0,i.useEffect)(()=>{const $=[window.setTimeout(()=>{O(!1)},1),window.setTimeout(()=>{A(!0)},1e4)];return()=>{$.forEach(window.clearTimeout)}});const P=()=>{A(!H)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",j&&"-cbwsdk-snackbar-instance-hidden",H&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:P},(0,n.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},b),(0,n.h)("div",{class:"-gear-container"},!H&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),k&&k.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},k.map(($,V)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",$.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:$.onClick,key:V},(0,n.h)("svg",{width:$.svgWidth,height:$.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":$.defaultFillRule,"clip-rule":$.defaultClipRule,d:$.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",$.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},$.info)))))};e.SnackbarInstance=p})(ea);Object.defineProperty(Wn,"__esModule",{value:!0});Wn.WalletLinkRelayUI=void 0;const j1=Vn,U1=Ki,H1=ea;class W1{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new H1.Snackbar({darkMode:t.darkMode}),this.linkFlow=new U1.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,j1.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}}Wn.WalletLinkRelayUI=W1;Object.defineProperty($n,"__esModule",{value:!0});$n.WalletLinkRelay=void 0;const Ur=Bn,V1=Ke,Ve=X,fr=un,yc=wt,qt=hn,q1=Gi,dr=cn,z1=Wn;class jt extends yc.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=c=>{var o;this.isLinked=c;const f=this.storage.getItem(yc.LOCAL_STORAGE_ADDRESSES_KEY);if(c&&(this.session.linked=c),this.isUnlinkedErrorState=!1,f){const g=f.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(g[0]!==""&&!c&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const v=this.getSessionIdHash();(o=this.diagnostic)===null||o===void 0||o.log(fr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:v})}}},this.metadataUpdated=(c,o)=>{this.storage.setItem(c,o)},this.chainUpdated=(c,o)=>{this.chainCallbackParams.chainId===c&&this.chainCallbackParams.jsonRpcUrl===o||(this.chainCallbackParams={chainId:c,jsonRpcUrl:o},this.chainCallback&&this.chainCallback(c,o))},this.accountUpdated=c=>{this.accountsCallback&&this.accountsCallback([c]),jt.accountRequestCallbackIds.size>0&&(Array.from(jt.accountRequestCallbackIds.values()).forEach(o=>{const f={type:"WEB3_RESPONSE",id:o,response:{method:"requestEthereumAccounts",result:[c]}};this.invokeCallback(Object.assign(Object.assign({},f),{id:o}))}),jt.accountRequestCallbackIds.clear())},this.connectedUpdated=c=>{this.ui.setConnected(c)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=qt.Session.load(this.storage)||new qt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new q1.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:c}=this.options,o=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:c,session:t});return i.connect(),{session:t,ui:o,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(fr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=qt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:qt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:c,connection:o}=this.subscribe();this._session=s,this.connection=o,this.ui=c,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(fr.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,Ve.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Ve.hexStringFromBuffer)(t,!0),signature:(0,Ve.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ve.bigIntStringFromBN)(t.weiValue),data:(0,Ve.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Ve.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,Ve.bigIntStringFromBN)(t.weiValue),data:(0,Ve.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Ve.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Ve.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Ve.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Ve.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Ve.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,Ve.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,c),r==null||r()};return{promise:new Promise((c,o)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,f=>{if(r==null||r(),(0,dr.isErrorResponse)(f))return o(new Error(f.errorMessage));c(f)}),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 z1.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=qt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(fr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?qt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(c=>{var o;(o=this.diagnostic)===null||o===void 0||o.log(fr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?qt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:c.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(fr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){jt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),jt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const c=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Ur.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:c,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,Ve.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,c)=>{if(this.relayEventManager.callbacks.set(r,o=>{if(this.ui.hideRequestEthereumAccounts(),(0,dr.isErrorResponse)(o))return c(new Error(o.errorMessage));s(o)}),this.ui.inlineAccountsResponse()){const o=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:f}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:o})}else{const o=Ur.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(o)})}jt.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,Ve.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,c)},s=new Promise((c,o)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,dr.isErrorResponse)(p))return o(new Error(p.errorMessage));c(p)});const f=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:V1.ProviderType.Unselected}})},g=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:g,onCancel:f,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,c){const o={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:c}};let f=null;const g=(0,Ve.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,o.method,b),f==null||f()};this.ui.inlineWatchAsset()||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const v=new Promise((b,k)=>{this.relayEventManager.callbacks.set(g,H=>{if(f==null||f(),(0,dr.isErrorResponse)(H))return k(new Error(H.errorMessage));b(H)});const j=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!1}})},O=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:O,onCancel:j,type:t,address:r,symbol:n,decimals:i,image:s,chainId:c}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,o)});return{cancel:p,promise:v}}addEthereumChain(t,r,n,i,s,c){const o={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:c}};let f=null;const g=(0,Ve.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,o.method,b),f==null||f()};return this.ui.inlineAddEthereumChain(t)||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((b,k)=>{this.relayEventManager.callbacks.set(g,H=>{if(f==null||f(),(0,dr.isErrorResponse)(H))return k(new Error(H.errorMessage));b(H)});const j=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},O=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:H}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:j,onApprove:O,chainId:o.params.chainId,rpcUrls:o.params.rpcUrls,blockExplorerUrls:o.params.blockExplorerUrls,chainName:o.params.chainName,iconUrls:o.params.iconUrls,nativeCurrency:o.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,o)}),cancel:p}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Ve.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,o)};return{promise:new Promise((o,f)=>{this.relayEventManager.callbacks.set(i,v=>{if((0,dr.isErrorResponse)(v)&&v.errorCode)return f(Ur.standardErrors.provider.custom({code:v.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,dr.isErrorResponse)(v))return f(new Error(v.errorMessage));o(v)});const g=v=>{var b;if(v){const k=(b=(0,Ur.getErrorCode)(v))!==null&&b!==void 0?b:Ur.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",v instanceof Error?v:Ur.standardErrors.provider.unsupportedChain(t),k)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:v}}})};this.ui.switchEthereumChain({onCancel:g,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return qt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}$n.WalletLinkRelay=jt;jt.accountRequestCallbackIds=new Set;var zn={},cs={},Iu={};(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,o)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(ea,e)})(Iu);var ra={};Object.defineProperty(ra,"__esModule",{value:!0});ra.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 xu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.RedirectDialog=void 0;const G1=xu(qn),Nt=lt,J1=Vn,Z1=Iu,K1=xu(ra);class Y1{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,J1.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Nt.render)(null,this.root),t&&(0,Nt.render)((0,Nt.h)(Q1,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}cs.RedirectDialog=Y1;const Q1=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Nt.h)(Z1.SnackbarContainer,{darkMode:r},(0,Nt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Nt.h)("style",null,K1.default),(0,Nt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Nt.h)("div",{class:(0,G1.default)("-cbwsdk-redirect-dialog-box",s)},(0,Nt.h)("p",null,e),(0,Nt.h)("button",{onClick:n},t))))};Object.defineProperty(zn,"__esModule",{value:!0});zn.MobileRelayUI=void 0;const X1=cs;class eg{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new X1.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}}zn.MobileRelayUI=eg;Object.defineProperty(On,"__esModule",{value:!0});On.MobileRelay=void 0;const tg=X,rg=$n,ng=zn;class ig extends rg.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,tg.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 ng.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}})}}On.MobileRelay=ig;var Lo={exports:{}},Au=br.EventEmitter,ro,vc;function sg(){if(vc)return ro;vc=1;function e(j,O){var H=Object.keys(j);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(j);O&&(A=A.filter(function(P){return Object.getOwnPropertyDescriptor(j,P).enumerable})),H.push.apply(H,A)}return H}function t(j){for(var O=1;O<arguments.length;O++){var H=arguments[O]!=null?arguments[O]:{};O%2?e(Object(H),!0).forEach(function(A){r(j,A,H[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(H)):e(Object(H)).forEach(function(A){Object.defineProperty(j,A,Object.getOwnPropertyDescriptor(H,A))})}return j}function r(j,O,H){return O=c(O),O in j?Object.defineProperty(j,O,{value:H,enumerable:!0,configurable:!0,writable:!0}):j[O]=H,j}function n(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function i(j,O){for(var H=0;H<O.length;H++){var A=O[H];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(j,c(A.key),A)}}function s(j,O,H){return O&&i(j.prototype,O),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var O=o(j,"string");return typeof O=="symbol"?O:String(O)}function o(j,O){if(typeof j!="object"||j===null)return j;var H=j[Symbol.toPrimitive];if(H!==void 0){var A=H.call(j,O||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(j)}var f=Fn,g=f.Buffer,p=br,v=p.inspect,b=v&&v.custom||"inspect";function k(j,O,H){g.prototype.copy.call(j,O,H)}return ro=function(){function j(){n(this,j),this.head=null,this.tail=null,this.length=0}return s(j,[{key:"push",value:function(H){var A={data:H,next:null};this.length>0?this.tail.next=A:this.head=A,this.tail=A,++this.length}},{key:"unshift",value:function(H){var A={data:H,next:this.head};this.length===0&&(this.tail=A),this.head=A,++this.length}},{key:"shift",value:function(){if(this.length!==0){var H=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,H}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(H){if(this.length===0)return"";for(var A=this.head,P=""+A.data;A=A.next;)P+=H+A.data;return P}},{key:"concat",value:function(H){if(this.length===0)return g.alloc(0);for(var A=g.allocUnsafe(H>>>0),P=this.head,$=0;P;)k(P.data,A,$),$+=P.data.length,P=P.next;return A}},{key:"consume",value:function(H,A){var P;return H<this.head.data.length?(P=this.head.data.slice(0,H),this.head.data=this.head.data.slice(H)):H===this.head.data.length?P=this.shift():P=A?this._getString(H):this._getBuffer(H),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(H){var A=this.head,P=1,$=A.data;for(H-=$.length;A=A.next;){var V=A.data,D=H>V.length?V.length:H;if(D===V.length?$+=V:$+=V.slice(0,H),H-=D,H===0){D===V.length?(++P,A.next?this.head=A.next:this.head=this.tail=null):(this.head=A,A.data=V.slice(D));break}++P}return this.length-=P,$}},{key:"_getBuffer",value:function(H){var A=g.allocUnsafe(H),P=this.head,$=1;for(P.data.copy(A),H-=P.data.length;P=P.next;){var V=P.data,D=H>V.length?V.length:H;if(V.copy(A,A.length-H,0,D),H-=D,H===0){D===V.length?(++$,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=V.slice(D));break}++$}return this.length-=$,A}},{key:b,value:function(H,A){return v(this,t(t({},A),{},{depth:0,customInspect:!1}))}}]),j}(),ro}function og(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Oo,this,e)):process.nextTick(Oo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Mi,r):(r._writableState.errorEmitted=!0,process.nextTick(wc,r,s)):process.nextTick(wc,r,s):t?(process.nextTick(Mi,r),t(s)):process.nextTick(Mi,r)}),this)}function wc(e,t){Oo(e,t),Mi(e)}function Mi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function ag(){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 Oo(e,t){e.emit("error",t)}function cg(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var ku={destroy:og,undestroy:ag,errorOrDestroy:cg},Rr={};function lg(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Tu={};function Et(e,t,r){r||(r=Error);function n(s,c,o){return typeof t=="string"?t:t(s,c,o)}var i=function(s){lg(c,s);function c(o,f,g){return s.call(this,n(o,f,g))||this}return c}(r);i.prototype.name=r.name,i.prototype.code=e,Tu[e]=i}function bc(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 ug(e,t,r){return e.substr(0,t.length)===t}function hg(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function fg(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Et("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Et("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&ug(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(hg(e," argument"))i="The ".concat(e," ").concat(n," ").concat(bc(t,"type"));else{var s=fg(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(bc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Et("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Et("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Et("ERR_STREAM_PREMATURE_CLOSE","Premature close");Et("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Et("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Et("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Et("ERR_STREAM_WRITE_AFTER_END","write after end");Et("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Et("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Et("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Rr.codes=Tu;var dg=Rr.codes.ERR_INVALID_OPT_VALUE;function pg(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function gg(e,t,r,n){var i=pg(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new dg(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Bu={getHighWaterMark:gg},mg=yg;function yg(e,t){if(no("noDeprecation"))return e;var r=!1;function n(){if(!r){if(no("throwDeprecation"))throw new Error(t);no("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function no(e){try{if(!ee.localStorage)return!1}catch{return!1}var t=ee.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var io,_c;function Nu(){if(_c)return io;_c=1,io=Q;function e(T){var L=this;this.next=null,this.entry=null,this.finish=function(){J(L,T)}}var t;Q.WritableState=z;var r={deprecate:mg},n=Au,i=Fn.Buffer,s=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(T){return i.from(T)}function o(T){return i.isBuffer(T)||T instanceof s}var f=ku,g=Bu,p=g.getHighWaterMark,v=Rr.codes,b=v.ERR_INVALID_ARG_TYPE,k=v.ERR_METHOD_NOT_IMPLEMENTED,j=v.ERR_MULTIPLE_CALLBACK,O=v.ERR_STREAM_CANNOT_PIPE,H=v.ERR_STREAM_DESTROYED,A=v.ERR_STREAM_NULL_VALUES,P=v.ERR_STREAM_WRITE_AFTER_END,$=v.ERR_UNKNOWN_ENCODING,V=f.errorOrDestroy;Ct(Q,n);function D(){}function z(T,L,W){t=t||rn(),T=T||{},typeof W!="boolean"&&(W=L instanceof t),this.objectMode=!!T.objectMode,W&&(this.objectMode=this.objectMode||!!T.writableObjectMode),this.highWaterMark=p(this,T,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Z=T.decodeStrings===!1;this.decodeStrings=!Z,this.defaultEncoding=T.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(le){y(L,le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=T.emitClose!==!1,this.autoDestroy=!!T.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}z.prototype.getBuffer=function(){for(var L=this.bufferedRequest,W=[];L;)W.push(L),L=L.next;return W},function(){try{Object.defineProperty(z.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var te;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(te=Function.prototype[Symbol.hasInstance],Object.defineProperty(Q,Symbol.hasInstance,{value:function(L){return te.call(this,L)?!0:this!==Q?!1:L&&L._writableState instanceof z}})):te=function(L){return L instanceof this};function Q(T){t=t||rn();var L=this instanceof t;if(!L&&!te.call(Q,this))return new Q(T);this._writableState=new z(T,this,L),this.writable=!0,T&&(typeof T.write=="function"&&(this._write=T.write),typeof T.writev=="function"&&(this._writev=T.writev),typeof T.destroy=="function"&&(this._destroy=T.destroy),typeof T.final=="function"&&(this._final=T.final)),n.call(this)}Q.prototype.pipe=function(){V(this,new O)};function Y(T,L){var W=new P;V(T,W),process.nextTick(L,W)}function de(T,L,W,Z){var le;return W===null?le=new A:typeof W!="string"&&!L.objectMode&&(le=new b("chunk",["string","Buffer"],W)),le?(V(T,le),process.nextTick(Z,le),!1):!0}Q.prototype.write=function(T,L,W){var Z=this._writableState,le=!1,M=!Z.objectMode&&o(T);return M&&!i.isBuffer(T)&&(T=c(T)),typeof L=="function"&&(W=L,L=null),M?L="buffer":L||(L=Z.defaultEncoding),typeof W!="function"&&(W=D),Z.ending?Y(this,W):(M||de(this,Z,T,W))&&(Z.pendingcb++,le=pe(this,Z,M,T,L,W)),le},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){var T=this._writableState;T.corked&&(T.corked--,!T.writing&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&I(this,T))},Q.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=L.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((L+"").toLowerCase())>-1))throw new $(L);return this._writableState.defaultEncoding=L,this},Object.defineProperty(Q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(T,L,W){return!T.objectMode&&T.decodeStrings!==!1&&typeof L=="string"&&(L=i.from(L,W)),L}Object.defineProperty(Q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pe(T,L,W,Z,le,M){if(!W){var C=oe(L,Z,le);Z!==C&&(W=!0,le="buffer",Z=C)}var q=L.objectMode?1:Z.length;L.length+=q;var G=L.length<L.highWaterMark;if(G||(L.needDrain=!0),L.writing||L.corked){var se=L.lastBufferedRequest;L.lastBufferedRequest={chunk:Z,encoding:le,isBuf:W,callback:M,next:null},se?se.next=L.lastBufferedRequest:L.bufferedRequest=L.lastBufferedRequest,L.bufferedRequestCount+=1}else x(T,L,!1,q,Z,le,M);return G}function x(T,L,W,Z,le,M,C){L.writelen=Z,L.writecb=C,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new H("write")):W?T._writev(le,L.onwrite):T._write(le,M,L.onwrite),L.sync=!1}function a(T,L,W,Z,le){--L.pendingcb,W?(process.nextTick(le,Z),process.nextTick(R,T,L),T._writableState.errorEmitted=!0,V(T,Z)):(le(Z),T._writableState.errorEmitted=!0,V(T,Z),R(T,L))}function d(T){T.writing=!1,T.writecb=null,T.length-=T.writelen,T.writelen=0}function y(T,L){var W=T._writableState,Z=W.sync,le=W.writecb;if(typeof le!="function")throw new j;if(d(W),L)a(T,W,Z,L,le);else{var M=B(W)||T.destroyed;!M&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&I(T,W),Z?process.nextTick(w,T,W,M,le):w(T,W,M,le)}}function w(T,L,W,Z){W||S(T,L),L.pendingcb--,Z(),R(T,L)}function S(T,L){L.length===0&&L.needDrain&&(L.needDrain=!1,T.emit("drain"))}function I(T,L){L.bufferProcessing=!0;var W=L.bufferedRequest;if(T._writev&&W&&W.next){var Z=L.bufferedRequestCount,le=new Array(Z),M=L.corkedRequestsFree;M.entry=W;for(var C=0,q=!0;W;)le[C]=W,W.isBuf||(q=!1),W=W.next,C+=1;le.allBuffers=q,x(T,L,!0,L.length,le,"",M.finish),L.pendingcb++,L.lastBufferedRequest=null,M.next?(L.corkedRequestsFree=M.next,M.next=null):L.corkedRequestsFree=new e(L),L.bufferedRequestCount=0}else{for(;W;){var G=W.chunk,se=W.encoding,ue=W.callback,re=L.objectMode?1:G.length;if(x(T,L,!1,re,G,se,ue),W=W.next,L.bufferedRequestCount--,L.writing)break}W===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=W,L.bufferProcessing=!1}Q.prototype._write=function(T,L,W){W(new k("_write()"))},Q.prototype._writev=null,Q.prototype.end=function(T,L,W){var Z=this._writableState;return typeof T=="function"?(W=T,T=null,L=null):typeof L=="function"&&(W=L,L=null),T!=null&&this.write(T,L),Z.corked&&(Z.corked=1,this.uncork()),Z.ending||K(this,Z,W),this},Object.defineProperty(Q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function B(T){return T.ending&&T.length===0&&T.bufferedRequest===null&&!T.finished&&!T.writing}function _(T,L){T._final(function(W){L.pendingcb--,W&&V(T,W),L.prefinished=!0,T.emit("prefinish"),R(T,L)})}function u(T,L){!L.prefinished&&!L.finalCalled&&(typeof T._final=="function"&&!L.destroyed?(L.pendingcb++,L.finalCalled=!0,process.nextTick(_,T,L)):(L.prefinished=!0,T.emit("prefinish")))}function R(T,L){var W=B(L);if(W&&(u(T,L),L.pendingcb===0&&(L.finished=!0,T.emit("finish"),L.autoDestroy))){var Z=T._readableState;(!Z||Z.autoDestroy&&Z.endEmitted)&&T.destroy()}return W}function K(T,L,W){L.ending=!0,R(T,L),W&&(L.finished?process.nextTick(W):T.once("finish",W)),L.ended=!0,T.writable=!1}function J(T,L,W){var Z=T.entry;for(T.entry=null;Z;){var le=Z.callback;L.pendingcb--,le(W),Z=Z.next}L.corkedRequestsFree.next=T}return Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(L){this._writableState&&(this._writableState.destroyed=L)}}),Q.prototype.destroy=f.destroy,Q.prototype._undestroy=f.undestroy,Q.prototype._destroy=function(T,L){L(T)},io}var so,Ec;function rn(){if(Ec)return so;Ec=1;var e=Object.keys||function(g){var p=[];for(var v in g)p.push(v);return p};so=c;var t=Lu(),r=Nu();Ct(c,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];c.prototype[s]||(c.prototype[s]=r.prototype[s])}function c(g){if(!(this instanceof c))return new c(g);t.call(this,g),r.call(this,g),this.allowHalfOpen=!0,g&&(g.readable===!1&&(this.readable=!1),g.writable===!1&&(this.writable=!1),g.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",o)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o(){this._writableState.ended||process.nextTick(f,this)}function f(g){g.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=p,this._writableState.destroyed=p)}}),so}var oo={},Sc;function Rc(){if(Sc)return oo;Sc=1;var e=Wt.Buffer,t=e.isEncoding||function(A){switch(A=""+A,A&&A.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(A){if(!A)return"utf8";for(var P;;)switch(A){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return A;default:if(P)return;A=(""+A).toLowerCase(),P=!0}}function n(A){var P=r(A);if(typeof P!="string"&&(e.isEncoding===t||!t(A)))throw new Error("Unknown encoding: "+A);return P||A}oo.StringDecoder=i;function i(A){this.encoding=n(A);var P;switch(this.encoding){case"utf16le":this.text=v,this.end=b,P=4;break;case"utf8":this.fillLast=f,P=4;break;case"base64":this.text=k,this.end=j,P=3;break;default:this.write=O,this.end=H;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(P)}i.prototype.write=function(A){if(A.length===0)return"";var P,$;if(this.lastNeed){if(P=this.fillLast(A),P===void 0)return"";$=this.lastNeed,this.lastNeed=0}else $=0;return $<A.length?P?P+this.text(A,$):this.text(A,$):P||""},i.prototype.end=p,i.prototype.text=g,i.prototype.fillLast=function(A){if(this.lastNeed<=A.length)return A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,A.length),this.lastNeed-=A.length};function s(A){return A<=127?0:A>>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function c(A,P,$){var V=P.length-1;if(V<$)return 0;var D=s(P[V]);return D>=0?(D>0&&(A.lastNeed=D-1),D):--V<$||D===-2?0:(D=s(P[V]),D>=0?(D>0&&(A.lastNeed=D-2),D):--V<$||D===-2?0:(D=s(P[V]),D>=0?(D>0&&(D===2?D=0:A.lastNeed=D-3),D):0))}function o(A,P,$){if((P[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&P.length>1){if((P[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&P.length>2&&(P[2]&192)!==128)return A.lastNeed=2,"�"}}function f(A){var P=this.lastTotal-this.lastNeed,$=o(this,A);if($!==void 0)return $;if(this.lastNeed<=A.length)return A.copy(this.lastChar,P,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,P,0,A.length),this.lastNeed-=A.length}function g(A,P){var $=c(this,A,P);if(!this.lastNeed)return A.toString("utf8",P);this.lastTotal=$;var V=A.length-($-this.lastNeed);return A.copy(this.lastChar,0,V),A.toString("utf8",P,V)}function p(A){var P=A&&A.length?this.write(A):"";return this.lastNeed?P+"�":P}function v(A,P){if((A.length-P)%2===0){var $=A.toString("utf16le",P);if($){var V=$.charCodeAt($.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],$.slice(0,-1)}return $}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",P,A.length-1)}function b(A){var P=A&&A.length?this.write(A):"";if(this.lastNeed){var $=this.lastTotal-this.lastNeed;return P+this.lastChar.toString("utf16le",0,$)}return P}function k(A,P){var $=(A.length-P)%3;return $===0?A.toString("base64",P):(this.lastNeed=3-$,this.lastTotal=3,$===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",P,A.length-$))}function j(A){var P=A&&A.length?this.write(A):"";return this.lastNeed?P+this.lastChar.toString("base64",0,3-this.lastNeed):P}function O(A){return A.toString(this.encoding)}function H(A){return A&&A.length?this.write(A):""}return oo}var Mc=Rr.codes.ERR_STREAM_PREMATURE_CLOSE;function vg(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 wg(){}function bg(e){return e.setHeader&&typeof e.abort=="function"}function Pu(e,t,r){if(typeof t=="function")return Pu(e,null,t);t||(t={}),r=vg(r||wg);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||o()},c=e._writableState&&e._writableState.finished,o=function(){i=!1,c=!0,n||r.call(e)},f=e._readableState&&e._readableState.endEmitted,g=function(){n=!1,f=!0,i||r.call(e)},p=function(j){r.call(e,j)},v=function(){var j;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(j=new Mc),r.call(e,j);if(i&&!c)return(!e._writableState||!e._writableState.ended)&&(j=new Mc),r.call(e,j)},b=function(){e.req.on("finish",o)};return bg(e)?(e.on("complete",o),e.on("abort",v),e.req?b():e.on("request",b)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",g),e.on("finish",o),t.error!==!1&&e.on("error",p),e.on("close",v),function(){e.removeListener("complete",o),e.removeListener("abort",v),e.removeListener("request",b),e.req&&e.req.removeListener("finish",o),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",o),e.removeListener("end",g),e.removeListener("error",p),e.removeListener("close",v)}}var na=Pu,ao,Cc;function _g(){if(Cc)return ao;Cc=1;var e;function t($,V,D){return V=r(V),V in $?Object.defineProperty($,V,{value:D,enumerable:!0,configurable:!0,writable:!0}):$[V]=D,$}function r($){var V=n($,"string");return typeof V=="symbol"?V:String(V)}function n($,V){if(typeof $!="object"||$===null)return $;var D=$[Symbol.toPrimitive];if(D!==void 0){var z=D.call($,V||"default");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)($)}var i=na,s=Symbol("lastResolve"),c=Symbol("lastReject"),o=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),p=Symbol("handlePromise"),v=Symbol("stream");function b($,V){return{value:$,done:V}}function k($){var V=$[s];if(V!==null){var D=$[v].read();D!==null&&($[g]=null,$[s]=null,$[c]=null,V(b(D,!1)))}}function j($){process.nextTick(k,$)}function O($,V){return function(D,z){$.then(function(){if(V[f]){D(b(void 0,!0));return}V[p](D,z)},z)}}var H=Object.getPrototypeOf(function(){}),A=Object.setPrototypeOf((e={get stream(){return this[v]},next:function(){var V=this,D=this[o];if(D!==null)return Promise.reject(D);if(this[f])return Promise.resolve(b(void 0,!0));if(this[v].destroyed)return new Promise(function(Y,de){process.nextTick(function(){V[o]?de(V[o]):Y(b(void 0,!0))})});var z=this[g],te;if(z)te=new Promise(O(z,this));else{var Q=this[v].read();if(Q!==null)return Promise.resolve(b(Q,!1));te=new Promise(this[p])}return this[g]=te,te}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var V=this;return new Promise(function(D,z){V[v].destroy(null,function(te){if(te){z(te);return}D(b(void 0,!0))})})}),e),H),P=function(V){var D,z=Object.create(A,(D={},t(D,v,{value:V,writable:!0}),t(D,s,{value:null,writable:!0}),t(D,c,{value:null,writable:!0}),t(D,o,{value:null,writable:!0}),t(D,f,{value:V._readableState.endEmitted,writable:!0}),t(D,p,{value:function(Q,Y){var de=z[v].read();de?(z[g]=null,z[s]=null,z[c]=null,Q(b(de,!1))):(z[s]=Q,z[c]=Y)},writable:!0}),D));return z[g]=null,i(V,function(te){if(te&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Q=z[c];Q!==null&&(z[g]=null,z[s]=null,z[c]=null,Q(te)),z[o]=te;return}var Y=z[s];Y!==null&&(z[g]=null,z[s]=null,z[c]=null,Y(b(void 0,!0))),z[f]=!0}),V.on("readable",j.bind(null,z)),z};return ao=P,ao}var co,Ic;function Eg(){return Ic||(Ic=1,co=function(){throw new Error("Readable.from is not available in the browser")}),co}var lo,xc;function Lu(){if(xc)return lo;xc=1,lo=Y;var e;Y.ReadableState=Q,br.EventEmitter;var t=function(C,q){return C.listeners(q).length},r=Au,n=Fn.Buffer,i=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(M){return n.from(M)}function c(M){return n.isBuffer(M)||M instanceof i}var o=br,f;o&&o.debuglog?f=o.debuglog("stream"):f=function(){};var g=sg(),p=ku,v=Bu,b=v.getHighWaterMark,k=Rr.codes,j=k.ERR_INVALID_ARG_TYPE,O=k.ERR_STREAM_PUSH_AFTER_EOF,H=k.ERR_METHOD_NOT_IMPLEMENTED,A=k.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,$,V;Ct(Y,r);var D=p.errorOrDestroy,z=["error","close","destroy","pause","resume"];function te(M,C,q){if(typeof M.prependListener=="function")return M.prependListener(C,q);!M._events||!M._events[C]?M.on(C,q):Array.isArray(M._events[C])?M._events[C].unshift(q):M._events[C]=[q,M._events[C]]}function Q(M,C,q){e=e||rn(),M=M||{},typeof q!="boolean"&&(q=C instanceof e),this.objectMode=!!M.objectMode,q&&(this.objectMode=this.objectMode||!!M.readableObjectMode),this.highWaterMark=b(this,M,"readableHighWaterMark",q),this.buffer=new g,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=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.destroyed=!1,this.defaultEncoding=M.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,M.encoding&&(P||(P=Rc().StringDecoder),this.decoder=new P(M.encoding),this.encoding=M.encoding)}function Y(M){if(e=e||rn(),!(this instanceof Y))return new Y(M);var C=this instanceof e;this._readableState=new Q(M,this,C),this.readable=!0,M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy)),r.call(this)}Object.defineProperty(Y.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(C){this._readableState&&(this._readableState.destroyed=C)}}),Y.prototype.destroy=p.destroy,Y.prototype._undestroy=p.undestroy,Y.prototype._destroy=function(M,C){C(M)},Y.prototype.push=function(M,C){var q=this._readableState,G;return q.objectMode?G=!0:typeof M=="string"&&(C=C||q.defaultEncoding,C!==q.encoding&&(M=n.from(M,C),C=""),G=!0),de(this,M,C,!1,G)},Y.prototype.unshift=function(M){return de(this,M,null,!0,!1)};function de(M,C,q,G,se){f("readableAddChunk",C);var ue=M._readableState;if(C===null)ue.reading=!1,y(M,ue);else{var re;if(se||(re=pe(ue,C)),re)D(M,re);else if(ue.objectMode||C&&C.length>0)if(typeof C!="string"&&!ue.objectMode&&Object.getPrototypeOf(C)!==n.prototype&&(C=s(C)),G)ue.endEmitted?D(M,new A):oe(M,ue,C,!0);else if(ue.ended)D(M,new O);else{if(ue.destroyed)return!1;ue.reading=!1,ue.decoder&&!q?(C=ue.decoder.write(C),ue.objectMode||C.length!==0?oe(M,ue,C,!1):I(M,ue)):oe(M,ue,C,!1)}else G||(ue.reading=!1,I(M,ue))}return!ue.ended&&(ue.length<ue.highWaterMark||ue.length===0)}function oe(M,C,q,G){C.flowing&&C.length===0&&!C.sync?(C.awaitDrain=0,M.emit("data",q)):(C.length+=C.objectMode?1:q.length,G?C.buffer.unshift(q):C.buffer.push(q),C.needReadable&&w(M)),I(M,C)}function pe(M,C){var q;return!c(C)&&typeof C!="string"&&C!==void 0&&!M.objectMode&&(q=new j("chunk",["string","Buffer","Uint8Array"],C)),q}Y.prototype.isPaused=function(){return this._readableState.flowing===!1},Y.prototype.setEncoding=function(M){P||(P=Rc().StringDecoder);var C=new P(M);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,G="";q!==null;)G+=C.write(q.data),q=q.next;return this._readableState.buffer.clear(),G!==""&&this._readableState.buffer.push(G),this._readableState.length=G.length,this};var x=1073741824;function a(M){return M>=x?M=x:(M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++),M}function d(M,C){return M<=0||C.length===0&&C.ended?0:C.objectMode?1:M!==M?C.flowing&&C.length?C.buffer.head.data.length:C.length:(M>C.highWaterMark&&(C.highWaterMark=a(M)),M<=C.length?M:C.ended?C.length:(C.needReadable=!0,0))}Y.prototype.read=function(M){f("read",M),M=parseInt(M,10);var C=this._readableState,q=M;if(M!==0&&(C.emittedReadable=!1),M===0&&C.needReadable&&((C.highWaterMark!==0?C.length>=C.highWaterMark:C.length>0)||C.ended))return f("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?W(this):w(this),null;if(M=d(M,C),M===0&&C.ended)return C.length===0&&W(this),null;var G=C.needReadable;f("need readable",G),(C.length===0||C.length-M<C.highWaterMark)&&(G=!0,f("length less than watermark",G)),C.ended||C.reading?(G=!1,f("reading or ended",G)):G&&(f("do read"),C.reading=!0,C.sync=!0,C.length===0&&(C.needReadable=!0),this._read(C.highWaterMark),C.sync=!1,C.reading||(M=d(q,C)));var se;return M>0?se=L(M,C):se=null,se===null?(C.needReadable=C.length<=C.highWaterMark,M=0):(C.length-=M,C.awaitDrain=0),C.length===0&&(C.ended||(C.needReadable=!0),q!==M&&C.ended&&W(this)),se!==null&&this.emit("data",se),se};function y(M,C){if(f("onEofChunk"),!C.ended){if(C.decoder){var q=C.decoder.end();q&&q.length&&(C.buffer.push(q),C.length+=C.objectMode?1:q.length)}C.ended=!0,C.sync?w(M):(C.needReadable=!1,C.emittedReadable||(C.emittedReadable=!0,S(M)))}}function w(M){var C=M._readableState;f("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(f("emitReadable",C.flowing),C.emittedReadable=!0,process.nextTick(S,M))}function S(M){var C=M._readableState;f("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&(C.length||C.ended)&&(M.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,T(M)}function I(M,C){C.readingMore||(C.readingMore=!0,process.nextTick(B,M,C))}function B(M,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){var q=C.length;if(f("maybeReadMore read 0"),M.read(0),q===C.length)break}C.readingMore=!1}Y.prototype._read=function(M){D(this,new H("_read()"))},Y.prototype.pipe=function(M,C){var q=this,G=this._readableState;switch(G.pipesCount){case 0:G.pipes=M;break;case 1:G.pipes=[G.pipes,M];break;default:G.pipes.push(M);break}G.pipesCount+=1,f("pipe count=%d opts=%j",G.pipesCount,C);var se=(!C||C.end!==!1)&&M!==process.stdout&&M!==process.stderr,ue=se?be:Ee;G.endEmitted?process.nextTick(ue):q.once("end",ue),M.on("unpipe",re);function re(m,l){f("onunpipe"),m===q&&l&&l.hasUnpiped===!1&&(l.hasUnpiped=!0,Se())}function be(){f("onend"),M.end()}var pt=_(q);M.on("drain",pt);var Re=!1;function Se(){f("cleanup"),M.removeListener("close",Me),M.removeListener("finish",Qe),M.removeListener("drain",pt),M.removeListener("error",_e),M.removeListener("unpipe",re),q.removeListener("end",be),q.removeListener("end",Ee),q.removeListener("data",Ze),Re=!0,G.awaitDrain&&(!M._writableState||M._writableState.needDrain)&&pt()}q.on("data",Ze);function Ze(m){f("ondata");var l=M.write(m);f("dest.write",l),l===!1&&((G.pipesCount===1&&G.pipes===M||G.pipesCount>1&&le(G.pipes,M)!==-1)&&!Re&&(f("false write response, pause",G.awaitDrain),G.awaitDrain++),q.pause())}function _e(m){f("onerror",m),Ee(),M.removeListener("error",_e),t(M,"error")===0&&D(M,m)}te(M,"error",_e);function Me(){M.removeListener("finish",Qe),Ee()}M.once("close",Me);function Qe(){f("onfinish"),M.removeListener("close",Me),Ee()}M.once("finish",Qe);function Ee(){f("unpipe"),q.unpipe(M)}return M.emit("pipe",q),G.flowing||(f("pipe resume"),q.resume()),M};function _(M){return function(){var q=M._readableState;f("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&t(M,"data")&&(q.flowing=!0,T(M))}}Y.prototype.unpipe=function(M){var C=this._readableState,q={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return M&&M!==C.pipes?this:(M||(M=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,M&&M.emit("unpipe",this,q),this);if(!M){var G=C.pipes,se=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var ue=0;ue<se;ue++)G[ue].emit("unpipe",this,{hasUnpiped:!1});return this}var re=le(C.pipes,M);return re===-1?this:(C.pipes.splice(re,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),M.emit("unpipe",this,q),this)},Y.prototype.on=function(M,C){var q=r.prototype.on.call(this,M,C),G=this._readableState;return M==="data"?(G.readableListening=this.listenerCount("readable")>0,G.flowing!==!1&&this.resume()):M==="readable"&&!G.endEmitted&&!G.readableListening&&(G.readableListening=G.needReadable=!0,G.flowing=!1,G.emittedReadable=!1,f("on readable",G.length,G.reading),G.length?w(this):G.reading||process.nextTick(R,this)),q},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(M,C){var q=r.prototype.removeListener.call(this,M,C);return M==="readable"&&process.nextTick(u,this),q},Y.prototype.removeAllListeners=function(M){var C=r.prototype.removeAllListeners.apply(this,arguments);return(M==="readable"||M===void 0)&&process.nextTick(u,this),C};function u(M){var C=M._readableState;C.readableListening=M.listenerCount("readable")>0,C.resumeScheduled&&!C.paused?C.flowing=!0:M.listenerCount("data")>0&&M.resume()}function R(M){f("readable nexttick read 0"),M.read(0)}Y.prototype.resume=function(){var M=this._readableState;return M.flowing||(f("resume"),M.flowing=!M.readableListening,K(this,M)),M.paused=!1,this};function K(M,C){C.resumeScheduled||(C.resumeScheduled=!0,process.nextTick(J,M,C))}function J(M,C){f("resume",C.reading),C.reading||M.read(0),C.resumeScheduled=!1,M.emit("resume"),T(M),C.flowing&&!C.reading&&M.read(0)}Y.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function T(M){var C=M._readableState;for(f("flow",C.flowing);C.flowing&&M.read()!==null;);}Y.prototype.wrap=function(M){var C=this,q=this._readableState,G=!1;M.on("end",function(){if(f("wrapped end"),q.decoder&&!q.ended){var re=q.decoder.end();re&&re.length&&C.push(re)}C.push(null)}),M.on("data",function(re){if(f("wrapped data"),q.decoder&&(re=q.decoder.write(re)),!(q.objectMode&&re==null)&&!(!q.objectMode&&(!re||!re.length))){var be=C.push(re);be||(G=!0,M.pause())}});for(var se in M)this[se]===void 0&&typeof M[se]=="function"&&(this[se]=function(be){return function(){return M[be].apply(M,arguments)}}(se));for(var ue=0;ue<z.length;ue++)M.on(z[ue],this.emit.bind(this,z[ue]));return this._read=function(re){f("wrapped _read",re),G&&(G=!1,M.resume())},this},typeof Symbol=="function"&&(Y.prototype[Symbol.asyncIterator]=function(){return $===void 0&&($=_g()),$(this)}),Object.defineProperty(Y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Y.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Y.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(C){this._readableState&&(this._readableState.flowing=C)}}),Y._fromList=L,Object.defineProperty(Y.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function L(M,C){if(C.length===0)return null;var q;return C.objectMode?q=C.buffer.shift():!M||M>=C.length?(C.decoder?q=C.buffer.join(""):C.buffer.length===1?q=C.buffer.first():q=C.buffer.concat(C.length),C.buffer.clear()):q=C.buffer.consume(M,C.decoder),q}function W(M){var C=M._readableState;f("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,process.nextTick(Z,C,M))}function Z(M,C){if(f("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&M.length===0&&(M.endEmitted=!0,C.readable=!1,C.emit("end"),M.autoDestroy)){var q=C._writableState;(!q||q.autoDestroy&&q.finished)&&C.destroy()}}typeof Symbol=="function"&&(Y.from=function(M,C){return V===void 0&&(V=Eg()),V(Y,M,C)});function le(M,C){for(var q=0,G=M.length;q<G;q++)if(M[q]===C)return q;return-1}return lo}var Ou=Ht,ls=Rr.codes,Sg=ls.ERR_METHOD_NOT_IMPLEMENTED,Rg=ls.ERR_MULTIPLE_CALLBACK,Mg=ls.ERR_TRANSFORM_ALREADY_TRANSFORMING,Cg=ls.ERR_TRANSFORM_WITH_LENGTH_0,us=rn();Ct(Ht,us);function Ig(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Rg);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 Ht(e){if(!(this instanceof Ht))return new Ht(e);us.call(this,e),this._transformState={afterTransform:Ig.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",xg)}function xg(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Ac(e,t,r)}):Ac(this,null,null)}Ht.prototype.push=function(e,t){return this._transformState.needTransform=!1,us.prototype.push.call(this,e,t)};Ht.prototype._transform=function(e,t,r){r(new Sg("_transform()"))};Ht.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)}};Ht.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};Ht.prototype._destroy=function(e,t){us.prototype._destroy.call(this,e,function(r){t(r)})};function Ac(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Cg;if(e._transformState.transforming)throw new Mg;return e.push(null)}var Ag=Mn,$u=Ou;Ct(Mn,$u);function Mn(e){if(!(this instanceof Mn))return new Mn(e);$u.call(this,e)}Mn.prototype._transform=function(e,t,r){r(null,e)};var uo;function kg(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Fu=Rr.codes,Tg=Fu.ERR_MISSING_ARGS,Bg=Fu.ERR_STREAM_DESTROYED;function kc(e){if(e)throw e}function Ng(e){return e.setHeader&&typeof e.abort=="function"}function Pg(e,t,r,n){n=kg(n);var i=!1;e.on("close",function(){i=!0}),uo===void 0&&(uo=na),uo(e,{readable:t,writable:r},function(c){if(c)return n(c);i=!0,n()});var s=!1;return function(c){if(!i&&!s){if(s=!0,Ng(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(c||new Bg("pipe"))}}}function Tc(e){e()}function Lg(e,t){return e.pipe(t)}function Og(e){return!e.length||typeof e[e.length-1]!="function"?kc:e.pop()}function $g(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Og(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Tg("streams");var i,s=t.map(function(c,o){var f=o<t.length-1,g=o>0;return Pg(c,f,g,function(p){i||(i=p),p&&s.forEach(Tc),!f&&(s.forEach(Tc),n(i))})});return t.reduce(Lg)}var Fg=$g;(function(e,t){t=e.exports=Lu(),t.Stream=t,t.Readable=t,t.Writable=Nu(),t.Duplex=rn(),t.Transform=Ou,t.PassThrough=Ag,t.finished=na,t.pipeline=Fg})(Lo,Lo.exports);var Du=Lo.exports;const{Transform:Dg}=Du;var jg=e=>class ju extends Dg{constructor(r,n,i,s,c){super(c),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=c,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(c){s=c}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ju(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Ug}=Du;var Hg=e=>class Uu extends Ug{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(c){s=c}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Uu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Wg=jg,Vg=Hg;var qg=function(e){const t=Wg(e),r=Vg(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)}}},Hu={};const Bc=[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];Hu.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],c=e[4]^e[14]^e[24]^e[34]^e[44],o=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],g=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],v=e[9]^e[19]^e[29]^e[39]^e[49];let b=p^(i<<1|s>>>31),k=v^(s<<1|i>>>31);const j=e[0]^b,O=e[1]^k,H=e[10]^b,A=e[11]^k,P=e[20]^b,$=e[21]^k,V=e[30]^b,D=e[31]^k,z=e[40]^b,te=e[41]^k;b=r^(c<<1|o>>>31),k=n^(o<<1|c>>>31);const Q=e[2]^b,Y=e[3]^k,de=e[12]^b,oe=e[13]^k,pe=e[22]^b,x=e[23]^k,a=e[32]^b,d=e[33]^k,y=e[42]^b,w=e[43]^k;b=i^(f<<1|g>>>31),k=s^(g<<1|f>>>31);const S=e[4]^b,I=e[5]^k,B=e[14]^b,_=e[15]^k,u=e[24]^b,R=e[25]^k,K=e[34]^b,J=e[35]^k,T=e[44]^b,L=e[45]^k;b=c^(p<<1|v>>>31),k=o^(v<<1|p>>>31);const W=e[6]^b,Z=e[7]^k,le=e[16]^b,M=e[17]^k,C=e[26]^b,q=e[27]^k,G=e[36]^b,se=e[37]^k,ue=e[46]^b,re=e[47]^k;b=f^(r<<1|n>>>31),k=g^(n<<1|r>>>31);const be=e[8]^b,pt=e[9]^k,Re=e[18]^b,Se=e[19]^k,Ze=e[28]^b,_e=e[29]^k,Me=e[38]^b,Qe=e[39]^k,Ee=e[48]^b,m=e[49]^k,l=j,h=O,E=A<<4|H>>>28,N=H<<4|A>>>28,F=P<<3|$>>>29,U=$<<3|P>>>29,he=D<<9|V>>>23,ae=V<<9|D>>>23,ie=z<<18|te>>>14,Ce=te<<18|z>>>14,ne=Q<<1|Y>>>31,Ie=Y<<1|Q>>>31,Ir=oe<<12|de>>>20,xe=de<<12|oe>>>20,Ae=pe<<10|x>>>22,xr=x<<10|pe>>>22,ke=d<<13|a>>>19,Te=a<<13|d>>>19,Ar=y<<2|w>>>30,Be=w<<2|y>>>30,Ne=I<<30|S>>>2,kr=S<<30|I>>>2,Pe=B<<6|_>>>26,Le=_<<6|B>>>26,Tr=R<<11|u>>>21,Oe=u<<11|R>>>21,$e=K<<15|J>>>17,Br=J<<15|K>>>17,Fe=L<<29|T>>>3,De=T<<29|L>>>3,Nr=W<<28|Z>>>4,je=Z<<28|W>>>4,Ue=M<<23|le>>>9,Pr=le<<23|M>>>9,He=C<<25|q>>>7,We=q<<25|C>>>7,Kt=G<<21|se>>>11,Yt=se<<21|G>>>11,Qt=re<<24|ue>>>8,Xt=ue<<24|re>>>8,er=be<<27|pt>>>5,tr=pt<<27|be>>>5,rr=Re<<20|Se>>>12,nr=Se<<20|Re>>>12,ir=_e<<7|Ze>>>25,sr=Ze<<7|_e>>>25,or=Me<<8|Qe>>>24,ar=Qe<<8|Me>>>24,cr=Ee<<14|m>>>18,lr=m<<14|Ee>>>18;e[0]=l^~Ir&Tr,e[1]=h^~xe&Oe,e[10]=Nr^~rr&F,e[11]=je^~nr&U,e[20]=ne^~Pe&He,e[21]=Ie^~Le&We,e[30]=er^~E&Ae,e[31]=tr^~N&xr,e[40]=Ne^~Ue&ir,e[41]=kr^~Pr&sr,e[2]=Ir^~Tr&Kt,e[3]=xe^~Oe&Yt,e[12]=rr^~F&ke,e[13]=nr^~U&Te,e[22]=Pe^~He&or,e[23]=Le^~We&ar,e[32]=E^~Ae&$e,e[33]=N^~xr&Br,e[42]=Ue^~ir&he,e[43]=Pr^~sr&ae,e[4]=Tr^~Kt&cr,e[5]=Oe^~Yt&lr,e[14]=F^~ke&Fe,e[15]=U^~Te&De,e[24]=He^~or&ie,e[25]=We^~ar&Ce,e[34]=Ae^~$e&Qt,e[35]=xr^~Br&Xt,e[44]=ir^~he&Ar,e[45]=sr^~ae&Be,e[6]=Kt^~cr&l,e[7]=Yt^~lr&h,e[16]=ke^~Fe&Nr,e[17]=Te^~De&je,e[26]=or^~ie&ne,e[27]=ar^~Ce&Ie,e[36]=$e^~Qt&er,e[37]=Br^~Xt&tr,e[46]=he^~Ar&Ne,e[47]=ae^~Be&kr,e[8]=cr^~l&Ir,e[9]=lr^~h&xe,e[18]=Fe^~Nr&rr,e[19]=De^~je&nr,e[28]=ie^~ne&Pe,e[29]=Ce^~Ie&Le,e[38]=Qt^~er&E,e[39]=Xt^~tr&N,e[48]=Ar^~Ne&Ue,e[49]=Be^~kr&Pr,e[0]^=Bc[t*2],e[1]^=Bc[t*2+1]}};const Bi=Hu;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&&(Bi.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&&Bi.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Bi.p1600(this.state),this.count=0,this.squeezing=!0};dn.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Bi.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 zg=dn,Gg=qg(zg);const Jg=Gg,Zg=$i;function Wu(e){return Buffer.allocUnsafe(e).fill(0)}function Vu(e,t,r){const n=Wu(t);return e=hs(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 Kg(e,t){return Vu(e,t,!0)}function hs(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")qu(e)?e=Buffer.from(Xg(zu(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(Zg.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function Yg(e){return e=hs(e),"0x"+e.toString("hex")}function Qg(e,t){return e=hs(e),t||(t=256),Jg("keccak"+t).update(e).digest()}function Xg(e){return e.length%2?"0"+e:e}function qu(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function zu(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var Gu={zeros:Wu,setLength:Vu,setLengthRight:Kg,isHexString:qu,stripHexPrefix:zu,toBuffer:hs,bufferToHex:Yg,keccak:Qg};const Er=Gu,yr=$i;function Ju(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 Kr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Nc(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Zu(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function pr(e){var t=typeof e;if(t==="string")return Er.isHexString(e)?new yr(Er.stripHexPrefix(e),16):new yr(e,10);if(t==="number")return new yr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Bt(e,t){var r,n,i,s;if(e==="address")return Bt("uint160",pr(t));if(e==="bool")return Bt("uint8",t?1:0);if(e==="string")return Bt("bytes",new Buffer(t,"utf8"));if(tm(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Zu(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(Bt(e,t[s]));if(r==="dynamic"){var c=Bt("uint256",t.length);i.unshift(c)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([Bt("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,Er.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Kr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Er.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Kr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=pr(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Kr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=pr(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Nc(e),n=pr(t),n<0)throw new Error("Supplied ufixed is negative");return Bt("uint256",n.mul(new yr(2).pow(new yr(r[1]))))}else if(e.startsWith("fixed"))return r=Nc(e),Bt("int256",pr(t).mul(new yr(2).pow(new yr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function em(e){return e==="string"||e==="bytes"||Zu(e)==="dynamic"}function tm(e){return e.lastIndexOf("]")===e.length-1}function rm(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var c=Ju(e[s]),o=t[s],f=Bt(c,o);em(c)?(r.push(Bt("uint256",i)),n.push(f),i+=f.length):r.push(f)}return Buffer.concat(r.concat(n))}function Ku(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 c=Ju(e[s]),o=t[s];if(c==="bytes")i.push(o);else if(c==="string")i.push(new Buffer(o,"utf8"));else if(c==="bool")i.push(new Buffer(o?"01":"00","hex"));else if(c==="address")i.push(Er.setLength(o,20));else if(c.startsWith("bytes")){if(r=Kr(c),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(Er.setLengthRight(o,r))}else if(c.startsWith("uint")){if(r=Kr(c),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=pr(o),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(c.startsWith("int")){if(r=Kr(c),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=pr(o),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+c)}return Buffer.concat(i)}function nm(e,t){return Er.keccak(Ku(e,t))}var im={rawEncode:rm,solidityPack:Ku,soliditySHA3:nm};const Rt=Gu,_n=im,Yu={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"]},ho={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const c=(o,f,g)=>{if(r[f]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Rt.keccak(this.encodeData(f,g,r,n))];if(g===void 0)throw new Error(`missing value for field ${o} of type ${f}`);if(f==="bytes")return["bytes32",Rt.keccak(g)];if(f==="string")return typeof g=="string"&&(g=Buffer.from(g,"utf8")),["bytes32",Rt.keccak(g)];if(f.lastIndexOf("]")===f.length-1){const p=f.slice(0,f.lastIndexOf("[")),v=g.map(b=>c(o,p,b));return["bytes32",Rt.keccak(_n.rawEncode(v.map(([b])=>b),v.map(([,b])=>b)))]}return[f,g]};for(const o of r[e]){const[f,g]=c(o.name,o.type,t[o.name]);i.push(f),s.push(g)}}else for(const c of r[e]){let o=t[c.name];if(o!==void 0)if(c.type==="bytes")i.push("bytes32"),o=Rt.keccak(o),s.push(o);else if(c.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=Rt.keccak(o),s.push(o);else if(r[c.type]!==void 0)i.push("bytes32"),o=Rt.keccak(this.encodeData(c.type,o,r,n)),s.push(o);else{if(c.type.lastIndexOf("]")===c.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(c.type),s.push(o)}}return _n.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:c,type:o})=>o+" "+c).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return Rt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Rt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Yu.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Rt.keccak(Buffer.concat(n))}};var sm={TYPED_MESSAGE_SCHEMA:Yu,TypedDataUtils:ho,hashForSignTypedDataLegacy:function(e){return om(e.data)},hashForSignTypedData_v3:function(e){return ho.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return ho.hash(e.data)}};function om(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?Rt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return _n.soliditySHA3(["bytes32","bytes32"],[_n.soliditySHA3(new Array(e.length).fill("string"),i),_n.soliditySHA3(n,r)])}var nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.filterFromParam=nn.FilterPolyfill=void 0;const Vr=Ke,ot=X,am=5*60*1e3,gr={jsonrpc:"2.0",id:0};class cm{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,Vr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Qu(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,ot.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,ot.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,ot.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,ot.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,ot.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(li())}async getFilterLogs(t){const r=(0,ot.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},gr),{method:"eth_getLogs",params:[Pc(n)]})):li()}makeFilterId(){return(0,Vr.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 li();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return ui();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const c=await this.sendAsyncPromise(Object.assign(Object.assign({},gr),{method:"eth_getLogs",params:[Pc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(c.result)){const o=c.result.map(g=>(0,ot.intNumberFromHexString)(g.blockNumber||"0x0")),f=Math.max(...o);if(f&&f>n){const g=(0,Vr.IntNumber)(f+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${g}`),this.cursors.set(t,g)}}return c}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return li();const n=await this.getCurrentBlockHeight();if(r>n)return ui();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,ot.range)(r,n+1).map(c=>this.getBlockHashByNumber((0,Vr.IntNumber)(c))))).filter(c=>!!c),s=(0,Vr.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({},gr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(ui())}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)},am);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({},gr),{method:"eth_blockNumber",params:[]}));return(0,ot.intNumberFromHexString)((0,ot.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},gr),{method:"eth_getBlockByNumber",params:[(0,ot.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,ot.ensureHexString)(r.result.hash):null}}nn.FilterPolyfill=cm;function Qu(e){return{fromBlock:Lc(e.fromBlock),toBlock:Lc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}nn.filterFromParam=Qu;function Pc(e){const t={fromBlock:Oc(e.fromBlock),toBlock:Oc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Lc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Vr.IntNumber)(0);if((0,ot.isHexString)(e))return(0,ot.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Oc(e){return e==="latest"?e:(0,ot.hexStringFromIntNumber)(e)}function li(){return Object.assign(Object.assign({},gr),{error:{code:-32e3,message:"filter not found"}})}function ui(){return Object.assign(Object.assign({},gr),{result:[]})}var fs={},Xu={},ds={},ia=lm;function lm(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 $c=(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(c,o){if(t.multiArgs){const f=new Array(arguments.length-1);for(let g=1;g<arguments.length;g++)f[g-1]=arguments[g];c?(f.unshift(c),s(f)):i(f)}else c?s(c):i(o)}):n.push(function(c){if(t.multiArgs){const o=new Array(arguments.length-1);for(let f=0;f<arguments.length;f++)o[f]=arguments[f];i(o)}else i(c)}),e.apply(this,n)})};var um=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=c=>typeof c=="string"?i===c:c.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):$c(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)?$c(s,t):s}return n},Gn={},Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});const hm=br;function Fc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function fm(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let dm=class extends hm.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 c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const o=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw o.context=c,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Fc(s,this,r);else{const c=s.length,o=fm(s);for(let f=0;f<c;f+=1)Fc(o[f],this,r)}return!0}};Jn.default=dm;var pm=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.BaseBlockTracker=void 0;const gm=pm(Jn),mm=1e3,ym=(e,t)=>e+t,Dc=["sync","latest"];class vm extends gm.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*mm,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){Dc.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 Dc.map(t=>this.listenerCount(t)).reduce(ym)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=jc(t),i=jc(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}}Gn.BaseBlockTracker=vm;function jc(e){return Number.parseInt(e,16)}var eh={},th={},it={};class rh extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...c}=t,{path:o}=t,f=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??f),s!=null&&(this.cause=f),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function wm(e){return _t(e)&&typeof e[Symbol.iterator]=="function"}function _t(e){return typeof e=="object"&&e!=null}function Uc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ye(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function bm(e){const{done:t,value:r}=e.next();return t?void 0:r}function _m(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:c}=r,{refinement:o,message:f=`Expected a value of type \`${c}\`${o?` with refinement \`${o}\``:""}, but received: \`${Ye(n)}\``}=e;return{value:n,type:c,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:f}}function*$o(e,t,r,n){wm(e)||(e=[e]);for(const i of e){const s=_m(i,t,r,n);s&&(yield s)}}function*sa(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:c=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),c&&t.type!=="type"&&_t(t.schema)&&_t(e)&&!Array.isArray(e)))for(const g in e)t.schema[g]===void 0&&delete e[g];let f="valid";for(const g of t.validator(e,o))g.explanation=r.message,f="not_valid",yield[g,void 0];for(let[g,p,v]of t.entries(e,o)){const b=sa(p,v,{path:g===void 0?n:[...n,g],branch:g===void 0?i:[...i,p],coerce:s,mask:c,message:r.message});for(const k of b)k[0]?(f=k[0].refinement!=null?"not_refined":"not_valid",yield[k[0],void 0]):s&&(p=k[1],g===void 0?e=p:e instanceof Map?e.set(g,p):e instanceof Set?e.add(p):_t(e)&&(p!==void 0||g in e)&&(e[g]=p))}if(f!=="not_valid")for(const g of t.refiner(e,o))g.explanation=r.message,f="not_refined",yield[g,void 0];f==="valid"&&(yield[void 0,e])}class Ge{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:c=f=>f,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=c,i?this.validator=(f,g)=>{const p=i(f,g);return $o(p,g,this,f)}:this.validator=()=>[],s?this.refiner=(f,g)=>{const p=s(f,g);return $o(p,g,this,f)}:this.refiner=()=>[]}assert(t,r){return nh(t,this,r)}create(t,r){return ih(t,this,r)}is(t){return oa(t,this)}mask(t,r){return sh(t,this,r)}validate(t,r={}){return pn(t,this,r)}}function nh(e,t,r){const n=pn(e,t,{message:r});if(n[0])throw n[0]}function ih(e,t,r){const n=pn(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function sh(e,t,r){const n=pn(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function oa(e,t){return!pn(e,t)[0]}function pn(e,t,r={}){const n=sa(e,t,r),i=bm(n);return i[0]?[new rh(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function Em(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Kn(n):Zn(n)}function ut(e,t){return new Ge({type:e,schema:null,validator:t})}function Sm(e,t){return new Ge({...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 Rm(e){return new Ge({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 Mm(e){let t;return new Ge({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 Cm(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Kn(n);default:return Zn(n)}}function Im(e){const t=e instanceof Ge,r=t?{...e.schema}:{...e};for(const n in r)r[n]=oh(r[n]);return t&&e.type==="type"?Kn(r):Zn(r)}function xm(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Kn(n);default:return Zn(n)}}function Am(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ut(e,t)}function km(){return ut("any",()=>!0)}function Tm(e){return new Ge({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: ${Ye(t)}`}})}function Bm(){return ut("bigint",e=>typeof e=="bigint")}function Nm(){return ut("boolean",e=>typeof e=="boolean")}function Pm(){return ut("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ye(e)}`)}function Lm(e){const t={},r=e.map(n=>Ye(n)).join();for(const n of e)t[n]=n;return new Ge({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ye(n)}`}})}function Om(){return ut("func",e=>typeof e=="function"||`Expected a function, but received: ${Ye(e)}`)}function $m(e){return ut("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ye(t)}`)}function Fm(){return ut("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ye(e)}`)}function Dm(e){return new Ge({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 jm(e){const t=Ye(e),r=typeof e;return new Ge({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ye(n)}`}})}function Um(e,t){return new Ge({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: ${Ye(r)}`}})}function aa(){return ut("never",()=>!1)}function Hm(e){return new Ge({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function Wm(){return ut("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ye(e)}`)}function Zn(e){const t=e?Object.keys(e):[],r=aa();return new Ge({type:"object",schema:e||null,*entries(n){if(e&&_t(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 _t(n)||`Expected an object, but received: ${Ye(n)}`},coercer(n){return _t(n)?{...n}:n}})}function oh(e){return new Ge({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Vm(e,t){return new Ge({type:"record",schema:null,*entries(r){if(_t(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return _t(r)||`Expected an object, but received: ${Ye(r)}`}})}function qm(){return ut("regexp",e=>e instanceof RegExp)}function zm(e){return new Ge({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: ${Ye(t)}`}})}function ah(){return ut("string",e=>typeof e=="string"||`Expected a string, but received: ${Ye(e)}`)}function Gm(e){const t=aa();return new Ge({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: ${Ye(r)}`}})}function Kn(e){const t=Object.keys(e);return new Ge({type:"type",schema:e,*entries(r){if(_t(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return _t(r)||`Expected an object, but received: ${Ye(r)}`},coercer(r){return _t(r)?{...r}:r}})}function Jm(e){const t=e.map(r=>r.type).join(" | ");return new Ge({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[...c]=sa(r,s,n),[o]=c;if(o[0])for(const[f]of c)f&&i.push(f);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ye(r)}`,...i]}})}function ch(){return ut("unknown",()=>!0)}function ca(e,t,r){return new Ge({...e,coercer:(n,i)=>oa(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Zm(e,t,r={}){return ca(e,ch(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&Uc(n)&&Uc(i)){const s={...n};let c=!1;for(const o in i)s[o]===void 0&&(s[o]=i[o],c=!0);if(c)return s}return n})}function Km(e){return ca(e,ah(),t=>t.trim())}function Ym(e){return Mr(e,"empty",t=>{const r=lh(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function lh(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Qm(e,t,r={}){const{exclusive:n}=r;return Mr(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Xm(e,t,r={}){const{exclusive:n}=r;return Mr(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function ey(e){return Mr(e,"nonempty",t=>lh(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function ty(e,t){return Mr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function ry(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Mr(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:c}=s;return t<=c&&c<=r||`${n} with a size ${i} but received one with a size of \`${c}\``}else{const{length:c}=s;return t<=c&&c<=r||`${n} with a length ${i} but received one with a length of \`${c}\``}})}function Mr(e,t,r){return new Ge({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),c=$o(s,i,e,n);for(const o of c)yield{...o,refinement:t}}})}const ny=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ge,StructError:rh,any:km,array:Tm,assert:nh,assign:Em,bigint:Bm,boolean:Nm,coerce:ca,create:ih,date:Pm,defaulted:Zm,define:ut,deprecated:Sm,dynamic:Rm,empty:Ym,enums:Lm,func:Om,instance:$m,integer:Fm,intersection:Dm,is:oa,lazy:Mm,literal:jm,map:Um,mask:sh,max:Qm,min:Xm,never:aa,nonempty:ey,nullable:Hm,number:Wm,object:Zn,omit:Cm,optional:oh,partial:Im,pattern:ty,pick:xm,record:Vm,refine:Mr,regexp:qm,set:zm,size:ry,string:ah,struct:Am,trimmed:Km,tuple:Gm,type:Kn,union:Jm,unknown:ch,validate:pn},Symbol.toStringTag,{value:"Module"})),Cr=an(ny);Object.defineProperty(it,"__esModule",{value:!0});it.assertExhaustive=it.assertStruct=it.assert=it.AssertionError=void 0;const iy=Cr;function sy(e){return typeof e=="object"&&e!==null&&"message"in e}function oy(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function ay(e){const t=sy(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function uh(e,t){return oy(e)?new e({message:t}):e({message:t})}class la extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}it.AssertionError=la;function cy(e,t="Assertion failed.",r=la){if(!e)throw t instanceof Error?t:uh(r,t)}it.assert=cy;function ly(e,t,r="Assertion failed",n=la){try{(0,iy.assert)(e,t)}catch(i){throw uh(n,`${r}: ${ay(i)}.`)}}it.assertStruct=ly;function uy(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}it.assertExhaustive=uy;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.base64=void 0;const hy=Cr,fy=it,dy=(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 c;s==="base64"?c=String.raw`[A-Za-z0-9+\/]`:((0,fy.assert)(s==="base64url"),c=String.raw`[-_A-Za-z0-9]`);let o;return i?o=new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):o=new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,hy.pattern)(e,o)};Yn.base64=dy;var we={},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=Cr,r=it;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(g){return(0,t.is)(g,e.HexStruct)}e.isHexString=n;function i(g){return(0,t.is)(g,e.StrictHexStruct)}e.isStrictHexString=i;function s(g){(0,r.assert)(n(g),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function c(g){(0,r.assert)(i(g),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=c;function o(g){return g.startsWith("0x")?g:g.startsWith("0X")?`0x${g.substring(2)}`:`0x${g}`}e.add0x=o;function f(g){return g.startsWith("0x")||g.startsWith("0X")?g.substring(2):g}e.remove0x=f})(Qn);Object.defineProperty(we,"__esModule",{value:!0});we.createDataView=we.concatBytes=we.valueToBytes=we.stringToBytes=we.numberToBytes=we.signedBigIntToBytes=we.bigIntToBytes=we.hexToBytes=we.bytesToString=we.bytesToNumber=we.bytesToSignedBigInt=we.bytesToBigInt=we.bytesToHex=we.assertIsBytes=we.isBytes=void 0;const dt=it,Fo=Qn,Hc=48,Wc=58,Vc=87;function py(){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 gy=py();function ua(e){return e instanceof Uint8Array}we.isBytes=ua;function gn(e){(0,dt.assert)(ua(e),"Value must be a Uint8Array.")}we.assertIsBytes=gn;function hh(e){if(gn(e),e.length===0)return"0x";const t=gy(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Fo.add0x)(r.join(""))}we.bytesToHex=hh;function fh(e){gn(e);const t=hh(e);return BigInt(t)}we.bytesToBigInt=fh;function my(e){gn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}we.bytesToSignedBigInt=my;function yy(e){gn(e);const t=fh(e);return(0,dt.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}we.bytesToNumber=yy;function vy(e){return gn(e),new TextDecoder().decode(e)}we.bytesToString=vy;function ps(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Fo.assertIsHexString)(e);const r=(0,Fo.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 c=n.charCodeAt(s*2),o=n.charCodeAt(s*2+1),f=c-(c<Wc?Hc:Vc),g=o-(o<Wc?Hc:Vc);i[s]=f*16+g}return i}we.hexToBytes=ps;function dh(e){(0,dt.assert)(typeof e=="bigint","Value must be a bigint."),(0,dt.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return ps(t)}we.bigIntToBytes=dh;function wy(e,t){(0,dt.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function by(e,t){(0,dt.assert)(typeof e=="bigint","Value must be a bigint."),(0,dt.assert)(typeof t=="number","Byte length must be a number."),(0,dt.assert)(t>0,"Byte length must be greater than 0."),(0,dt.assert)(wy(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()}we.signedBigIntToBytes=by;function ph(e){(0,dt.assert)(typeof e=="number","Value must be a number."),(0,dt.assert)(e>=0,"Value must be a non-negative number."),(0,dt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return ps(t)}we.numberToBytes=ph;function gh(e){return(0,dt.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}we.stringToBytes=gh;function mh(e){if(typeof e=="bigint")return dh(e);if(typeof e=="number")return ph(e);if(typeof e=="string")return e.startsWith("0x")?ps(e):gh(e);if(ua(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}we.valueToBytes=mh;function _y(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=mh(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}we.concatBytes=_y;function Ey(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}we.createDataView=Ey;var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.ChecksumStruct=void 0;const qc=Cr,Sy=Yn;gs.ChecksumStruct=(0,qc.size)((0,Sy.base64)((0,qc.string)(),{paddingRequired:!0}),44,44);var $t={};Object.defineProperty($t,"__esModule",{value:!0});$t.createHex=$t.createBytes=$t.createBigInt=$t.createNumber=void 0;const ze=Cr,Ry=it,yh=we,ms=Qn,vh=(0,ze.union)([(0,ze.number)(),(0,ze.bigint)(),(0,ze.string)(),ms.StrictHexStruct]),My=(0,ze.coerce)((0,ze.number)(),vh,Number),Cy=(0,ze.coerce)((0,ze.bigint)(),vh,BigInt);(0,ze.union)([ms.StrictHexStruct,(0,ze.instance)(Uint8Array)]);const Iy=(0,ze.coerce)((0,ze.instance)(Uint8Array),(0,ze.union)([ms.StrictHexStruct]),yh.hexToBytes),xy=(0,ze.coerce)(ms.StrictHexStruct,(0,ze.instance)(Uint8Array),yh.bytesToHex);function Ay(e){try{const t=(0,ze.create)(e,My);return(0,Ry.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof ze.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}$t.createNumber=Ay;function ky(e){try{return(0,ze.create)(e,Cy)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}$t.createBigInt=ky;function Ty(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,ze.create)(e,Iy)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}$t.createBytes=Ty;function By(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,ze.create)(e,xy)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}$t.createHex=By;var sn={},wh=ee&&ee.__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},at=ee&&ee.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},St,kt;Object.defineProperty(sn,"__esModule",{value:!0});sn.FrozenSet=sn.FrozenMap=void 0;class ha{constructor(t){St.set(this,void 0),wh(this,St,new Map(t),"f"),Object.freeze(this)}get size(){return at(this,St,"f").size}[(St=new WeakMap,Symbol.iterator)](){return at(this,St,"f")[Symbol.iterator]()}entries(){return at(this,St,"f").entries()}forEach(t,r){return at(this,St,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return at(this,St,"f").get(t)}has(t){return at(this,St,"f").has(t)}keys(){return at(this,St,"f").keys()}values(){return at(this,St,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}sn.FrozenMap=ha;class fa{constructor(t){kt.set(this,void 0),wh(this,kt,new Set(t),"f"),Object.freeze(this)}get size(){return at(this,kt,"f").size}[(kt=new WeakMap,Symbol.iterator)](){return at(this,kt,"f")[Symbol.iterator]()}entries(){return at(this,kt,"f").entries()}forEach(t,r){return at(this,kt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return at(this,kt,"f").has(t)}keys(){return at(this,kt,"f").keys()}values(){return at(this,kt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}sn.FrozenSet=fa;Object.freeze(ha);Object.freeze(ha.prototype);Object.freeze(fa);Object.freeze(fa.prototype);var bh={};Object.defineProperty(bh,"__esModule",{value:!0});var _h={};(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=Cr,r=it,n=()=>(0,t.define)("finite number",D=>(0,t.is)(D,(0,t.number)())&&Number.isFinite(D));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",(D,z)=>{function te(Q,Y){const oe=[...Y.validator(Q,z)];return oe.length>0?oe:!0}try{const Q=te(D,e.UnsafeJsonStruct);return Q!==!0?Q:te(JSON.parse(JSON.stringify(D)),e.UnsafeJsonStruct)}catch(Q){return Q instanceof RangeError?"Circular reference detected":!1}});function i(D){return(0,t.is)(D,e.JsonStruct)}e.isValidJson=i;function s(D){(0,r.assertStruct)(D,e.JsonStruct,"Invalid JSON value");const z=JSON.stringify(D);return new TextEncoder().encode(z).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function c(D){return(0,t.is)(D,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=c;function o(D,z){(0,r.assertStruct)(D,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",z)}e.assertIsJsonRpcNotification=o;function f(D){return(0,t.is)(D,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=f;function g(D,z){(0,r.assertStruct)(D,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",z)}e.assertIsJsonRpcRequest=g,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 p(D){return(0,t.is)(D,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function v(D,z){(0,r.assertStruct)(D,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",z)}e.assertIsPendingJsonRpcResponse=v;function b(D){return(0,t.is)(D,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=b;function k(D,z){(0,r.assertStruct)(D,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",z)}e.assertIsJsonRpcResponse=k;function j(D){return(0,t.is)(D,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=j;function O(D,z){(0,r.assertStruct)(D,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",z)}e.assertIsJsonRpcSuccess=O;function H(D){return(0,t.is)(D,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=H;function A(D,z){(0,r.assertStruct)(D,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",z)}e.assertIsJsonRpcFailure=A;function P(D){return(0,t.is)(D,e.JsonRpcErrorStruct)}e.isJsonRpcError=P;function $(D,z){(0,r.assertStruct)(D,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",z)}e.assertIsJsonRpcError=$;function V(D){const{permitEmptyString:z,permitFractions:te,permitNull:Q}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},D);return de=>!!(typeof de=="number"&&(te||Number.isInteger(de))||typeof de=="string"&&(z||de.length>0)||Q&&de===null)}e.getJsonRpcIdValidator=V})(_h);var Eh={};Object.defineProperty(Eh,"__esModule",{value:!0});var on={},Ny=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.createModuleLogger=on.createProjectLogger=void 0;const Py=Ny(ef),Ly=(0,Py.default)("metamask");function Oy(e){return Ly.extend(e)}on.createProjectLogger=Oy;function $y(e,t){return e.extend(t)}on.createModuleLogger=$y;var Sh={};(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(g){return Array.isArray(g)&&g.length>0}e.isNonEmptyArray=t;function r(g){return g==null}e.isNullOrUndefined=r;function n(g){return!!g&&typeof g=="object"&&!Array.isArray(g)}e.isObject=n;const i=(g,p)=>Object.hasOwnProperty.call(g,p);e.hasProperty=i,function(g){g[g.Null=4]="Null",g[g.Comma=1]="Comma",g[g.Wrapper=1]="Wrapper",g[g.True=4]="True",g[g.False=5]="False",g[g.Quote=1]="Quote",g[g.Colon=1]="Colon",g[g.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(g){if(typeof g!="object"||g===null)return!1;try{let p=g;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(g)===p}catch{return!1}}e.isPlainObject=s;function c(g){return g.charCodeAt(0)<=127}e.isASCII=c;function o(g){var p;return g.split("").reduce((b,k)=>c(k)?b+1:b+2,0)+((p=g.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=o;function f(g){return g.toString().length}e.calculateNumberSize=f})(Sh);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.hexToBigInt=Ft.hexToNumber=Ft.bigIntToHex=Ft.numberToHex=void 0;const Yr=it,Cn=Qn,Fy=e=>((0,Yr.assert)(typeof e=="number","Value must be a number."),(0,Yr.assert)(e>=0,"Value must be a non-negative number."),(0,Yr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Cn.add0x)(e.toString(16)));Ft.numberToHex=Fy;const Dy=e=>((0,Yr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Yr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Cn.add0x)(e.toString(16)));Ft.bigIntToHex=Dy;const jy=e=>{(0,Cn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Yr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ft.hexToNumber=jy;const Uy=e=>((0,Cn.assertIsHexString)(e),BigInt((0,Cn.add0x)(e)));Ft.hexToBigInt=Uy;var Rh={};Object.defineProperty(Rh,"__esModule",{value:!0});var Mh={};(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,c)=>{if(!t(s))throw new Error(`"${c}" must be a non-negative integer. Received: "${s}".`)};function n(s,c){return r(s,"count"),s*c}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(Mh);var Ch={};Object.defineProperty(Ch,"__esModule",{value:!0});var Ih={},Do={exports:{}};const Hy="2.0.0",xh=256,Wy=Number.MAX_SAFE_INTEGER||9007199254740991,Vy=16,qy=xh-6,zy=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ys={MAX_LENGTH:xh,MAX_SAFE_COMPONENT_LENGTH:Vy,MAX_SAFE_BUILD_LENGTH:qy,MAX_SAFE_INTEGER:Wy,RELEASE_TYPES:zy,SEMVER_SPEC_VERSION:Hy,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},fo={};const Gy=typeof process=="object"&&fo&&fo.NODE_DEBUG&&/\bsemver\b/i.test(fo.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var vs=Gy;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ys,s=vs;t=e.exports={};const c=t.re=[],o=t.safeRe=[],f=t.src=[],g=t.safeSrc=[],p=t.t={};let v=0;const b="[a-zA-Z0-9-]",k=[["\\s",1],["\\d",i],[b,n]],j=H=>{for(const[A,P]of k)H=H.split(`${A}*`).join(`${A}{0,${P}}`).split(`${A}+`).join(`${A}{1,${P}}`);return H},O=(H,A,P)=>{const $=j(A),V=v++;s(H,V,A),p[H]=V,f[V]=A,g[V]=$,c[V]=new RegExp(A,P?"g":void 0),o[V]=new RegExp($,P?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*"),O("NUMERICIDENTIFIERLOOSE","\\d+"),O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${b}*`),O("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`),O("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`),O("PRERELEASEIDENTIFIER",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIER]})`),O("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIERLOOSE]})`),O("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`),O("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`),O("BUILDIDENTIFIER",`${b}+`),O("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`),O("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`),O("FULL",`^${f[p.FULLPLAIN]}$`),O("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`),O("LOOSE",`^${f[p.LOOSEPLAIN]}$`),O("GTLT","((?:<|>)?=?)"),O("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),O("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`),O("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`),O("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`),O("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`),O("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`),O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),O("COERCE",`${f[p.COERCEPLAIN]}(?:$|[^\\d])`),O("COERCEFULL",f[p.COERCEPLAIN]+`(?:${f[p.PRERELEASE]})?(?:${f[p.BUILD]})?(?:$|[^\\d])`),O("COERCERTL",f[p.COERCE],!0),O("COERCERTLFULL",f[p.COERCEFULL],!0),O("LONETILDE","(?:~>?)"),O("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",O("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`),O("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`),O("LONECARET","(?:\\^)"),O("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",O("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`),O("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`),O("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`),O("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`),O("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",O("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`),O("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`),O("STAR","(<|>)?=?\\s*\\*"),O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Do,Do.exports);var Xn=Do.exports;const Jy=Object.freeze({loose:!0}),Zy=Object.freeze({}),Ky=e=>e?typeof e!="object"?Jy:e:Zy;var da=Ky;const zc=/^[0-9]+$/,Ah=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=zc.test(e),n=zc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Yy=(e,t)=>Ah(t,e);var kh={compareIdentifiers:Ah,rcompareIdentifiers:Yy};const hi=vs,{MAX_LENGTH:Gc,MAX_SAFE_INTEGER:fi}=ys,{safeRe:di,t:pi}=Xn,Qy=da,{compareIdentifiers:po}=kh;let Xy=class Tt{constructor(t,r){if(r=Qy(r),t instanceof Tt){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>Gc)throw new TypeError(`version is longer than ${Gc} characters`);hi("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?di[pi.LOOSE]:di[pi.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>fi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>fi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>fi||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<fi)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(hi("SemVer.compare",this.version,this.options,t),!(t instanceof Tt)){if(typeof t=="string"&&t===this.version)return 0;t=new Tt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Tt||(t=new Tt(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 Tt||(t=new Tt(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(hi("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 po(n,i)}while(++r)}compareBuild(t){t instanceof Tt||(t=new Tt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(hi("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 po(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[pi.PRERELEASELOOSE]:di[pi.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]),po(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 ct=Xy;const Jc=ct,ev=(e,t,r=!1)=>{if(e instanceof Jc)return e;try{return new Jc(e,t)}catch(n){if(!r)return null;throw n}};var mn=ev;const tv=mn,rv=(e,t)=>{const r=tv(e,t);return r?r.version:null};var nv=rv;const iv=mn,sv=(e,t)=>{const r=iv(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var ov=sv;const Zc=ct,av=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Zc(e instanceof Zc?e.version:e,r).inc(t,n,i).version}catch{return null}};var cv=av;const Kc=mn,lv=(e,t)=>{const r=Kc(e,null,!0),n=Kc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,c=s?r:n,o=s?n:r,f=!!c.prerelease.length;if(!!o.prerelease.length&&!f){if(!o.patch&&!o.minor)return"major";if(o.compareMain(c)===0)return o.minor&&!o.patch?"minor":"patch"}const p=f?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var uv=lv;const hv=ct,fv=(e,t)=>new hv(e,t).major;var dv=fv;const pv=ct,gv=(e,t)=>new pv(e,t).minor;var mv=gv;const yv=ct,vv=(e,t)=>new yv(e,t).patch;var wv=vv;const bv=mn,_v=(e,t)=>{const r=bv(e,t);return r&&r.prerelease.length?r.prerelease:null};var Ev=_v;const Yc=ct,Sv=(e,t,r)=>new Yc(e,r).compare(new Yc(t,r));var It=Sv;const Rv=It,Mv=(e,t,r)=>Rv(t,e,r);var Cv=Mv;const Iv=It,xv=(e,t)=>Iv(e,t,!0);var Av=xv;const Qc=ct,kv=(e,t,r)=>{const n=new Qc(e,r),i=new Qc(t,r);return n.compare(i)||n.compareBuild(i)};var pa=kv;const Tv=pa,Bv=(e,t)=>e.sort((r,n)=>Tv(r,n,t));var Nv=Bv;const Pv=pa,Lv=(e,t)=>e.sort((r,n)=>Pv(n,r,t));var Ov=Lv;const $v=It,Fv=(e,t,r)=>$v(e,t,r)>0;var ws=Fv;const Dv=It,jv=(e,t,r)=>Dv(e,t,r)<0;var ga=jv;const Uv=It,Hv=(e,t,r)=>Uv(e,t,r)===0;var Th=Hv;const Wv=It,Vv=(e,t,r)=>Wv(e,t,r)!==0;var Bh=Vv;const qv=It,zv=(e,t,r)=>qv(e,t,r)>=0;var ma=zv;const Gv=It,Jv=(e,t,r)=>Gv(e,t,r)<=0;var ya=Jv;const Zv=Th,Kv=Bh,Yv=ws,Qv=ma,Xv=ga,ew=ya,tw=(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 Zv(e,r,n);case"!=":return Kv(e,r,n);case">":return Yv(e,r,n);case">=":return Qv(e,r,n);case"<":return Xv(e,r,n);case"<=":return ew(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Nh=tw;const rw=ct,nw=mn,{safeRe:gi,t:mi}=Xn,iw=(e,t)=>{if(e instanceof rw)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?gi[mi.COERCEFULL]:gi[mi.COERCE]);else{const f=t.includePrerelease?gi[mi.COERCERTLFULL]:gi[mi.COERCERTL];let g;for(;(g=f.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||g.index+g[0].length!==r.index+r[0].length)&&(r=g),f.lastIndex=g.index+g[1].length+g[2].length;f.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",o=t.includePrerelease&&r[6]?`+${r[6]}`:"";return nw(`${n}.${i}.${s}${c}${o}`,t)};var sw=iw;class ow{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 aw=ow,go,Xc;function xt(){if(Xc)return go;Xc=1;const e=/\s+/g;class t{constructor(d,y){if(y=i(y),d instanceof t)return d.loose===!!y.loose&&d.includePrerelease===!!y.includePrerelease?d:new t(d.raw,y);if(d instanceof s)return this.raw=d.value,this.set=[[d]],this.formatted=void 0,this;if(this.options=y,this.loose=!!y.loose,this.includePrerelease=!!y.includePrerelease,this.raw=d.trim().replace(e," "),this.set=this.raw.split("||").map(w=>this.parseRange(w.trim())).filter(w=>w.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const w=this.set[0];if(this.set=this.set.filter(S=>!O(S[0])),this.set.length===0)this.set=[w];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&H(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let d=0;d<this.set.length;d++){d>0&&(this.formatted+="||");const y=this.set[d];for(let w=0;w<y.length;w++)w>0&&(this.formatted+=" "),this.formatted+=y[w].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(d){const w=((this.options.includePrerelease&&k)|(this.options.loose&&j))+":"+d,S=n.get(w);if(S)return S;const I=this.options.loose,B=I?f[g.HYPHENRANGELOOSE]:f[g.HYPHENRANGE];d=d.replace(B,pe(this.options.includePrerelease)),c("hyphen replace",d),d=d.replace(f[g.COMPARATORTRIM],p),c("comparator trim",d),d=d.replace(f[g.TILDETRIM],v),c("tilde trim",d),d=d.replace(f[g.CARETTRIM],b),c("caret trim",d);let _=d.split(" ").map(J=>P(J,this.options)).join(" ").split(/\s+/).map(J=>oe(J,this.options));I&&(_=_.filter(J=>(c("loose invalid filter",J,this.options),!!J.match(f[g.COMPARATORLOOSE])))),c("range list",_);const u=new Map,R=_.map(J=>new s(J,this.options));for(const J of R){if(O(J))return[J];u.set(J.value,J)}u.size>1&&u.has("")&&u.delete("");const K=[...u.values()];return n.set(w,K),K}intersects(d,y){if(!(d instanceof t))throw new TypeError("a Range is required");return this.set.some(w=>A(w,y)&&d.set.some(S=>A(S,y)&&w.every(I=>S.every(B=>I.intersects(B,y)))))}test(d){if(!d)return!1;if(typeof d=="string")try{d=new o(d,this.options)}catch{return!1}for(let y=0;y<this.set.length;y++)if(x(this.set[y],d,this.options))return!0;return!1}}go=t;const r=aw,n=new r,i=da,s=bs(),c=vs,o=ct,{safeRe:f,t:g,comparatorTrimReplace:p,tildeTrimReplace:v,caretTrimReplace:b}=Xn,{FLAG_INCLUDE_PRERELEASE:k,FLAG_LOOSE:j}=ys,O=a=>a.value==="<0.0.0-0",H=a=>a.value==="",A=(a,d)=>{let y=!0;const w=a.slice();let S=w.pop();for(;y&&w.length;)y=w.every(I=>S.intersects(I,d)),S=w.pop();return y},P=(a,d)=>(a=a.replace(f[g.BUILD],""),c("comp",a,d),a=z(a,d),c("caret",a),a=V(a,d),c("tildes",a),a=Q(a,d),c("xrange",a),a=de(a,d),c("stars",a),a),$=a=>!a||a.toLowerCase()==="x"||a==="*",V=(a,d)=>a.trim().split(/\s+/).map(y=>D(y,d)).join(" "),D=(a,d)=>{const y=d.loose?f[g.TILDELOOSE]:f[g.TILDE];return a.replace(y,(w,S,I,B,_)=>{c("tilde",a,w,S,I,B,_);let u;return $(S)?u="":$(I)?u=`>=${S}.0.0 <${+S+1}.0.0-0`:$(B)?u=`>=${S}.${I}.0 <${S}.${+I+1}.0-0`:_?(c("replaceTilde pr",_),u=`>=${S}.${I}.${B}-${_} <${S}.${+I+1}.0-0`):u=`>=${S}.${I}.${B} <${S}.${+I+1}.0-0`,c("tilde return",u),u})},z=(a,d)=>a.trim().split(/\s+/).map(y=>te(y,d)).join(" "),te=(a,d)=>{c("caret",a,d);const y=d.loose?f[g.CARETLOOSE]:f[g.CARET],w=d.includePrerelease?"-0":"";return a.replace(y,(S,I,B,_,u)=>{c("caret",a,S,I,B,_,u);let R;return $(I)?R="":$(B)?R=`>=${I}.0.0${w} <${+I+1}.0.0-0`:$(_)?I==="0"?R=`>=${I}.${B}.0${w} <${I}.${+B+1}.0-0`:R=`>=${I}.${B}.0${w} <${+I+1}.0.0-0`:u?(c("replaceCaret pr",u),I==="0"?B==="0"?R=`>=${I}.${B}.${_}-${u} <${I}.${B}.${+_+1}-0`:R=`>=${I}.${B}.${_}-${u} <${I}.${+B+1}.0-0`:R=`>=${I}.${B}.${_}-${u} <${+I+1}.0.0-0`):(c("no pr"),I==="0"?B==="0"?R=`>=${I}.${B}.${_}${w} <${I}.${B}.${+_+1}-0`:R=`>=${I}.${B}.${_}${w} <${I}.${+B+1}.0-0`:R=`>=${I}.${B}.${_} <${+I+1}.0.0-0`),c("caret return",R),R})},Q=(a,d)=>(c("replaceXRanges",a,d),a.split(/\s+/).map(y=>Y(y,d)).join(" ")),Y=(a,d)=>{a=a.trim();const y=d.loose?f[g.XRANGELOOSE]:f[g.XRANGE];return a.replace(y,(w,S,I,B,_,u)=>{c("xRange",a,w,S,I,B,_,u);const R=$(I),K=R||$(B),J=K||$(_),T=J;return S==="="&&T&&(S=""),u=d.includePrerelease?"-0":"",R?S===">"||S==="<"?w="<0.0.0-0":w="*":S&&T?(K&&(B=0),_=0,S===">"?(S=">=",K?(I=+I+1,B=0,_=0):(B=+B+1,_=0)):S==="<="&&(S="<",K?I=+I+1:B=+B+1),S==="<"&&(u="-0"),w=`${S+I}.${B}.${_}${u}`):K?w=`>=${I}.0.0${u} <${+I+1}.0.0-0`:J&&(w=`>=${I}.${B}.0${u} <${I}.${+B+1}.0-0`),c("xRange return",w),w})},de=(a,d)=>(c("replaceStars",a,d),a.trim().replace(f[g.STAR],"")),oe=(a,d)=>(c("replaceGTE0",a,d),a.trim().replace(f[d.includePrerelease?g.GTE0PRE:g.GTE0],"")),pe=a=>(d,y,w,S,I,B,_,u,R,K,J,T)=>($(w)?y="":$(S)?y=`>=${w}.0.0${a?"-0":""}`:$(I)?y=`>=${w}.${S}.0${a?"-0":""}`:B?y=`>=${y}`:y=`>=${y}${a?"-0":""}`,$(R)?u="":$(K)?u=`<${+R+1}.0.0-0`:$(J)?u=`<${R}.${+K+1}.0-0`:T?u=`<=${R}.${K}.${J}-${T}`:a?u=`<${R}.${K}.${+J+1}-0`:u=`<=${u}`,`${y} ${u}`.trim()),x=(a,d,y)=>{for(let w=0;w<a.length;w++)if(!a[w].test(d))return!1;if(d.prerelease.length&&!y.includePrerelease){for(let w=0;w<a.length;w++)if(c(a[w].semver),a[w].semver!==s.ANY&&a[w].semver.prerelease.length>0){const S=a[w].semver;if(S.major===d.major&&S.minor===d.minor&&S.patch===d.patch)return!0}return!1}return!0};return go}var mo,el;function bs(){if(el)return mo;el=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,v){if(v=r(v),p instanceof t){if(p.loose===!!v.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),c("comparator",p,v),this.options=v,this.loose=!!v.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(p){const v=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],b=p.match(v);if(!b)throw new TypeError(`Invalid comparator: ${p}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new o(b[2],this.options.loose):this.semver=e}toString(){return this.value}test(p){if(c("Comparator.test",p,this.options.loose),this.semver===e||p===e)return!0;if(typeof p=="string")try{p=new o(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,v){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f(p.value,v).test(this.value):p.operator===""?p.value===""?!0:new f(this.value,v).test(p.semver):(v=r(v),v.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!v.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,v)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,v)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}mo=t;const r=da,{safeRe:n,t:i}=Xn,s=Nh,c=vs,o=ct,f=xt();return mo}const cw=xt(),lw=(e,t,r)=>{try{t=new cw(t,r)}catch{return!1}return t.test(e)};var _s=lw;const uw=xt(),hw=(e,t)=>new uw(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var fw=hw;const dw=ct,pw=xt(),gw=(e,t,r)=>{let n=null,i=null,s=null;try{s=new pw(t,r)}catch{return null}return e.forEach(c=>{s.test(c)&&(!n||i.compare(c)===-1)&&(n=c,i=new dw(n,r))}),n};var mw=gw;const yw=ct,vw=xt(),ww=(e,t,r)=>{let n=null,i=null,s=null;try{s=new vw(t,r)}catch{return null}return e.forEach(c=>{s.test(c)&&(!n||i.compare(c)===1)&&(n=c,i=new yw(n,r))}),n};var bw=ww;const yo=ct,_w=xt(),tl=ws,Ew=(e,t)=>{e=new _w(e,t);let r=new yo("0.0.0");if(e.test(r)||(r=new yo("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(c=>{const o=new yo(c.semver.version);switch(c.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||tl(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||tl(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Sw=Ew;const Rw=xt(),Mw=(e,t)=>{try{return new Rw(e,t).range||"*"}catch{return null}};var Cw=Mw;const Iw=ct,Ph=bs(),{ANY:xw}=Ph,Aw=xt(),kw=_s,rl=ws,nl=ga,Tw=ya,Bw=ma,Nw=(e,t,r,n)=>{e=new Iw(e,n),t=new Aw(t,n);let i,s,c,o,f;switch(r){case">":i=rl,s=Tw,c=nl,o=">",f=">=";break;case"<":i=nl,s=Bw,c=rl,o="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kw(e,t,n))return!1;for(let g=0;g<t.set.length;++g){const p=t.set[g];let v=null,b=null;if(p.forEach(k=>{k.semver===xw&&(k=new Ph(">=0.0.0")),v=v||k,b=b||k,i(k.semver,v.semver,n)?v=k:c(k.semver,b.semver,n)&&(b=k)}),v.operator===o||v.operator===f||(!b.operator||b.operator===o)&&s(e,b.semver))return!1;if(b.operator===f&&c(e,b.semver))return!1}return!0};var va=Nw;const Pw=va,Lw=(e,t,r)=>Pw(e,t,">",r);var Ow=Lw;const $w=va,Fw=(e,t,r)=>$w(e,t,"<",r);var Dw=Fw;const il=xt(),jw=(e,t,r)=>(e=new il(e,r),t=new il(t,r),e.intersects(t,r));var Uw=jw;const Hw=_s,Ww=It;var Vw=(e,t,r)=>{const n=[];let i=null,s=null;const c=e.sort((p,v)=>Ww(p,v,r));for(const p of c)Hw(p,t,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const o=[];for(const[p,v]of n)p===v?o.push(p):!v&&p===c[0]?o.push("*"):v?p===c[0]?o.push(`<=${v}`):o.push(`${p} - ${v}`):o.push(`>=${p}`);const f=o.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return f.length<g.length?f:t};const sl=xt(),wa=bs(),{ANY:vo}=wa,vn=_s,ba=It,qw=(e,t,r={})=>{if(e===t)return!0;e=new sl(e,r),t=new sl(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const c=Gw(i,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},zw=[new wa(">=0.0.0-0")],ol=[new wa(">=0.0.0")],Gw=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vo){if(t.length===1&&t[0].semver===vo)return!0;r.includePrerelease?e=zw:e=ol}if(t.length===1&&t[0].semver===vo){if(r.includePrerelease)return!0;t=ol}const n=new Set;let i,s;for(const k of e)k.operator===">"||k.operator===">="?i=al(i,k,r):k.operator==="<"||k.operator==="<="?s=cl(s,k,r):n.add(k.semver);if(n.size>1)return null;let c;if(i&&s){if(c=ba(i.semver,s.semver,r),c>0)return null;if(c===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const k of n){if(i&&!vn(k,String(i),r)||s&&!vn(k,String(s),r))return null;for(const j of t)if(!vn(k,String(j),r))return!1;return!0}let o,f,g,p,v=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;v&&v.prerelease.length===1&&s.operator==="<"&&v.prerelease[0]===0&&(v=!1);for(const k of t){if(p=p||k.operator===">"||k.operator===">=",g=g||k.operator==="<"||k.operator==="<=",i){if(b&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===b.major&&k.semver.minor===b.minor&&k.semver.patch===b.patch&&(b=!1),k.operator===">"||k.operator===">="){if(o=al(i,k,r),o===k&&o!==i)return!1}else if(i.operator===">="&&!vn(i.semver,String(k),r))return!1}if(s){if(v&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===v.major&&k.semver.minor===v.minor&&k.semver.patch===v.patch&&(v=!1),k.operator==="<"||k.operator==="<="){if(f=cl(s,k,r),f===k&&f!==s)return!1}else if(s.operator==="<="&&!vn(s.semver,String(k),r))return!1}if(!k.operator&&(s||i)&&c!==0)return!1}return!(i&&g&&!s&&c!==0||s&&p&&!i&&c!==0||b||v)},al=(e,t,r)=>{if(!e)return t;const n=ba(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},cl=(e,t,r)=>{if(!e)return t;const n=ba(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Jw=qw;const wo=Xn,ll=ys,Zw=ct,ul=kh,Kw=mn,Yw=nv,Qw=ov,Xw=cv,eb=uv,tb=dv,rb=mv,nb=wv,ib=Ev,sb=It,ob=Cv,ab=Av,cb=pa,lb=Nv,ub=Ov,hb=ws,fb=ga,db=Th,pb=Bh,gb=ma,mb=ya,yb=Nh,vb=sw,wb=bs(),bb=xt(),_b=_s,Eb=fw,Sb=mw,Rb=bw,Mb=Sw,Cb=Cw,Ib=va,xb=Ow,Ab=Dw,kb=Uw,Tb=Vw,Bb=Jw;var Nb={parse:Kw,valid:Yw,clean:Qw,inc:Xw,diff:eb,major:tb,minor:rb,patch:nb,prerelease:ib,compare:sb,rcompare:ob,compareLoose:ab,compareBuild:cb,sort:lb,rsort:ub,gt:hb,lt:fb,eq:db,neq:pb,gte:gb,lte:mb,cmp:yb,coerce:vb,Comparator:wb,Range:bb,satisfies:_b,toComparators:Eb,maxSatisfying:Sb,minSatisfying:Rb,minVersion:Mb,validRange:Cb,outside:Ib,gtr:xb,ltr:Ab,intersects:kb,simplifyRange:Tb,subset:Bb,SemVer:Zw,re:wo.re,src:wo.src,tokens:wo.t,SEMVER_SPEC_VERSION:ll.SEMVER_SPEC_VERSION,RELEASE_TYPES:ll.RELEASE_TYPES,compareIdentifiers:ul.compareIdentifiers,rcompareIdentifiers:ul.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=Nb,r=Cr,n=it;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",v=>(0,t.valid)(v)===null?`Expected SemVer version, got "${v}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",v=>(0,t.validRange)(v)===null?`Expected SemVer range, got "${v}"`:!0);function i(v){return(0,r.is)(v,e.VersionStruct)}e.isValidSemVerVersion=i;function s(v){return(0,r.is)(v,e.VersionRangeStruct)}e.isValidSemVerRange=s;function c(v){(0,n.assertStruct)(v,e.VersionStruct)}e.assertIsSemVerVersion=c;function o(v){(0,n.assertStruct)(v,e.VersionRangeStruct)}e.assertIsSemVerRange=o;function f(v,b){return(0,t.gt)(v,b)}e.gtVersion=f;function g(v,b){return(0,t.gtr)(v,b)}e.gtRange=g;function p(v,b){return(0,t.satisfies)(v,b,{includePrerelease:!0})}e.satisfiesVersionRange=p})(Ih);(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,o)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(it,e),r(Yn,e),r(we,e),r(gs,e),r($t,e),r(sn,e),r(bh,e),r(Qn,e),r(_h,e),r(Eh,e),r(on,e),r(Sh,e),r(Ft,e),r(Rh,e),r(Mh,e),r(Ch,e),r(Ih,e)})(th);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=th;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(eh);var Lh=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ds,"__esModule",{value:!0});ds.PollingBlockTracker=void 0;const Pb=Lh(ia),Lb=Lh(um),Ob=Gn,hl=eh,fl=(0,hl.createModuleLogger)(hl.projectLogger,"polling-block-tracker"),$b=(0,Pb.default)(),Fb=1e3;class Db extends Ob.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*Fb,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=dl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
8
- ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=dl(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:$b(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),fl("Making request",t);const r=await(0,Lb.default)(n=>this._provider.sendAsync(t,n))();if(fl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
9
- ${r.error.message}`);return r.result}}ds.PollingBlockTracker=Db;function dl(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Es={},jb=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Es,"__esModule",{value:!0});Es.SubscribeBlockTracker=void 0;const Ub=jb(ia),Hb=Gn,Wb=(0,Ub.default)();class Vb extends Hb.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:Wb(),method:t,params:r,jsonrpc:"2.0"},(s,c)=>{s?i(s):n(c.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)}}Es.SubscribeBlockTracker=Vb;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(ds,e),r(Es,e)})(Xu);var _a={},Ss={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.getUniqueId=void 0;const Oh=4294967295;let bo=Math.floor(Math.random()*Oh);function qb(){return bo=(bo+1)%Oh,bo}ei.getUniqueId=qb;Object.defineProperty(Ss,"__esModule",{value:!0});Ss.createIdRemapMiddleware=void 0;const zb=ei;function Gb(){return(e,t,r,n)=>{const i=e.id,s=zb.getUniqueId();e.id=s,t.id=s,r(c=>{e.id=i,t.id=i,c()})}}Ss.createIdRemapMiddleware=Gb;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.createAsyncMiddleware=void 0;function Jb(e){return async(t,r,n,i)=>{let s;const c=new Promise(p=>{s=p});let o=null,f=!1;const g=async()=>{f=!0,n(p=>{o=p,s()}),await c};try{await e(t,r,g),f?(await c,o(null)):i(null)}catch(p){o?o(p):i(p)}}}Rs.createAsyncMiddleware=Jb;var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.createScaffoldMiddleware=void 0;function Zb(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())}}Ms.createScaffoldMiddleware=Zb;var ti={},Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});const Kb=br;function pl(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Yb(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Qb=class extends Kb.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 c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const o=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw o.context=c,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")pl(s,this,r);else{const c=s.length,o=Yb(s);for(let f=0;f<c;f+=1)pl(o[f],this,r)}return!0}};Ea.default=Qb;var $h={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.EthereumProviderError=Jt.EthereumRpcError=void 0;const Xb=tf;class Fh 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 Xb.default(this.serialize(),r2,2)}}Jt.EthereumRpcError=Fh;class e2 extends Fh{constructor(t,r,n){if(!t2(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Jt.EthereumProviderError=e2;function t2(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function r2(e,t){if(t!=="[Circular]")return t}var Sa={},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=Jt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:c(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function c(b,k=i){if(Number.isInteger(b)){const j=b.toString();if(v(t.errorValues,j))return t.errorValues[j].message;if(g(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=c;function o(b){if(!Number.isInteger(b))return!1;const k=b.toString();return!!(t.errorValues[k]||g(b))}e.isValidCode=o;function f(b,{fallbackError:k=s,shouldIncludeStack:j=!1}={}){var O,H;if(!k||!Number.isInteger(k.code)||typeof k.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof r.EthereumRpcError)return b.serialize();const A={};if(b&&typeof b=="object"&&!Array.isArray(b)&&v(b,"code")&&o(b.code)){const $=b;A.code=$.code,$.message&&typeof $.message=="string"?(A.message=$.message,v($,"data")&&(A.data=$.data)):(A.message=c(A.code),A.data={originalError:p(b)})}else{A.code=k.code;const $=(O=b)===null||O===void 0?void 0:O.message;A.message=$&&typeof $=="string"?$:k.message,A.data={originalError:p(b)}}const P=(H=b)===null||H===void 0?void 0:H.stack;return j&&b&&P&&typeof P=="string"&&(A.stack=P),A}e.serializeError=f;function g(b){return b>=-32099&&b<=-32e3}function p(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function v(b,k){return Object.prototype.hasOwnProperty.call(b,k)}})(Sa);var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.ethErrors=void 0;const Ra=Jt,Dh=Sa,st=Zt;Cs.ethErrors={rpc:{parse:e=>mt(st.errorCodes.rpc.parse,e),invalidRequest:e=>mt(st.errorCodes.rpc.invalidRequest,e),invalidParams:e=>mt(st.errorCodes.rpc.invalidParams,e),methodNotFound:e=>mt(st.errorCodes.rpc.methodNotFound,e),internal:e=>mt(st.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 mt(t,e)},invalidInput:e=>mt(st.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>mt(st.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>mt(st.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>mt(st.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>mt(st.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>mt(st.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>wn(st.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>wn(st.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>wn(st.errorCodes.provider.unsupportedMethod,e),disconnected:e=>wn(st.errorCodes.provider.disconnected,e),chainDisconnected:e=>wn(st.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 Ra.EthereumProviderError(t,r,n)}}};function mt(e,t){const[r,n]=jh(t);return new Ra.EthereumRpcError(e,r||Dh.getMessageFromCode(e),n)}function wn(e,t){const[r,n]=jh(t);return new Ra.EthereumProviderError(e,r||Dh.getMessageFromCode(e),n)}function jh(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=Jt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Sa;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Cs;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}})})($h);var n2=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ti,"__esModule",{value:!0});ti.JsonRpcEngine=void 0;const i2=n2(Ea),yt=$h;class Dt extends i2.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,c,o]=await Dt._runAllMiddleware(t,r,this._middleware);return c?(await Dt._runReturnHandlers(o),i(s)):n(async f=>{try{await Dt._runReturnHandlers(o)}catch(g){return f(g)}return f()})}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 c=new yt.EthereumRpcError(yt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(c,{id:void 0,jsonrpc:"2.0",error:c})}if(typeof t.method!="string"){const c=new yt.EthereumRpcError(yt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(c,{id:t.id,jsonrpc:"2.0",error:c})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(c){s=c}return s&&(delete i.result,i.error||(i.error=yt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Dt._runAllMiddleware(t,r,this._middleware);if(Dt._checkForCompletion(t,r,i),await Dt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,c=!1;for(const o of n)if([s,c]=await Dt._runMiddleware(t,r,o,i),c)break;return[s,c,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const c=f=>{const g=f||r.error;g&&(r.error=yt.serializeError(g)),s([g,!0])},o=f=>{r.error?c(r.error):(f&&(typeof f!="function"&&c(new yt.EthereumRpcError(yt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof f}" for request:
6
+ */(function(e){const t=Wi,r=zo,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const m=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(m,l),m.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function c(m){if(m>i)throw new RangeError('The value "'+m+'" is invalid for option "size"');const l=new Uint8Array(m);return Object.setPrototypeOf(l,o.prototype),l}function o(m,l,h){if(typeof m=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(m)}return f(m,l,h)}o.poolSize=8192;function f(m,l,h){if(typeof m=="string")return b(m,l);if(ArrayBuffer.isView(m))return j(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(Ze(m,ArrayBuffer)||m&&Ze(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ze(m,SharedArrayBuffer)||m&&Ze(m.buffer,SharedArrayBuffer)))return O(m,l,h);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const E=m.valueOf&&m.valueOf();if(E!=null&&E!==m)return o.from(E,l,h);const N=H(m);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return o.from(m[Symbol.toPrimitive]("string"),l,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}o.from=function(m,l,h){return f(m,l,h)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function g(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function p(m,l,h){return g(m),m<=0?c(m):l!==void 0?typeof h=="string"?c(m).fill(l,h):c(m).fill(l):c(m)}o.alloc=function(m,l,h){return p(m,l,h)};function v(m){return g(m),c(m<0?0:A(m)|0)}o.allocUnsafe=function(m){return v(m)},o.allocUnsafeSlow=function(m){return v(m)};function b(m,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const h=$(m,l)|0;let E=c(h);const N=E.write(m,l);return N!==h&&(E=E.slice(0,N)),E}function k(m){const l=m.length<0?0:A(m.length)|0,h=c(l);for(let E=0;E<l;E+=1)h[E]=m[E]&255;return h}function j(m){if(Ze(m,Uint8Array)){const l=new Uint8Array(m);return O(l.buffer,l.byteOffset,l.byteLength)}return k(m)}function O(m,l,h){if(l<0||m.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<l+(h||0))throw new RangeError('"length" is outside of buffer bounds');let E;return l===void 0&&h===void 0?E=new Uint8Array(m):h===void 0?E=new Uint8Array(m,l):E=new Uint8Array(m,l,h),Object.setPrototypeOf(E,o.prototype),E}function H(m){if(o.isBuffer(m)){const l=A(m.length)|0,h=c(l);return h.length===0||m.copy(h,0,0,l),h}if(m.length!==void 0)return typeof m.length!="number"||_e(m.length)?c(0):k(m);if(m.type==="Buffer"&&Array.isArray(m.data))return k(m.data)}function A(m){if(m>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return m|0}function P(m){return+m!=m&&(m=0),o.alloc(+m)}o.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==o.prototype},o.compare=function(l,h){if(Ze(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),Ze(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),!o.isBuffer(l)||!o.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===h)return 0;let E=l.length,N=h.length;for(let F=0,U=Math.min(E,N);F<U;++F)if(l[F]!==h[F]){E=l[F],N=h[F];break}return E<N?-1:N<E?1:0},o.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(l,h){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return o.alloc(0);let E;if(h===void 0)for(h=0,E=0;E<l.length;++E)h+=l[E].length;const N=o.allocUnsafe(h);let F=0;for(E=0;E<l.length;++E){let U=l[E];if(Ze(U,Uint8Array))F+U.length>N.length?(o.isBuffer(U)||(U=o.from(U)),U.copy(N,F)):Uint8Array.prototype.set.call(N,U,F);else if(o.isBuffer(U))U.copy(N,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=U.length}return N};function $(m,l){if(o.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||Ze(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);const h=m.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&h===0)return 0;let N=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return re(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Re(m).length;default:if(N)return E?-1:re(m).length;l=(""+l).toLowerCase(),N=!0}}o.byteLength=$;function V(m,l,h){let E=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,l>>>=0,h<=l))return"";for(m||(m="utf8");;)switch(m){case"hex":return I(this,l,h);case"utf8":case"utf-8":return a(this,l,h);case"ascii":return w(this,l,h);case"latin1":case"binary":return S(this,l,h);case"base64":return x(this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,l,h);default:if(E)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function D(m,l,h){const E=m[l];m[l]=m[h],m[h]=E}o.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<l;h+=2)D(this,h,h+1);return this},o.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<l;h+=4)D(this,h,h+3),D(this,h+1,h+2);return this},o.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<l;h+=8)D(this,h,h+7),D(this,h+1,h+6),D(this,h+2,h+5),D(this,h+3,h+4);return this},o.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?a(this,0,l):V.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(l){if(!o.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:o.compare(this,l)===0},o.prototype.inspect=function(){let l="";const h=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(l+=" ... "),"<Buffer "+l+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(l,h,E,N,F){if(Ze(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(h===void 0&&(h=0),E===void 0&&(E=l?l.length:0),N===void 0&&(N=0),F===void 0&&(F=this.length),h<0||E>l.length||N<0||F>this.length)throw new RangeError("out of range index");if(N>=F&&h>=E)return 0;if(N>=F)return-1;if(h>=E)return 1;if(h>>>=0,E>>>=0,N>>>=0,F>>>=0,this===l)return 0;let U=F-N,he=E-h;const ae=Math.min(U,he),ie=this.slice(N,F),Me=l.slice(h,E);for(let ne=0;ne<ae;++ne)if(ie[ne]!==Me[ne]){U=ie[ne],he=Me[ne];break}return U<he?-1:he<U?1:0};function z(m,l,h,E,N){if(m.length===0)return-1;if(typeof h=="string"?(E=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,_e(h)&&(h=N?0:m.length-1),h<0&&(h=m.length+h),h>=m.length){if(N)return-1;h=m.length-1}else if(h<0)if(N)h=0;else return-1;if(typeof l=="string"&&(l=o.from(l,E)),o.isBuffer(l))return l.length===0?-1:te(m,l,h,E,N);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(m,l,h):Uint8Array.prototype.lastIndexOf.call(m,l,h):te(m,[l],h,E,N);throw new TypeError("val must be string, number or Buffer")}function te(m,l,h,E,N){let F=1,U=m.length,he=l.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(m.length<2||l.length<2)return-1;F=2,U/=2,he/=2,h/=2}function ae(Me,ne){return F===1?Me[ne]:Me.readUInt16BE(ne*F)}let ie;if(N){let Me=-1;for(ie=h;ie<U;ie++)if(ae(m,ie)===ae(l,Me===-1?0:ie-Me)){if(Me===-1&&(Me=ie),ie-Me+1===he)return Me*F}else Me!==-1&&(ie-=ie-Me),Me=-1}else for(h+he>U&&(h=U-he),ie=h;ie>=0;ie--){let Me=!0;for(let ne=0;ne<he;ne++)if(ae(m,ie+ne)!==ae(l,ne)){Me=!1;break}if(Me)return ie}return-1}o.prototype.includes=function(l,h,E){return this.indexOf(l,h,E)!==-1},o.prototype.indexOf=function(l,h,E){return z(this,l,h,E,!0)},o.prototype.lastIndexOf=function(l,h,E){return z(this,l,h,E,!1)};function Q(m,l,h,E){h=Number(h)||0;const N=m.length-h;E?(E=Number(E),E>N&&(E=N)):E=N;const F=l.length;E>F/2&&(E=F/2);let U;for(U=0;U<E;++U){const he=parseInt(l.substr(U*2,2),16);if(_e(he))return U;m[h+U]=he}return U}function Y(m,l,h,E){return Se(re(l,m.length-h),m,h,E)}function de(m,l,h,E){return Se(be(l),m,h,E)}function oe(m,l,h,E){return Se(Re(l),m,h,E)}function pe(m,l,h,E){return Se(pt(l,m.length-h),m,h,E)}o.prototype.write=function(l,h,E,N){if(h===void 0)N="utf8",E=this.length,h=0;else if(E===void 0&&typeof h=="string")N=h,E=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(E)?(E=E>>>0,N===void 0&&(N="utf8")):(N=E,E=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const F=this.length-h;if((E===void 0||E>F)&&(E=F),l.length>0&&(E<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");let U=!1;for(;;)switch(N){case"hex":return Q(this,l,h,E);case"utf8":case"utf-8":return Y(this,l,h,E);case"ascii":case"latin1":case"binary":return de(this,l,h,E);case"base64":return oe(this,l,h,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,l,h,E);default:if(U)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),U=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(m,l,h){return l===0&&h===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(l,h))}function a(m,l,h){h=Math.min(m.length,h);const E=[];let N=l;for(;N<h;){const F=m[N];let U=null,he=F>239?4:F>223?3:F>191?2:1;if(N+he<=h){let ae,ie,Me,ne;switch(he){case 1:F<128&&(U=F);break;case 2:ae=m[N+1],(ae&192)===128&&(ne=(F&31)<<6|ae&63,ne>127&&(U=ne));break;case 3:ae=m[N+1],ie=m[N+2],(ae&192)===128&&(ie&192)===128&&(ne=(F&15)<<12|(ae&63)<<6|ie&63,ne>2047&&(ne<55296||ne>57343)&&(U=ne));break;case 4:ae=m[N+1],ie=m[N+2],Me=m[N+3],(ae&192)===128&&(ie&192)===128&&(Me&192)===128&&(ne=(F&15)<<18|(ae&63)<<12|(ie&63)<<6|Me&63,ne>65535&&ne<1114112&&(U=ne))}}U===null?(U=65533,he=1):U>65535&&(U-=65536,E.push(U>>>10&1023|55296),U=56320|U&1023),E.push(U),N+=he}return y(E)}const d=4096;function y(m){const l=m.length;if(l<=d)return String.fromCharCode.apply(String,m);let h="",E=0;for(;E<l;)h+=String.fromCharCode.apply(String,m.slice(E,E+=d));return h}function w(m,l,h){let E="";h=Math.min(m.length,h);for(let N=l;N<h;++N)E+=String.fromCharCode(m[N]&127);return E}function S(m,l,h){let E="";h=Math.min(m.length,h);for(let N=l;N<h;++N)E+=String.fromCharCode(m[N]);return E}function I(m,l,h){const E=m.length;(!l||l<0)&&(l=0),(!h||h<0||h>E)&&(h=E);let N="";for(let F=l;F<h;++F)N+=Ce[m[F]];return N}function B(m,l,h){const E=m.slice(l,h);let N="";for(let F=0;F<E.length-1;F+=2)N+=String.fromCharCode(E[F]+E[F+1]*256);return N}o.prototype.slice=function(l,h){const E=this.length;l=~~l,h=h===void 0?E:~~h,l<0?(l+=E,l<0&&(l=0)):l>E&&(l=E),h<0?(h+=E,h<0&&(h=0)):h>E&&(h=E),h<l&&(h=l);const N=this.subarray(l,h);return Object.setPrototypeOf(N,o.prototype),N};function _(m,l,h){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+l>h)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=this[l],F=1,U=0;for(;++U<h&&(F*=256);)N+=this[l+U]*F;return N},o.prototype.readUintBE=o.prototype.readUIntBE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=this[l+--h],F=1;for(;h>0&&(F*=256);)N+=this[l+--h]*F;return N},o.prototype.readUint8=o.prototype.readUInt8=function(l,h){return l=l>>>0,h||_(l,1,this.length),this[l]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(l,h){return l=l>>>0,h||_(l,2,this.length),this[l]|this[l+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(l,h){return l=l>>>0,h||_(l,2,this.length),this[l]<<8|this[l+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(l,h){return l=l>>>0,h||_(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(l,h){return l=l>>>0,h||_(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},o.prototype.readBigUInt64LE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,F=this[++l]+this[++l]*2**8+this[++l]*2**16+E*2**24;return BigInt(N)+(BigInt(F)<<BigInt(32))}),o.prototype.readBigUInt64BE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=h*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],F=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+E;return(BigInt(N)<<BigInt(32))+BigInt(F)}),o.prototype.readIntLE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=this[l],F=1,U=0;for(;++U<h&&(F*=256);)N+=this[l+U]*F;return F*=128,N>=F&&(N-=Math.pow(2,8*h)),N},o.prototype.readIntBE=function(l,h,E){l=l>>>0,h=h>>>0,E||_(l,h,this.length);let N=h,F=1,U=this[l+--N];for(;N>0&&(F*=256);)U+=this[l+--N]*F;return F*=128,U>=F&&(U-=Math.pow(2,8*h)),U},o.prototype.readInt8=function(l,h){return l=l>>>0,h||_(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},o.prototype.readInt16LE=function(l,h){l=l>>>0,h||_(l,2,this.length);const E=this[l]|this[l+1]<<8;return E&32768?E|4294901760:E},o.prototype.readInt16BE=function(l,h){l=l>>>0,h||_(l,2,this.length);const E=this[l+1]|this[l]<<8;return E&32768?E|4294901760:E},o.prototype.readInt32LE=function(l,h){return l=l>>>0,h||_(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},o.prototype.readInt32BE=function(l,h){return l=l>>>0,h||_(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},o.prototype.readBigInt64LE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(E<<24);return(BigInt(N)<<BigInt(32))+BigInt(h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),o.prototype.readBigInt64BE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],E=this[l+7];(h===void 0||E===void 0)&&G(l,this.length-8);const N=(h<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(N)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+E)}),o.prototype.readFloatLE=function(l,h){return l=l>>>0,h||_(l,4,this.length),r.read(this,l,!0,23,4)},o.prototype.readFloatBE=function(l,h){return l=l>>>0,h||_(l,4,this.length),r.read(this,l,!1,23,4)},o.prototype.readDoubleLE=function(l,h){return l=l>>>0,h||_(l,8,this.length),r.read(this,l,!0,52,8)},o.prototype.readDoubleBE=function(l,h){return l=l>>>0,h||_(l,8,this.length),r.read(this,l,!1,52,8)};function u(m,l,h,E,N,F){if(!o.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>N||l<F)throw new RangeError('"value" argument is out of bounds');if(h+E>m.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(l,h,E,N){if(l=+l,h=h>>>0,E=E>>>0,!N){const he=Math.pow(2,8*E)-1;u(this,l,h,E,he,0)}let F=1,U=0;for(this[h]=l&255;++U<E&&(F*=256);)this[h+U]=l/F&255;return h+E},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(l,h,E,N){if(l=+l,h=h>>>0,E=E>>>0,!N){const he=Math.pow(2,8*E)-1;u(this,l,h,E,he,0)}let F=E-1,U=1;for(this[h+F]=l&255;--F>=0&&(U*=256);)this[h+F]=l/U&255;return h+E},o.prototype.writeUint8=o.prototype.writeUInt8=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,1,255,0),this[h]=l&255,h+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,65535,0),this[h]=l&255,this[h+1]=l>>>8,h+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,65535,0),this[h]=l>>>8,this[h+1]=l&255,h+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,4294967295,0),this[h+3]=l>>>24,this[h+2]=l>>>16,this[h+1]=l>>>8,this[h]=l&255,h+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,4294967295,0),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4};function R(m,l,h,E,N){M(l,E,N,m,h,7);let F=Number(l&BigInt(4294967295));m[h++]=F,F=F>>8,m[h++]=F,F=F>>8,m[h++]=F,F=F>>8,m[h++]=F;let U=Number(l>>BigInt(32)&BigInt(4294967295));return m[h++]=U,U=U>>8,m[h++]=U,U=U>>8,m[h++]=U,U=U>>8,m[h++]=U,h}function K(m,l,h,E,N){M(l,E,N,m,h,7);let F=Number(l&BigInt(4294967295));m[h+7]=F,F=F>>8,m[h+6]=F,F=F>>8,m[h+5]=F,F=F>>8,m[h+4]=F;let U=Number(l>>BigInt(32)&BigInt(4294967295));return m[h+3]=U,U=U>>8,m[h+2]=U,U=U>>8,m[h+1]=U,U=U>>8,m[h]=U,h+8}o.prototype.writeBigUInt64LE=Qe(function(l,h=0){return R(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Qe(function(l,h=0){return K(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(l,h,E,N){if(l=+l,h=h>>>0,!N){const ae=Math.pow(2,8*E-1);u(this,l,h,E,ae-1,-ae)}let F=0,U=1,he=0;for(this[h]=l&255;++F<E&&(U*=256);)l<0&&he===0&&this[h+F-1]!==0&&(he=1),this[h+F]=(l/U>>0)-he&255;return h+E},o.prototype.writeIntBE=function(l,h,E,N){if(l=+l,h=h>>>0,!N){const ae=Math.pow(2,8*E-1);u(this,l,h,E,ae-1,-ae)}let F=E-1,U=1,he=0;for(this[h+F]=l&255;--F>=0&&(U*=256);)l<0&&he===0&&this[h+F+1]!==0&&(he=1),this[h+F]=(l/U>>0)-he&255;return h+E},o.prototype.writeInt8=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,1,127,-128),l<0&&(l=255+l+1),this[h]=l&255,h+1},o.prototype.writeInt16LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,32767,-32768),this[h]=l&255,this[h+1]=l>>>8,h+2},o.prototype.writeInt16BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,2,32767,-32768),this[h]=l>>>8,this[h+1]=l&255,h+2},o.prototype.writeInt32LE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,2147483647,-2147483648),this[h]=l&255,this[h+1]=l>>>8,this[h+2]=l>>>16,this[h+3]=l>>>24,h+4},o.prototype.writeInt32BE=function(l,h,E){return l=+l,h=h>>>0,E||u(this,l,h,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4},o.prototype.writeBigInt64LE=Qe(function(l,h=0){return R(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Qe(function(l,h=0){return K(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(m,l,h,E,N,F){if(h+E>m.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function T(m,l,h,E,N){return l=+l,h=h>>>0,N||J(m,l,h,4),r.write(m,l,h,E,23,4),h+4}o.prototype.writeFloatLE=function(l,h,E){return T(this,l,h,!0,E)},o.prototype.writeFloatBE=function(l,h,E){return T(this,l,h,!1,E)};function L(m,l,h,E,N){return l=+l,h=h>>>0,N||J(m,l,h,8),r.write(m,l,h,E,52,8),h+8}o.prototype.writeDoubleLE=function(l,h,E){return L(this,l,h,!0,E)},o.prototype.writeDoubleBE=function(l,h,E){return L(this,l,h,!1,E)},o.prototype.copy=function(l,h,E,N){if(!o.isBuffer(l))throw new TypeError("argument should be a Buffer");if(E||(E=0),!N&&N!==0&&(N=this.length),h>=l.length&&(h=l.length),h||(h=0),N>0&&N<E&&(N=E),N===E||l.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),l.length-h<N-E&&(N=l.length-h+E);const F=N-E;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,E,N):Uint8Array.prototype.set.call(l,this.subarray(E,N),h),F},o.prototype.fill=function(l,h,E,N){if(typeof l=="string"){if(typeof h=="string"?(N=h,h=0,E=this.length):typeof E=="string"&&(N=E,E=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!o.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(l.length===1){const U=l.charCodeAt(0);(N==="utf8"&&U<128||N==="latin1")&&(l=U)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(h<0||this.length<h||this.length<E)throw new RangeError("Out of range index");if(E<=h)return this;h=h>>>0,E=E===void 0?this.length:E>>>0,l||(l=0);let F;if(typeof l=="number")for(F=h;F<E;++F)this[F]=l;else{const U=o.isBuffer(l)?l:o.from(l,N),he=U.length;if(he===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(F=0;F<E-h;++F)this[F+h]=U[F%he]}return this};const W={};function Z(m,l,h){W[m]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(N){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:N,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(m,l){return`The "${m}" argument must be of type number. Received type ${typeof l}`},TypeError),Z("ERR_OUT_OF_RANGE",function(m,l,h){let E=`The value of "${m}" is out of range.`,N=h;return Number.isInteger(h)&&Math.abs(h)>2**32?N=le(String(h)):typeof h=="bigint"&&(N=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(N=le(N)),N+="n"),E+=` It must be ${l}. Received ${N}`,E},RangeError);function le(m){let l="",h=m.length;const E=m[0]==="-"?1:0;for(;h>=E+4;h-=3)l=`_${m.slice(h-3,h)}${l}`;return`${m.slice(0,h)}${l}`}function C(m,l,h){q(l,"offset"),(m[l]===void 0||m[l+h]===void 0)&&G(l,m.length-(h+1))}function M(m,l,h,E,N,F){if(m>h||m<l){const U=typeof l=="bigint"?"n":"";let he;throw l===0||l===BigInt(0)?he=`>= 0${U} and < 2${U} ** ${(F+1)*8}${U}`:he=`>= -(2${U} ** ${(F+1)*8-1}${U}) and < 2 ** ${(F+1)*8-1}${U}`,new W.ERR_OUT_OF_RANGE("value",he,m)}C(E,N,F)}function q(m,l){if(typeof m!="number")throw new W.ERR_INVALID_ARG_TYPE(l,"number",m)}function G(m,l,h){throw Math.floor(m)!==m?(q(m,h),new W.ERR_OUT_OF_RANGE("offset","an integer",m)):l<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,m)}const se=/[^+/0-9A-Za-z-_]/g;function ue(m){if(m=m.split("=")[0],m=m.trim().replace(se,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function re(m,l){l=l||1/0;let h;const E=m.length;let N=null;const F=[];for(let U=0;U<E;++U){if(h=m.charCodeAt(U),h>55295&&h<57344){if(!N){if(h>56319){(l-=3)>-1&&F.push(239,191,189);continue}else if(U+1===E){(l-=3)>-1&&F.push(239,191,189);continue}N=h;continue}if(h<56320){(l-=3)>-1&&F.push(239,191,189),N=h;continue}h=(N-55296<<10|h-56320)+65536}else N&&(l-=3)>-1&&F.push(239,191,189);if(N=null,h<128){if((l-=1)<0)break;F.push(h)}else if(h<2048){if((l-=2)<0)break;F.push(h>>6|192,h&63|128)}else if(h<65536){if((l-=3)<0)break;F.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((l-=4)<0)break;F.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return F}function be(m){const l=[];for(let h=0;h<m.length;++h)l.push(m.charCodeAt(h)&255);return l}function pt(m,l){let h,E,N;const F=[];for(let U=0;U<m.length&&!((l-=2)<0);++U)h=m.charCodeAt(U),E=h>>8,N=h%256,F.push(N),F.push(E);return F}function Re(m){return t.toByteArray(ue(m))}function Se(m,l,h,E){let N;for(N=0;N<E&&!(N+h>=l.length||N>=m.length);++N)l[N+h]=m[N];return N}function Ze(m,l){return m instanceof l||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===l.name}function _e(m){return m!==m}const Ce=function(){const m="0123456789abcdef",l=new Array(256);for(let h=0;h<16;++h){const E=h*16;for(let N=0;N<16;++N)l[E+N]=m[h]+m[N]}return l}();function Qe(m){return typeof BigInt>"u"?Ee:m}function Ee(){throw new Error("BigInt not supported")}})(Fn);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Fn,n=r.Buffer;function i(c,o){for(var f in c)o[f]=c[f]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(c,o,f){return n(c,o,f)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(c,o,f){if(typeof c=="number")throw new TypeError("Argument must not be a number");return n(c,o,f)},s.alloc=function(c,o,f){if(typeof c!="number")throw new TypeError("Argument must be a number");var g=n(c);return o!==void 0?typeof f=="string"?g.fill(o,f):g.fill(o):g.fill(0),g},s.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n(c)},s.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(No,No.exports);var Wt=No.exports,Js,Qa;function D0(){if(Qa)return Js;Qa=1;var e=Xd;return Js=function(r){return!!e(r)},Js}var j0=In,U0=zl,H0=U0("TypedArray.prototype.buffer",!0),W0=D0(),V0=H0||function(t){if(!W0(t))throw new j0("Not a Typed Array");return t.buffer},Ct=Wt.Buffer,q0=Md,z0=V0,G0=ArrayBuffer.isView||function(t){try{return z0(t),!0}catch{return!1}},J0=typeof Uint8Array<"u",hu=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Z0=hu&&(Ct.prototype instanceof Uint8Array||Ct.TYPED_ARRAY_SUPPORT),K0=function(t,r){if(Ct.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Ct.from(t):t;if(typeof t=="string")return Ct.from(t,r);if(hu&&G0(t)){if(t.byteLength===0)return Ct.alloc(0);if(Z0){var n=Ct.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=Ct.from(i);if(s.length===t.byteLength)return s}if(J0&&t instanceof Uint8Array)return Ct.from(t);var c=q0(t);if(c)for(var o=0;o<t.length;o+=1){var f=t[o];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(c||Ct.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Ct.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Y0=Wt.Buffer,Q0=K0;function Vi(e,t){this._block=Y0.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Vi.prototype.update=function(e,t){e=Q0(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,c=0;c<i;){for(var o=s%n,f=Math.min(i-c,n-o),g=0;g<f;g++)r[o+g]=e[c+g];s+=f,c+=f,s%n===0&&this._update(r)}return this._len+=i,this};Vi.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};Vi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var fn=Vi,X0=Mt,fu=fn,ep=Wt.Buffer,tp=[1518500249,1859775393,-1894007588,-899497514],rp=new Array(80);function Dn(){this.init(),this._w=rp,fu.call(this,64,56)}X0(Dn,fu);Dn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function np(e){return e<<5|e>>>27}function ip(e){return e<<30|e>>>2}function sp(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,c=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=t[o-3]^t[o-8]^t[o-14]^t[o-16];for(var f=0;f<80;++f){var g=~~(f/20),p=np(r)+sp(g,n,i,s)+c+t[f]+tp[g]|0;c=s,s=i,i=ip(n),n=r,r=p}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=c+this._e|0};Dn.prototype._hash=function(){var e=ep.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 op=Dn,ap=Mt,du=fn,cp=Wt.Buffer,lp=[1518500249,1859775393,-1894007588,-899497514],up=new Array(80);function jn(){this.init(),this._w=up,du.call(this,64,56)}ap(jn,du);jn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function hp(e){return e<<1|e>>>31}function fp(e){return e<<5|e>>>27}function dp(e){return e<<30|e>>>2}function pp(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}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,c=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=hp(t[o-3]^t[o-8]^t[o-14]^t[o-16]);for(var f=0;f<80;++f){var g=~~(f/20),p=fp(r)+pp(g,n,i,s)+c+t[f]+lp[g]|0;c=s,s=i,i=dp(n),n=r,r=p}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=c+this._e|0};jn.prototype._hash=function(){var e=cp.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 gp=jn,mp=Mt,pu=fn,yp=Wt.Buffer,vp=[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],wp=new Array(64);function Un(){this.init(),this._w=wp,pu.call(this,64,56)}mp(Un,pu);Un.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 bp(e,t,r){return r^e&(t^r)}function _p(e,t,r){return e&t|r&(e|t)}function Ep(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Sp(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Rp(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Cp(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Un.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,c=this._e|0,o=this._f|0,f=this._g|0,g=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=Cp(t[p-2])+t[p-7]+Rp(t[p-15])+t[p-16]|0;for(var v=0;v<64;++v){var b=g+Sp(c)+bp(c,o,f)+vp[v]+t[v]|0,k=Ep(r)+_p(r,n,i)|0;g=f,f=o,o=c,c=s+b|0,s=i,i=n,n=r,r=b+k|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=c+this._e|0,this._f=o+this._f|0,this._g=f+this._g|0,this._h=g+this._h|0};Un.prototype._hash=function(){var e=yp.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 gu=Un,Mp=Mt,Ip=gu,xp=fn,Ap=Wt.Buffer,kp=new Array(64);function qi(){this.init(),this._w=kp,xp.call(this,64,56)}Mp(qi,Ip);qi.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};qi.prototype._hash=function(){var e=Ap.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 Tp=qi,Bp=Mt,mu=fn,Np=Wt.Buffer,Xa=[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],Pp=new Array(160);function Hn(){this.init(),this._w=Pp,mu.call(this,128,112)}Bp(Hn,mu);Hn.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 ec(e,t,r){return r^e&(t^r)}function tc(e,t,r){return e&t|r&(e|t)}function rc(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function nc(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Lp(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Op(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function $p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Fp(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Xe(e,t){return e>>>0<t>>>0?1:0}Hn.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,c=this._eh|0,o=this._fh|0,f=this._gh|0,g=this._hh|0,p=this._al|0,v=this._bl|0,b=this._cl|0,k=this._dl|0,j=this._el|0,O=this._fl|0,H=this._gl|0,A=this._hl|0,P=0;P<32;P+=2)t[P]=e.readInt32BE(P*4),t[P+1]=e.readInt32BE(P*4+4);for(;P<160;P+=2){var $=t[P-30],V=t[P-15*2+1],D=Lp($,V),z=Op(V,$);$=t[P-2*2],V=t[P-2*2+1];var te=$p($,V),Q=Fp(V,$),Y=t[P-7*2],de=t[P-7*2+1],oe=t[P-16*2],pe=t[P-16*2+1],x=z+de|0,a=D+Y+Xe(x,z)|0;x=x+Q|0,a=a+te+Xe(x,Q)|0,x=x+pe|0,a=a+oe+Xe(x,pe)|0,t[P]=a,t[P+1]=x}for(var d=0;d<160;d+=2){a=t[d],x=t[d+1];var y=tc(r,n,i),w=tc(p,v,b),S=rc(r,p),I=rc(p,r),B=nc(c,j),_=nc(j,c),u=Xa[d],R=Xa[d+1],K=ec(c,o,f),J=ec(j,O,H),T=A+_|0,L=g+B+Xe(T,A)|0;T=T+J|0,L=L+K+Xe(T,J)|0,T=T+R|0,L=L+u+Xe(T,R)|0,T=T+x|0,L=L+a+Xe(T,x)|0;var W=I+w|0,Z=S+y+Xe(W,I)|0;g=f,A=H,f=o,H=O,o=c,O=j,j=k+T|0,c=s+L+Xe(j,k)|0,s=i,k=b,i=n,b=v,n=r,v=p,p=T+W|0,r=L+Z+Xe(p,T)|0}this._al=this._al+p|0,this._bl=this._bl+v|0,this._cl=this._cl+b|0,this._dl=this._dl+k|0,this._el=this._el+j|0,this._fl=this._fl+O|0,this._gl=this._gl+H|0,this._hl=this._hl+A|0,this._ah=this._ah+r+Xe(this._al,p)|0,this._bh=this._bh+n+Xe(this._bl,v)|0,this._ch=this._ch+i+Xe(this._cl,b)|0,this._dh=this._dh+s+Xe(this._dl,k)|0,this._eh=this._eh+c+Xe(this._el,j)|0,this._fh=this._fh+o+Xe(this._fl,O)|0,this._gh=this._gh+f+Xe(this._gl,H)|0,this._hh=this._hh+g+Xe(this._hl,A)|0};Hn.prototype._hash=function(){var e=Np.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 yu=Hn,Dp=Mt,jp=yu,Up=fn,Hp=Wt.Buffer,Wp=new Array(160);function zi(){this.init(),this._w=Wp,Up.call(this,128,112)}Dp(zi,jp);zi.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};zi.prototype._hash=function(){var e=Hp.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 Vp=zi;(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=op,e.exports.sha1=gp,e.exports.sha224=Tp,e.exports.sha256=gu,e.exports.sha384=Vp,e.exports.sha512=yu})(lu);var qp=lu.exports;Object.defineProperty(hn,"__esModule",{value:!0});hn.Session=void 0;const ic=qp,sc=X,oc="session:id",ac="session:secret",cc="session:linked";class Go{constructor(t,r,n,i){this._storage=t,this._id=r||(0,sc.randomBytesHex)(16),this._secret=n||(0,sc.randomBytesHex)(32),this._key=new ic.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(oc),n=t.getItem(cc),i=t.getItem(ac);return r&&i?new Go(t,r,i,n==="1"):null}static hash(t){return new ic.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(oc,this._id),this._storage.setItem(ac,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(cc,this._linked?"1":"0")}}hn.Session=Go;var Gi={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Cipher=void 0;const si=X;class zp{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,si.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),o=16,f=c.slice(c.byteLength-o),g=c.slice(0,c.byteLength-o),p=new Uint8Array(f),v=new Uint8Array(g),b=new Uint8Array([...n,...p,...v]);return(0,si.uint8ArrayToHex)(b)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,si.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,si.hexStringToUint8Array)(t),o=c.slice(0,12),f=c.slice(12,28),g=c.slice(28),p=new Uint8Array([...g,...f]),v={name:"AES-GCM",iv:new Uint8Array(o)};try{const b=await window.crypto.subtle.decrypt(v,s,p),k=new TextDecoder;n(k.decode(b))}catch(b){i(b)}})()})}}Ji.Cipher=zp;var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.WalletLinkHTTP=void 0;class Gp{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(c=>c.event==="Web3Response").map(c=>({type:"Event",sessionId:this.sessionId,eventId:c.id,event:c.event,data:c.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Zi.WalletLinkHTTP=Gp;var en={};Object.defineProperty(en,"__esModule",{value:!0});en.WalletLinkWebSocket=en.ConnectionState=void 0;var zr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(zr||(en.ConnectionState=zr={}));class Jp{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,zr.CONNECTING),i.onclose=s=>{var c;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,zr.DISCONNECTED)},i.onopen=s=>{var c;t(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,zr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},i.onmessage=s=>{var c,o;if(s.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(s.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,f)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,zr.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=Jp;Object.defineProperty(Gi,"__esModule",{value:!0});Gi.WalletLinkConnection=void 0;const Dr=Ke,Zp=Ji,At=un,lc=wt,jr=hn,Kp=Zi,oi=en,uc=1e4,Yp=6e4;class Qp{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Dr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=o=>{if(!o)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",g=>o.JsonRpcUrl&&this.handleChainUpdated(g,o.JsonRpcUrl)]]).forEach((g,p)=>{const v=o[p];v!==void 0&&g(v)})},this.handleDestroyed=o=>{var f,g;o==="1"&&((f=this.listener)===null||f===void 0||f.resetAndReload(),(g=this.diagnostic)===null||g===void 0||g.log(At.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:jr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async o=>{var f,g;try{const p=await this.cipher.decrypt(o);(f=this.listener)===null||f===void 0||f.accountUpdated(p)}catch{(g=this.diagnostic)===null||g===void 0||g.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(o,f)=>{var g,p;try{const v=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.metadataUpdated(o,v)}catch{(p=this.diagnostic)===null||p===void 0||p.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:o})}},this.handleWalletUsernameUpdated=async o=>{this.handleMetadataUpdated(lc.WALLET_USER_NAME_KEY,o)},this.handleAppVersionUpdated=async o=>{this.handleMetadataUpdated(lc.APP_VERSION_KEY,o)},this.handleChainUpdated=async(o,f)=>{var g,p;try{const v=await this.cipher.decrypt(o),b=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.chainUpdated(v,b)}catch{(p=this.diagnostic)===null||p===void 0||p.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Zp.Cipher(t.secret),this.diagnostic=i,this.listener=n;const c=new oi.WalletLinkWebSocket(`${r}/rpc`,s);c.setConnectionStateListener(async o=>{var f;(f=this.diagnostic)===null||f===void 0||f.log(At.EVENTS.CONNECTED_STATE_CHANGE,{state:o,sessionIdHash:jr.Session.hash(t.id)});let g=!1;switch(o){case oi.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(v=>setTimeout(v,5e3)),this.destroyed||c.connect().catch(()=>{p()})};p()}break;case oi.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),g=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},uc),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case oi.ConnectionState.CONNECTING:break}this.connected!==g&&(this.connected=g)}),c.setIncomingDataListener(o=>{var f,g,p;switch(o.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const v=o.type==="IsLinkedOK"?o.linked:void 0;(f=this.diagnostic)===null||f===void 0||f.log(At.EVENTS.LINKED,{sessionIdHash:jr.Session.hash(t.id),linked:v,type:o.type,onlineGuests:o.onlineGuests}),this.linked=v||o.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(g=this.diagnostic)===null||g===void 0||g.log(At.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:jr.Session.hash(t.id),metadata_keys:o&&o.metadata?Object.keys(o.metadata):void 0}),this.handleSessionMetadataUpdated(o.metadata);break}case"Event":{this.handleIncomingEvent(o);break}}o.id!==void 0&&((p=this.requestResolutions.get(o.id))===null||p===void 0||p(o))}),this.ws=c,this.http=new Kp.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(At.EVENTS.STARTED_CONNECTING,{sessionIdHash:jr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(At.EVENTS.DISCONNECTED,{sessionIdHash:jr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(At.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const c=await this.makeRequest(s);if(c.type==="Fail")throw new Error(c.error||"failed to publish event");return c.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>uc*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Yp){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,c)=>{i=window.setTimeout(()=>{c(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,c=>{clearTimeout(i),s(c),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Dr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Gi.WalletLinkConnection=Qp;var Wn={},Vn={},Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.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 Xp=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.injectCssReset=void 0;const e1=Xp(Jo);function t1(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(e1.default)),document.documentElement.appendChild(e)}Vn.injectCssReset=t1;var Ki={};const lt=an(Gh);var Yi={};function vu(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=vu(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function hc(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=vu(e))&&(n&&(n+=" "),n+=t);return n}const r1=Object.freeze(Object.defineProperty({__proto__:null,clsx:hc,default:hc},Symbol.toStringTag,{value:"Module"})),qn=an(r1),Qi=an(Jh);var tn={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.CloseIcon=void 0;const fc=lt;function n1(e){return(0,fc.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,fc.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"}))}Xi.CloseIcon=n1;var es={};Object.defineProperty(es,"__esModule",{value:!0});es.CoinbaseWalletRound=void 0;const ai=lt;function i1(e){return(0,ai.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ai.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,ai.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,ai.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"}))}es.CoinbaseWalletRound=i1;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.QRCodeIcon=void 0;const yn=lt;function s1(e){return(0,yn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,yn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,yn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,yn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,yn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}ts.QRCodeIcon=s1;var rs={};function wu(e){this.mode=ft.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}wu.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Ot(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Ot.prototype={addData:function(e){var t=new wu(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Ot.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=qe.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var c=s*i,o=0;o<this.modules[s].length;o++){var f=o*i,g=this.modules[s][o];g&&(n.beginFill(0,100),n.moveTo(f,c),n.lineTo(f+i,c),n.lineTo(f+i,c+i),n.lineTo(f,c+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=qe.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var c=-2;c<=2;c++)s==-2||s==2||c==-2||c==2||s==0&&c==0?this.modules[n+s][i+c]=!0:this.modules[n+s][i+c]=!1}},setupTypeNumber:function(e){for(var t=qe.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=qe.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,c=this.moduleCount-1;c>0;c-=2)for(c==6&&c--;;){for(var o=0;o<2;o++)if(this.modules[n][c-o]==null){var f=!1;s<e.length&&(f=(e[s]>>>i&1)==1);var g=qe.getMask(t,n,c-o);g&&(f=!f),this.modules[n][c-o]=f,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Ot.PAD0=236;Ot.PAD1=17;Ot.createData=function(e,t,r){for(var n=Lt.getRSBlocks(e,t),i=new bu,s=0;s<r.length;s++){var c=r[s];i.put(c.mode,4),i.put(c.getLength(),qe.getLengthInBits(c.mode,e)),c.write(i)}for(var o=0,s=0;s<n.length;s++)o+=n[s].dataCount;if(i.getLengthInBits()>o*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(Ot.PAD0,8),i.getLengthInBits()>=o*8));)i.put(Ot.PAD1,8);return Ot.createBytes(i,n)};Ot.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),c=new Array(t.length),o=0;o<t.length;o++){var f=t[o].dataCount,g=t[o].totalCount-f;n=Math.max(n,f),i=Math.max(i,g),s[o]=new Array(f);for(var p=0;p<s[o].length;p++)s[o][p]=255&e.buffer[p+r];r+=f;var v=qe.getErrorCorrectPolynomial(g),b=new Zr(s[o],v.getLength()-1),k=b.mod(v);c[o]=new Array(v.getLength()-1);for(var p=0;p<c[o].length;p++){var j=p+k.getLength()-c[o].length;c[o][p]=j>=0?k.get(j):0}}for(var O=0,p=0;p<t.length;p++)O+=t[p].totalCount;for(var H=new Array(O),A=0,p=0;p<n;p++)for(var o=0;o<t.length;o++)p<s[o].length&&(H[A++]=s[o][p]);for(var p=0;p<i;p++)for(var o=0;o<t.length;o++)p<c[o].length&&(H[A++]=c[o][p]);return H};var ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Gt={L:1,M:0,Q:3,H:2},Vt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},qe={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15)>=0;)t^=qe.G15<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15);return(e<<10|t)^qe.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18)>=0;)t^=qe.G18<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return qe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Vt.PATTERN000:return(t+r)%2==0;case Vt.PATTERN001:return t%2==0;case Vt.PATTERN010:return r%3==0;case Vt.PATTERN011:return(t+r)%3==0;case Vt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Vt.PATTERN101:return t*r%2+t*r%3==0;case Vt.PATTERN110:return(t*r%2+t*r%3)%2==0;case Vt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Zr([1],0),r=0;r<e;r++)t=t.multiply(new Zr([1,tt.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ft.MODE_NUMBER:return 10;case ft.MODE_ALPHA_NUM:return 9;case ft.MODE_8BIT_BYTE:return 8;case ft.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ft.MODE_NUMBER:return 12;case ft.MODE_ALPHA_NUM:return 11;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ft.MODE_NUMBER:return 14;case ft.MODE_ALPHA_NUM:return 13;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,c=e.isDark(n,i),o=-1;o<=1;o++)if(!(n+o<0||t<=n+o))for(var f=-1;f<=1;f++)i+f<0||t<=i+f||o==0&&f==0||c==e.isDark(n+o,i+f)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var g=0;e.isDark(n,i)&&g++,e.isDark(n+1,i)&&g++,e.isDark(n,i+1)&&g++,e.isDark(n+1,i+1)&&g++,(g==0||g==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 p=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&p++;var v=Math.abs(100*p/t/t-50)/5;return r+=v*10,r}},tt={glog:function(e){if(e<1)throw new Error("glog("+e+")");return tt.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return tt.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var nt=0;nt<8;nt++)tt.EXP_TABLE[nt]=1<<nt;for(var nt=8;nt<256;nt++)tt.EXP_TABLE[nt]=tt.EXP_TABLE[nt-4]^tt.EXP_TABLE[nt-5]^tt.EXP_TABLE[nt-6]^tt.EXP_TABLE[nt-8];for(var nt=0;nt<255;nt++)tt.LOG_TABLE[tt.EXP_TABLE[nt]]=nt;function Zr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Zr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=tt.gexp(tt.glog(this.get(r))+tt.glog(e.get(n)));return new Zr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=tt.glog(this.get(0))-tt.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]^=tt.gexp(tt.glog(e.get(n))+t);return new Zr(r,0).mod(e)}};function Lt(e,t){this.totalCount=e,this.dataCount=t}Lt.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Lt.getRSBlocks=function(e,t){var r=Lt.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var c=r[s*3+0],o=r[s*3+1],f=r[s*3+2],g=0;g<c;g++)i.push(new Lt(o,f));return i};Lt.getRsBlockTable=function(e,t){switch(t){case Gt.L:return Lt.RS_BLOCK_TABLE[(e-1)*4+0];case Gt.M:return Lt.RS_BLOCK_TABLE[(e-1)*4+1];case Gt.Q:return Lt.RS_BLOCK_TABLE[(e-1)*4+2];case Gt.H:return Lt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function bu(){this.buffer=[],this.length=0}bu.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 _u(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(f){switch(f){case"L":return Gt.L;case"M":return Gt.M;case"Q":return Gt.Q;case"H":return Gt.H;default:throw new Error("Unknwon error correction level: "+f)}}function n(f,g){for(var p=i(f),v=1,b=0,k=0,j=Zs.length;k<=j;k++){var O=Zs[k];if(!O)throw new Error("Content too long: expected "+b+" but got "+p);switch(g){case"L":b=O[0];break;case"M":b=O[1];break;case"Q":b=O[2];break;case"H":b=O[3];break;default:throw new Error("Unknwon error correction level: "+g)}if(p<=b)break;v++}if(v>Zs.length)throw new Error("Content too long");return v}function i(f){var g=encodeURI(f).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return g.length+(g.length!=f?3:0)}var s=this.options.content,c=n(s,this.options.ecl),o=r(this.options.ecl);this.qrcode=new Ot(c,o),this.qrcode.addData(s),this.qrcode.make()}_u.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r
7
+ `:"",c=t.width,o=t.height,f=r.length,g=c/(f+2*t.padding),p=o/(f+2*t.padding),v=typeof t.join<"u"?!!t.join:!1,b=typeof t.swap<"u"?!!t.swap:!1,k=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,j=typeof t.predefined<"u"?!!t.predefined:!1,O=j?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+g+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",H=i+'<rect x="0" y="0" width="'+c+'" height="'+o+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,A="",P="",$=0;$<f;$++)for(var V=0;V<f;V++){var D=r[V][$];if(D){var z=V*g+t.padding*g,te=$*p+t.padding*p;if(b){var Q=z;z=te,te=Q}if(v){var Y=g+z,de=p+te;z=Number.isInteger(z)?Number(z):z.toFixed(2),te=Number.isInteger(te)?Number(te):te.toFixed(2),Y=Number.isInteger(Y)?Number(Y):Y.toFixed(2),de=Number.isInteger(de)?Number(de):de.toFixed(2),P+="M"+z+","+te+" V"+de+" H"+Y+" V"+te+" H"+z+" Z "}else j?A+=i+'<use x="'+z.toString()+'" y="'+te.toString()+'" href="#qrmodule" />'+s:A+=i+'<rect x="'+z.toString()+'" y="'+te.toString()+'" width="'+g+'" height="'+p+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}v&&(A=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+P+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const x=c*this.options.image.width/100,a=o*this.options.image.height/100,d=c/2-x/2,y=o/2-a/2;oe+=`<svg x="${d}" y="${y}" width="${x}" height="${a}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,oe+=this.options.image.svg+s,oe+="</svg>"}var pe="";switch(e.container){case"svg":k&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+c+'" height="'+o+'">'+s,pe+=O+H+A,pe+=oe,pe+="</svg>";break;case"svg-viewbox":k&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+c+" "+o+'">'+s,pe+=O+H+A,pe+=oe,pe+="</svg>";break;case"g":pe+='<g width="'+c+'" height="'+o+'">'+s,pe+=O+H+A,pe+=oe,pe+="</g>";break;default:pe+=(O+H+A+oe).replace(/^\s+/,"");break}return pe};var o1=_u,a1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rs,"__esModule",{value:!0});rs.QRCode=void 0;const c1=lt,dc=Qi,l1=a1(o1),u1=e=>{const[t,r]=(0,dc.useState)("");return(0,dc.useEffect)(()=>{var n,i;const s=new l1.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}),c=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${c}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,c1.h)("img",{src:t,alt:"QR Code"}):null};rs.QRCode=u1;var ns={},Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.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 h1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ns,"__esModule",{value:!0});ns.Spinner=void 0;const ci=lt,f1=h1(Zo),d1=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,ci.h)("div",{class:"-cbwsdk-spinner"},(0,ci.h)("style",null,f1.default),(0,ci.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ci.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ns.Spinner=d1;var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.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 Eu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tn,"__esModule",{value:!0});tn.CoinbaseWalletSteps=tn.ConnectContent=void 0;const wr=Eu(qn),ve=lt,p1=X,g1=ln,m1=Xi,y1=es,v1=ts,w1=rs,b1=ns,_1=Eu(Ko),Ks={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Su},E1=e=>e==="light"?"#FFFFFF":"#0A0B0D";function S1(e){const{theme:t}=e,r=(0,p1.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Ks.steps;return(0,ve.h)("div",{"data-testid":"connect-content",className:(0,wr.default)("-cbwsdk-connect-content",t)},(0,ve.h)("style",null,_1.default),(0,ve.h)("div",{className:"-cbwsdk-connect-content-header"},(0,ve.h)("h2",{className:(0,wr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,ve.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,ve.h)(m1.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ve.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,ve.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,ve.h)(R1,{title:Ks.title,description:Ks.description,theme:t})),(0,ve.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,ve.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,ve.h)(w1.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,ve.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:g1.LIB_VERSION}),(0,ve.h)("input",{type:"hidden",value:r})),(0,ve.h)(n,{theme:t}),!e.isConnected&&(0,ve.h)("div",{"data-testid":"connecting-spinner",className:(0,wr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,ve.h)(b1.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,ve.h)("p",null,"Connecting...")))))}tn.ConnectContent=S1;function R1({title:e,description:t,theme:r}){return(0,ve.h)("div",{className:(0,wr.default)("-cbwsdk-connect-item",r)},(0,ve.h)("div",null,(0,ve.h)(y1.CoinbaseWalletRound,null)),(0,ve.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,ve.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,ve.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Su({theme:e}){return(0,ve.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,ve.h)("li",{className:(0,wr.default)("-cbwsdk-wallet-steps-item",e)},(0,ve.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,ve.h)("li",{className:(0,wr.default)("-cbwsdk-wallet-steps-item",e)},(0,ve.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,ve.h)("span",null,"Tap ",(0,ve.h)("strong",null,"Scan")," "),(0,ve.h)("span",{className:(0,wr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,ve.h)(v1.QRCodeIcon,{fill:E1(e)})))))}tn.CoinbaseWalletSteps=Su;var is={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.ArrowLeftIcon=void 0;const pc=lt;function C1(e){return(0,pc.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,pc.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"}))}ss.ArrowLeftIcon=C1;var os={};Object.defineProperty(os,"__esModule",{value:!0});os.LaptopIcon=void 0;const Ys=lt;function M1(e){return(0,Ys.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ys.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ys.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"}))}os.LaptopIcon=M1;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.SafeIcon=void 0;const gc=lt;function I1(e){return(0,gc.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,gc.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"}))}as.SafeIcon=I1;var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.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 Ru=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(is,"__esModule",{value:!0});is.TryExtensionContent=void 0;const ur=Ru(qn),Je=lt,Qs=Qi,x1=ss,A1=os,k1=as,T1=Ru(Yo);function B1({theme:e}){const[t,r]=(0,Qs.useState)(!1),n=(0,Qs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Qs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Je.h)("div",{class:(0,ur.default)("-cbwsdk-try-extension",e)},(0,Je.h)("style",null,T1.default),(0,Je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Je.h)("h3",{class:(0,ur.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Je.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Je.h)("button",{class:(0,ur.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Je.h)("div",null,!t&&(0,Je.h)(x1.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Je.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Je.h)("span",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Je.h)(A1.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Je.h)("div",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Je.h)("span",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Je.h)(k1.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Je.h)("div",{class:(0,ur.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}is.TryExtensionContent=B1;var Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.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 Cu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConnectDialog=void 0;const Xs=Cu(qn),hr=lt,eo=Qi,N1=tn,P1=is,L1=Cu(Qo),O1=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,eo.useState)(!t),[s,c]=(0,eo.useState)(!t);(0,eo.useEffect)(()=>{const f=[window.setTimeout(()=>{c(!t)},10)];return t?i(!1):f.push(window.setTimeout(()=>{i(!0)},360)),()=>{f.forEach(window.clearTimeout)}},[t]);const o=r?"dark":"light";return(0,hr.h)("div",{class:(0,Xs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,hr.h)("style",null,L1.default),(0,hr.h)("div",{class:(0,Xs.default)("-cbwsdk-connect-dialog-backdrop",o,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,hr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,hr.h)("div",{class:(0,Xs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,hr.h)(N1.ConnectContent,{theme:o,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,hr.h)(P1.TryExtensionContent,{theme:o}))))};Yi.ConnectDialog=O1;Object.defineProperty(Ki,"__esModule",{value:!0});Ki.LinkFlow=void 0;const to=lt,$1=Yi;class F1{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,to.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,to.render)((0,to.h)($1.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)}}Ki.LinkFlow=F1;var Xo={},ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.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=ee&&ee.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(qn),n=lt,i=Qi,s=t(ea),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class f{constructor(b){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=b.darkMode}attach(b){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",b.appendChild(this.root),this.render()}presentItem(b){const k=this.nextItemKey++;return this.items.set(k,b),this.render(),()=>{this.items.delete(k),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([b,k])=>(0,n.h)(e.SnackbarInstance,Object.assign({},k,{key:b}))))),this.root)}}e.Snackbar=f;const g=v=>(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"},v.children));e.SnackbarContainer=g;const p=({autoExpand:v,message:b,menuItems:k})=>{const[j,O]=(0,i.useState)(!0),[H,A]=(0,i.useState)(v??!1);(0,i.useEffect)(()=>{const $=[window.setTimeout(()=>{O(!1)},1),window.setTimeout(()=>{A(!0)},1e4)];return()=>{$.forEach(window.clearTimeout)}});const P=()=>{A(!H)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",j&&"-cbwsdk-snackbar-instance-hidden",H&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:P},(0,n.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},b),(0,n.h)("div",{class:"-gear-container"},!H&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),k&&k.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},k.map(($,V)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",$.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:$.onClick,key:V},(0,n.h)("svg",{width:$.svgWidth,height:$.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":$.defaultFillRule,"clip-rule":$.defaultClipRule,d:$.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",$.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},$.info)))))};e.SnackbarInstance=p})(Xo);Object.defineProperty(Wn,"__esModule",{value:!0});Wn.WalletLinkRelayUI=void 0;const D1=Vn,j1=Ki,U1=Xo;class H1{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new U1.Snackbar({darkMode:t.darkMode}),this.linkFlow=new j1.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,D1.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}}Wn.WalletLinkRelayUI=H1;Object.defineProperty($n,"__esModule",{value:!0});$n.WalletLinkRelay=void 0;const Ur=Bn,W1=Ke,Ve=X,fr=un,mc=wt,qt=hn,V1=Gi,dr=cn,q1=Wn;class jt extends mc.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=c=>{var o;this.isLinked=c;const f=this.storage.getItem(mc.LOCAL_STORAGE_ADDRESSES_KEY);if(c&&(this.session.linked=c),this.isUnlinkedErrorState=!1,f){const g=f.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(g[0]!==""&&!c&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const v=this.getSessionIdHash();(o=this.diagnostic)===null||o===void 0||o.log(fr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:v})}}},this.metadataUpdated=(c,o)=>{this.storage.setItem(c,o)},this.chainUpdated=(c,o)=>{this.chainCallbackParams.chainId===c&&this.chainCallbackParams.jsonRpcUrl===o||(this.chainCallbackParams={chainId:c,jsonRpcUrl:o},this.chainCallback&&this.chainCallback(c,o))},this.accountUpdated=c=>{this.accountsCallback&&this.accountsCallback([c]),jt.accountRequestCallbackIds.size>0&&(Array.from(jt.accountRequestCallbackIds.values()).forEach(o=>{const f={type:"WEB3_RESPONSE",id:o,response:{method:"requestEthereumAccounts",result:[c]}};this.invokeCallback(Object.assign(Object.assign({},f),{id:o}))}),jt.accountRequestCallbackIds.clear())},this.connectedUpdated=c=>{this.ui.setConnected(c)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=qt.Session.load(this.storage)||new qt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new V1.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:c}=this.options,o=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:c,session:t});return i.connect(),{session:t,ui:o,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(fr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=qt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:qt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:c,connection:o}=this.subscribe();this._session=s,this.connection=o,this.ui=c,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(fr.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,Ve.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Ve.hexStringFromBuffer)(t,!0),signature:(0,Ve.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ve.bigIntStringFromBN)(t.weiValue),data:(0,Ve.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Ve.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,Ve.bigIntStringFromBN)(t.weiValue),data:(0,Ve.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Ve.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Ve.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Ve.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Ve.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Ve.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,Ve.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,c),r==null||r()};return{promise:new Promise((c,o)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,f=>{if(r==null||r(),(0,dr.isErrorResponse)(f))return o(new Error(f.errorMessage));c(f)}),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 q1.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=qt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(fr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?qt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(c=>{var o;(o=this.diagnostic)===null||o===void 0||o.log(fr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?qt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:c.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(fr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){jt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),jt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const c=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Ur.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:c,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,Ve.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,c)=>{if(this.relayEventManager.callbacks.set(r,o=>{if(this.ui.hideRequestEthereumAccounts(),(0,dr.isErrorResponse)(o))return c(new Error(o.errorMessage));s(o)}),this.ui.inlineAccountsResponse()){const o=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:f}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:o})}else{const o=Ur.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(o)})}jt.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,Ve.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,c)},s=new Promise((c,o)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,dr.isErrorResponse)(p))return o(new Error(p.errorMessage));c(p)});const f=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:W1.ProviderType.Unselected}})},g=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:g,onCancel:f,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,c){const o={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:c}};let f=null;const g=(0,Ve.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,o.method,b),f==null||f()};this.ui.inlineWatchAsset()||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const v=new Promise((b,k)=>{this.relayEventManager.callbacks.set(g,H=>{if(f==null||f(),(0,dr.isErrorResponse)(H))return k(new Error(H.errorMessage));b(H)});const j=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!1}})},O=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:O,onCancel:j,type:t,address:r,symbol:n,decimals:i,image:s,chainId:c}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,o)});return{cancel:p,promise:v}}addEthereumChain(t,r,n,i,s,c){const o={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:c}};let f=null;const g=(0,Ve.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,o.method,b),f==null||f()};return this.ui.inlineAddEthereumChain(t)||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((b,k)=>{this.relayEventManager.callbacks.set(g,H=>{if(f==null||f(),(0,dr.isErrorResponse)(H))return k(new Error(H.errorMessage));b(H)});const j=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},O=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:H}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:j,onApprove:O,chainId:o.params.chainId,rpcUrls:o.params.rpcUrls,blockExplorerUrls:o.params.blockExplorerUrls,chainName:o.params.chainName,iconUrls:o.params.iconUrls,nativeCurrency:o.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,o)}),cancel:p}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Ve.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,o)};return{promise:new Promise((o,f)=>{this.relayEventManager.callbacks.set(i,v=>{if((0,dr.isErrorResponse)(v)&&v.errorCode)return f(Ur.standardErrors.provider.custom({code:v.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,dr.isErrorResponse)(v))return f(new Error(v.errorMessage));o(v)});const g=v=>{var b;if(v){const k=(b=(0,Ur.getErrorCode)(v))!==null&&b!==void 0?b:Ur.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",v instanceof Error?v:Ur.standardErrors.provider.unsupportedChain(t),k)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:v}}})};this.ui.switchEthereumChain({onCancel:g,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return qt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}$n.WalletLinkRelay=jt;jt.accountRequestCallbackIds=new Set;var zn={},cs={},Mu={};(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,o)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(Xo,e)})(Mu);var ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.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 Iu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.RedirectDialog=void 0;const z1=Iu(qn),Nt=lt,G1=Vn,J1=Mu,Z1=Iu(ta);class K1{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,G1.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Nt.render)(null,this.root),t&&(0,Nt.render)((0,Nt.h)(Y1,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}cs.RedirectDialog=K1;const Y1=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Nt.h)(J1.SnackbarContainer,{darkMode:r},(0,Nt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Nt.h)("style",null,Z1.default),(0,Nt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Nt.h)("div",{class:(0,z1.default)("-cbwsdk-redirect-dialog-box",s)},(0,Nt.h)("p",null,e),(0,Nt.h)("button",{onClick:n},t))))};Object.defineProperty(zn,"__esModule",{value:!0});zn.MobileRelayUI=void 0;const Q1=cs;class X1{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Q1.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}}zn.MobileRelayUI=X1;Object.defineProperty(On,"__esModule",{value:!0});On.MobileRelay=void 0;const eg=X,tg=$n,rg=zn;class ng extends tg.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,eg.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 rg.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}})}}On.MobileRelay=ng;var Po={exports:{}},xu=br.EventEmitter,ro,yc;function ig(){if(yc)return ro;yc=1;function e(j,O){var H=Object.keys(j);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(j);O&&(A=A.filter(function(P){return Object.getOwnPropertyDescriptor(j,P).enumerable})),H.push.apply(H,A)}return H}function t(j){for(var O=1;O<arguments.length;O++){var H=arguments[O]!=null?arguments[O]:{};O%2?e(Object(H),!0).forEach(function(A){r(j,A,H[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(H)):e(Object(H)).forEach(function(A){Object.defineProperty(j,A,Object.getOwnPropertyDescriptor(H,A))})}return j}function r(j,O,H){return O=c(O),O in j?Object.defineProperty(j,O,{value:H,enumerable:!0,configurable:!0,writable:!0}):j[O]=H,j}function n(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function i(j,O){for(var H=0;H<O.length;H++){var A=O[H];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(j,c(A.key),A)}}function s(j,O,H){return O&&i(j.prototype,O),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var O=o(j,"string");return typeof O=="symbol"?O:String(O)}function o(j,O){if(typeof j!="object"||j===null)return j;var H=j[Symbol.toPrimitive];if(H!==void 0){var A=H.call(j,O||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(j)}var f=Fn,g=f.Buffer,p=br,v=p.inspect,b=v&&v.custom||"inspect";function k(j,O,H){g.prototype.copy.call(j,O,H)}return ro=function(){function j(){n(this,j),this.head=null,this.tail=null,this.length=0}return s(j,[{key:"push",value:function(H){var A={data:H,next:null};this.length>0?this.tail.next=A:this.head=A,this.tail=A,++this.length}},{key:"unshift",value:function(H){var A={data:H,next:this.head};this.length===0&&(this.tail=A),this.head=A,++this.length}},{key:"shift",value:function(){if(this.length!==0){var H=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,H}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(H){if(this.length===0)return"";for(var A=this.head,P=""+A.data;A=A.next;)P+=H+A.data;return P}},{key:"concat",value:function(H){if(this.length===0)return g.alloc(0);for(var A=g.allocUnsafe(H>>>0),P=this.head,$=0;P;)k(P.data,A,$),$+=P.data.length,P=P.next;return A}},{key:"consume",value:function(H,A){var P;return H<this.head.data.length?(P=this.head.data.slice(0,H),this.head.data=this.head.data.slice(H)):H===this.head.data.length?P=this.shift():P=A?this._getString(H):this._getBuffer(H),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(H){var A=this.head,P=1,$=A.data;for(H-=$.length;A=A.next;){var V=A.data,D=H>V.length?V.length:H;if(D===V.length?$+=V:$+=V.slice(0,H),H-=D,H===0){D===V.length?(++P,A.next?this.head=A.next:this.head=this.tail=null):(this.head=A,A.data=V.slice(D));break}++P}return this.length-=P,$}},{key:"_getBuffer",value:function(H){var A=g.allocUnsafe(H),P=this.head,$=1;for(P.data.copy(A),H-=P.data.length;P=P.next;){var V=P.data,D=H>V.length?V.length:H;if(V.copy(A,A.length-H,0,D),H-=D,H===0){D===V.length?(++$,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=V.slice(D));break}++$}return this.length-=$,A}},{key:b,value:function(H,A){return v(this,t(t({},A),{},{depth:0,customInspect:!1}))}}]),j}(),ro}function sg(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Lo,this,e)):process.nextTick(Lo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Ci,r):(r._writableState.errorEmitted=!0,process.nextTick(vc,r,s)):process.nextTick(vc,r,s):t?(process.nextTick(Ci,r),t(s)):process.nextTick(Ci,r)}),this)}function vc(e,t){Lo(e,t),Ci(e)}function Ci(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function og(){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 Lo(e,t){e.emit("error",t)}function ag(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Au={destroy:sg,undestroy:og,errorOrDestroy:ag},Rr={};function cg(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ku={};function Et(e,t,r){r||(r=Error);function n(s,c,o){return typeof t=="string"?t:t(s,c,o)}var i=function(s){cg(c,s);function c(o,f,g){return s.call(this,n(o,f,g))||this}return c}(r);i.prototype.name=r.name,i.prototype.code=e,ku[e]=i}function wc(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 lg(e,t,r){return e.substr(0,t.length)===t}function ug(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function hg(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Et("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Et("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&lg(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(ug(e," argument"))i="The ".concat(e," ").concat(n," ").concat(wc(t,"type"));else{var s=hg(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(wc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Et("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Et("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Et("ERR_STREAM_PREMATURE_CLOSE","Premature close");Et("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Et("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Et("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Et("ERR_STREAM_WRITE_AFTER_END","write after end");Et("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Et("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Et("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Rr.codes=ku;var fg=Rr.codes.ERR_INVALID_OPT_VALUE;function dg(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function pg(e,t,r,n){var i=dg(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new fg(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Tu={getHighWaterMark:pg},gg=mg;function mg(e,t){if(no("noDeprecation"))return e;var r=!1;function n(){if(!r){if(no("throwDeprecation"))throw new Error(t);no("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function no(e){try{if(!ee.localStorage)return!1}catch{return!1}var t=ee.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var io,bc;function Bu(){if(bc)return io;bc=1,io=Q;function e(T){var L=this;this.next=null,this.entry=null,this.finish=function(){J(L,T)}}var t;Q.WritableState=z;var r={deprecate:gg},n=xu,i=Fn.Buffer,s=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(T){return i.from(T)}function o(T){return i.isBuffer(T)||T instanceof s}var f=Au,g=Tu,p=g.getHighWaterMark,v=Rr.codes,b=v.ERR_INVALID_ARG_TYPE,k=v.ERR_METHOD_NOT_IMPLEMENTED,j=v.ERR_MULTIPLE_CALLBACK,O=v.ERR_STREAM_CANNOT_PIPE,H=v.ERR_STREAM_DESTROYED,A=v.ERR_STREAM_NULL_VALUES,P=v.ERR_STREAM_WRITE_AFTER_END,$=v.ERR_UNKNOWN_ENCODING,V=f.errorOrDestroy;Mt(Q,n);function D(){}function z(T,L,W){t=t||rn(),T=T||{},typeof W!="boolean"&&(W=L instanceof t),this.objectMode=!!T.objectMode,W&&(this.objectMode=this.objectMode||!!T.writableObjectMode),this.highWaterMark=p(this,T,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Z=T.decodeStrings===!1;this.decodeStrings=!Z,this.defaultEncoding=T.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(le){y(L,le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=T.emitClose!==!1,this.autoDestroy=!!T.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}z.prototype.getBuffer=function(){for(var L=this.bufferedRequest,W=[];L;)W.push(L),L=L.next;return W},function(){try{Object.defineProperty(z.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var te;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(te=Function.prototype[Symbol.hasInstance],Object.defineProperty(Q,Symbol.hasInstance,{value:function(L){return te.call(this,L)?!0:this!==Q?!1:L&&L._writableState instanceof z}})):te=function(L){return L instanceof this};function Q(T){t=t||rn();var L=this instanceof t;if(!L&&!te.call(Q,this))return new Q(T);this._writableState=new z(T,this,L),this.writable=!0,T&&(typeof T.write=="function"&&(this._write=T.write),typeof T.writev=="function"&&(this._writev=T.writev),typeof T.destroy=="function"&&(this._destroy=T.destroy),typeof T.final=="function"&&(this._final=T.final)),n.call(this)}Q.prototype.pipe=function(){V(this,new O)};function Y(T,L){var W=new P;V(T,W),process.nextTick(L,W)}function de(T,L,W,Z){var le;return W===null?le=new A:typeof W!="string"&&!L.objectMode&&(le=new b("chunk",["string","Buffer"],W)),le?(V(T,le),process.nextTick(Z,le),!1):!0}Q.prototype.write=function(T,L,W){var Z=this._writableState,le=!1,C=!Z.objectMode&&o(T);return C&&!i.isBuffer(T)&&(T=c(T)),typeof L=="function"&&(W=L,L=null),C?L="buffer":L||(L=Z.defaultEncoding),typeof W!="function"&&(W=D),Z.ending?Y(this,W):(C||de(this,Z,T,W))&&(Z.pendingcb++,le=pe(this,Z,C,T,L,W)),le},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){var T=this._writableState;T.corked&&(T.corked--,!T.writing&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&I(this,T))},Q.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=L.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((L+"").toLowerCase())>-1))throw new $(L);return this._writableState.defaultEncoding=L,this},Object.defineProperty(Q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(T,L,W){return!T.objectMode&&T.decodeStrings!==!1&&typeof L=="string"&&(L=i.from(L,W)),L}Object.defineProperty(Q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pe(T,L,W,Z,le,C){if(!W){var M=oe(L,Z,le);Z!==M&&(W=!0,le="buffer",Z=M)}var q=L.objectMode?1:Z.length;L.length+=q;var G=L.length<L.highWaterMark;if(G||(L.needDrain=!0),L.writing||L.corked){var se=L.lastBufferedRequest;L.lastBufferedRequest={chunk:Z,encoding:le,isBuf:W,callback:C,next:null},se?se.next=L.lastBufferedRequest:L.bufferedRequest=L.lastBufferedRequest,L.bufferedRequestCount+=1}else x(T,L,!1,q,Z,le,C);return G}function x(T,L,W,Z,le,C,M){L.writelen=Z,L.writecb=M,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new H("write")):W?T._writev(le,L.onwrite):T._write(le,C,L.onwrite),L.sync=!1}function a(T,L,W,Z,le){--L.pendingcb,W?(process.nextTick(le,Z),process.nextTick(R,T,L),T._writableState.errorEmitted=!0,V(T,Z)):(le(Z),T._writableState.errorEmitted=!0,V(T,Z),R(T,L))}function d(T){T.writing=!1,T.writecb=null,T.length-=T.writelen,T.writelen=0}function y(T,L){var W=T._writableState,Z=W.sync,le=W.writecb;if(typeof le!="function")throw new j;if(d(W),L)a(T,W,Z,L,le);else{var C=B(W)||T.destroyed;!C&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&I(T,W),Z?process.nextTick(w,T,W,C,le):w(T,W,C,le)}}function w(T,L,W,Z){W||S(T,L),L.pendingcb--,Z(),R(T,L)}function S(T,L){L.length===0&&L.needDrain&&(L.needDrain=!1,T.emit("drain"))}function I(T,L){L.bufferProcessing=!0;var W=L.bufferedRequest;if(T._writev&&W&&W.next){var Z=L.bufferedRequestCount,le=new Array(Z),C=L.corkedRequestsFree;C.entry=W;for(var M=0,q=!0;W;)le[M]=W,W.isBuf||(q=!1),W=W.next,M+=1;le.allBuffers=q,x(T,L,!0,L.length,le,"",C.finish),L.pendingcb++,L.lastBufferedRequest=null,C.next?(L.corkedRequestsFree=C.next,C.next=null):L.corkedRequestsFree=new e(L),L.bufferedRequestCount=0}else{for(;W;){var G=W.chunk,se=W.encoding,ue=W.callback,re=L.objectMode?1:G.length;if(x(T,L,!1,re,G,se,ue),W=W.next,L.bufferedRequestCount--,L.writing)break}W===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=W,L.bufferProcessing=!1}Q.prototype._write=function(T,L,W){W(new k("_write()"))},Q.prototype._writev=null,Q.prototype.end=function(T,L,W){var Z=this._writableState;return typeof T=="function"?(W=T,T=null,L=null):typeof L=="function"&&(W=L,L=null),T!=null&&this.write(T,L),Z.corked&&(Z.corked=1,this.uncork()),Z.ending||K(this,Z,W),this},Object.defineProperty(Q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function B(T){return T.ending&&T.length===0&&T.bufferedRequest===null&&!T.finished&&!T.writing}function _(T,L){T._final(function(W){L.pendingcb--,W&&V(T,W),L.prefinished=!0,T.emit("prefinish"),R(T,L)})}function u(T,L){!L.prefinished&&!L.finalCalled&&(typeof T._final=="function"&&!L.destroyed?(L.pendingcb++,L.finalCalled=!0,process.nextTick(_,T,L)):(L.prefinished=!0,T.emit("prefinish")))}function R(T,L){var W=B(L);if(W&&(u(T,L),L.pendingcb===0&&(L.finished=!0,T.emit("finish"),L.autoDestroy))){var Z=T._readableState;(!Z||Z.autoDestroy&&Z.endEmitted)&&T.destroy()}return W}function K(T,L,W){L.ending=!0,R(T,L),W&&(L.finished?process.nextTick(W):T.once("finish",W)),L.ended=!0,T.writable=!1}function J(T,L,W){var Z=T.entry;for(T.entry=null;Z;){var le=Z.callback;L.pendingcb--,le(W),Z=Z.next}L.corkedRequestsFree.next=T}return Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(L){this._writableState&&(this._writableState.destroyed=L)}}),Q.prototype.destroy=f.destroy,Q.prototype._undestroy=f.undestroy,Q.prototype._destroy=function(T,L){L(T)},io}var so,_c;function rn(){if(_c)return so;_c=1;var e=Object.keys||function(g){var p=[];for(var v in g)p.push(v);return p};so=c;var t=Pu(),r=Bu();Mt(c,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];c.prototype[s]||(c.prototype[s]=r.prototype[s])}function c(g){if(!(this instanceof c))return new c(g);t.call(this,g),r.call(this,g),this.allowHalfOpen=!0,g&&(g.readable===!1&&(this.readable=!1),g.writable===!1&&(this.writable=!1),g.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",o)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o(){this._writableState.ended||process.nextTick(f,this)}function f(g){g.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=p,this._writableState.destroyed=p)}}),so}var oo={},Ec;function Sc(){if(Ec)return oo;Ec=1;var e=Wt.Buffer,t=e.isEncoding||function(A){switch(A=""+A,A&&A.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(A){if(!A)return"utf8";for(var P;;)switch(A){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return A;default:if(P)return;A=(""+A).toLowerCase(),P=!0}}function n(A){var P=r(A);if(typeof P!="string"&&(e.isEncoding===t||!t(A)))throw new Error("Unknown encoding: "+A);return P||A}oo.StringDecoder=i;function i(A){this.encoding=n(A);var P;switch(this.encoding){case"utf16le":this.text=v,this.end=b,P=4;break;case"utf8":this.fillLast=f,P=4;break;case"base64":this.text=k,this.end=j,P=3;break;default:this.write=O,this.end=H;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(P)}i.prototype.write=function(A){if(A.length===0)return"";var P,$;if(this.lastNeed){if(P=this.fillLast(A),P===void 0)return"";$=this.lastNeed,this.lastNeed=0}else $=0;return $<A.length?P?P+this.text(A,$):this.text(A,$):P||""},i.prototype.end=p,i.prototype.text=g,i.prototype.fillLast=function(A){if(this.lastNeed<=A.length)return A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,this.lastTotal-this.lastNeed,0,A.length),this.lastNeed-=A.length};function s(A){return A<=127?0:A>>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function c(A,P,$){var V=P.length-1;if(V<$)return 0;var D=s(P[V]);return D>=0?(D>0&&(A.lastNeed=D-1),D):--V<$||D===-2?0:(D=s(P[V]),D>=0?(D>0&&(A.lastNeed=D-2),D):--V<$||D===-2?0:(D=s(P[V]),D>=0?(D>0&&(D===2?D=0:A.lastNeed=D-3),D):0))}function o(A,P,$){if((P[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&P.length>1){if((P[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&P.length>2&&(P[2]&192)!==128)return A.lastNeed=2,"�"}}function f(A){var P=this.lastTotal-this.lastNeed,$=o(this,A);if($!==void 0)return $;if(this.lastNeed<=A.length)return A.copy(this.lastChar,P,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,P,0,A.length),this.lastNeed-=A.length}function g(A,P){var $=c(this,A,P);if(!this.lastNeed)return A.toString("utf8",P);this.lastTotal=$;var V=A.length-($-this.lastNeed);return A.copy(this.lastChar,0,V),A.toString("utf8",P,V)}function p(A){var P=A&&A.length?this.write(A):"";return this.lastNeed?P+"�":P}function v(A,P){if((A.length-P)%2===0){var $=A.toString("utf16le",P);if($){var V=$.charCodeAt($.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],$.slice(0,-1)}return $}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",P,A.length-1)}function b(A){var P=A&&A.length?this.write(A):"";if(this.lastNeed){var $=this.lastTotal-this.lastNeed;return P+this.lastChar.toString("utf16le",0,$)}return P}function k(A,P){var $=(A.length-P)%3;return $===0?A.toString("base64",P):(this.lastNeed=3-$,this.lastTotal=3,$===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",P,A.length-$))}function j(A){var P=A&&A.length?this.write(A):"";return this.lastNeed?P+this.lastChar.toString("base64",0,3-this.lastNeed):P}function O(A){return A.toString(this.encoding)}function H(A){return A&&A.length?this.write(A):""}return oo}var Rc=Rr.codes.ERR_STREAM_PREMATURE_CLOSE;function yg(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 vg(){}function wg(e){return e.setHeader&&typeof e.abort=="function"}function Nu(e,t,r){if(typeof t=="function")return Nu(e,null,t);t||(t={}),r=yg(r||vg);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||o()},c=e._writableState&&e._writableState.finished,o=function(){i=!1,c=!0,n||r.call(e)},f=e._readableState&&e._readableState.endEmitted,g=function(){n=!1,f=!0,i||r.call(e)},p=function(j){r.call(e,j)},v=function(){var j;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(j=new Rc),r.call(e,j);if(i&&!c)return(!e._writableState||!e._writableState.ended)&&(j=new Rc),r.call(e,j)},b=function(){e.req.on("finish",o)};return wg(e)?(e.on("complete",o),e.on("abort",v),e.req?b():e.on("request",b)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",g),e.on("finish",o),t.error!==!1&&e.on("error",p),e.on("close",v),function(){e.removeListener("complete",o),e.removeListener("abort",v),e.removeListener("request",b),e.req&&e.req.removeListener("finish",o),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",o),e.removeListener("end",g),e.removeListener("error",p),e.removeListener("close",v)}}var ra=Nu,ao,Cc;function bg(){if(Cc)return ao;Cc=1;var e;function t($,V,D){return V=r(V),V in $?Object.defineProperty($,V,{value:D,enumerable:!0,configurable:!0,writable:!0}):$[V]=D,$}function r($){var V=n($,"string");return typeof V=="symbol"?V:String(V)}function n($,V){if(typeof $!="object"||$===null)return $;var D=$[Symbol.toPrimitive];if(D!==void 0){var z=D.call($,V||"default");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)($)}var i=ra,s=Symbol("lastResolve"),c=Symbol("lastReject"),o=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),p=Symbol("handlePromise"),v=Symbol("stream");function b($,V){return{value:$,done:V}}function k($){var V=$[s];if(V!==null){var D=$[v].read();D!==null&&($[g]=null,$[s]=null,$[c]=null,V(b(D,!1)))}}function j($){process.nextTick(k,$)}function O($,V){return function(D,z){$.then(function(){if(V[f]){D(b(void 0,!0));return}V[p](D,z)},z)}}var H=Object.getPrototypeOf(function(){}),A=Object.setPrototypeOf((e={get stream(){return this[v]},next:function(){var V=this,D=this[o];if(D!==null)return Promise.reject(D);if(this[f])return Promise.resolve(b(void 0,!0));if(this[v].destroyed)return new Promise(function(Y,de){process.nextTick(function(){V[o]?de(V[o]):Y(b(void 0,!0))})});var z=this[g],te;if(z)te=new Promise(O(z,this));else{var Q=this[v].read();if(Q!==null)return Promise.resolve(b(Q,!1));te=new Promise(this[p])}return this[g]=te,te}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var V=this;return new Promise(function(D,z){V[v].destroy(null,function(te){if(te){z(te);return}D(b(void 0,!0))})})}),e),H),P=function(V){var D,z=Object.create(A,(D={},t(D,v,{value:V,writable:!0}),t(D,s,{value:null,writable:!0}),t(D,c,{value:null,writable:!0}),t(D,o,{value:null,writable:!0}),t(D,f,{value:V._readableState.endEmitted,writable:!0}),t(D,p,{value:function(Q,Y){var de=z[v].read();de?(z[g]=null,z[s]=null,z[c]=null,Q(b(de,!1))):(z[s]=Q,z[c]=Y)},writable:!0}),D));return z[g]=null,i(V,function(te){if(te&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Q=z[c];Q!==null&&(z[g]=null,z[s]=null,z[c]=null,Q(te)),z[o]=te;return}var Y=z[s];Y!==null&&(z[g]=null,z[s]=null,z[c]=null,Y(b(void 0,!0))),z[f]=!0}),V.on("readable",j.bind(null,z)),z};return ao=P,ao}var co,Mc;function _g(){return Mc||(Mc=1,co=function(){throw new Error("Readable.from is not available in the browser")}),co}var lo,Ic;function Pu(){if(Ic)return lo;Ic=1,lo=Y;var e;Y.ReadableState=Q,br.EventEmitter;var t=function(M,q){return M.listeners(q).length},r=xu,n=Fn.Buffer,i=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(C){return n.from(C)}function c(C){return n.isBuffer(C)||C instanceof i}var o=br,f;o&&o.debuglog?f=o.debuglog("stream"):f=function(){};var g=ig(),p=Au,v=Tu,b=v.getHighWaterMark,k=Rr.codes,j=k.ERR_INVALID_ARG_TYPE,O=k.ERR_STREAM_PUSH_AFTER_EOF,H=k.ERR_METHOD_NOT_IMPLEMENTED,A=k.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,$,V;Mt(Y,r);var D=p.errorOrDestroy,z=["error","close","destroy","pause","resume"];function te(C,M,q){if(typeof C.prependListener=="function")return C.prependListener(M,q);!C._events||!C._events[M]?C.on(M,q):Array.isArray(C._events[M])?C._events[M].unshift(q):C._events[M]=[q,C._events[M]]}function Q(C,M,q){e=e||rn(),C=C||{},typeof q!="boolean"&&(q=M instanceof e),this.objectMode=!!C.objectMode,q&&(this.objectMode=this.objectMode||!!C.readableObjectMode),this.highWaterMark=b(this,C,"readableHighWaterMark",q),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=C.emitClose!==!1,this.autoDestroy=!!C.autoDestroy,this.destroyed=!1,this.defaultEncoding=C.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,C.encoding&&(P||(P=Sc().StringDecoder),this.decoder=new P(C.encoding),this.encoding=C.encoding)}function Y(C){if(e=e||rn(),!(this instanceof Y))return new Y(C);var M=this instanceof e;this._readableState=new Q(C,this,M),this.readable=!0,C&&(typeof C.read=="function"&&(this._read=C.read),typeof C.destroy=="function"&&(this._destroy=C.destroy)),r.call(this)}Object.defineProperty(Y.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(M){this._readableState&&(this._readableState.destroyed=M)}}),Y.prototype.destroy=p.destroy,Y.prototype._undestroy=p.undestroy,Y.prototype._destroy=function(C,M){M(C)},Y.prototype.push=function(C,M){var q=this._readableState,G;return q.objectMode?G=!0:typeof C=="string"&&(M=M||q.defaultEncoding,M!==q.encoding&&(C=n.from(C,M),M=""),G=!0),de(this,C,M,!1,G)},Y.prototype.unshift=function(C){return de(this,C,null,!0,!1)};function de(C,M,q,G,se){f("readableAddChunk",M);var ue=C._readableState;if(M===null)ue.reading=!1,y(C,ue);else{var re;if(se||(re=pe(ue,M)),re)D(C,re);else if(ue.objectMode||M&&M.length>0)if(typeof M!="string"&&!ue.objectMode&&Object.getPrototypeOf(M)!==n.prototype&&(M=s(M)),G)ue.endEmitted?D(C,new A):oe(C,ue,M,!0);else if(ue.ended)D(C,new O);else{if(ue.destroyed)return!1;ue.reading=!1,ue.decoder&&!q?(M=ue.decoder.write(M),ue.objectMode||M.length!==0?oe(C,ue,M,!1):I(C,ue)):oe(C,ue,M,!1)}else G||(ue.reading=!1,I(C,ue))}return!ue.ended&&(ue.length<ue.highWaterMark||ue.length===0)}function oe(C,M,q,G){M.flowing&&M.length===0&&!M.sync?(M.awaitDrain=0,C.emit("data",q)):(M.length+=M.objectMode?1:q.length,G?M.buffer.unshift(q):M.buffer.push(q),M.needReadable&&w(C)),I(C,M)}function pe(C,M){var q;return!c(M)&&typeof M!="string"&&M!==void 0&&!C.objectMode&&(q=new j("chunk",["string","Buffer","Uint8Array"],M)),q}Y.prototype.isPaused=function(){return this._readableState.flowing===!1},Y.prototype.setEncoding=function(C){P||(P=Sc().StringDecoder);var M=new P(C);this._readableState.decoder=M,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,G="";q!==null;)G+=M.write(q.data),q=q.next;return this._readableState.buffer.clear(),G!==""&&this._readableState.buffer.push(G),this._readableState.length=G.length,this};var x=1073741824;function a(C){return C>=x?C=x:(C--,C|=C>>>1,C|=C>>>2,C|=C>>>4,C|=C>>>8,C|=C>>>16,C++),C}function d(C,M){return C<=0||M.length===0&&M.ended?0:M.objectMode?1:C!==C?M.flowing&&M.length?M.buffer.head.data.length:M.length:(C>M.highWaterMark&&(M.highWaterMark=a(C)),C<=M.length?C:M.ended?M.length:(M.needReadable=!0,0))}Y.prototype.read=function(C){f("read",C),C=parseInt(C,10);var M=this._readableState,q=C;if(C!==0&&(M.emittedReadable=!1),C===0&&M.needReadable&&((M.highWaterMark!==0?M.length>=M.highWaterMark:M.length>0)||M.ended))return f("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?W(this):w(this),null;if(C=d(C,M),C===0&&M.ended)return M.length===0&&W(this),null;var G=M.needReadable;f("need readable",G),(M.length===0||M.length-C<M.highWaterMark)&&(G=!0,f("length less than watermark",G)),M.ended||M.reading?(G=!1,f("reading or ended",G)):G&&(f("do read"),M.reading=!0,M.sync=!0,M.length===0&&(M.needReadable=!0),this._read(M.highWaterMark),M.sync=!1,M.reading||(C=d(q,M)));var se;return C>0?se=L(C,M):se=null,se===null?(M.needReadable=M.length<=M.highWaterMark,C=0):(M.length-=C,M.awaitDrain=0),M.length===0&&(M.ended||(M.needReadable=!0),q!==C&&M.ended&&W(this)),se!==null&&this.emit("data",se),se};function y(C,M){if(f("onEofChunk"),!M.ended){if(M.decoder){var q=M.decoder.end();q&&q.length&&(M.buffer.push(q),M.length+=M.objectMode?1:q.length)}M.ended=!0,M.sync?w(C):(M.needReadable=!1,M.emittedReadable||(M.emittedReadable=!0,S(C)))}}function w(C){var M=C._readableState;f("emitReadable",M.needReadable,M.emittedReadable),M.needReadable=!1,M.emittedReadable||(f("emitReadable",M.flowing),M.emittedReadable=!0,process.nextTick(S,C))}function S(C){var M=C._readableState;f("emitReadable_",M.destroyed,M.length,M.ended),!M.destroyed&&(M.length||M.ended)&&(C.emit("readable"),M.emittedReadable=!1),M.needReadable=!M.flowing&&!M.ended&&M.length<=M.highWaterMark,T(C)}function I(C,M){M.readingMore||(M.readingMore=!0,process.nextTick(B,C,M))}function B(C,M){for(;!M.reading&&!M.ended&&(M.length<M.highWaterMark||M.flowing&&M.length===0);){var q=M.length;if(f("maybeReadMore read 0"),C.read(0),q===M.length)break}M.readingMore=!1}Y.prototype._read=function(C){D(this,new H("_read()"))},Y.prototype.pipe=function(C,M){var q=this,G=this._readableState;switch(G.pipesCount){case 0:G.pipes=C;break;case 1:G.pipes=[G.pipes,C];break;default:G.pipes.push(C);break}G.pipesCount+=1,f("pipe count=%d opts=%j",G.pipesCount,M);var se=(!M||M.end!==!1)&&C!==process.stdout&&C!==process.stderr,ue=se?be:Ee;G.endEmitted?process.nextTick(ue):q.once("end",ue),C.on("unpipe",re);function re(m,l){f("onunpipe"),m===q&&l&&l.hasUnpiped===!1&&(l.hasUnpiped=!0,Se())}function be(){f("onend"),C.end()}var pt=_(q);C.on("drain",pt);var Re=!1;function Se(){f("cleanup"),C.removeListener("close",Ce),C.removeListener("finish",Qe),C.removeListener("drain",pt),C.removeListener("error",_e),C.removeListener("unpipe",re),q.removeListener("end",be),q.removeListener("end",Ee),q.removeListener("data",Ze),Re=!0,G.awaitDrain&&(!C._writableState||C._writableState.needDrain)&&pt()}q.on("data",Ze);function Ze(m){f("ondata");var l=C.write(m);f("dest.write",l),l===!1&&((G.pipesCount===1&&G.pipes===C||G.pipesCount>1&&le(G.pipes,C)!==-1)&&!Re&&(f("false write response, pause",G.awaitDrain),G.awaitDrain++),q.pause())}function _e(m){f("onerror",m),Ee(),C.removeListener("error",_e),t(C,"error")===0&&D(C,m)}te(C,"error",_e);function Ce(){C.removeListener("finish",Qe),Ee()}C.once("close",Ce);function Qe(){f("onfinish"),C.removeListener("close",Ce),Ee()}C.once("finish",Qe);function Ee(){f("unpipe"),q.unpipe(C)}return C.emit("pipe",q),G.flowing||(f("pipe resume"),q.resume()),C};function _(C){return function(){var q=C._readableState;f("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&t(C,"data")&&(q.flowing=!0,T(C))}}Y.prototype.unpipe=function(C){var M=this._readableState,q={hasUnpiped:!1};if(M.pipesCount===0)return this;if(M.pipesCount===1)return C&&C!==M.pipes?this:(C||(C=M.pipes),M.pipes=null,M.pipesCount=0,M.flowing=!1,C&&C.emit("unpipe",this,q),this);if(!C){var G=M.pipes,se=M.pipesCount;M.pipes=null,M.pipesCount=0,M.flowing=!1;for(var ue=0;ue<se;ue++)G[ue].emit("unpipe",this,{hasUnpiped:!1});return this}var re=le(M.pipes,C);return re===-1?this:(M.pipes.splice(re,1),M.pipesCount-=1,M.pipesCount===1&&(M.pipes=M.pipes[0]),C.emit("unpipe",this,q),this)},Y.prototype.on=function(C,M){var q=r.prototype.on.call(this,C,M),G=this._readableState;return C==="data"?(G.readableListening=this.listenerCount("readable")>0,G.flowing!==!1&&this.resume()):C==="readable"&&!G.endEmitted&&!G.readableListening&&(G.readableListening=G.needReadable=!0,G.flowing=!1,G.emittedReadable=!1,f("on readable",G.length,G.reading),G.length?w(this):G.reading||process.nextTick(R,this)),q},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(C,M){var q=r.prototype.removeListener.call(this,C,M);return C==="readable"&&process.nextTick(u,this),q},Y.prototype.removeAllListeners=function(C){var M=r.prototype.removeAllListeners.apply(this,arguments);return(C==="readable"||C===void 0)&&process.nextTick(u,this),M};function u(C){var M=C._readableState;M.readableListening=C.listenerCount("readable")>0,M.resumeScheduled&&!M.paused?M.flowing=!0:C.listenerCount("data")>0&&C.resume()}function R(C){f("readable nexttick read 0"),C.read(0)}Y.prototype.resume=function(){var C=this._readableState;return C.flowing||(f("resume"),C.flowing=!C.readableListening,K(this,C)),C.paused=!1,this};function K(C,M){M.resumeScheduled||(M.resumeScheduled=!0,process.nextTick(J,C,M))}function J(C,M){f("resume",M.reading),M.reading||C.read(0),M.resumeScheduled=!1,C.emit("resume"),T(C),M.flowing&&!M.reading&&C.read(0)}Y.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function T(C){var M=C._readableState;for(f("flow",M.flowing);M.flowing&&C.read()!==null;);}Y.prototype.wrap=function(C){var M=this,q=this._readableState,G=!1;C.on("end",function(){if(f("wrapped end"),q.decoder&&!q.ended){var re=q.decoder.end();re&&re.length&&M.push(re)}M.push(null)}),C.on("data",function(re){if(f("wrapped data"),q.decoder&&(re=q.decoder.write(re)),!(q.objectMode&&re==null)&&!(!q.objectMode&&(!re||!re.length))){var be=M.push(re);be||(G=!0,C.pause())}});for(var se in C)this[se]===void 0&&typeof C[se]=="function"&&(this[se]=function(be){return function(){return C[be].apply(C,arguments)}}(se));for(var ue=0;ue<z.length;ue++)C.on(z[ue],this.emit.bind(this,z[ue]));return this._read=function(re){f("wrapped _read",re),G&&(G=!1,C.resume())},this},typeof Symbol=="function"&&(Y.prototype[Symbol.asyncIterator]=function(){return $===void 0&&($=bg()),$(this)}),Object.defineProperty(Y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Y.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Y.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(M){this._readableState&&(this._readableState.flowing=M)}}),Y._fromList=L,Object.defineProperty(Y.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function L(C,M){if(M.length===0)return null;var q;return M.objectMode?q=M.buffer.shift():!C||C>=M.length?(M.decoder?q=M.buffer.join(""):M.buffer.length===1?q=M.buffer.first():q=M.buffer.concat(M.length),M.buffer.clear()):q=M.buffer.consume(C,M.decoder),q}function W(C){var M=C._readableState;f("endReadable",M.endEmitted),M.endEmitted||(M.ended=!0,process.nextTick(Z,M,C))}function Z(C,M){if(f("endReadableNT",C.endEmitted,C.length),!C.endEmitted&&C.length===0&&(C.endEmitted=!0,M.readable=!1,M.emit("end"),C.autoDestroy)){var q=M._writableState;(!q||q.autoDestroy&&q.finished)&&M.destroy()}}typeof Symbol=="function"&&(Y.from=function(C,M){return V===void 0&&(V=_g()),V(Y,C,M)});function le(C,M){for(var q=0,G=C.length;q<G;q++)if(C[q]===M)return q;return-1}return lo}var Lu=Ht,ls=Rr.codes,Eg=ls.ERR_METHOD_NOT_IMPLEMENTED,Sg=ls.ERR_MULTIPLE_CALLBACK,Rg=ls.ERR_TRANSFORM_ALREADY_TRANSFORMING,Cg=ls.ERR_TRANSFORM_WITH_LENGTH_0,us=rn();Mt(Ht,us);function Mg(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Sg);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 Ht(e){if(!(this instanceof Ht))return new Ht(e);us.call(this,e),this._transformState={afterTransform:Mg.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",Ig)}function Ig(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){xc(e,t,r)}):xc(this,null,null)}Ht.prototype.push=function(e,t){return this._transformState.needTransform=!1,us.prototype.push.call(this,e,t)};Ht.prototype._transform=function(e,t,r){r(new Eg("_transform()"))};Ht.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)}};Ht.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};Ht.prototype._destroy=function(e,t){us.prototype._destroy.call(this,e,function(r){t(r)})};function xc(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Cg;if(e._transformState.transforming)throw new Rg;return e.push(null)}var xg=Cn,Ou=Lu;Mt(Cn,Ou);function Cn(e){if(!(this instanceof Cn))return new Cn(e);Ou.call(this,e)}Cn.prototype._transform=function(e,t,r){r(null,e)};var uo;function Ag(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var $u=Rr.codes,kg=$u.ERR_MISSING_ARGS,Tg=$u.ERR_STREAM_DESTROYED;function Ac(e){if(e)throw e}function Bg(e){return e.setHeader&&typeof e.abort=="function"}function Ng(e,t,r,n){n=Ag(n);var i=!1;e.on("close",function(){i=!0}),uo===void 0&&(uo=ra),uo(e,{readable:t,writable:r},function(c){if(c)return n(c);i=!0,n()});var s=!1;return function(c){if(!i&&!s){if(s=!0,Bg(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(c||new Tg("pipe"))}}}function kc(e){e()}function Pg(e,t){return e.pipe(t)}function Lg(e){return!e.length||typeof e[e.length-1]!="function"?Ac:e.pop()}function Og(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Lg(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new kg("streams");var i,s=t.map(function(c,o){var f=o<t.length-1,g=o>0;return Ng(c,f,g,function(p){i||(i=p),p&&s.forEach(kc),!f&&(s.forEach(kc),n(i))})});return t.reduce(Pg)}var $g=Og;(function(e,t){t=e.exports=Pu(),t.Stream=t,t.Readable=t,t.Writable=Bu(),t.Duplex=rn(),t.Transform=Lu,t.PassThrough=xg,t.finished=ra,t.pipeline=$g})(Po,Po.exports);var Fu=Po.exports;const{Transform:Fg}=Fu;var Dg=e=>class Du extends Fg{constructor(r,n,i,s,c){super(c),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=c,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(c){s=c}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Du(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:jg}=Fu;var Ug=e=>class ju extends jg{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(c){s=c}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ju(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Hg=Dg,Wg=Ug;var Vg=function(e){const t=Hg(e),r=Wg(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Uu={};const Tc=[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];Uu.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],c=e[4]^e[14]^e[24]^e[34]^e[44],o=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],g=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],v=e[9]^e[19]^e[29]^e[39]^e[49];let b=p^(i<<1|s>>>31),k=v^(s<<1|i>>>31);const j=e[0]^b,O=e[1]^k,H=e[10]^b,A=e[11]^k,P=e[20]^b,$=e[21]^k,V=e[30]^b,D=e[31]^k,z=e[40]^b,te=e[41]^k;b=r^(c<<1|o>>>31),k=n^(o<<1|c>>>31);const Q=e[2]^b,Y=e[3]^k,de=e[12]^b,oe=e[13]^k,pe=e[22]^b,x=e[23]^k,a=e[32]^b,d=e[33]^k,y=e[42]^b,w=e[43]^k;b=i^(f<<1|g>>>31),k=s^(g<<1|f>>>31);const S=e[4]^b,I=e[5]^k,B=e[14]^b,_=e[15]^k,u=e[24]^b,R=e[25]^k,K=e[34]^b,J=e[35]^k,T=e[44]^b,L=e[45]^k;b=c^(p<<1|v>>>31),k=o^(v<<1|p>>>31);const W=e[6]^b,Z=e[7]^k,le=e[16]^b,C=e[17]^k,M=e[26]^b,q=e[27]^k,G=e[36]^b,se=e[37]^k,ue=e[46]^b,re=e[47]^k;b=f^(r<<1|n>>>31),k=g^(n<<1|r>>>31);const be=e[8]^b,pt=e[9]^k,Re=e[18]^b,Se=e[19]^k,Ze=e[28]^b,_e=e[29]^k,Ce=e[38]^b,Qe=e[39]^k,Ee=e[48]^b,m=e[49]^k,l=j,h=O,E=A<<4|H>>>28,N=H<<4|A>>>28,F=P<<3|$>>>29,U=$<<3|P>>>29,he=D<<9|V>>>23,ae=V<<9|D>>>23,ie=z<<18|te>>>14,Me=te<<18|z>>>14,ne=Q<<1|Y>>>31,Ie=Y<<1|Q>>>31,Ir=oe<<12|de>>>20,xe=de<<12|oe>>>20,Ae=pe<<10|x>>>22,xr=x<<10|pe>>>22,ke=d<<13|a>>>19,Te=a<<13|d>>>19,Ar=y<<2|w>>>30,Be=w<<2|y>>>30,Ne=I<<30|S>>>2,kr=S<<30|I>>>2,Pe=B<<6|_>>>26,Le=_<<6|B>>>26,Tr=R<<11|u>>>21,Oe=u<<11|R>>>21,$e=K<<15|J>>>17,Br=J<<15|K>>>17,Fe=L<<29|T>>>3,De=T<<29|L>>>3,Nr=W<<28|Z>>>4,je=Z<<28|W>>>4,Ue=C<<23|le>>>9,Pr=le<<23|C>>>9,He=M<<25|q>>>7,We=q<<25|M>>>7,Kt=G<<21|se>>>11,Yt=se<<21|G>>>11,Qt=re<<24|ue>>>8,Xt=ue<<24|re>>>8,er=be<<27|pt>>>5,tr=pt<<27|be>>>5,rr=Re<<20|Se>>>12,nr=Se<<20|Re>>>12,ir=_e<<7|Ze>>>25,sr=Ze<<7|_e>>>25,or=Ce<<8|Qe>>>24,ar=Qe<<8|Ce>>>24,cr=Ee<<14|m>>>18,lr=m<<14|Ee>>>18;e[0]=l^~Ir&Tr,e[1]=h^~xe&Oe,e[10]=Nr^~rr&F,e[11]=je^~nr&U,e[20]=ne^~Pe&He,e[21]=Ie^~Le&We,e[30]=er^~E&Ae,e[31]=tr^~N&xr,e[40]=Ne^~Ue&ir,e[41]=kr^~Pr&sr,e[2]=Ir^~Tr&Kt,e[3]=xe^~Oe&Yt,e[12]=rr^~F&ke,e[13]=nr^~U&Te,e[22]=Pe^~He&or,e[23]=Le^~We&ar,e[32]=E^~Ae&$e,e[33]=N^~xr&Br,e[42]=Ue^~ir&he,e[43]=Pr^~sr&ae,e[4]=Tr^~Kt&cr,e[5]=Oe^~Yt&lr,e[14]=F^~ke&Fe,e[15]=U^~Te&De,e[24]=He^~or&ie,e[25]=We^~ar&Me,e[34]=Ae^~$e&Qt,e[35]=xr^~Br&Xt,e[44]=ir^~he&Ar,e[45]=sr^~ae&Be,e[6]=Kt^~cr&l,e[7]=Yt^~lr&h,e[16]=ke^~Fe&Nr,e[17]=Te^~De&je,e[26]=or^~ie&ne,e[27]=ar^~Me&Ie,e[36]=$e^~Qt&er,e[37]=Br^~Xt&tr,e[46]=he^~Ar&Ne,e[47]=ae^~Be&kr,e[8]=cr^~l&Ir,e[9]=lr^~h&xe,e[18]=Fe^~Nr&rr,e[19]=De^~je&nr,e[28]=ie^~ne&Pe,e[29]=Me^~Ie&Le,e[38]=Qt^~er&E,e[39]=Xt^~tr&N,e[48]=Ar^~Ne&Ue,e[49]=Be^~kr&Pr,e[0]^=Tc[t*2],e[1]^=Tc[t*2+1]}};const Bi=Uu;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&&(Bi.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&&Bi.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Bi.p1600(this.state),this.count=0,this.squeezing=!0};dn.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Bi.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 qg=dn,zg=Vg(qg);const Gg=zg,Jg=$i;function Hu(e){return Buffer.allocUnsafe(e).fill(0)}function Wu(e,t,r){const n=Hu(t);return e=hs(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 Zg(e,t){return Wu(e,t,!0)}function hs(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")Vu(e)?e=Buffer.from(Qg(qu(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(Jg.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function Kg(e){return e=hs(e),"0x"+e.toString("hex")}function Yg(e,t){return e=hs(e),t||(t=256),Gg("keccak"+t).update(e).digest()}function Qg(e){return e.length%2?"0"+e:e}function Vu(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function qu(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var zu={zeros:Hu,setLength:Wu,setLengthRight:Zg,isHexString:Vu,stripHexPrefix:qu,toBuffer:hs,bufferToHex:Kg,keccak:Yg};const Er=zu,yr=$i;function Gu(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 Kr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Bc(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Ju(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function pr(e){var t=typeof e;if(t==="string")return Er.isHexString(e)?new yr(Er.stripHexPrefix(e),16):new yr(e,10);if(t==="number")return new yr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Bt(e,t){var r,n,i,s;if(e==="address")return Bt("uint160",pr(t));if(e==="bool")return Bt("uint8",t?1:0);if(e==="string")return Bt("bytes",new Buffer(t,"utf8"));if(em(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Ju(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(Bt(e,t[s]));if(r==="dynamic"){var c=Bt("uint256",t.length);i.unshift(c)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([Bt("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,Er.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Kr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Er.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Kr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=pr(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Kr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=pr(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Bc(e),n=pr(t),n<0)throw new Error("Supplied ufixed is negative");return Bt("uint256",n.mul(new yr(2).pow(new yr(r[1]))))}else if(e.startsWith("fixed"))return r=Bc(e),Bt("int256",pr(t).mul(new yr(2).pow(new yr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Xg(e){return e==="string"||e==="bytes"||Ju(e)==="dynamic"}function em(e){return e.lastIndexOf("]")===e.length-1}function tm(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var c=Gu(e[s]),o=t[s],f=Bt(c,o);Xg(c)?(r.push(Bt("uint256",i)),n.push(f),i+=f.length):r.push(f)}return Buffer.concat(r.concat(n))}function Zu(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 c=Gu(e[s]),o=t[s];if(c==="bytes")i.push(o);else if(c==="string")i.push(new Buffer(o,"utf8"));else if(c==="bool")i.push(new Buffer(o?"01":"00","hex"));else if(c==="address")i.push(Er.setLength(o,20));else if(c.startsWith("bytes")){if(r=Kr(c),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(Er.setLengthRight(o,r))}else if(c.startsWith("uint")){if(r=Kr(c),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=pr(o),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(c.startsWith("int")){if(r=Kr(c),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=pr(o),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+c)}return Buffer.concat(i)}function rm(e,t){return Er.keccak(Zu(e,t))}var nm={rawEncode:tm,solidityPack:Zu,soliditySHA3:rm};const Rt=zu,_n=nm,Ku={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"]},ho={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const c=(o,f,g)=>{if(r[f]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Rt.keccak(this.encodeData(f,g,r,n))];if(g===void 0)throw new Error(`missing value for field ${o} of type ${f}`);if(f==="bytes")return["bytes32",Rt.keccak(g)];if(f==="string")return typeof g=="string"&&(g=Buffer.from(g,"utf8")),["bytes32",Rt.keccak(g)];if(f.lastIndexOf("]")===f.length-1){const p=f.slice(0,f.lastIndexOf("[")),v=g.map(b=>c(o,p,b));return["bytes32",Rt.keccak(_n.rawEncode(v.map(([b])=>b),v.map(([,b])=>b)))]}return[f,g]};for(const o of r[e]){const[f,g]=c(o.name,o.type,t[o.name]);i.push(f),s.push(g)}}else for(const c of r[e]){let o=t[c.name];if(o!==void 0)if(c.type==="bytes")i.push("bytes32"),o=Rt.keccak(o),s.push(o);else if(c.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=Rt.keccak(o),s.push(o);else if(r[c.type]!==void 0)i.push("bytes32"),o=Rt.keccak(this.encodeData(c.type,o,r,n)),s.push(o);else{if(c.type.lastIndexOf("]")===c.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(c.type),s.push(o)}}return _n.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:c,type:o})=>o+" "+c).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return Rt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Rt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Ku.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Rt.keccak(Buffer.concat(n))}};var im={TYPED_MESSAGE_SCHEMA:Ku,TypedDataUtils:ho,hashForSignTypedDataLegacy:function(e){return sm(e.data)},hashForSignTypedData_v3:function(e){return ho.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return ho.hash(e.data)}};function sm(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?Rt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return _n.soliditySHA3(["bytes32","bytes32"],[_n.soliditySHA3(new Array(e.length).fill("string"),i),_n.soliditySHA3(n,r)])}var nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.filterFromParam=nn.FilterPolyfill=void 0;const Vr=Ke,ot=X,om=5*60*1e3,gr={jsonrpc:"2.0",id:0};class am{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,Vr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Yu(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,ot.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,ot.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,ot.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,ot.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,ot.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(li())}async getFilterLogs(t){const r=(0,ot.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},gr),{method:"eth_getLogs",params:[Nc(n)]})):li()}makeFilterId(){return(0,Vr.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 li();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return ui();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const c=await this.sendAsyncPromise(Object.assign(Object.assign({},gr),{method:"eth_getLogs",params:[Nc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(c.result)){const o=c.result.map(g=>(0,ot.intNumberFromHexString)(g.blockNumber||"0x0")),f=Math.max(...o);if(f&&f>n){const g=(0,Vr.IntNumber)(f+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${g}`),this.cursors.set(t,g)}}return c}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return li();const n=await this.getCurrentBlockHeight();if(r>n)return ui();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,ot.range)(r,n+1).map(c=>this.getBlockHashByNumber((0,Vr.IntNumber)(c))))).filter(c=>!!c),s=(0,Vr.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({},gr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(ui())}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)},om);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({},gr),{method:"eth_blockNumber",params:[]}));return(0,ot.intNumberFromHexString)((0,ot.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},gr),{method:"eth_getBlockByNumber",params:[(0,ot.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,ot.ensureHexString)(r.result.hash):null}}nn.FilterPolyfill=am;function Yu(e){return{fromBlock:Pc(e.fromBlock),toBlock:Pc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}nn.filterFromParam=Yu;function Nc(e){const t={fromBlock:Lc(e.fromBlock),toBlock:Lc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Pc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Vr.IntNumber)(0);if((0,ot.isHexString)(e))return(0,ot.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Lc(e){return e==="latest"?e:(0,ot.hexStringFromIntNumber)(e)}function li(){return Object.assign(Object.assign({},gr),{error:{code:-32e3,message:"filter not found"}})}function ui(){return Object.assign(Object.assign({},gr),{result:[]})}var fs={},Qu={},ds={},na=cm;function cm(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 Oc=(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(c,o){if(t.multiArgs){const f=new Array(arguments.length-1);for(let g=1;g<arguments.length;g++)f[g-1]=arguments[g];c?(f.unshift(c),s(f)):i(f)}else c?s(c):i(o)}):n.push(function(c){if(t.multiArgs){const o=new Array(arguments.length-1);for(let f=0;f<arguments.length;f++)o[f]=arguments[f];i(o)}else i(c)}),e.apply(this,n)})};var lm=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=c=>typeof c=="string"?i===c:c.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):Oc(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)?Oc(s,t):s}return n},Gn={},Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});const um=br;function $c(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function hm(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let fm=class extends um.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 c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const o=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw o.context=c,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")$c(s,this,r);else{const c=s.length,o=hm(s);for(let f=0;f<c;f+=1)$c(o[f],this,r)}return!0}};Jn.default=fm;var dm=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.BaseBlockTracker=void 0;const pm=dm(Jn),gm=1e3,mm=(e,t)=>e+t,Fc=["sync","latest"];class ym extends pm.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*gm,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){Fc.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 Fc.map(t=>this.listenerCount(t)).reduce(mm)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Dc(t),i=Dc(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}}Gn.BaseBlockTracker=ym;function Dc(e){return Number.parseInt(e,16)}var Xu={},eh={},it={};class th extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...c}=t,{path:o}=t,f=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??f),s!=null&&(this.cause=f),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function vm(e){return _t(e)&&typeof e[Symbol.iterator]=="function"}function _t(e){return typeof e=="object"&&e!=null}function jc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ye(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function wm(e){const{done:t,value:r}=e.next();return t?void 0:r}function bm(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:c}=r,{refinement:o,message:f=`Expected a value of type \`${c}\`${o?` with refinement \`${o}\``:""}, but received: \`${Ye(n)}\``}=e;return{value:n,type:c,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:f}}function*Oo(e,t,r,n){vm(e)||(e=[e]);for(const i of e){const s=bm(i,t,r,n);s&&(yield s)}}function*ia(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:c=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),c&&t.type!=="type"&&_t(t.schema)&&_t(e)&&!Array.isArray(e)))for(const g in e)t.schema[g]===void 0&&delete e[g];let f="valid";for(const g of t.validator(e,o))g.explanation=r.message,f="not_valid",yield[g,void 0];for(let[g,p,v]of t.entries(e,o)){const b=ia(p,v,{path:g===void 0?n:[...n,g],branch:g===void 0?i:[...i,p],coerce:s,mask:c,message:r.message});for(const k of b)k[0]?(f=k[0].refinement!=null?"not_refined":"not_valid",yield[k[0],void 0]):s&&(p=k[1],g===void 0?e=p:e instanceof Map?e.set(g,p):e instanceof Set?e.add(p):_t(e)&&(p!==void 0||g in e)&&(e[g]=p))}if(f!=="not_valid")for(const g of t.refiner(e,o))g.explanation=r.message,f="not_refined",yield[g,void 0];f==="valid"&&(yield[void 0,e])}class Ge{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:c=f=>f,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=c,i?this.validator=(f,g)=>{const p=i(f,g);return Oo(p,g,this,f)}:this.validator=()=>[],s?this.refiner=(f,g)=>{const p=s(f,g);return Oo(p,g,this,f)}:this.refiner=()=>[]}assert(t,r){return rh(t,this,r)}create(t,r){return nh(t,this,r)}is(t){return sa(t,this)}mask(t,r){return ih(t,this,r)}validate(t,r={}){return pn(t,this,r)}}function rh(e,t,r){const n=pn(e,t,{message:r});if(n[0])throw n[0]}function nh(e,t,r){const n=pn(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function ih(e,t,r){const n=pn(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function sa(e,t){return!pn(e,t)[0]}function pn(e,t,r={}){const n=ia(e,t,r),i=wm(n);return i[0]?[new th(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function _m(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Kn(n):Zn(n)}function ut(e,t){return new Ge({type:e,schema:null,validator:t})}function Em(e,t){return new Ge({...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 Sm(e){return new Ge({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 Rm(e){let t;return new Ge({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 Cm(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Kn(n);default:return Zn(n)}}function Mm(e){const t=e instanceof Ge,r=t?{...e.schema}:{...e};for(const n in r)r[n]=sh(r[n]);return t&&e.type==="type"?Kn(r):Zn(r)}function Im(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Kn(n);default:return Zn(n)}}function xm(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ut(e,t)}function Am(){return ut("any",()=>!0)}function km(e){return new Ge({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: ${Ye(t)}`}})}function Tm(){return ut("bigint",e=>typeof e=="bigint")}function Bm(){return ut("boolean",e=>typeof e=="boolean")}function Nm(){return ut("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ye(e)}`)}function Pm(e){const t={},r=e.map(n=>Ye(n)).join();for(const n of e)t[n]=n;return new Ge({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ye(n)}`}})}function Lm(){return ut("func",e=>typeof e=="function"||`Expected a function, but received: ${Ye(e)}`)}function Om(e){return ut("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ye(t)}`)}function $m(){return ut("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ye(e)}`)}function Fm(e){return new Ge({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 Dm(e){const t=Ye(e),r=typeof e;return new Ge({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ye(n)}`}})}function jm(e,t){return new Ge({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: ${Ye(r)}`}})}function oa(){return ut("never",()=>!1)}function Um(e){return new Ge({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function Hm(){return ut("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ye(e)}`)}function Zn(e){const t=e?Object.keys(e):[],r=oa();return new Ge({type:"object",schema:e||null,*entries(n){if(e&&_t(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 _t(n)||`Expected an object, but received: ${Ye(n)}`},coercer(n){return _t(n)?{...n}:n}})}function sh(e){return new Ge({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Wm(e,t){return new Ge({type:"record",schema:null,*entries(r){if(_t(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return _t(r)||`Expected an object, but received: ${Ye(r)}`}})}function Vm(){return ut("regexp",e=>e instanceof RegExp)}function qm(e){return new Ge({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: ${Ye(t)}`}})}function oh(){return ut("string",e=>typeof e=="string"||`Expected a string, but received: ${Ye(e)}`)}function zm(e){const t=oa();return new Ge({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: ${Ye(r)}`}})}function Kn(e){const t=Object.keys(e);return new Ge({type:"type",schema:e,*entries(r){if(_t(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return _t(r)||`Expected an object, but received: ${Ye(r)}`},coercer(r){return _t(r)?{...r}:r}})}function Gm(e){const t=e.map(r=>r.type).join(" | ");return new Ge({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[...c]=ia(r,s,n),[o]=c;if(o[0])for(const[f]of c)f&&i.push(f);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ye(r)}`,...i]}})}function ah(){return ut("unknown",()=>!0)}function aa(e,t,r){return new Ge({...e,coercer:(n,i)=>sa(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Jm(e,t,r={}){return aa(e,ah(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&jc(n)&&jc(i)){const s={...n};let c=!1;for(const o in i)s[o]===void 0&&(s[o]=i[o],c=!0);if(c)return s}return n})}function Zm(e){return aa(e,oh(),t=>t.trim())}function Km(e){return Cr(e,"empty",t=>{const r=ch(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function ch(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Ym(e,t,r={}){const{exclusive:n}=r;return Cr(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Qm(e,t,r={}){const{exclusive:n}=r;return Cr(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Xm(e){return Cr(e,"nonempty",t=>ch(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function ey(e,t){return Cr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function ty(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Cr(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:c}=s;return t<=c&&c<=r||`${n} with a size ${i} but received one with a size of \`${c}\``}else{const{length:c}=s;return t<=c&&c<=r||`${n} with a length ${i} but received one with a length of \`${c}\``}})}function Cr(e,t,r){return new Ge({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),c=Oo(s,i,e,n);for(const o of c)yield{...o,refinement:t}}})}const ry=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ge,StructError:th,any:Am,array:km,assert:rh,assign:_m,bigint:Tm,boolean:Bm,coerce:aa,create:nh,date:Nm,defaulted:Jm,define:ut,deprecated:Em,dynamic:Sm,empty:Km,enums:Pm,func:Lm,instance:Om,integer:$m,intersection:Fm,is:sa,lazy:Rm,literal:Dm,map:jm,mask:ih,max:Ym,min:Qm,never:oa,nonempty:Xm,nullable:Um,number:Hm,object:Zn,omit:Cm,optional:sh,partial:Mm,pattern:ey,pick:Im,record:Wm,refine:Cr,regexp:Vm,set:qm,size:ty,string:oh,struct:xm,trimmed:Zm,tuple:zm,type:Kn,union:Gm,unknown:ah,validate:pn},Symbol.toStringTag,{value:"Module"})),Mr=an(ry);Object.defineProperty(it,"__esModule",{value:!0});it.assertExhaustive=it.assertStruct=it.assert=it.AssertionError=void 0;const ny=Mr;function iy(e){return typeof e=="object"&&e!==null&&"message"in e}function sy(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function oy(e){const t=iy(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function lh(e,t){return sy(e)?new e({message:t}):e({message:t})}class ca extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}it.AssertionError=ca;function ay(e,t="Assertion failed.",r=ca){if(!e)throw t instanceof Error?t:lh(r,t)}it.assert=ay;function cy(e,t,r="Assertion failed",n=ca){try{(0,ny.assert)(e,t)}catch(i){throw lh(n,`${r}: ${oy(i)}.`)}}it.assertStruct=cy;function ly(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}it.assertExhaustive=ly;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.base64=void 0;const uy=Mr,hy=it,fy=(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 c;s==="base64"?c=String.raw`[A-Za-z0-9+\/]`:((0,hy.assert)(s==="base64url"),c=String.raw`[-_A-Za-z0-9]`);let o;return i?o=new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):o=new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,uy.pattern)(e,o)};Yn.base64=fy;var we={},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=Mr,r=it;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(g){return(0,t.is)(g,e.HexStruct)}e.isHexString=n;function i(g){return(0,t.is)(g,e.StrictHexStruct)}e.isStrictHexString=i;function s(g){(0,r.assert)(n(g),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function c(g){(0,r.assert)(i(g),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=c;function o(g){return g.startsWith("0x")?g:g.startsWith("0X")?`0x${g.substring(2)}`:`0x${g}`}e.add0x=o;function f(g){return g.startsWith("0x")||g.startsWith("0X")?g.substring(2):g}e.remove0x=f})(Qn);Object.defineProperty(we,"__esModule",{value:!0});we.createDataView=we.concatBytes=we.valueToBytes=we.stringToBytes=we.numberToBytes=we.signedBigIntToBytes=we.bigIntToBytes=we.hexToBytes=we.bytesToString=we.bytesToNumber=we.bytesToSignedBigInt=we.bytesToBigInt=we.bytesToHex=we.assertIsBytes=we.isBytes=void 0;const dt=it,$o=Qn,Uc=48,Hc=58,Wc=87;function dy(){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 py=dy();function la(e){return e instanceof Uint8Array}we.isBytes=la;function gn(e){(0,dt.assert)(la(e),"Value must be a Uint8Array.")}we.assertIsBytes=gn;function uh(e){if(gn(e),e.length===0)return"0x";const t=py(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,$o.add0x)(r.join(""))}we.bytesToHex=uh;function hh(e){gn(e);const t=uh(e);return BigInt(t)}we.bytesToBigInt=hh;function gy(e){gn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}we.bytesToSignedBigInt=gy;function my(e){gn(e);const t=hh(e);return(0,dt.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}we.bytesToNumber=my;function yy(e){return gn(e),new TextDecoder().decode(e)}we.bytesToString=yy;function ps(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,$o.assertIsHexString)(e);const r=(0,$o.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 c=n.charCodeAt(s*2),o=n.charCodeAt(s*2+1),f=c-(c<Hc?Uc:Wc),g=o-(o<Hc?Uc:Wc);i[s]=f*16+g}return i}we.hexToBytes=ps;function fh(e){(0,dt.assert)(typeof e=="bigint","Value must be a bigint."),(0,dt.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return ps(t)}we.bigIntToBytes=fh;function vy(e,t){(0,dt.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function wy(e,t){(0,dt.assert)(typeof e=="bigint","Value must be a bigint."),(0,dt.assert)(typeof t=="number","Byte length must be a number."),(0,dt.assert)(t>0,"Byte length must be greater than 0."),(0,dt.assert)(vy(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()}we.signedBigIntToBytes=wy;function dh(e){(0,dt.assert)(typeof e=="number","Value must be a number."),(0,dt.assert)(e>=0,"Value must be a non-negative number."),(0,dt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return ps(t)}we.numberToBytes=dh;function ph(e){return(0,dt.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}we.stringToBytes=ph;function gh(e){if(typeof e=="bigint")return fh(e);if(typeof e=="number")return dh(e);if(typeof e=="string")return e.startsWith("0x")?ps(e):ph(e);if(la(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}we.valueToBytes=gh;function by(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=gh(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}we.concatBytes=by;function _y(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}we.createDataView=_y;var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.ChecksumStruct=void 0;const Vc=Mr,Ey=Yn;gs.ChecksumStruct=(0,Vc.size)((0,Ey.base64)((0,Vc.string)(),{paddingRequired:!0}),44,44);var $t={};Object.defineProperty($t,"__esModule",{value:!0});$t.createHex=$t.createBytes=$t.createBigInt=$t.createNumber=void 0;const ze=Mr,Sy=it,mh=we,ms=Qn,yh=(0,ze.union)([(0,ze.number)(),(0,ze.bigint)(),(0,ze.string)(),ms.StrictHexStruct]),Ry=(0,ze.coerce)((0,ze.number)(),yh,Number),Cy=(0,ze.coerce)((0,ze.bigint)(),yh,BigInt);(0,ze.union)([ms.StrictHexStruct,(0,ze.instance)(Uint8Array)]);const My=(0,ze.coerce)((0,ze.instance)(Uint8Array),(0,ze.union)([ms.StrictHexStruct]),mh.hexToBytes),Iy=(0,ze.coerce)(ms.StrictHexStruct,(0,ze.instance)(Uint8Array),mh.bytesToHex);function xy(e){try{const t=(0,ze.create)(e,Ry);return(0,Sy.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof ze.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}$t.createNumber=xy;function Ay(e){try{return(0,ze.create)(e,Cy)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}$t.createBigInt=Ay;function ky(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,ze.create)(e,My)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}$t.createBytes=ky;function Ty(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,ze.create)(e,Iy)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}$t.createHex=Ty;var sn={},vh=ee&&ee.__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},at=ee&&ee.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},St,kt;Object.defineProperty(sn,"__esModule",{value:!0});sn.FrozenSet=sn.FrozenMap=void 0;class ua{constructor(t){St.set(this,void 0),vh(this,St,new Map(t),"f"),Object.freeze(this)}get size(){return at(this,St,"f").size}[(St=new WeakMap,Symbol.iterator)](){return at(this,St,"f")[Symbol.iterator]()}entries(){return at(this,St,"f").entries()}forEach(t,r){return at(this,St,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return at(this,St,"f").get(t)}has(t){return at(this,St,"f").has(t)}keys(){return at(this,St,"f").keys()}values(){return at(this,St,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}sn.FrozenMap=ua;class ha{constructor(t){kt.set(this,void 0),vh(this,kt,new Set(t),"f"),Object.freeze(this)}get size(){return at(this,kt,"f").size}[(kt=new WeakMap,Symbol.iterator)](){return at(this,kt,"f")[Symbol.iterator]()}entries(){return at(this,kt,"f").entries()}forEach(t,r){return at(this,kt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return at(this,kt,"f").has(t)}keys(){return at(this,kt,"f").keys()}values(){return at(this,kt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}sn.FrozenSet=ha;Object.freeze(ua);Object.freeze(ua.prototype);Object.freeze(ha);Object.freeze(ha.prototype);var wh={};Object.defineProperty(wh,"__esModule",{value:!0});var bh={};(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=Mr,r=it,n=()=>(0,t.define)("finite number",D=>(0,t.is)(D,(0,t.number)())&&Number.isFinite(D));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",(D,z)=>{function te(Q,Y){const oe=[...Y.validator(Q,z)];return oe.length>0?oe:!0}try{const Q=te(D,e.UnsafeJsonStruct);return Q!==!0?Q:te(JSON.parse(JSON.stringify(D)),e.UnsafeJsonStruct)}catch(Q){return Q instanceof RangeError?"Circular reference detected":!1}});function i(D){return(0,t.is)(D,e.JsonStruct)}e.isValidJson=i;function s(D){(0,r.assertStruct)(D,e.JsonStruct,"Invalid JSON value");const z=JSON.stringify(D);return new TextEncoder().encode(z).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function c(D){return(0,t.is)(D,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=c;function o(D,z){(0,r.assertStruct)(D,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",z)}e.assertIsJsonRpcNotification=o;function f(D){return(0,t.is)(D,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=f;function g(D,z){(0,r.assertStruct)(D,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",z)}e.assertIsJsonRpcRequest=g,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 p(D){return(0,t.is)(D,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function v(D,z){(0,r.assertStruct)(D,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",z)}e.assertIsPendingJsonRpcResponse=v;function b(D){return(0,t.is)(D,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=b;function k(D,z){(0,r.assertStruct)(D,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",z)}e.assertIsJsonRpcResponse=k;function j(D){return(0,t.is)(D,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=j;function O(D,z){(0,r.assertStruct)(D,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",z)}e.assertIsJsonRpcSuccess=O;function H(D){return(0,t.is)(D,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=H;function A(D,z){(0,r.assertStruct)(D,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",z)}e.assertIsJsonRpcFailure=A;function P(D){return(0,t.is)(D,e.JsonRpcErrorStruct)}e.isJsonRpcError=P;function $(D,z){(0,r.assertStruct)(D,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",z)}e.assertIsJsonRpcError=$;function V(D){const{permitEmptyString:z,permitFractions:te,permitNull:Q}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},D);return de=>!!(typeof de=="number"&&(te||Number.isInteger(de))||typeof de=="string"&&(z||de.length>0)||Q&&de===null)}e.getJsonRpcIdValidator=V})(bh);var _h={};Object.defineProperty(_h,"__esModule",{value:!0});var on={},By=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.createModuleLogger=on.createProjectLogger=void 0;const Ny=By(Xh),Py=(0,Ny.default)("metamask");function Ly(e){return Py.extend(e)}on.createProjectLogger=Ly;function Oy(e,t){return e.extend(t)}on.createModuleLogger=Oy;var Eh={};(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(g){return Array.isArray(g)&&g.length>0}e.isNonEmptyArray=t;function r(g){return g==null}e.isNullOrUndefined=r;function n(g){return!!g&&typeof g=="object"&&!Array.isArray(g)}e.isObject=n;const i=(g,p)=>Object.hasOwnProperty.call(g,p);e.hasProperty=i,function(g){g[g.Null=4]="Null",g[g.Comma=1]="Comma",g[g.Wrapper=1]="Wrapper",g[g.True=4]="True",g[g.False=5]="False",g[g.Quote=1]="Quote",g[g.Colon=1]="Colon",g[g.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(g){if(typeof g!="object"||g===null)return!1;try{let p=g;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(g)===p}catch{return!1}}e.isPlainObject=s;function c(g){return g.charCodeAt(0)<=127}e.isASCII=c;function o(g){var p;return g.split("").reduce((b,k)=>c(k)?b+1:b+2,0)+((p=g.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=o;function f(g){return g.toString().length}e.calculateNumberSize=f})(Eh);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.hexToBigInt=Ft.hexToNumber=Ft.bigIntToHex=Ft.numberToHex=void 0;const Yr=it,Mn=Qn,$y=e=>((0,Yr.assert)(typeof e=="number","Value must be a number."),(0,Yr.assert)(e>=0,"Value must be a non-negative number."),(0,Yr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Mn.add0x)(e.toString(16)));Ft.numberToHex=$y;const Fy=e=>((0,Yr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Yr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Mn.add0x)(e.toString(16)));Ft.bigIntToHex=Fy;const Dy=e=>{(0,Mn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Yr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ft.hexToNumber=Dy;const jy=e=>((0,Mn.assertIsHexString)(e),BigInt((0,Mn.add0x)(e)));Ft.hexToBigInt=jy;var Sh={};Object.defineProperty(Sh,"__esModule",{value:!0});var Rh={};(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,c)=>{if(!t(s))throw new Error(`"${c}" must be a non-negative integer. Received: "${s}".`)};function n(s,c){return r(s,"count"),s*c}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(Rh);var Ch={};Object.defineProperty(Ch,"__esModule",{value:!0});var Mh={},Fo={exports:{}};const Uy="2.0.0",Ih=256,Hy=Number.MAX_SAFE_INTEGER||9007199254740991,Wy=16,Vy=Ih-6,qy=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ys={MAX_LENGTH:Ih,MAX_SAFE_COMPONENT_LENGTH:Wy,MAX_SAFE_BUILD_LENGTH:Vy,MAX_SAFE_INTEGER:Hy,RELEASE_TYPES:qy,SEMVER_SPEC_VERSION:Uy,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},fo={};const zy=typeof process=="object"&&fo&&fo.NODE_DEBUG&&/\bsemver\b/i.test(fo.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var vs=zy;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ys,s=vs;t=e.exports={};const c=t.re=[],o=t.safeRe=[],f=t.src=[],g=t.safeSrc=[],p=t.t={};let v=0;const b="[a-zA-Z0-9-]",k=[["\\s",1],["\\d",i],[b,n]],j=H=>{for(const[A,P]of k)H=H.split(`${A}*`).join(`${A}{0,${P}}`).split(`${A}+`).join(`${A}{1,${P}}`);return H},O=(H,A,P)=>{const $=j(A),V=v++;s(H,V,A),p[H]=V,f[V]=A,g[V]=$,c[V]=new RegExp(A,P?"g":void 0),o[V]=new RegExp($,P?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*"),O("NUMERICIDENTIFIERLOOSE","\\d+"),O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${b}*`),O("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`),O("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`),O("PRERELEASEIDENTIFIER",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIER]})`),O("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIERLOOSE]})`),O("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`),O("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`),O("BUILDIDENTIFIER",`${b}+`),O("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`),O("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`),O("FULL",`^${f[p.FULLPLAIN]}$`),O("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`),O("LOOSE",`^${f[p.LOOSEPLAIN]}$`),O("GTLT","((?:<|>)?=?)"),O("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),O("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`),O("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`),O("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`),O("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`),O("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`),O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),O("COERCE",`${f[p.COERCEPLAIN]}(?:$|[^\\d])`),O("COERCEFULL",f[p.COERCEPLAIN]+`(?:${f[p.PRERELEASE]})?(?:${f[p.BUILD]})?(?:$|[^\\d])`),O("COERCERTL",f[p.COERCE],!0),O("COERCERTLFULL",f[p.COERCEFULL],!0),O("LONETILDE","(?:~>?)"),O("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",O("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`),O("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`),O("LONECARET","(?:\\^)"),O("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",O("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`),O("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`),O("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`),O("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`),O("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",O("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`),O("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`),O("STAR","(<|>)?=?\\s*\\*"),O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Fo,Fo.exports);var Xn=Fo.exports;const Gy=Object.freeze({loose:!0}),Jy=Object.freeze({}),Zy=e=>e?typeof e!="object"?Gy:e:Jy;var fa=Zy;const qc=/^[0-9]+$/,xh=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=qc.test(e),n=qc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Ky=(e,t)=>xh(t,e);var Ah={compareIdentifiers:xh,rcompareIdentifiers:Ky};const hi=vs,{MAX_LENGTH:zc,MAX_SAFE_INTEGER:fi}=ys,{safeRe:di,t:pi}=Xn,Yy=fa,{compareIdentifiers:po}=Ah;let Qy=class Tt{constructor(t,r){if(r=Yy(r),t instanceof Tt){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>zc)throw new TypeError(`version is longer than ${zc} characters`);hi("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?di[pi.LOOSE]:di[pi.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>fi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>fi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>fi||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<fi)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(hi("SemVer.compare",this.version,this.options,t),!(t instanceof Tt)){if(typeof t=="string"&&t===this.version)return 0;t=new Tt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Tt||(t=new Tt(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 Tt||(t=new Tt(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(hi("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 po(n,i)}while(++r)}compareBuild(t){t instanceof Tt||(t=new Tt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(hi("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 po(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[pi.PRERELEASELOOSE]:di[pi.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]),po(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 ct=Qy;const Gc=ct,Xy=(e,t,r=!1)=>{if(e instanceof Gc)return e;try{return new Gc(e,t)}catch(n){if(!r)return null;throw n}};var mn=Xy;const ev=mn,tv=(e,t)=>{const r=ev(e,t);return r?r.version:null};var rv=tv;const nv=mn,iv=(e,t)=>{const r=nv(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var sv=iv;const Jc=ct,ov=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Jc(e instanceof Jc?e.version:e,r).inc(t,n,i).version}catch{return null}};var av=ov;const Zc=mn,cv=(e,t)=>{const r=Zc(e,null,!0),n=Zc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,c=s?r:n,o=s?n:r,f=!!c.prerelease.length;if(!!o.prerelease.length&&!f){if(!o.patch&&!o.minor)return"major";if(o.compareMain(c)===0)return o.minor&&!o.patch?"minor":"patch"}const p=f?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var lv=cv;const uv=ct,hv=(e,t)=>new uv(e,t).major;var fv=hv;const dv=ct,pv=(e,t)=>new dv(e,t).minor;var gv=pv;const mv=ct,yv=(e,t)=>new mv(e,t).patch;var vv=yv;const wv=mn,bv=(e,t)=>{const r=wv(e,t);return r&&r.prerelease.length?r.prerelease:null};var _v=bv;const Kc=ct,Ev=(e,t,r)=>new Kc(e,r).compare(new Kc(t,r));var It=Ev;const Sv=It,Rv=(e,t,r)=>Sv(t,e,r);var Cv=Rv;const Mv=It,Iv=(e,t)=>Mv(e,t,!0);var xv=Iv;const Yc=ct,Av=(e,t,r)=>{const n=new Yc(e,r),i=new Yc(t,r);return n.compare(i)||n.compareBuild(i)};var da=Av;const kv=da,Tv=(e,t)=>e.sort((r,n)=>kv(r,n,t));var Bv=Tv;const Nv=da,Pv=(e,t)=>e.sort((r,n)=>Nv(n,r,t));var Lv=Pv;const Ov=It,$v=(e,t,r)=>Ov(e,t,r)>0;var ws=$v;const Fv=It,Dv=(e,t,r)=>Fv(e,t,r)<0;var pa=Dv;const jv=It,Uv=(e,t,r)=>jv(e,t,r)===0;var kh=Uv;const Hv=It,Wv=(e,t,r)=>Hv(e,t,r)!==0;var Th=Wv;const Vv=It,qv=(e,t,r)=>Vv(e,t,r)>=0;var ga=qv;const zv=It,Gv=(e,t,r)=>zv(e,t,r)<=0;var ma=Gv;const Jv=kh,Zv=Th,Kv=ws,Yv=ga,Qv=pa,Xv=ma,ew=(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 Jv(e,r,n);case"!=":return Zv(e,r,n);case">":return Kv(e,r,n);case">=":return Yv(e,r,n);case"<":return Qv(e,r,n);case"<=":return Xv(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Bh=ew;const tw=ct,rw=mn,{safeRe:gi,t:mi}=Xn,nw=(e,t)=>{if(e instanceof tw)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?gi[mi.COERCEFULL]:gi[mi.COERCE]);else{const f=t.includePrerelease?gi[mi.COERCERTLFULL]:gi[mi.COERCERTL];let g;for(;(g=f.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||g.index+g[0].length!==r.index+r[0].length)&&(r=g),f.lastIndex=g.index+g[1].length+g[2].length;f.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",o=t.includePrerelease&&r[6]?`+${r[6]}`:"";return rw(`${n}.${i}.${s}${c}${o}`,t)};var iw=nw;class sw{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 ow=sw,go,Qc;function xt(){if(Qc)return go;Qc=1;const e=/\s+/g;class t{constructor(d,y){if(y=i(y),d instanceof t)return d.loose===!!y.loose&&d.includePrerelease===!!y.includePrerelease?d:new t(d.raw,y);if(d instanceof s)return this.raw=d.value,this.set=[[d]],this.formatted=void 0,this;if(this.options=y,this.loose=!!y.loose,this.includePrerelease=!!y.includePrerelease,this.raw=d.trim().replace(e," "),this.set=this.raw.split("||").map(w=>this.parseRange(w.trim())).filter(w=>w.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const w=this.set[0];if(this.set=this.set.filter(S=>!O(S[0])),this.set.length===0)this.set=[w];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&H(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let d=0;d<this.set.length;d++){d>0&&(this.formatted+="||");const y=this.set[d];for(let w=0;w<y.length;w++)w>0&&(this.formatted+=" "),this.formatted+=y[w].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(d){const w=((this.options.includePrerelease&&k)|(this.options.loose&&j))+":"+d,S=n.get(w);if(S)return S;const I=this.options.loose,B=I?f[g.HYPHENRANGELOOSE]:f[g.HYPHENRANGE];d=d.replace(B,pe(this.options.includePrerelease)),c("hyphen replace",d),d=d.replace(f[g.COMPARATORTRIM],p),c("comparator trim",d),d=d.replace(f[g.TILDETRIM],v),c("tilde trim",d),d=d.replace(f[g.CARETTRIM],b),c("caret trim",d);let _=d.split(" ").map(J=>P(J,this.options)).join(" ").split(/\s+/).map(J=>oe(J,this.options));I&&(_=_.filter(J=>(c("loose invalid filter",J,this.options),!!J.match(f[g.COMPARATORLOOSE])))),c("range list",_);const u=new Map,R=_.map(J=>new s(J,this.options));for(const J of R){if(O(J))return[J];u.set(J.value,J)}u.size>1&&u.has("")&&u.delete("");const K=[...u.values()];return n.set(w,K),K}intersects(d,y){if(!(d instanceof t))throw new TypeError("a Range is required");return this.set.some(w=>A(w,y)&&d.set.some(S=>A(S,y)&&w.every(I=>S.every(B=>I.intersects(B,y)))))}test(d){if(!d)return!1;if(typeof d=="string")try{d=new o(d,this.options)}catch{return!1}for(let y=0;y<this.set.length;y++)if(x(this.set[y],d,this.options))return!0;return!1}}go=t;const r=ow,n=new r,i=fa,s=bs(),c=vs,o=ct,{safeRe:f,t:g,comparatorTrimReplace:p,tildeTrimReplace:v,caretTrimReplace:b}=Xn,{FLAG_INCLUDE_PRERELEASE:k,FLAG_LOOSE:j}=ys,O=a=>a.value==="<0.0.0-0",H=a=>a.value==="",A=(a,d)=>{let y=!0;const w=a.slice();let S=w.pop();for(;y&&w.length;)y=w.every(I=>S.intersects(I,d)),S=w.pop();return y},P=(a,d)=>(a=a.replace(f[g.BUILD],""),c("comp",a,d),a=z(a,d),c("caret",a),a=V(a,d),c("tildes",a),a=Q(a,d),c("xrange",a),a=de(a,d),c("stars",a),a),$=a=>!a||a.toLowerCase()==="x"||a==="*",V=(a,d)=>a.trim().split(/\s+/).map(y=>D(y,d)).join(" "),D=(a,d)=>{const y=d.loose?f[g.TILDELOOSE]:f[g.TILDE];return a.replace(y,(w,S,I,B,_)=>{c("tilde",a,w,S,I,B,_);let u;return $(S)?u="":$(I)?u=`>=${S}.0.0 <${+S+1}.0.0-0`:$(B)?u=`>=${S}.${I}.0 <${S}.${+I+1}.0-0`:_?(c("replaceTilde pr",_),u=`>=${S}.${I}.${B}-${_} <${S}.${+I+1}.0-0`):u=`>=${S}.${I}.${B} <${S}.${+I+1}.0-0`,c("tilde return",u),u})},z=(a,d)=>a.trim().split(/\s+/).map(y=>te(y,d)).join(" "),te=(a,d)=>{c("caret",a,d);const y=d.loose?f[g.CARETLOOSE]:f[g.CARET],w=d.includePrerelease?"-0":"";return a.replace(y,(S,I,B,_,u)=>{c("caret",a,S,I,B,_,u);let R;return $(I)?R="":$(B)?R=`>=${I}.0.0${w} <${+I+1}.0.0-0`:$(_)?I==="0"?R=`>=${I}.${B}.0${w} <${I}.${+B+1}.0-0`:R=`>=${I}.${B}.0${w} <${+I+1}.0.0-0`:u?(c("replaceCaret pr",u),I==="0"?B==="0"?R=`>=${I}.${B}.${_}-${u} <${I}.${B}.${+_+1}-0`:R=`>=${I}.${B}.${_}-${u} <${I}.${+B+1}.0-0`:R=`>=${I}.${B}.${_}-${u} <${+I+1}.0.0-0`):(c("no pr"),I==="0"?B==="0"?R=`>=${I}.${B}.${_}${w} <${I}.${B}.${+_+1}-0`:R=`>=${I}.${B}.${_}${w} <${I}.${+B+1}.0-0`:R=`>=${I}.${B}.${_} <${+I+1}.0.0-0`),c("caret return",R),R})},Q=(a,d)=>(c("replaceXRanges",a,d),a.split(/\s+/).map(y=>Y(y,d)).join(" ")),Y=(a,d)=>{a=a.trim();const y=d.loose?f[g.XRANGELOOSE]:f[g.XRANGE];return a.replace(y,(w,S,I,B,_,u)=>{c("xRange",a,w,S,I,B,_,u);const R=$(I),K=R||$(B),J=K||$(_),T=J;return S==="="&&T&&(S=""),u=d.includePrerelease?"-0":"",R?S===">"||S==="<"?w="<0.0.0-0":w="*":S&&T?(K&&(B=0),_=0,S===">"?(S=">=",K?(I=+I+1,B=0,_=0):(B=+B+1,_=0)):S==="<="&&(S="<",K?I=+I+1:B=+B+1),S==="<"&&(u="-0"),w=`${S+I}.${B}.${_}${u}`):K?w=`>=${I}.0.0${u} <${+I+1}.0.0-0`:J&&(w=`>=${I}.${B}.0${u} <${I}.${+B+1}.0-0`),c("xRange return",w),w})},de=(a,d)=>(c("replaceStars",a,d),a.trim().replace(f[g.STAR],"")),oe=(a,d)=>(c("replaceGTE0",a,d),a.trim().replace(f[d.includePrerelease?g.GTE0PRE:g.GTE0],"")),pe=a=>(d,y,w,S,I,B,_,u,R,K,J,T)=>($(w)?y="":$(S)?y=`>=${w}.0.0${a?"-0":""}`:$(I)?y=`>=${w}.${S}.0${a?"-0":""}`:B?y=`>=${y}`:y=`>=${y}${a?"-0":""}`,$(R)?u="":$(K)?u=`<${+R+1}.0.0-0`:$(J)?u=`<${R}.${+K+1}.0-0`:T?u=`<=${R}.${K}.${J}-${T}`:a?u=`<${R}.${K}.${+J+1}-0`:u=`<=${u}`,`${y} ${u}`.trim()),x=(a,d,y)=>{for(let w=0;w<a.length;w++)if(!a[w].test(d))return!1;if(d.prerelease.length&&!y.includePrerelease){for(let w=0;w<a.length;w++)if(c(a[w].semver),a[w].semver!==s.ANY&&a[w].semver.prerelease.length>0){const S=a[w].semver;if(S.major===d.major&&S.minor===d.minor&&S.patch===d.patch)return!0}return!1}return!0};return go}var mo,Xc;function bs(){if(Xc)return mo;Xc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,v){if(v=r(v),p instanceof t){if(p.loose===!!v.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),c("comparator",p,v),this.options=v,this.loose=!!v.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(p){const v=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],b=p.match(v);if(!b)throw new TypeError(`Invalid comparator: ${p}`);this.operator=b[1]!==void 0?b[1]:"",this.operator==="="&&(this.operator=""),b[2]?this.semver=new o(b[2],this.options.loose):this.semver=e}toString(){return this.value}test(p){if(c("Comparator.test",p,this.options.loose),this.semver===e||p===e)return!0;if(typeof p=="string")try{p=new o(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,v){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f(p.value,v).test(this.value):p.operator===""?p.value===""?!0:new f(this.value,v).test(p.semver):(v=r(v),v.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!v.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,v)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,v)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}mo=t;const r=fa,{safeRe:n,t:i}=Xn,s=Bh,c=vs,o=ct,f=xt();return mo}const aw=xt(),cw=(e,t,r)=>{try{t=new aw(t,r)}catch{return!1}return t.test(e)};var _s=cw;const lw=xt(),uw=(e,t)=>new lw(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var hw=uw;const fw=ct,dw=xt(),pw=(e,t,r)=>{let n=null,i=null,s=null;try{s=new dw(t,r)}catch{return null}return e.forEach(c=>{s.test(c)&&(!n||i.compare(c)===-1)&&(n=c,i=new fw(n,r))}),n};var gw=pw;const mw=ct,yw=xt(),vw=(e,t,r)=>{let n=null,i=null,s=null;try{s=new yw(t,r)}catch{return null}return e.forEach(c=>{s.test(c)&&(!n||i.compare(c)===1)&&(n=c,i=new mw(n,r))}),n};var ww=vw;const yo=ct,bw=xt(),el=ws,_w=(e,t)=>{e=new bw(e,t);let r=new yo("0.0.0");if(e.test(r)||(r=new yo("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(c=>{const o=new yo(c.semver.version);switch(c.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||el(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||el(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Ew=_w;const Sw=xt(),Rw=(e,t)=>{try{return new Sw(e,t).range||"*"}catch{return null}};var Cw=Rw;const Mw=ct,Nh=bs(),{ANY:Iw}=Nh,xw=xt(),Aw=_s,tl=ws,rl=pa,kw=ma,Tw=ga,Bw=(e,t,r,n)=>{e=new Mw(e,n),t=new xw(t,n);let i,s,c,o,f;switch(r){case">":i=tl,s=kw,c=rl,o=">",f=">=";break;case"<":i=rl,s=Tw,c=tl,o="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Aw(e,t,n))return!1;for(let g=0;g<t.set.length;++g){const p=t.set[g];let v=null,b=null;if(p.forEach(k=>{k.semver===Iw&&(k=new Nh(">=0.0.0")),v=v||k,b=b||k,i(k.semver,v.semver,n)?v=k:c(k.semver,b.semver,n)&&(b=k)}),v.operator===o||v.operator===f||(!b.operator||b.operator===o)&&s(e,b.semver))return!1;if(b.operator===f&&c(e,b.semver))return!1}return!0};var ya=Bw;const Nw=ya,Pw=(e,t,r)=>Nw(e,t,">",r);var Lw=Pw;const Ow=ya,$w=(e,t,r)=>Ow(e,t,"<",r);var Fw=$w;const nl=xt(),Dw=(e,t,r)=>(e=new nl(e,r),t=new nl(t,r),e.intersects(t,r));var jw=Dw;const Uw=_s,Hw=It;var Ww=(e,t,r)=>{const n=[];let i=null,s=null;const c=e.sort((p,v)=>Hw(p,v,r));for(const p of c)Uw(p,t,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const o=[];for(const[p,v]of n)p===v?o.push(p):!v&&p===c[0]?o.push("*"):v?p===c[0]?o.push(`<=${v}`):o.push(`${p} - ${v}`):o.push(`>=${p}`);const f=o.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return f.length<g.length?f:t};const il=xt(),va=bs(),{ANY:vo}=va,vn=_s,wa=It,Vw=(e,t,r={})=>{if(e===t)return!0;e=new il(e,r),t=new il(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const c=zw(i,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},qw=[new va(">=0.0.0-0")],sl=[new va(">=0.0.0")],zw=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vo){if(t.length===1&&t[0].semver===vo)return!0;r.includePrerelease?e=qw:e=sl}if(t.length===1&&t[0].semver===vo){if(r.includePrerelease)return!0;t=sl}const n=new Set;let i,s;for(const k of e)k.operator===">"||k.operator===">="?i=ol(i,k,r):k.operator==="<"||k.operator==="<="?s=al(s,k,r):n.add(k.semver);if(n.size>1)return null;let c;if(i&&s){if(c=wa(i.semver,s.semver,r),c>0)return null;if(c===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const k of n){if(i&&!vn(k,String(i),r)||s&&!vn(k,String(s),r))return null;for(const j of t)if(!vn(k,String(j),r))return!1;return!0}let o,f,g,p,v=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;v&&v.prerelease.length===1&&s.operator==="<"&&v.prerelease[0]===0&&(v=!1);for(const k of t){if(p=p||k.operator===">"||k.operator===">=",g=g||k.operator==="<"||k.operator==="<=",i){if(b&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===b.major&&k.semver.minor===b.minor&&k.semver.patch===b.patch&&(b=!1),k.operator===">"||k.operator===">="){if(o=ol(i,k,r),o===k&&o!==i)return!1}else if(i.operator===">="&&!vn(i.semver,String(k),r))return!1}if(s){if(v&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===v.major&&k.semver.minor===v.minor&&k.semver.patch===v.patch&&(v=!1),k.operator==="<"||k.operator==="<="){if(f=al(s,k,r),f===k&&f!==s)return!1}else if(s.operator==="<="&&!vn(s.semver,String(k),r))return!1}if(!k.operator&&(s||i)&&c!==0)return!1}return!(i&&g&&!s&&c!==0||s&&p&&!i&&c!==0||b||v)},ol=(e,t,r)=>{if(!e)return t;const n=wa(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},al=(e,t,r)=>{if(!e)return t;const n=wa(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Gw=Vw;const wo=Xn,cl=ys,Jw=ct,ll=Ah,Zw=mn,Kw=rv,Yw=sv,Qw=av,Xw=lv,eb=fv,tb=gv,rb=vv,nb=_v,ib=It,sb=Cv,ob=xv,ab=da,cb=Bv,lb=Lv,ub=ws,hb=pa,fb=kh,db=Th,pb=ga,gb=ma,mb=Bh,yb=iw,vb=bs(),wb=xt(),bb=_s,_b=hw,Eb=gw,Sb=ww,Rb=Ew,Cb=Cw,Mb=ya,Ib=Lw,xb=Fw,Ab=jw,kb=Ww,Tb=Gw;var Bb={parse:Zw,valid:Kw,clean:Yw,inc:Qw,diff:Xw,major:eb,minor:tb,patch:rb,prerelease:nb,compare:ib,rcompare:sb,compareLoose:ob,compareBuild:ab,sort:cb,rsort:lb,gt:ub,lt:hb,eq:fb,neq:db,gte:pb,lte:gb,cmp:mb,coerce:yb,Comparator:vb,Range:wb,satisfies:bb,toComparators:_b,maxSatisfying:Eb,minSatisfying:Sb,minVersion:Rb,validRange:Cb,outside:Mb,gtr:Ib,ltr:xb,intersects:Ab,simplifyRange:kb,subset:Tb,SemVer:Jw,re:wo.re,src:wo.src,tokens:wo.t,SEMVER_SPEC_VERSION:cl.SEMVER_SPEC_VERSION,RELEASE_TYPES:cl.RELEASE_TYPES,compareIdentifiers:ll.compareIdentifiers,rcompareIdentifiers:ll.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=Bb,r=Mr,n=it;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",v=>(0,t.valid)(v)===null?`Expected SemVer version, got "${v}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",v=>(0,t.validRange)(v)===null?`Expected SemVer range, got "${v}"`:!0);function i(v){return(0,r.is)(v,e.VersionStruct)}e.isValidSemVerVersion=i;function s(v){return(0,r.is)(v,e.VersionRangeStruct)}e.isValidSemVerRange=s;function c(v){(0,n.assertStruct)(v,e.VersionStruct)}e.assertIsSemVerVersion=c;function o(v){(0,n.assertStruct)(v,e.VersionRangeStruct)}e.assertIsSemVerRange=o;function f(v,b){return(0,t.gt)(v,b)}e.gtVersion=f;function g(v,b){return(0,t.gtr)(v,b)}e.gtRange=g;function p(v,b){return(0,t.satisfies)(v,b,{includePrerelease:!0})}e.satisfiesVersionRange=p})(Mh);(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,o)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(it,e),r(Yn,e),r(we,e),r(gs,e),r($t,e),r(sn,e),r(wh,e),r(Qn,e),r(bh,e),r(_h,e),r(on,e),r(Eh,e),r(Ft,e),r(Sh,e),r(Rh,e),r(Ch,e),r(Mh,e)})(eh);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=eh;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Xu);var Ph=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ds,"__esModule",{value:!0});ds.PollingBlockTracker=void 0;const Nb=Ph(na),Pb=Ph(lm),Lb=Gn,ul=Xu,hl=(0,ul.createModuleLogger)(ul.projectLogger,"polling-block-tracker"),Ob=(0,Nb.default)(),$b=1e3;class Fb extends Lb.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*$b,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=fl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
8
+ ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=fl(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:Ob(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),hl("Making request",t);const r=await(0,Pb.default)(n=>this._provider.sendAsync(t,n))();if(hl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
9
+ ${r.error.message}`);return r.result}}ds.PollingBlockTracker=Fb;function fl(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Es={},Db=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Es,"__esModule",{value:!0});Es.SubscribeBlockTracker=void 0;const jb=Db(na),Ub=Gn,Hb=(0,jb.default)();class Wb extends Ub.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:Hb(),method:t,params:r,jsonrpc:"2.0"},(s,c)=>{s?i(s):n(c.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)}}Es.SubscribeBlockTracker=Wb;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(ds,e),r(Es,e)})(Qu);var ba={},Ss={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.getUniqueId=void 0;const Lh=4294967295;let bo=Math.floor(Math.random()*Lh);function Vb(){return bo=(bo+1)%Lh,bo}ei.getUniqueId=Vb;Object.defineProperty(Ss,"__esModule",{value:!0});Ss.createIdRemapMiddleware=void 0;const qb=ei;function zb(){return(e,t,r,n)=>{const i=e.id,s=qb.getUniqueId();e.id=s,t.id=s,r(c=>{e.id=i,t.id=i,c()})}}Ss.createIdRemapMiddleware=zb;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.createAsyncMiddleware=void 0;function Gb(e){return async(t,r,n,i)=>{let s;const c=new Promise(p=>{s=p});let o=null,f=!1;const g=async()=>{f=!0,n(p=>{o=p,s()}),await c};try{await e(t,r,g),f?(await c,o(null)):i(null)}catch(p){o?o(p):i(p)}}}Rs.createAsyncMiddleware=Gb;var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.createScaffoldMiddleware=void 0;function Jb(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())}}Cs.createScaffoldMiddleware=Jb;var ti={},_a={};Object.defineProperty(_a,"__esModule",{value:!0});const Zb=br;function dl(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Kb(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Yb=class extends Zb.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 c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const o=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw o.context=c,o}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")dl(s,this,r);else{const c=s.length,o=Kb(s);for(let f=0;f<c;f+=1)dl(o[f],this,r)}return!0}};_a.default=Yb;var Oh={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.EthereumProviderError=Jt.EthereumRpcError=void 0;const Qb=ef;class $h extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Qb.default(this.serialize(),t2,2)}}Jt.EthereumRpcError=$h;class Xb extends $h{constructor(t,r,n){if(!e2(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Jt.EthereumProviderError=Xb;function e2(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function t2(e,t){if(t!=="[Circular]")return t}var Ea={},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=Jt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:c(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function c(b,k=i){if(Number.isInteger(b)){const j=b.toString();if(v(t.errorValues,j))return t.errorValues[j].message;if(g(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return k}e.getMessageFromCode=c;function o(b){if(!Number.isInteger(b))return!1;const k=b.toString();return!!(t.errorValues[k]||g(b))}e.isValidCode=o;function f(b,{fallbackError:k=s,shouldIncludeStack:j=!1}={}){var O,H;if(!k||!Number.isInteger(k.code)||typeof k.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof r.EthereumRpcError)return b.serialize();const A={};if(b&&typeof b=="object"&&!Array.isArray(b)&&v(b,"code")&&o(b.code)){const $=b;A.code=$.code,$.message&&typeof $.message=="string"?(A.message=$.message,v($,"data")&&(A.data=$.data)):(A.message=c(A.code),A.data={originalError:p(b)})}else{A.code=k.code;const $=(O=b)===null||O===void 0?void 0:O.message;A.message=$&&typeof $=="string"?$:k.message,A.data={originalError:p(b)}}const P=(H=b)===null||H===void 0?void 0:H.stack;return j&&b&&P&&typeof P=="string"&&(A.stack=P),A}e.serializeError=f;function g(b){return b>=-32099&&b<=-32e3}function p(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function v(b,k){return Object.prototype.hasOwnProperty.call(b,k)}})(Ea);var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.ethErrors=void 0;const Sa=Jt,Fh=Ea,st=Zt;Ms.ethErrors={rpc:{parse:e=>mt(st.errorCodes.rpc.parse,e),invalidRequest:e=>mt(st.errorCodes.rpc.invalidRequest,e),invalidParams:e=>mt(st.errorCodes.rpc.invalidParams,e),methodNotFound:e=>mt(st.errorCodes.rpc.methodNotFound,e),internal:e=>mt(st.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 mt(t,e)},invalidInput:e=>mt(st.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>mt(st.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>mt(st.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>mt(st.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>mt(st.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>mt(st.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>wn(st.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>wn(st.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>wn(st.errorCodes.provider.unsupportedMethod,e),disconnected:e=>wn(st.errorCodes.provider.disconnected,e),chainDisconnected:e=>wn(st.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 Sa.EthereumProviderError(t,r,n)}}};function mt(e,t){const[r,n]=Dh(t);return new Sa.EthereumRpcError(e,r||Fh.getMessageFromCode(e),n)}function wn(e,t){const[r,n]=Dh(t);return new Sa.EthereumProviderError(e,r||Fh.getMessageFromCode(e),n)}function Dh(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=Jt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Ea;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ms;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}})})(Oh);var r2=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ti,"__esModule",{value:!0});ti.JsonRpcEngine=void 0;const n2=r2(_a),yt=Oh;class Dt extends n2.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,c,o]=await Dt._runAllMiddleware(t,r,this._middleware);return c?(await Dt._runReturnHandlers(o),i(s)):n(async f=>{try{await Dt._runReturnHandlers(o)}catch(g){return f(g)}return f()})}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 c=new yt.EthereumRpcError(yt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(c,{id:void 0,jsonrpc:"2.0",error:c})}if(typeof t.method!="string"){const c=new yt.EthereumRpcError(yt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(c,{id:t.id,jsonrpc:"2.0",error:c})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(c){s=c}return s&&(delete i.result,i.error||(i.error=yt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Dt._runAllMiddleware(t,r,this._middleware);if(Dt._checkForCompletion(t,r,i),await Dt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,c=!1;for(const o of n)if([s,c]=await Dt._runMiddleware(t,r,o,i),c)break;return[s,c,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const c=f=>{const g=f||r.error;g&&(r.error=yt.serializeError(g)),s([g,!0])},o=f=>{r.error?c(r.error):(f&&(typeof f!="function"&&c(new yt.EthereumRpcError(yt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof f}" for request:
10
10
  ${_o(t)}`,{request:t})),i.push(f)),s([null,!1]))};try{n(t,r,o,c)}catch(f){c(f)}})}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 yt.EthereumRpcError(yt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
11
11
  ${_o(t)}`,{request:t});if(!n)throw new yt.EthereumRpcError(yt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
12
- ${_o(t)}`,{request:t})}}ti.JsonRpcEngine=Dt;function _o(e){return JSON.stringify(e,null,2)}var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.mergeMiddleware=void 0;const s2=ti;function o2(e){const t=new s2.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Is.mergeMiddleware=o2;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(Ss,e),r(Rs,e),r(Ms,e),r(ei,e),r(ti,e),r(Is,e)})(_a);var Uh={},Ma={};const Ca=an(zh);var xs={};Object.defineProperty(xs,"__esModule",{value:!0});var gl=Ca,a2=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 gl.__awaiter(this,void 0,void 0,function(){var r,n,i;return gl.__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}();xs.default=a2;Object.defineProperty(Ma,"__esModule",{value:!0});var ml=Ca,c2=xs,l2=function(){function e(){this._semaphore=new c2.default(1)}return e.prototype.acquire=function(){return ml.__awaiter(this,void 0,void 0,function(){var t,r;return ml.__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}();Ma.default=l2;var As={};Object.defineProperty(As,"__esModule",{value:!0});As.withTimeout=void 0;var yi=Ca;function u2(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return yi.__awaiter(n,void 0,void 0,function(){var c,o,f;return yi.__generator(this,function(g){switch(g.label){case 0:return c=!1,setTimeout(function(){c=!0,s(r)},t),[4,e.acquire()];case 1:return o=g.sent(),c?(f=Array.isArray(o)?o[1]:o,f()):i(o),[2]}})})})},runExclusive:function(i){return yi.__awaiter(this,void 0,void 0,function(){var s,c;return yi.__generator(this,function(o){switch(o.label){case 0:s=function(){},o.label=1;case 1:return o.trys.push([1,,7,8]),[4,this.acquire()];case 2:return c=o.sent(),Array.isArray(c)?(s=c[1],[4,i(c[0])]):[3,4];case 3:return[2,o.sent()];case 4:return s=c,[4,i()];case 5:return[2,o.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}As.withTimeout=u2;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=Ma;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=xs;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=As;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Uh);var h2=d2,f2=Object.prototype.hasOwnProperty;function d2(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)f2.call(r,n)&&(e[n]=r[n])}return e}const p2=h2,g2=ia();var m2=ce;function ce(e){const t=this;t.currentProvider=e}ce.prototype.getBalance=ri(2,"eth_getBalance");ce.prototype.getCode=ri(2,"eth_getCode");ce.prototype.getTransactionCount=ri(2,"eth_getTransactionCount");ce.prototype.getStorageAt=ri(3,"eth_getStorageAt");ce.prototype.call=ri(2,"eth_call");ce.prototype.protocolVersion=ge("eth_protocolVersion");ce.prototype.syncing=ge("eth_syncing");ce.prototype.coinbase=ge("eth_coinbase");ce.prototype.mining=ge("eth_mining");ce.prototype.hashrate=ge("eth_hashrate");ce.prototype.gasPrice=ge("eth_gasPrice");ce.prototype.accounts=ge("eth_accounts");ce.prototype.blockNumber=ge("eth_blockNumber");ce.prototype.getBlockTransactionCountByHash=ge("eth_getBlockTransactionCountByHash");ce.prototype.getBlockTransactionCountByNumber=ge("eth_getBlockTransactionCountByNumber");ce.prototype.getUncleCountByBlockHash=ge("eth_getUncleCountByBlockHash");ce.prototype.getUncleCountByBlockNumber=ge("eth_getUncleCountByBlockNumber");ce.prototype.sign=ge("eth_sign");ce.prototype.sendTransaction=ge("eth_sendTransaction");ce.prototype.sendRawTransaction=ge("eth_sendRawTransaction");ce.prototype.estimateGas=ge("eth_estimateGas");ce.prototype.getBlockByHash=ge("eth_getBlockByHash");ce.prototype.getBlockByNumber=ge("eth_getBlockByNumber");ce.prototype.getTransactionByHash=ge("eth_getTransactionByHash");ce.prototype.getTransactionByBlockHashAndIndex=ge("eth_getTransactionByBlockHashAndIndex");ce.prototype.getTransactionByBlockNumberAndIndex=ge("eth_getTransactionByBlockNumberAndIndex");ce.prototype.getTransactionReceipt=ge("eth_getTransactionReceipt");ce.prototype.getUncleByBlockHashAndIndex=ge("eth_getUncleByBlockHashAndIndex");ce.prototype.getUncleByBlockNumberAndIndex=ge("eth_getUncleByBlockNumberAndIndex");ce.prototype.getCompilers=ge("eth_getCompilers");ce.prototype.compileLLL=ge("eth_compileLLL");ce.prototype.compileSolidity=ge("eth_compileSolidity");ce.prototype.compileSerpent=ge("eth_compileSerpent");ce.prototype.newFilter=ge("eth_newFilter");ce.prototype.newBlockFilter=ge("eth_newBlockFilter");ce.prototype.newPendingTransactionFilter=ge("eth_newPendingTransactionFilter");ce.prototype.uninstallFilter=ge("eth_uninstallFilter");ce.prototype.getFilterChanges=ge("eth_getFilterChanges");ce.prototype.getFilterLogs=ge("eth_getFilterLogs");ce.prototype.getLogs=ge("eth_getLogs");ce.prototype.getWork=ge("eth_getWork");ce.prototype.submitWork=ge("eth_submitWork");ce.prototype.submitHashrate=ge("eth_submitHashrate");ce.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(y2(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function ge(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function ri(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 y2(e){return p2({id:g2(),jsonrpc:"2.0",params:[]},e)}const yl=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((c,o)=>{t.multiArgs?i.push((...g)=>{t.errorFirst?g[0]?o(g):(g.shift(),c(g)):c(g)}):t.errorFirst?i.push((g,p)=>{g?o(g):c(p)}):i.push(c),Reflect.apply(e,this===r?n:this,i)})},vl=new WeakMap;var v2=(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=(c,o)=>{let f=vl.get(c);if(f||(f={},vl.set(c,f)),o in f)return f[o];const g=j=>typeof j=="string"||typeof o=="symbol"?o===j:j.test(o),p=Reflect.getOwnPropertyDescriptor(c,o),v=p===void 0||p.writable||p.configurable,k=(t.include?t.include.some(g):!t.exclude.some(g))&&v;return f[o]=k,k},i=new WeakMap,s=new Proxy(e,{apply(c,o,f){const g=i.get(c);if(g)return Reflect.apply(g,o,f);const p=t.excludeMain?c:yl(c,t,s,c);return i.set(c,p),Reflect.apply(p,o,f)},get(c,o){const f=c[o];if(!n(c,o)||f===Function.prototype[o])return f;const g=i.get(f);if(g)return g;if(typeof f=="function"){const p=yl(f,t,s,c);return i.set(f,p),p}return f}});return s};const w2=Jn.default;let b2=class extends w2{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 Ia=b2;const _2=Ia;let E2=class extends _2{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 S2=E2,ni={minBlockRef:R2,maxBlockRef:M2,sortBlockRefs:xa,bnToHex:C2,blockRefIsNumber:I2,hexToInt:Ni,incrementHexInt:x2,intToHex:Hh,unsafeRandomBytes:A2};function R2(...e){return xa(e)[0]}function M2(...e){const t=xa(e);return t[t.length-1]}function xa(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Ni(t)-Ni(r))}function C2(e){return"0x"+e.toString(16)}function I2(e){return e&&!["earliest","latest","pending"].includes(e)}function Ni(e){return e==null?e:Number.parseInt(e,16)}function x2(e){if(e==null)return e;const t=Ni(e);return Hh(t+1)}function Hh(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function A2(e){let t="0x";for(let r=0;r<e;r++)t+=wl(),t+=wl();return t}function wl(){return Math.floor(Math.random()*16).toString(16)}const k2=m2,T2=v2,B2=S2,{bnToHex:z_,hexToInt:vi,incrementHexInt:N2,minBlockRef:P2,blockRefIsNumber:L2}=ni;let O2=class extends B2{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new k2(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=P2(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=N2(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),o=(await this._fetchLogs(s)).filter(f=>this.matchLog(f));this.addResults(o)}async _fetchLogs(t){return await T2(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(vi(this.params.fromBlock)>=vi(t.blockNumber)||L2(this.params.toBlock)&&vi(this.params.toBlock)<=vi(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 c=t.topics[s];if(!c)return!1;c=c.toLowerCase();let o=Array.isArray(i)?i:[i];return o.includes(null)?!0:(o=o.map(p=>p.toLowerCase()),o.includes(c))})}};var $2=O2,Aa=F2;async function F2({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=bl(t),s=bl(r)-n+1,c=Array(s).fill().map((f,g)=>n+g).map(D2);let o=await Promise.all(c.map(f=>U2(e,"eth_getBlockByNumber",[f,!1])));return o=o.filter(f=>f!==null),o}function bl(e){return e==null?e:Number.parseInt(e,16)}function D2(e){return e==null?e:"0x"+e.toString(16)}function j2(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 U2(e,t,r){for(let n=0;n<3;n++)try{return await j2(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 H2=Ia,W2=Aa,{incrementHexInt:V2}=ni;let q2=class extends H2{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=V2(t),c=(await W2({provider:this.provider,fromBlock:i,toBlock:n})).map(o=>o.hash);this.addResults(c)}};var z2=q2;const G2=Ia,J2=Aa,{incrementHexInt:Z2}=ni;let K2=class extends G2{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=Z2(t),i=await J2({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const c of i)s.push(...c.transactions);this.addResults(s)}};var Y2=K2;const Q2=Uh.Mutex,{createAsyncMiddleware:X2,createScaffoldMiddleware:e_}=_a,t_=$2,r_=z2,n_=Y2,{intToHex:Wh,hexToInt:Eo}=ni;var i_=s_;function s_({blockTracker:e,provider:t}){let r=0,n={};const i=new Q2,s=o_({mutex:i}),c=e_({eth_newFilter:s(So(f)),eth_newBlockFilter:s(So(g)),eth_newPendingTransactionFilter:s(So(p)),eth_uninstallFilter:s(Ci(k)),eth_getFilterChanges:s(Ci(v)),eth_getFilterLogs:s(Ci(b))}),o=async({oldBlock:P,newBlock:$})=>{if(n.length===0)return;const V=await i.acquire();try{await Promise.all(Hr(n).map(async D=>{try{await D.update({oldBlock:P,newBlock:$})}catch(z){console.error(z)}}))}catch(D){console.error(D)}V()};return c.newLogFilter=f,c.newBlockFilter=g,c.newPendingTransactionFilter=p,c.uninstallFilter=k,c.getFilterChanges=v,c.getFilterLogs=b,c.destroy=()=>{H()},c;async function f(P){const $=new t_({provider:t,params:P});return await j($),$}async function g(){const P=new r_({provider:t});return await j(P),P}async function p(){const P=new n_({provider:t});return await j(P),P}async function v(P){const $=Eo(P),V=n[$];if(!V)throw new Error(`No filter for index "${$}"`);return V.getChangesAndClear()}async function b(P){const $=Eo(P),V=n[$];if(!V)throw new Error(`No filter for index "${$}"`);let D=[];return V.type==="log"&&(D=V.getAllResults()),D}async function k(P){const $=Eo(P),D=!!n[$];return D&&await O($),D}async function j(P){const $=Hr(n).length,V=await e.getLatestBlock();await P.initialize({currentBlock:V}),r++,n[r]=P,P.id=r,P.idHex=Wh(r);const D=Hr(n).length;return A({prevFilterCount:$,newFilterCount:D}),r}async function O(P){const $=Hr(n).length;delete n[P];const V=Hr(n).length;A({prevFilterCount:$,newFilterCount:V})}async function H(){const P=Hr(n).length;n={},A({prevFilterCount:P,newFilterCount:0})}function A({prevFilterCount:P,newFilterCount:$}){if(P===0&&$>0){e.on("sync",o);return}if(P>0&&$===0){e.removeListener("sync",o);return}}}function So(e){return Ci(async(...t)=>{const r=await e(...t);return Wh(r.id)})}function Ci(e){return X2(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function o_({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Hr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const a_=Jn.default,{createAsyncMiddleware:_l,createScaffoldMiddleware:c_}=_a,l_=i_,{unsafeRandomBytes:u_,incrementHexInt:h_}=ni,f_=Aa;var d_=p_;function p_({blockTracker:e,provider:t}){const r={},n=l_({blockTracker:e,provider:t});let i=!1;const s=new a_,c=c_({eth_subscribe:_l(o),eth_unsubscribe:_l(f)});return c.destroy=p,{events:s,middleware:c};async function o(v,b){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const k=v.params[0],j=u_(16);let O;switch(k){case"newHeads":O=H({subId:j});break;case"logs":const P=v.params[1],$=await n.newLogFilter(P);O=A({subId:j,filter:$});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${k}"`)}r[j]=O,b.result=j;return;function H({subId:P}){const $={type:k,destroy:async()=>{e.removeListener("sync",$.update)},update:async({oldBlock:V,newBlock:D})=>{const z=D,te=h_(V);(await f_({provider:t,fromBlock:te,toBlock:z})).map(g_).filter(de=>de!==null).forEach(de=>{g(P,de)})}};return e.on("sync",$.update),$}function A({subId:P,filter:$}){return $.on("update",D=>g(P,D)),{type:k,destroy:async()=>await n.uninstallFilter($.idHex)}}}async function f(v,b){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const k=v.params[0],j=r[k];if(!j){b.result=!1;return}delete r[k],await j.destroy(),b.result=!0}function g(v,b){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:v,result:b}})}function p(){s.removeAllListeners();for(const v in r)r[v].destroy(),delete r[v];i=!0}}function g_(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(fs,"__esModule",{value:!0});fs.SubscriptionManager=void 0;const m_=Xu,y_=d_,El=()=>{};class v_{constructor(t){const r=new m_.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=y_({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,El,El),r}destroy(){this.subscriptionMiddleware.destroy()}}fs.SubscriptionManager=v_;var Vh=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CoinbaseWalletProvider=void 0;const w_=Vh($i),b_=k0,ye=Bn,fe=X,__=On,Sl=wt,wi=hn,ht=cn,Ro=Vh(sm),bn=un,E_=nn,S_=fs,Rl="DefaultChainId",Ml="DefaultJsonRpcUrl";class R_ extends b_.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new E_.FilterPolyfill(this),this._subscriptionManager=new S_.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,fe.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const c=this._storage.getItem(Sl.LOCAL_STORAGE_ADDRESSES_KEY);if(c){const o=c.split(" ");o[0]!==""&&(this._addresses=o.map(f=>(0,fe.ensureAddressString)(f)),this.emit("accountsChanged",o))}this._subscriptionManager.events.on("notification",o=>{this.emit("message",{type:o.method,data:o.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",o=>{var f;if(!(o.origin!==location.origin||o.source!==window)&&o.data.type==="walletLinkMessage"&&o.data.data.action==="dappChainSwitched"){const g=o.data.data.chainId,p=(f=o.data.data.jsonRpcUrl)!==null&&f!==void 0?f:this.jsonRpcUrl;this.updateProviderInfo(p,Number(g))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,fe.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(Ml))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Ml,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(Rl,r.toString(10)),((0,fe.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,c){const f=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,c==null?void 0:c.toString()).promise;return(0,ht.isErrorResponse)(f)?!1:!!f.result}async addEthereumChain(t,r,n,i,s,c){var o,f;if((0,fe.ensureIntNumber)(t)===this.getChainId())return!1;const g=await this.initializeRelay(),p=g.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await g.requestEthereumAccounts().promise;const v=await g.addEthereumChain(t.toString(),r,s,n,i,c).promise;return(0,ht.isErrorResponse)(v)?!1:(((o=v.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(r[0],t),((f=v.result)===null||f===void 0?void 0:f.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,ht.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===ye.standardErrorCodes.provider.unsupportedChain?ye.standardErrors.provider.unsupportedChain():ye.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?wi.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,ye.serializeError)(i,t)})}catch(n){throw(0,ye.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],c={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(c).then(o=>o.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,ye.serializeError)(n,t)})}catch(n){return Promise.reject((0,ye.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,ye.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,ye.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw ye.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 ye.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 ye.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,fe.ensureRegExpString)(t)).promise;if((0,ht.isErrorResponse)(n))throw(0,ye.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,ye.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,ht.isErrorResponse)(i))throw(0,ye.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,ye.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?wi.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof __.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ht.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,ht.isErrorResponse)(n))throw(0,ye.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,ye.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,fe.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Sl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(o=>r(Object.assign(Object.assign({},o),{id:t.id}))).catch(o=>n(o));return}const c=this._handleSubscriptionMethods(t);if(c!==void 0){c.then(o=>r({jsonrpc:"2.0",id:t.id,result:o.result})).catch(o=>n(o));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var c;throw(s.code===ye.standardErrorCodes.rpc.methodNotFound||s.code===ye.standardErrorCodes.rpc.methodNotSupported)&&((c=this.diagnostic)===null||c===void 0||c.log(bn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?wi.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,fe.ensureAddressString)(t);return this._addresses.map(i=>(0,fe.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,fe.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,fe.ensureAddressString)(t.to):null,i=t.value!=null?(0,fe.ensureBN)(t.value):new w_.default(0),s=t.data?(0,fe.ensureBuffer)(t.data):Buffer.alloc(0),c=t.nonce!=null?(0,fe.ensureIntNumber)(t.nonce):null,o=t.gasPrice!=null?(0,fe.ensureBN)(t.gasPrice):null,f=t.maxFeePerGas!=null?(0,fe.ensureBN)(t.maxFeePerGas):null,g=t.maxPriorityFeePerGas!=null?(0,fe.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,fe.ensureBN)(t.gas):null,v=t.chainId?(0,fe.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:c,gasPriceInWei:o,maxFeePerGas:f,maxPriorityFeePerGas:g,gasLimit:p,chainId:v}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ye.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ye.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const c=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,ht.isErrorResponse)(c))throw new Error(c.errorMessage);return{jsonrpc:"2.0",id:0,result:c.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,ht.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,fe.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Rl);if(!t)return(0,fe.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,fe.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?wi.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,ht.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ye.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,fe.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,fe.ensureParsedJSONObject)(t[0]),n=(0,fe.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=Ro.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Ro.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Ro.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 c=t[0];if(((r=c.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(!c.chainName||c.chainName.trim()==="")throw ye.standardErrors.rpc.invalidParams("chainName is a required field");if(!c.nativeCurrency)throw ye.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(c.chainId,16);return await this.addEthereumChain(o,(n=c.rpcUrls)!==null&&n!==void 0?n:[],(i=c.blockExplorerUrls)!==null&&i!==void 0?i:[],c.chainName,(s=c.iconUrls)!==null&&s!==void 0?s:[],c.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 ye.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw ye.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw ye.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw ye.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:c,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,o,c,n)}}_eth_uninstallFilter(t){const r=(0,fe.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,fe.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,fe.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=R_;var ks={};Object.defineProperty(ks,"__esModule",{value:!0});ks.RelayEventManager=void 0;const M_=X;class C_{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,M_.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}ks.RelayEventManager=C_;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.CoinbaseWalletSDK=void 0;const I_=Li,x_=Oi,Cl=X,A_=Hi,k_=Xr,T_=On,B_=zn,N_=ks,P_=Wn,L_=$n,qh=ln;class Ts{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||x_.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 c=new URL(s),o=`${c.protocol}//${c.host}`;if(this._storage=new A_.ScopedLocalStorage(`-walletlink:${o}`),this._storage.setItem("version",Ts.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new N_.RelayEventManager;const f=(0,Cl.isMobileWeb)(),g=t.uiConstructor||(v=>f?new B_.MobileRelayUI(v):new P_.WalletLinkRelayUI(v)),p={linkAPIUrl:s,version:qh.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:g,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=f?new T_.MobileRelay(p):new L_.WalletLinkRelay(p),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 k_.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,Cl.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,I_.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}}Rn.CoinbaseWalletSDK=Ts;Ts.VERSION=qh.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=Rn,r=Xr;var n=Rn;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)})(Yl);const O_=Gh(Yl),K_=Object.freeze(Object.defineProperty({__proto__:null,default:O_},Symbol.toStringTag,{value:"Module"}));export{K_ as i};
12
+ ${_o(t)}`,{request:t})}}ti.JsonRpcEngine=Dt;function _o(e){return JSON.stringify(e,null,2)}var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.mergeMiddleware=void 0;const i2=ti;function s2(e){const t=new i2.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Is.mergeMiddleware=s2;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__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(Ss,e),r(Rs,e),r(Cs,e),r(ei,e),r(ti,e),r(Is,e)})(ba);var jh={},Ra={};const Ca=an(qh);var xs={};Object.defineProperty(xs,"__esModule",{value:!0});var pl=Ca,o2=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 pl.__awaiter(this,void 0,void 0,function(){var r,n,i;return pl.__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}();xs.default=o2;Object.defineProperty(Ra,"__esModule",{value:!0});var gl=Ca,a2=xs,c2=function(){function e(){this._semaphore=new a2.default(1)}return e.prototype.acquire=function(){return gl.__awaiter(this,void 0,void 0,function(){var t,r;return gl.__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}();Ra.default=c2;var As={};Object.defineProperty(As,"__esModule",{value:!0});As.withTimeout=void 0;var yi=Ca;function l2(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return yi.__awaiter(n,void 0,void 0,function(){var c,o,f;return yi.__generator(this,function(g){switch(g.label){case 0:return c=!1,setTimeout(function(){c=!0,s(r)},t),[4,e.acquire()];case 1:return o=g.sent(),c?(f=Array.isArray(o)?o[1]:o,f()):i(o),[2]}})})})},runExclusive:function(i){return yi.__awaiter(this,void 0,void 0,function(){var s,c;return yi.__generator(this,function(o){switch(o.label){case 0:s=function(){},o.label=1;case 1:return o.trys.push([1,,7,8]),[4,this.acquire()];case 2:return c=o.sent(),Array.isArray(c)?(s=c[1],[4,i(c[0])]):[3,4];case 3:return[2,o.sent()];case 4:return s=c,[4,i()];case 5:return[2,o.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}As.withTimeout=l2;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=Ra;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=xs;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=As;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(jh);var u2=f2,h2=Object.prototype.hasOwnProperty;function f2(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)h2.call(r,n)&&(e[n]=r[n])}return e}const d2=u2,p2=na();var g2=ce;function ce(e){const t=this;t.currentProvider=e}ce.prototype.getBalance=ri(2,"eth_getBalance");ce.prototype.getCode=ri(2,"eth_getCode");ce.prototype.getTransactionCount=ri(2,"eth_getTransactionCount");ce.prototype.getStorageAt=ri(3,"eth_getStorageAt");ce.prototype.call=ri(2,"eth_call");ce.prototype.protocolVersion=ge("eth_protocolVersion");ce.prototype.syncing=ge("eth_syncing");ce.prototype.coinbase=ge("eth_coinbase");ce.prototype.mining=ge("eth_mining");ce.prototype.hashrate=ge("eth_hashrate");ce.prototype.gasPrice=ge("eth_gasPrice");ce.prototype.accounts=ge("eth_accounts");ce.prototype.blockNumber=ge("eth_blockNumber");ce.prototype.getBlockTransactionCountByHash=ge("eth_getBlockTransactionCountByHash");ce.prototype.getBlockTransactionCountByNumber=ge("eth_getBlockTransactionCountByNumber");ce.prototype.getUncleCountByBlockHash=ge("eth_getUncleCountByBlockHash");ce.prototype.getUncleCountByBlockNumber=ge("eth_getUncleCountByBlockNumber");ce.prototype.sign=ge("eth_sign");ce.prototype.sendTransaction=ge("eth_sendTransaction");ce.prototype.sendRawTransaction=ge("eth_sendRawTransaction");ce.prototype.estimateGas=ge("eth_estimateGas");ce.prototype.getBlockByHash=ge("eth_getBlockByHash");ce.prototype.getBlockByNumber=ge("eth_getBlockByNumber");ce.prototype.getTransactionByHash=ge("eth_getTransactionByHash");ce.prototype.getTransactionByBlockHashAndIndex=ge("eth_getTransactionByBlockHashAndIndex");ce.prototype.getTransactionByBlockNumberAndIndex=ge("eth_getTransactionByBlockNumberAndIndex");ce.prototype.getTransactionReceipt=ge("eth_getTransactionReceipt");ce.prototype.getUncleByBlockHashAndIndex=ge("eth_getUncleByBlockHashAndIndex");ce.prototype.getUncleByBlockNumberAndIndex=ge("eth_getUncleByBlockNumberAndIndex");ce.prototype.getCompilers=ge("eth_getCompilers");ce.prototype.compileLLL=ge("eth_compileLLL");ce.prototype.compileSolidity=ge("eth_compileSolidity");ce.prototype.compileSerpent=ge("eth_compileSerpent");ce.prototype.newFilter=ge("eth_newFilter");ce.prototype.newBlockFilter=ge("eth_newBlockFilter");ce.prototype.newPendingTransactionFilter=ge("eth_newPendingTransactionFilter");ce.prototype.uninstallFilter=ge("eth_uninstallFilter");ce.prototype.getFilterChanges=ge("eth_getFilterChanges");ce.prototype.getFilterLogs=ge("eth_getFilterLogs");ce.prototype.getLogs=ge("eth_getLogs");ce.prototype.getWork=ge("eth_getWork");ce.prototype.submitWork=ge("eth_submitWork");ce.prototype.submitHashrate=ge("eth_submitHashrate");ce.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(m2(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function ge(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function ri(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 m2(e){return d2({id:p2(),jsonrpc:"2.0",params:[]},e)}const ml=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((c,o)=>{t.multiArgs?i.push((...g)=>{t.errorFirst?g[0]?o(g):(g.shift(),c(g)):c(g)}):t.errorFirst?i.push((g,p)=>{g?o(g):c(p)}):i.push(c),Reflect.apply(e,this===r?n:this,i)})},yl=new WeakMap;var y2=(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=(c,o)=>{let f=yl.get(c);if(f||(f={},yl.set(c,f)),o in f)return f[o];const g=j=>typeof j=="string"||typeof o=="symbol"?o===j:j.test(o),p=Reflect.getOwnPropertyDescriptor(c,o),v=p===void 0||p.writable||p.configurable,k=(t.include?t.include.some(g):!t.exclude.some(g))&&v;return f[o]=k,k},i=new WeakMap,s=new Proxy(e,{apply(c,o,f){const g=i.get(c);if(g)return Reflect.apply(g,o,f);const p=t.excludeMain?c:ml(c,t,s,c);return i.set(c,p),Reflect.apply(p,o,f)},get(c,o){const f=c[o];if(!n(c,o)||f===Function.prototype[o])return f;const g=i.get(f);if(g)return g;if(typeof f=="function"){const p=ml(f,t,s,c);return i.set(f,p),p}return f}});return s};const v2=Jn.default;let w2=class extends v2{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 Ma=w2;const b2=Ma;let _2=class extends b2{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 E2=_2,ni={minBlockRef:S2,maxBlockRef:R2,sortBlockRefs:Ia,bnToHex:C2,blockRefIsNumber:M2,hexToInt:Ni,incrementHexInt:I2,intToHex:Uh,unsafeRandomBytes:x2};function S2(...e){return Ia(e)[0]}function R2(...e){const t=Ia(e);return t[t.length-1]}function Ia(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Ni(t)-Ni(r))}function C2(e){return"0x"+e.toString(16)}function M2(e){return e&&!["earliest","latest","pending"].includes(e)}function Ni(e){return e==null?e:Number.parseInt(e,16)}function I2(e){if(e==null)return e;const t=Ni(e);return Uh(t+1)}function Uh(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function x2(e){let t="0x";for(let r=0;r<e;r++)t+=vl(),t+=vl();return t}function vl(){return Math.floor(Math.random()*16).toString(16)}const A2=g2,k2=y2,T2=E2,{bnToHex:z_,hexToInt:vi,incrementHexInt:B2,minBlockRef:N2,blockRefIsNumber:P2}=ni;let L2=class extends T2{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new A2(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=N2(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=B2(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),o=(await this._fetchLogs(s)).filter(f=>this.matchLog(f));this.addResults(o)}async _fetchLogs(t){return await k2(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(vi(this.params.fromBlock)>=vi(t.blockNumber)||P2(this.params.toBlock)&&vi(this.params.toBlock)<=vi(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 c=t.topics[s];if(!c)return!1;c=c.toLowerCase();let o=Array.isArray(i)?i:[i];return o.includes(null)?!0:(o=o.map(p=>p.toLowerCase()),o.includes(c))})}};var O2=L2,xa=$2;async function $2({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=wl(t),s=wl(r)-n+1,c=Array(s).fill().map((f,g)=>n+g).map(F2);let o=await Promise.all(c.map(f=>j2(e,"eth_getBlockByNumber",[f,!1])));return o=o.filter(f=>f!==null),o}function wl(e){return e==null?e:Number.parseInt(e,16)}function F2(e){return e==null?e:"0x"+e.toString(16)}function D2(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 j2(e,t,r){for(let n=0;n<3;n++)try{return await D2(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 U2=Ma,H2=xa,{incrementHexInt:W2}=ni;let V2=class extends U2{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=W2(t),c=(await H2({provider:this.provider,fromBlock:i,toBlock:n})).map(o=>o.hash);this.addResults(c)}};var q2=V2;const z2=Ma,G2=xa,{incrementHexInt:J2}=ni;let Z2=class extends z2{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=J2(t),i=await G2({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const c of i)s.push(...c.transactions);this.addResults(s)}};var K2=Z2;const Y2=jh.Mutex,{createAsyncMiddleware:Q2,createScaffoldMiddleware:X2}=ba,e_=O2,t_=q2,r_=K2,{intToHex:Hh,hexToInt:Eo}=ni;var n_=i_;function i_({blockTracker:e,provider:t}){let r=0,n={};const i=new Y2,s=s_({mutex:i}),c=X2({eth_newFilter:s(So(f)),eth_newBlockFilter:s(So(g)),eth_newPendingTransactionFilter:s(So(p)),eth_uninstallFilter:s(Mi(k)),eth_getFilterChanges:s(Mi(v)),eth_getFilterLogs:s(Mi(b))}),o=async({oldBlock:P,newBlock:$})=>{if(n.length===0)return;const V=await i.acquire();try{await Promise.all(Hr(n).map(async D=>{try{await D.update({oldBlock:P,newBlock:$})}catch(z){console.error(z)}}))}catch(D){console.error(D)}V()};return c.newLogFilter=f,c.newBlockFilter=g,c.newPendingTransactionFilter=p,c.uninstallFilter=k,c.getFilterChanges=v,c.getFilterLogs=b,c.destroy=()=>{H()},c;async function f(P){const $=new e_({provider:t,params:P});return await j($),$}async function g(){const P=new t_({provider:t});return await j(P),P}async function p(){const P=new r_({provider:t});return await j(P),P}async function v(P){const $=Eo(P),V=n[$];if(!V)throw new Error(`No filter for index "${$}"`);return V.getChangesAndClear()}async function b(P){const $=Eo(P),V=n[$];if(!V)throw new Error(`No filter for index "${$}"`);let D=[];return V.type==="log"&&(D=V.getAllResults()),D}async function k(P){const $=Eo(P),D=!!n[$];return D&&await O($),D}async function j(P){const $=Hr(n).length,V=await e.getLatestBlock();await P.initialize({currentBlock:V}),r++,n[r]=P,P.id=r,P.idHex=Hh(r);const D=Hr(n).length;return A({prevFilterCount:$,newFilterCount:D}),r}async function O(P){const $=Hr(n).length;delete n[P];const V=Hr(n).length;A({prevFilterCount:$,newFilterCount:V})}async function H(){const P=Hr(n).length;n={},A({prevFilterCount:P,newFilterCount:0})}function A({prevFilterCount:P,newFilterCount:$}){if(P===0&&$>0){e.on("sync",o);return}if(P>0&&$===0){e.removeListener("sync",o);return}}}function So(e){return Mi(async(...t)=>{const r=await e(...t);return Hh(r.id)})}function Mi(e){return Q2(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function s_({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Hr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const o_=Jn.default,{createAsyncMiddleware:bl,createScaffoldMiddleware:a_}=ba,c_=n_,{unsafeRandomBytes:l_,incrementHexInt:u_}=ni,h_=xa;var f_=d_;function d_({blockTracker:e,provider:t}){const r={},n=c_({blockTracker:e,provider:t});let i=!1;const s=new o_,c=a_({eth_subscribe:bl(o),eth_unsubscribe:bl(f)});return c.destroy=p,{events:s,middleware:c};async function o(v,b){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const k=v.params[0],j=l_(16);let O;switch(k){case"newHeads":O=H({subId:j});break;case"logs":const P=v.params[1],$=await n.newLogFilter(P);O=A({subId:j,filter:$});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${k}"`)}r[j]=O,b.result=j;return;function H({subId:P}){const $={type:k,destroy:async()=>{e.removeListener("sync",$.update)},update:async({oldBlock:V,newBlock:D})=>{const z=D,te=u_(V);(await h_({provider:t,fromBlock:te,toBlock:z})).map(p_).filter(de=>de!==null).forEach(de=>{g(P,de)})}};return e.on("sync",$.update),$}function A({subId:P,filter:$}){return $.on("update",D=>g(P,D)),{type:k,destroy:async()=>await n.uninstallFilter($.idHex)}}}async function f(v,b){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const k=v.params[0],j=r[k];if(!j){b.result=!1;return}delete r[k],await j.destroy(),b.result=!0}function g(v,b){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:v,result:b}})}function p(){s.removeAllListeners();for(const v in r)r[v].destroy(),delete r[v];i=!0}}function p_(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(fs,"__esModule",{value:!0});fs.SubscriptionManager=void 0;const g_=Qu,m_=f_,_l=()=>{};class y_{constructor(t){const r=new g_.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=m_({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,_l,_l),r}destroy(){this.subscriptionMiddleware.destroy()}}fs.SubscriptionManager=y_;var Wh=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CoinbaseWalletProvider=void 0;const v_=Wh($i),w_=A0,ye=Bn,fe=X,b_=On,El=wt,wi=hn,ht=cn,Ro=Wh(im),bn=un,__=nn,E_=fs,Sl="DefaultChainId",Rl="DefaultJsonRpcUrl";class S_ extends w_.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new __.FilterPolyfill(this),this._subscriptionManager=new E_.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,fe.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const c=this._storage.getItem(El.LOCAL_STORAGE_ADDRESSES_KEY);if(c){const o=c.split(" ");o[0]!==""&&(this._addresses=o.map(f=>(0,fe.ensureAddressString)(f)),this.emit("accountsChanged",o))}this._subscriptionManager.events.on("notification",o=>{this.emit("message",{type:o.method,data:o.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",o=>{var f;if(!(o.origin!==location.origin||o.source!==window)&&o.data.type==="walletLinkMessage"&&o.data.data.action==="dappChainSwitched"){const g=o.data.data.chainId,p=(f=o.data.data.jsonRpcUrl)!==null&&f!==void 0?f:this.jsonRpcUrl;this.updateProviderInfo(p,Number(g))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,fe.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(Rl))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Rl,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(Sl,r.toString(10)),((0,fe.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,c){const f=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,c==null?void 0:c.toString()).promise;return(0,ht.isErrorResponse)(f)?!1:!!f.result}async addEthereumChain(t,r,n,i,s,c){var o,f;if((0,fe.ensureIntNumber)(t)===this.getChainId())return!1;const g=await this.initializeRelay(),p=g.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await g.requestEthereumAccounts().promise;const v=await g.addEthereumChain(t.toString(),r,s,n,i,c).promise;return(0,ht.isErrorResponse)(v)?!1:(((o=v.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(r[0],t),((f=v.result)===null||f===void 0?void 0:f.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,ht.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===ye.standardErrorCodes.provider.unsupportedChain?ye.standardErrors.provider.unsupportedChain():ye.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?wi.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,ye.serializeError)(i,t)})}catch(n){throw(0,ye.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],c={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(c).then(o=>o.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,ye.serializeError)(n,t)})}catch(n){return Promise.reject((0,ye.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,ye.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,ye.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw ye.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 ye.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 ye.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,fe.ensureRegExpString)(t)).promise;if((0,ht.isErrorResponse)(n))throw(0,ye.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,ye.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,ht.isErrorResponse)(i))throw(0,ye.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,ye.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?wi.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof b_.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ht.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,ht.isErrorResponse)(n))throw(0,ye.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,ye.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,fe.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(El.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(o=>r(Object.assign(Object.assign({},o),{id:t.id}))).catch(o=>n(o));return}const c=this._handleSubscriptionMethods(t);if(c!==void 0){c.then(o=>r({jsonrpc:"2.0",id:t.id,result:o.result})).catch(o=>n(o));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var c;throw(s.code===ye.standardErrorCodes.rpc.methodNotFound||s.code===ye.standardErrorCodes.rpc.methodNotSupported)&&((c=this.diagnostic)===null||c===void 0||c.log(bn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?wi.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,fe.ensureAddressString)(t);return this._addresses.map(i=>(0,fe.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,fe.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,fe.ensureAddressString)(t.to):null,i=t.value!=null?(0,fe.ensureBN)(t.value):new v_.default(0),s=t.data?(0,fe.ensureBuffer)(t.data):Buffer.alloc(0),c=t.nonce!=null?(0,fe.ensureIntNumber)(t.nonce):null,o=t.gasPrice!=null?(0,fe.ensureBN)(t.gasPrice):null,f=t.maxFeePerGas!=null?(0,fe.ensureBN)(t.maxFeePerGas):null,g=t.maxPriorityFeePerGas!=null?(0,fe.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,fe.ensureBN)(t.gas):null,v=t.chainId?(0,fe.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:c,gasPriceInWei:o,maxFeePerGas:f,maxPriorityFeePerGas:g,gasLimit:p,chainId:v}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ye.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ye.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const c=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,ht.isErrorResponse)(c))throw new Error(c.errorMessage);return{jsonrpc:"2.0",id:0,result:c.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,ht.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,fe.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Sl);if(!t)return(0,fe.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,fe.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?wi.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,ht.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ye.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,fe.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,ht.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ye.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,fe.ensureParsedJSONObject)(t[0]),n=(0,fe.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=Ro.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Ro.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Ro.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 c=t[0];if(((r=c.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(!c.chainName||c.chainName.trim()==="")throw ye.standardErrors.rpc.invalidParams("chainName is a required field");if(!c.nativeCurrency)throw ye.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(c.chainId,16);return await this.addEthereumChain(o,(n=c.rpcUrls)!==null&&n!==void 0?n:[],(i=c.blockExplorerUrls)!==null&&i!==void 0?i:[],c.chainName,(s=c.iconUrls)!==null&&s!==void 0?s:[],c.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 ye.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw ye.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw ye.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw ye.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:c,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,o,c,n)}}_eth_uninstallFilter(t){const r=(0,fe.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,fe.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,fe.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=S_;var ks={};Object.defineProperty(ks,"__esModule",{value:!0});ks.RelayEventManager=void 0;const R_=X;class C_{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,R_.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}ks.RelayEventManager=C_;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.CoinbaseWalletSDK=void 0;const M_=Li,I_=Oi,Cl=X,x_=Hi,A_=Xr,k_=On,T_=zn,B_=ks,N_=Wn,P_=$n,Vh=ln;class Ts{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||I_.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 c=new URL(s),o=`${c.protocol}//${c.host}`;if(this._storage=new x_.ScopedLocalStorage(`-walletlink:${o}`),this._storage.setItem("version",Ts.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new B_.RelayEventManager;const f=(0,Cl.isMobileWeb)(),g=t.uiConstructor||(v=>f?new T_.MobileRelayUI(v):new N_.WalletLinkRelayUI(v)),p={linkAPIUrl:s,version:Vh.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:g,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=f?new k_.MobileRelay(p):new P_.WalletLinkRelay(p),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 A_.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,Cl.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,M_.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}}Rn.CoinbaseWalletSDK=Ts;Ts.VERSION=Vh.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=Rn,r=Xr;var n=Rn;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)})(Kl);const L_=zh(Kl),K_=Object.freeze(Object.defineProperty({__proto__:null,default:L_},Symbol.toStringTag,{value:"Module"}));export{K_ as i};