@dcl/auth-site 0.1.3-7359390835.commit-b3d936d → 0.1.3-7378840092.commit-24eec55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/index-10563468.js +55 -0
- package/assets/index-10563468.js.map +1 -0
- package/assets/{index-8d58c045.css → index-9bcd4ac5.css} +3 -3
- package/assets/index-ae5690b8.js +187 -0
- package/assets/index-ae5690b8.js.map +1 -0
- package/assets/index-bbaa3fa3.js +28 -0
- package/assets/index-bbaa3fa3.js.map +1 -0
- package/index.html +2 -2
- package/package.json +3 -3
- package/assets/correct-7356ede5.svg +0 -4
- package/assets/index-668ee52f.js +0 -182
- package/assets/index-9d208deb.js +0 -30
package/assets/index-9d208deb.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import{e as Zu,r as yo,c as te,g as mi,_ as J,a as bo,b as xg}from"./index-668ee52f.js";function Mg(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Qu={},Zi={},vo={};Object.defineProperty(vo,"__esModule",{value:!0});vo.walletLogo=void 0;const Cg=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' 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=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' 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=e,`data:image/svg+xml,%3Csvg width='${e}' 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 `}};vo.walletLogo=Cg;var mo={};Object.defineProperty(mo,"__esModule",{value:!0});mo.LINK_API_URL=void 0;mo.LINK_API_URL="https://www.walletlink.org";var wo={};Object.defineProperty(wo,"__esModule",{value:!0});wo.ScopedLocalStorage=void 0;class Ig{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}wo.ScopedLocalStorage=Ig;var ni={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});const Rg=Zu;function fl(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Ag(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}let Tg=class extends Rg.EventEmitter{emit(e,...r){let n=e==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")fl(s,this,r);else{const o=s.length,a=Ag(s);for(let u=0;u<o;u+=1)fl(a[u],this,r)}return!0}};_n.default=Tg;var Yu={exports:{}};Yu.exports;(function(t){(function(e,r){function n(w,c){if(!w)throw new Error(c||"Assertion failed")}function i(w,c){w.super_=c;var y=function(){};y.prototype=c.prototype,w.prototype=new y,w.prototype.constructor=w}function s(w,c,y){if(s.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&((c==="le"||c==="be")&&(y=c,c=10),this._init(w||0,c||10,y||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=yo.Buffer}catch{}s.isBN=function(c){return c instanceof s?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===s.wordSize&&Array.isArray(c.words)},s.max=function(c,y){return c.cmp(y)>0?c:y},s.min=function(c,y){return c.cmp(y)<0?c:y},s.prototype._init=function(c,y,v){if(typeof c=="number")return this._initNumber(c,y,v);if(typeof c=="object")return this._initArray(c,y,v);y==="hex"&&(y=16),n(y===(y|0)&&y>=2&&y<=36),c=c.toString().replace(/\s+/g,"");var S=0;c[0]==="-"&&(S++,this.negative=1),S<c.length&&(y===16?this._parseHex(c,S,v):(this._parseBase(c,y,S),v==="le"&&this._initArray(this.toArray(),y,v)))},s.prototype._initNumber=function(c,y,v){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(n(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),v==="le"&&this._initArray(this.toArray(),y,v)},s.prototype._initArray=function(c,y,v){if(n(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E,k,L=0;if(v==="be")for(S=c.length-1,E=0;S>=0;S-=3)k=c[S]|c[S-1]<<8|c[S-2]<<16,this.words[E]|=k<<L&67108863,this.words[E+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,E++);else if(v==="le")for(S=0,E=0;S<c.length;S+=3)k=c[S]|c[S+1]<<8|c[S+2]<<16,this.words[E]|=k<<L&67108863,this.words[E+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,E++);return this._strip()};function a(w,c){var y=w.charCodeAt(c);if(y>=48&&y<=57)return y-48;if(y>=65&&y<=70)return y-55;if(y>=97&&y<=102)return y-87;n(!1,"Invalid character in "+w)}function u(w,c,y){var v=a(w,y);return y-1>=c&&(v|=a(w,y-1)<<4),v}s.prototype._parseHex=function(c,y,v){this.length=Math.ceil((c.length-y)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E=0,k=0,L;if(v==="be")for(S=c.length-1;S>=y;S-=2)L=u(c,y,S)<<E,this.words[k]|=L&67108863,E>=18?(E-=18,k+=1,this.words[k]|=L>>>26):E+=8;else{var _=c.length-y;for(S=_%2===0?y+1:y;S<c.length;S+=2)L=u(c,y,S)<<E,this.words[k]|=L&67108863,E>=18?(E-=18,k+=1,this.words[k]|=L>>>26):E+=8}this._strip()};function l(w,c,y,v){for(var S=0,E=0,k=Math.min(w.length,y),L=c;L<k;L++){var _=w.charCodeAt(L)-48;S*=v,_>=49?E=_-49+10:_>=17?E=_-17+10:E=_,n(_>=0&&E<v,"Invalid character"),S+=E}return S}s.prototype._parseBase=function(c,y,v){this.words=[0],this.length=1;for(var S=0,E=1;E<=67108863;E*=y)S++;S--,E=E/y|0;for(var k=c.length-v,L=k%S,_=Math.min(k,k-L)+v,d=0,A=v;A<_;A+=S)d=l(c,A,A+S,y),this.imuln(E),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(L!==0){var Y=1;for(d=l(c,A,c.length,y),A=0;A<L;A++)Y*=y;this.imuln(Y),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this._strip()},s.prototype.copy=function(c){c.words=new Array(this.length);for(var y=0;y<this.length;y++)c.words[y]=this.words[y];c.length=this.length,c.negative=this.negative,c.red=this.red};function p(w,c){w.words=c.words,w.length=c.length,w.negative=c.negative,w.red=c.red}if(s.prototype._move=function(c){p(c,this)},s.prototype.clone=function(){var c=new s(null);return this.copy(c),c},s.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],T=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(c,y){c=c||10,y=y|0||1;var v;if(c===16||c==="hex"){v="";for(var S=0,E=0,k=0;k<this.length;k++){var L=this.words[k],_=((L<<S|E)&16777215).toString(16);E=L>>>24-S&16777215,S+=2,S>=26&&(S-=26,k--),E!==0||k!==this.length-1?v=m[6-_.length]+_+v:v=_+v}for(E!==0&&(v=E.toString(16)+v);v.length%y!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(c===(c|0)&&c>=2&&c<=36){var d=C[c],A=T[c];v="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var ee=Y.modrn(A).toString(c);Y=Y.idivn(A),Y.isZero()?v=ee+v:v=m[d-ee.length]+ee+v}for(this.isZero()&&(v="0"+v);v.length%y!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(c,y){return this.toArrayLike(o,c,y)}),s.prototype.toArray=function(c,y){return this.toArrayLike(Array,c,y)};var P=function(c,y){return c.allocUnsafe?c.allocUnsafe(y):new c(y)};s.prototype.toArrayLike=function(c,y,v){this._strip();var S=this.byteLength(),E=v||Math.max(1,S);n(S<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var k=P(c,E),L=y==="le"?"LE":"BE";return this["_toArrayLike"+L](k,S),k},s.prototype._toArrayLikeLE=function(c,y){for(var v=0,S=0,E=0,k=0;E<this.length;E++){var L=this.words[E]<<k|S;c[v++]=L&255,v<c.length&&(c[v++]=L>>8&255),v<c.length&&(c[v++]=L>>16&255),k===6?(v<c.length&&(c[v++]=L>>24&255),S=0,k=0):(S=L>>>24,k+=2)}if(v<c.length)for(c[v++]=S;v<c.length;)c[v++]=0},s.prototype._toArrayLikeBE=function(c,y){for(var v=c.length-1,S=0,E=0,k=0;E<this.length;E++){var L=this.words[E]<<k|S;c[v--]=L&255,v>=0&&(c[v--]=L>>8&255),v>=0&&(c[v--]=L>>16&255),k===6?(v>=0&&(c[v--]=L>>24&255),S=0,k=0):(S=L>>>24,k+=2)}if(v>=0)for(c[v--]=S;v>=0;)c[v--]=0},Math.clz32?s.prototype._countBits=function(c){return 32-Math.clz32(c)}:s.prototype._countBits=function(c){var y=c,v=0;return y>=4096&&(v+=13,y>>>=13),y>=64&&(v+=7,y>>>=7),y>=8&&(v+=4,y>>>=4),y>=2&&(v+=2,y>>>=2),v+y},s.prototype._zeroBits=function(c){if(c===0)return 26;var y=c,v=0;return y&8191||(v+=13,y>>>=13),y&127||(v+=7,y>>>=7),y&15||(v+=4,y>>>=4),y&3||(v+=2,y>>>=2),y&1||v++,v},s.prototype.bitLength=function(){var c=this.words[this.length-1],y=this._countBits(c);return(this.length-1)*26+y};function U(w){for(var c=new Array(w.bitLength()),y=0;y<c.length;y++){var v=y/26|0,S=y%26;c[y]=w.words[v]>>>S&1}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,y=0;y<this.length;y++){var v=this._zeroBits(this.words[y]);if(c+=v,v!==26)break}return c},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},s.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var y=0;y<c.length;y++)this.words[y]=this.words[y]|c.words[y];return this._strip()},s.prototype.ior=function(c){return n((this.negative|c.negative)===0),this.iuor(c)},s.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},s.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},s.prototype.iuand=function(c){var y;this.length>c.length?y=c:y=this;for(var v=0;v<y.length;v++)this.words[v]=this.words[v]&c.words[v];return this.length=y.length,this._strip()},s.prototype.iand=function(c){return n((this.negative|c.negative)===0),this.iuand(c)},s.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},s.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},s.prototype.iuxor=function(c){var y,v;this.length>c.length?(y=this,v=c):(y=c,v=this);for(var S=0;S<v.length;S++)this.words[S]=y.words[S]^v.words[S];if(this!==y)for(;S<y.length;S++)this.words[S]=y.words[S];return this.length=y.length,this._strip()},s.prototype.ixor=function(c){return n((this.negative|c.negative)===0),this.iuxor(c)},s.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},s.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},s.prototype.inotn=function(c){n(typeof c=="number"&&c>=0);var y=Math.ceil(c/26)|0,v=c%26;this._expand(y),v>0&&y--;for(var S=0;S<y;S++)this.words[S]=~this.words[S]&67108863;return v>0&&(this.words[S]=~this.words[S]&67108863>>26-v),this._strip()},s.prototype.notn=function(c){return this.clone().inotn(c)},s.prototype.setn=function(c,y){n(typeof c=="number"&&c>=0);var v=c/26|0,S=c%26;return this._expand(v+1),y?this.words[v]=this.words[v]|1<<S:this.words[v]=this.words[v]&~(1<<S),this._strip()},s.prototype.iadd=function(c){var y;if(this.negative!==0&&c.negative===0)return this.negative=0,y=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,y=this.isub(c),c.negative=1,y._normSign();var v,S;this.length>c.length?(v=this,S=c):(v=c,S=this);for(var E=0,k=0;k<S.length;k++)y=(v.words[k]|0)+(S.words[k]|0)+E,this.words[k]=y&67108863,E=y>>>26;for(;E!==0&&k<v.length;k++)y=(v.words[k]|0)+E,this.words[k]=y&67108863,E=y>>>26;if(this.length=v.length,E!==0)this.words[this.length]=E,this.length++;else if(v!==this)for(;k<v.length;k++)this.words[k]=v.words[k];return this},s.prototype.add=function(c){var y;return c.negative!==0&&this.negative===0?(c.negative=0,y=this.sub(c),c.negative^=1,y):c.negative===0&&this.negative!==0?(this.negative=0,y=c.sub(this),this.negative=1,y):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},s.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var y=this.iadd(c);return c.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var v=this.cmp(c);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,E;v>0?(S=this,E=c):(S=c,E=this);for(var k=0,L=0;L<E.length;L++)y=(S.words[L]|0)-(E.words[L]|0)+k,k=y>>26,this.words[L]=y&67108863;for(;k!==0&&L<S.length;L++)y=(S.words[L]|0)+k,k=y>>26,this.words[L]=y&67108863;if(k===0&&L<S.length&&S!==this)for(;L<S.length;L++)this.words[L]=S.words[L];return this.length=Math.max(this.length,L),S!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(c){return this.clone().isub(c)};function M(w,c,y){y.negative=c.negative^w.negative;var v=w.length+c.length|0;y.length=v,v=v-1|0;var S=w.words[0]|0,E=c.words[0]|0,k=S*E,L=k&67108863,_=k/67108864|0;y.words[0]=L;for(var d=1;d<v;d++){for(var A=_>>>26,Y=_&67108863,ee=Math.min(d,c.length-1),N=Math.max(0,d-w.length+1);N<=ee;N++){var $=d-N|0;S=w.words[$]|0,E=c.words[N]|0,k=S*E+Y,A+=k/67108864|0,Y=k&67108863}y.words[d]=Y|0,_=A|0}return _!==0?y.words[d]=_|0:y.length--,y._strip()}var O=function(c,y,v){var S=c.words,E=y.words,k=v.words,L=0,_,d,A,Y=S[0]|0,ee=Y&8191,N=Y>>>13,$=S[1]|0,V=$&8191,Q=$>>>13,ge=S[2]|0,I=ge&8191,R=ge>>>13,q=S[3]|0,Z=q&8191,fe=q>>>13,ye=S[4]|0,ae=ye&8191,xe=ye>>>13,Pt=S[5]|0,Te=Pt&8191,Re=Pt>>>13,ut=S[6]|0,Ce=ut&8191,ke=ut>>>13,ft=S[7]|0,Ie=ft&8191,b=ft>>>13,f=S[8]|0,h=f&8191,x=f>>>13,B=S[9]|0,F=B&8191,H=B>>>13,de=E[0]|0,he=de&8191,ce=de>>>13,Oe=E[1]|0,ue=Oe&8191,Pe=Oe>>>13,Tn=E[2]|0,$e=Tn&8191,De=Tn>>>13,kn=E[3]|0,Fe=kn&8191,je=kn>>>13,On=E[4]|0,Ue=On&8191,We=On>>>13,Nn=E[5]|0,He=Nn&8191,Ve=Nn>>>13,Ln=E[6]|0,ze=Ln&8191,qe=Ln>>>13,Bn=E[7]|0,Ge=Bn&8191,Je=Bn>>>13,Pn=E[8]|0,Ze=Pn&8191,Qe=Pn>>>13,$n=E[9]|0,Ye=$n&8191,Ke=$n>>>13;v.negative=c.negative^y.negative,v.length=19,_=Math.imul(ee,he),d=Math.imul(ee,ce),d=d+Math.imul(N,he)|0,A=Math.imul(N,ce);var Wr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,_=Math.imul(V,he),d=Math.imul(V,ce),d=d+Math.imul(Q,he)|0,A=Math.imul(Q,ce),_=_+Math.imul(ee,ue)|0,d=d+Math.imul(ee,Pe)|0,d=d+Math.imul(N,ue)|0,A=A+Math.imul(N,Pe)|0;var Hr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,_=Math.imul(I,he),d=Math.imul(I,ce),d=d+Math.imul(R,he)|0,A=Math.imul(R,ce),_=_+Math.imul(V,ue)|0,d=d+Math.imul(V,Pe)|0,d=d+Math.imul(Q,ue)|0,A=A+Math.imul(Q,Pe)|0,_=_+Math.imul(ee,$e)|0,d=d+Math.imul(ee,De)|0,d=d+Math.imul(N,$e)|0,A=A+Math.imul(N,De)|0;var Vr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,_=Math.imul(Z,he),d=Math.imul(Z,ce),d=d+Math.imul(fe,he)|0,A=Math.imul(fe,ce),_=_+Math.imul(I,ue)|0,d=d+Math.imul(I,Pe)|0,d=d+Math.imul(R,ue)|0,A=A+Math.imul(R,Pe)|0,_=_+Math.imul(V,$e)|0,d=d+Math.imul(V,De)|0,d=d+Math.imul(Q,$e)|0,A=A+Math.imul(Q,De)|0,_=_+Math.imul(ee,Fe)|0,d=d+Math.imul(ee,je)|0,d=d+Math.imul(N,Fe)|0,A=A+Math.imul(N,je)|0;var zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(zr>>>26)|0,zr&=67108863,_=Math.imul(ae,he),d=Math.imul(ae,ce),d=d+Math.imul(xe,he)|0,A=Math.imul(xe,ce),_=_+Math.imul(Z,ue)|0,d=d+Math.imul(Z,Pe)|0,d=d+Math.imul(fe,ue)|0,A=A+Math.imul(fe,Pe)|0,_=_+Math.imul(I,$e)|0,d=d+Math.imul(I,De)|0,d=d+Math.imul(R,$e)|0,A=A+Math.imul(R,De)|0,_=_+Math.imul(V,Fe)|0,d=d+Math.imul(V,je)|0,d=d+Math.imul(Q,Fe)|0,A=A+Math.imul(Q,je)|0,_=_+Math.imul(ee,Ue)|0,d=d+Math.imul(ee,We)|0,d=d+Math.imul(N,Ue)|0,A=A+Math.imul(N,We)|0;var qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(qr>>>26)|0,qr&=67108863,_=Math.imul(Te,he),d=Math.imul(Te,ce),d=d+Math.imul(Re,he)|0,A=Math.imul(Re,ce),_=_+Math.imul(ae,ue)|0,d=d+Math.imul(ae,Pe)|0,d=d+Math.imul(xe,ue)|0,A=A+Math.imul(xe,Pe)|0,_=_+Math.imul(Z,$e)|0,d=d+Math.imul(Z,De)|0,d=d+Math.imul(fe,$e)|0,A=A+Math.imul(fe,De)|0,_=_+Math.imul(I,Fe)|0,d=d+Math.imul(I,je)|0,d=d+Math.imul(R,Fe)|0,A=A+Math.imul(R,je)|0,_=_+Math.imul(V,Ue)|0,d=d+Math.imul(V,We)|0,d=d+Math.imul(Q,Ue)|0,A=A+Math.imul(Q,We)|0,_=_+Math.imul(ee,He)|0,d=d+Math.imul(ee,Ve)|0,d=d+Math.imul(N,He)|0,A=A+Math.imul(N,Ve)|0;var Gr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,_=Math.imul(Ce,he),d=Math.imul(Ce,ce),d=d+Math.imul(ke,he)|0,A=Math.imul(ke,ce),_=_+Math.imul(Te,ue)|0,d=d+Math.imul(Te,Pe)|0,d=d+Math.imul(Re,ue)|0,A=A+Math.imul(Re,Pe)|0,_=_+Math.imul(ae,$e)|0,d=d+Math.imul(ae,De)|0,d=d+Math.imul(xe,$e)|0,A=A+Math.imul(xe,De)|0,_=_+Math.imul(Z,Fe)|0,d=d+Math.imul(Z,je)|0,d=d+Math.imul(fe,Fe)|0,A=A+Math.imul(fe,je)|0,_=_+Math.imul(I,Ue)|0,d=d+Math.imul(I,We)|0,d=d+Math.imul(R,Ue)|0,A=A+Math.imul(R,We)|0,_=_+Math.imul(V,He)|0,d=d+Math.imul(V,Ve)|0,d=d+Math.imul(Q,He)|0,A=A+Math.imul(Q,Ve)|0,_=_+Math.imul(ee,ze)|0,d=d+Math.imul(ee,qe)|0,d=d+Math.imul(N,ze)|0,A=A+Math.imul(N,qe)|0;var Jr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,_=Math.imul(Ie,he),d=Math.imul(Ie,ce),d=d+Math.imul(b,he)|0,A=Math.imul(b,ce),_=_+Math.imul(Ce,ue)|0,d=d+Math.imul(Ce,Pe)|0,d=d+Math.imul(ke,ue)|0,A=A+Math.imul(ke,Pe)|0,_=_+Math.imul(Te,$e)|0,d=d+Math.imul(Te,De)|0,d=d+Math.imul(Re,$e)|0,A=A+Math.imul(Re,De)|0,_=_+Math.imul(ae,Fe)|0,d=d+Math.imul(ae,je)|0,d=d+Math.imul(xe,Fe)|0,A=A+Math.imul(xe,je)|0,_=_+Math.imul(Z,Ue)|0,d=d+Math.imul(Z,We)|0,d=d+Math.imul(fe,Ue)|0,A=A+Math.imul(fe,We)|0,_=_+Math.imul(I,He)|0,d=d+Math.imul(I,Ve)|0,d=d+Math.imul(R,He)|0,A=A+Math.imul(R,Ve)|0,_=_+Math.imul(V,ze)|0,d=d+Math.imul(V,qe)|0,d=d+Math.imul(Q,ze)|0,A=A+Math.imul(Q,qe)|0,_=_+Math.imul(ee,Ge)|0,d=d+Math.imul(ee,Je)|0,d=d+Math.imul(N,Ge)|0,A=A+Math.imul(N,Je)|0;var Zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,_=Math.imul(h,he),d=Math.imul(h,ce),d=d+Math.imul(x,he)|0,A=Math.imul(x,ce),_=_+Math.imul(Ie,ue)|0,d=d+Math.imul(Ie,Pe)|0,d=d+Math.imul(b,ue)|0,A=A+Math.imul(b,Pe)|0,_=_+Math.imul(Ce,$e)|0,d=d+Math.imul(Ce,De)|0,d=d+Math.imul(ke,$e)|0,A=A+Math.imul(ke,De)|0,_=_+Math.imul(Te,Fe)|0,d=d+Math.imul(Te,je)|0,d=d+Math.imul(Re,Fe)|0,A=A+Math.imul(Re,je)|0,_=_+Math.imul(ae,Ue)|0,d=d+Math.imul(ae,We)|0,d=d+Math.imul(xe,Ue)|0,A=A+Math.imul(xe,We)|0,_=_+Math.imul(Z,He)|0,d=d+Math.imul(Z,Ve)|0,d=d+Math.imul(fe,He)|0,A=A+Math.imul(fe,Ve)|0,_=_+Math.imul(I,ze)|0,d=d+Math.imul(I,qe)|0,d=d+Math.imul(R,ze)|0,A=A+Math.imul(R,qe)|0,_=_+Math.imul(V,Ge)|0,d=d+Math.imul(V,Je)|0,d=d+Math.imul(Q,Ge)|0,A=A+Math.imul(Q,Je)|0,_=_+Math.imul(ee,Ze)|0,d=d+Math.imul(ee,Qe)|0,d=d+Math.imul(N,Ze)|0,A=A+Math.imul(N,Qe)|0;var Qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,_=Math.imul(F,he),d=Math.imul(F,ce),d=d+Math.imul(H,he)|0,A=Math.imul(H,ce),_=_+Math.imul(h,ue)|0,d=d+Math.imul(h,Pe)|0,d=d+Math.imul(x,ue)|0,A=A+Math.imul(x,Pe)|0,_=_+Math.imul(Ie,$e)|0,d=d+Math.imul(Ie,De)|0,d=d+Math.imul(b,$e)|0,A=A+Math.imul(b,De)|0,_=_+Math.imul(Ce,Fe)|0,d=d+Math.imul(Ce,je)|0,d=d+Math.imul(ke,Fe)|0,A=A+Math.imul(ke,je)|0,_=_+Math.imul(Te,Ue)|0,d=d+Math.imul(Te,We)|0,d=d+Math.imul(Re,Ue)|0,A=A+Math.imul(Re,We)|0,_=_+Math.imul(ae,He)|0,d=d+Math.imul(ae,Ve)|0,d=d+Math.imul(xe,He)|0,A=A+Math.imul(xe,Ve)|0,_=_+Math.imul(Z,ze)|0,d=d+Math.imul(Z,qe)|0,d=d+Math.imul(fe,ze)|0,A=A+Math.imul(fe,qe)|0,_=_+Math.imul(I,Ge)|0,d=d+Math.imul(I,Je)|0,d=d+Math.imul(R,Ge)|0,A=A+Math.imul(R,Je)|0,_=_+Math.imul(V,Ze)|0,d=d+Math.imul(V,Qe)|0,d=d+Math.imul(Q,Ze)|0,A=A+Math.imul(Q,Qe)|0,_=_+Math.imul(ee,Ye)|0,d=d+Math.imul(ee,Ke)|0,d=d+Math.imul(N,Ye)|0,A=A+Math.imul(N,Ke)|0;var Yr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Yr>>>26)|0,Yr&=67108863,_=Math.imul(F,ue),d=Math.imul(F,Pe),d=d+Math.imul(H,ue)|0,A=Math.imul(H,Pe),_=_+Math.imul(h,$e)|0,d=d+Math.imul(h,De)|0,d=d+Math.imul(x,$e)|0,A=A+Math.imul(x,De)|0,_=_+Math.imul(Ie,Fe)|0,d=d+Math.imul(Ie,je)|0,d=d+Math.imul(b,Fe)|0,A=A+Math.imul(b,je)|0,_=_+Math.imul(Ce,Ue)|0,d=d+Math.imul(Ce,We)|0,d=d+Math.imul(ke,Ue)|0,A=A+Math.imul(ke,We)|0,_=_+Math.imul(Te,He)|0,d=d+Math.imul(Te,Ve)|0,d=d+Math.imul(Re,He)|0,A=A+Math.imul(Re,Ve)|0,_=_+Math.imul(ae,ze)|0,d=d+Math.imul(ae,qe)|0,d=d+Math.imul(xe,ze)|0,A=A+Math.imul(xe,qe)|0,_=_+Math.imul(Z,Ge)|0,d=d+Math.imul(Z,Je)|0,d=d+Math.imul(fe,Ge)|0,A=A+Math.imul(fe,Je)|0,_=_+Math.imul(I,Ze)|0,d=d+Math.imul(I,Qe)|0,d=d+Math.imul(R,Ze)|0,A=A+Math.imul(R,Qe)|0,_=_+Math.imul(V,Ye)|0,d=d+Math.imul(V,Ke)|0,d=d+Math.imul(Q,Ye)|0,A=A+Math.imul(Q,Ke)|0;var Kr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,_=Math.imul(F,$e),d=Math.imul(F,De),d=d+Math.imul(H,$e)|0,A=Math.imul(H,De),_=_+Math.imul(h,Fe)|0,d=d+Math.imul(h,je)|0,d=d+Math.imul(x,Fe)|0,A=A+Math.imul(x,je)|0,_=_+Math.imul(Ie,Ue)|0,d=d+Math.imul(Ie,We)|0,d=d+Math.imul(b,Ue)|0,A=A+Math.imul(b,We)|0,_=_+Math.imul(Ce,He)|0,d=d+Math.imul(Ce,Ve)|0,d=d+Math.imul(ke,He)|0,A=A+Math.imul(ke,Ve)|0,_=_+Math.imul(Te,ze)|0,d=d+Math.imul(Te,qe)|0,d=d+Math.imul(Re,ze)|0,A=A+Math.imul(Re,qe)|0,_=_+Math.imul(ae,Ge)|0,d=d+Math.imul(ae,Je)|0,d=d+Math.imul(xe,Ge)|0,A=A+Math.imul(xe,Je)|0,_=_+Math.imul(Z,Ze)|0,d=d+Math.imul(Z,Qe)|0,d=d+Math.imul(fe,Ze)|0,A=A+Math.imul(fe,Qe)|0,_=_+Math.imul(I,Ye)|0,d=d+Math.imul(I,Ke)|0,d=d+Math.imul(R,Ye)|0,A=A+Math.imul(R,Ke)|0;var Xr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,_=Math.imul(F,Fe),d=Math.imul(F,je),d=d+Math.imul(H,Fe)|0,A=Math.imul(H,je),_=_+Math.imul(h,Ue)|0,d=d+Math.imul(h,We)|0,d=d+Math.imul(x,Ue)|0,A=A+Math.imul(x,We)|0,_=_+Math.imul(Ie,He)|0,d=d+Math.imul(Ie,Ve)|0,d=d+Math.imul(b,He)|0,A=A+Math.imul(b,Ve)|0,_=_+Math.imul(Ce,ze)|0,d=d+Math.imul(Ce,qe)|0,d=d+Math.imul(ke,ze)|0,A=A+Math.imul(ke,qe)|0,_=_+Math.imul(Te,Ge)|0,d=d+Math.imul(Te,Je)|0,d=d+Math.imul(Re,Ge)|0,A=A+Math.imul(Re,Je)|0,_=_+Math.imul(ae,Ze)|0,d=d+Math.imul(ae,Qe)|0,d=d+Math.imul(xe,Ze)|0,A=A+Math.imul(xe,Qe)|0,_=_+Math.imul(Z,Ye)|0,d=d+Math.imul(Z,Ke)|0,d=d+Math.imul(fe,Ye)|0,A=A+Math.imul(fe,Ke)|0;var en=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(en>>>26)|0,en&=67108863,_=Math.imul(F,Ue),d=Math.imul(F,We),d=d+Math.imul(H,Ue)|0,A=Math.imul(H,We),_=_+Math.imul(h,He)|0,d=d+Math.imul(h,Ve)|0,d=d+Math.imul(x,He)|0,A=A+Math.imul(x,Ve)|0,_=_+Math.imul(Ie,ze)|0,d=d+Math.imul(Ie,qe)|0,d=d+Math.imul(b,ze)|0,A=A+Math.imul(b,qe)|0,_=_+Math.imul(Ce,Ge)|0,d=d+Math.imul(Ce,Je)|0,d=d+Math.imul(ke,Ge)|0,A=A+Math.imul(ke,Je)|0,_=_+Math.imul(Te,Ze)|0,d=d+Math.imul(Te,Qe)|0,d=d+Math.imul(Re,Ze)|0,A=A+Math.imul(Re,Qe)|0,_=_+Math.imul(ae,Ye)|0,d=d+Math.imul(ae,Ke)|0,d=d+Math.imul(xe,Ye)|0,A=A+Math.imul(xe,Ke)|0;var tn=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(tn>>>26)|0,tn&=67108863,_=Math.imul(F,He),d=Math.imul(F,Ve),d=d+Math.imul(H,He)|0,A=Math.imul(H,Ve),_=_+Math.imul(h,ze)|0,d=d+Math.imul(h,qe)|0,d=d+Math.imul(x,ze)|0,A=A+Math.imul(x,qe)|0,_=_+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ie,Je)|0,d=d+Math.imul(b,Ge)|0,A=A+Math.imul(b,Je)|0,_=_+Math.imul(Ce,Ze)|0,d=d+Math.imul(Ce,Qe)|0,d=d+Math.imul(ke,Ze)|0,A=A+Math.imul(ke,Qe)|0,_=_+Math.imul(Te,Ye)|0,d=d+Math.imul(Te,Ke)|0,d=d+Math.imul(Re,Ye)|0,A=A+Math.imul(Re,Ke)|0;var Ea=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,_=Math.imul(F,ze),d=Math.imul(F,qe),d=d+Math.imul(H,ze)|0,A=Math.imul(H,qe),_=_+Math.imul(h,Ge)|0,d=d+Math.imul(h,Je)|0,d=d+Math.imul(x,Ge)|0,A=A+Math.imul(x,Je)|0,_=_+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ie,Qe)|0,d=d+Math.imul(b,Ze)|0,A=A+Math.imul(b,Qe)|0,_=_+Math.imul(Ce,Ye)|0,d=d+Math.imul(Ce,Ke)|0,d=d+Math.imul(ke,Ye)|0,A=A+Math.imul(ke,Ke)|0;var xa=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(xa>>>26)|0,xa&=67108863,_=Math.imul(F,Ge),d=Math.imul(F,Je),d=d+Math.imul(H,Ge)|0,A=Math.imul(H,Je),_=_+Math.imul(h,Ze)|0,d=d+Math.imul(h,Qe)|0,d=d+Math.imul(x,Ze)|0,A=A+Math.imul(x,Qe)|0,_=_+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,Ke)|0,d=d+Math.imul(b,Ye)|0,A=A+Math.imul(b,Ke)|0;var Ma=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Ma>>>26)|0,Ma&=67108863,_=Math.imul(F,Ze),d=Math.imul(F,Qe),d=d+Math.imul(H,Ze)|0,A=Math.imul(H,Qe),_=_+Math.imul(h,Ye)|0,d=d+Math.imul(h,Ke)|0,d=d+Math.imul(x,Ye)|0,A=A+Math.imul(x,Ke)|0;var Ca=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,_=Math.imul(F,Ye),d=Math.imul(F,Ke),d=d+Math.imul(H,Ye)|0,A=Math.imul(H,Ke);var Ia=(L+_|0)+((d&8191)<<13)|0;return L=(A+(d>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,k[0]=Wr,k[1]=Hr,k[2]=Vr,k[3]=zr,k[4]=qr,k[5]=Gr,k[6]=Jr,k[7]=Zr,k[8]=Qr,k[9]=Yr,k[10]=Kr,k[11]=Xr,k[12]=en,k[13]=tn,k[14]=Ea,k[15]=xa,k[16]=Ma,k[17]=Ca,k[18]=Ia,L!==0&&(k[19]=L,v.length++),v};Math.imul||(O=M);function D(w,c,y){y.negative=c.negative^w.negative,y.length=w.length+c.length;for(var v=0,S=0,E=0;E<y.length-1;E++){var k=S;S=0;for(var L=v&67108863,_=Math.min(E,c.length-1),d=Math.max(0,E-w.length+1);d<=_;d++){var A=E-d,Y=w.words[A]|0,ee=c.words[d]|0,N=Y*ee,$=N&67108863;k=k+(N/67108864|0)|0,$=$+L|0,L=$&67108863,k=k+($>>>26)|0,S+=k>>>26,k&=67108863}y.words[E]=L,v=k,k=S}return v!==0?y.words[E]=v:y.length--,y._strip()}function W(w,c,y){return D(w,c,y)}s.prototype.mulTo=function(c,y){var v,S=this.length+c.length;return this.length===10&&c.length===10?v=O(this,c,y):S<63?v=M(this,c,y):S<1024?v=D(this,c,y):v=W(this,c,y),v},s.prototype.mul=function(c){var y=new s(null);return y.words=new Array(this.length+c.length),this.mulTo(c,y)},s.prototype.mulf=function(c){var y=new s(null);return y.words=new Array(this.length+c.length),W(this,c,y)},s.prototype.imul=function(c){return this.clone().mulTo(c,this)},s.prototype.imuln=function(c){var y=c<0;y&&(c=-c),n(typeof c=="number"),n(c<67108864);for(var v=0,S=0;S<this.length;S++){var E=(this.words[S]|0)*c,k=(E&67108863)+(v&67108863);v>>=26,v+=E/67108864|0,v+=k>>>26,this.words[S]=k&67108863}return v!==0&&(this.words[S]=v,this.length++),y?this.ineg():this},s.prototype.muln=function(c){return this.clone().imuln(c)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(c){var y=U(c);if(y.length===0)return new s(1);for(var v=this,S=0;S<y.length&&y[S]===0;S++,v=v.sqr());if(++S<y.length)for(var E=v.sqr();S<y.length;S++,E=E.sqr())y[S]!==0&&(v=v.mul(E));return v},s.prototype.iushln=function(c){n(typeof c=="number"&&c>=0);var y=c%26,v=(c-y)/26,S=67108863>>>26-y<<26-y,E;if(y!==0){var k=0;for(E=0;E<this.length;E++){var L=this.words[E]&S,_=(this.words[E]|0)-L<<y;this.words[E]=_|k,k=L>>>26-y}k&&(this.words[E]=k,this.length++)}if(v!==0){for(E=this.length-1;E>=0;E--)this.words[E+v]=this.words[E];for(E=0;E<v;E++)this.words[E]=0;this.length+=v}return this._strip()},s.prototype.ishln=function(c){return n(this.negative===0),this.iushln(c)},s.prototype.iushrn=function(c,y,v){n(typeof c=="number"&&c>=0);var S;y?S=(y-y%26)/26:S=0;var E=c%26,k=Math.min((c-E)/26,this.length),L=67108863^67108863>>>E<<E,_=v;if(S-=k,S=Math.max(0,S),_){for(var d=0;d<k;d++)_.words[d]=this.words[d];_.length=k}if(k!==0)if(this.length>k)for(this.length-=k,d=0;d<this.length;d++)this.words[d]=this.words[d+k];else this.words[0]=0,this.length=1;var A=0;for(d=this.length-1;d>=0&&(A!==0||d>=S);d--){var Y=this.words[d]|0;this.words[d]=A<<26-E|Y>>>E,A=Y&L}return _&&A!==0&&(_.words[_.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(c,y,v){return n(this.negative===0),this.iushrn(c,y,v)},s.prototype.shln=function(c){return this.clone().ishln(c)},s.prototype.ushln=function(c){return this.clone().iushln(c)},s.prototype.shrn=function(c){return this.clone().ishrn(c)},s.prototype.ushrn=function(c){return this.clone().iushrn(c)},s.prototype.testn=function(c){n(typeof c=="number"&&c>=0);var y=c%26,v=(c-y)/26,S=1<<y;if(this.length<=v)return!1;var E=this.words[v];return!!(E&S)},s.prototype.imaskn=function(c){n(typeof c=="number"&&c>=0);var y=c%26,v=(c-y)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(y!==0&&v++,this.length=Math.min(v,this.length),y!==0){var S=67108863^67108863>>>y<<y;this.words[this.length-1]&=S}return this._strip()},s.prototype.maskn=function(c){return this.clone().imaskn(c)},s.prototype.iaddn=function(c){return n(typeof c=="number"),n(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},s.prototype._iaddn=function(c){this.words[0]+=c;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},s.prototype.isubn=function(c){if(n(typeof c=="number"),n(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this._strip()},s.prototype.addn=function(c){return this.clone().iaddn(c)},s.prototype.subn=function(c){return this.clone().isubn(c)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(c,y,v){var S=c.length+v,E;this._expand(S);var k,L=0;for(E=0;E<c.length;E++){k=(this.words[E+v]|0)+L;var _=(c.words[E]|0)*y;k-=_&67108863,L=(k>>26)-(_/67108864|0),this.words[E+v]=k&67108863}for(;E<this.length-v;E++)k=(this.words[E+v]|0)+L,L=k>>26,this.words[E+v]=k&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,E=0;E<this.length;E++)k=-(this.words[E]|0)+L,L=k>>26,this.words[E]=k&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(c,y){var v=this.length-c.length,S=this.clone(),E=c,k=E.words[E.length-1]|0,L=this._countBits(k);v=26-L,v!==0&&(E=E.ushln(v),S.iushln(v),k=E.words[E.length-1]|0);var _=S.length-E.length,d;if(y!=="mod"){d=new s(null),d.length=_+1,d.words=new Array(d.length);for(var A=0;A<d.length;A++)d.words[A]=0}var Y=S.clone()._ishlnsubmul(E,1,_);Y.negative===0&&(S=Y,d&&(d.words[_]=1));for(var ee=_-1;ee>=0;ee--){var N=(S.words[E.length+ee]|0)*67108864+(S.words[E.length+ee-1]|0);for(N=Math.min(N/k|0,67108863),S._ishlnsubmul(E,N,ee);S.negative!==0;)N--,S.negative=0,S._ishlnsubmul(E,1,ee),S.isZero()||(S.negative^=1);d&&(d.words[ee]=N)}return d&&d._strip(),S._strip(),y!=="div"&&v!==0&&S.iushrn(v),{div:d||null,mod:S}},s.prototype.divmod=function(c,y,v){if(n(!c.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var S,E,k;return this.negative!==0&&c.negative===0?(k=this.neg().divmod(c,y),y!=="mod"&&(S=k.div.neg()),y!=="div"&&(E=k.mod.neg(),v&&E.negative!==0&&E.iadd(c)),{div:S,mod:E}):this.negative===0&&c.negative!==0?(k=this.divmod(c.neg(),y),y!=="mod"&&(S=k.div.neg()),{div:S,mod:k.mod}):this.negative&c.negative?(k=this.neg().divmod(c.neg(),y),y!=="div"&&(E=k.mod.neg(),v&&E.negative!==0&&E.isub(c)),{div:k.div,mod:E}):c.length>this.length||this.cmp(c)<0?{div:new s(0),mod:this}:c.length===1?y==="div"?{div:this.divn(c.words[0]),mod:null}:y==="mod"?{div:null,mod:new s(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new s(this.modrn(c.words[0]))}:this._wordDiv(c,y)},s.prototype.div=function(c){return this.divmod(c,"div",!1).div},s.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},s.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},s.prototype.divRound=function(c){var y=this.divmod(c);if(y.mod.isZero())return y.div;var v=y.div.negative!==0?y.mod.isub(c):y.mod,S=c.ushrn(1),E=c.andln(1),k=v.cmp(S);return k<0||E===1&&k===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},s.prototype.modrn=function(c){var y=c<0;y&&(c=-c),n(c<=67108863);for(var v=(1<<26)%c,S=0,E=this.length-1;E>=0;E--)S=(v*S+(this.words[E]|0))%c;return y?-S:S},s.prototype.modn=function(c){return this.modrn(c)},s.prototype.idivn=function(c){var y=c<0;y&&(c=-c),n(c<=67108863);for(var v=0,S=this.length-1;S>=0;S--){var E=(this.words[S]|0)+v*67108864;this.words[S]=E/c|0,v=E%c}return this._strip(),y?this.ineg():this},s.prototype.divn=function(c){return this.clone().idivn(c)},s.prototype.egcd=function(c){n(c.negative===0),n(!c.isZero());var y=this,v=c.clone();y.negative!==0?y=y.umod(c):y=y.clone();for(var S=new s(1),E=new s(0),k=new s(0),L=new s(1),_=0;y.isEven()&&v.isEven();)y.iushrn(1),v.iushrn(1),++_;for(var d=v.clone(),A=y.clone();!y.isZero();){for(var Y=0,ee=1;!(y.words[0]&ee)&&Y<26;++Y,ee<<=1);if(Y>0)for(y.iushrn(Y);Y-- >0;)(S.isOdd()||E.isOdd())&&(S.iadd(d),E.isub(A)),S.iushrn(1),E.iushrn(1);for(var N=0,$=1;!(v.words[0]&$)&&N<26;++N,$<<=1);if(N>0)for(v.iushrn(N);N-- >0;)(k.isOdd()||L.isOdd())&&(k.iadd(d),L.isub(A)),k.iushrn(1),L.iushrn(1);y.cmp(v)>=0?(y.isub(v),S.isub(k),E.isub(L)):(v.isub(y),k.isub(S),L.isub(E))}return{a:k,b:L,gcd:v.iushln(_)}},s.prototype._invmp=function(c){n(c.negative===0),n(!c.isZero());var y=this,v=c.clone();y.negative!==0?y=y.umod(c):y=y.clone();for(var S=new s(1),E=new s(0),k=v.clone();y.cmpn(1)>0&&v.cmpn(1)>0;){for(var L=0,_=1;!(y.words[0]&_)&&L<26;++L,_<<=1);if(L>0)for(y.iushrn(L);L-- >0;)S.isOdd()&&S.iadd(k),S.iushrn(1);for(var d=0,A=1;!(v.words[0]&A)&&d<26;++d,A<<=1);if(d>0)for(v.iushrn(d);d-- >0;)E.isOdd()&&E.iadd(k),E.iushrn(1);y.cmp(v)>=0?(y.isub(v),S.isub(E)):(v.isub(y),E.isub(S))}var Y;return y.cmpn(1)===0?Y=S:Y=E,Y.cmpn(0)<0&&Y.iadd(c),Y},s.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var y=this.clone(),v=c.clone();y.negative=0,v.negative=0;for(var S=0;y.isEven()&&v.isEven();S++)y.iushrn(1),v.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;v.isEven();)v.iushrn(1);var E=y.cmp(v);if(E<0){var k=y;y=v,v=k}else if(E===0||v.cmpn(1)===0)break;y.isub(v)}while(!0);return v.iushln(S)},s.prototype.invm=function(c){return this.egcd(c).a.umod(c)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(c){return this.words[0]&c},s.prototype.bincn=function(c){n(typeof c=="number");var y=c%26,v=(c-y)/26,S=1<<y;if(this.length<=v)return this._expand(v+1),this.words[v]|=S,this;for(var E=S,k=v;E!==0&&k<this.length;k++){var L=this.words[k]|0;L+=E,E=L>>>26,L&=67108863,this.words[k]=L}return E!==0&&(this.words[k]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(c){var y=c<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this._strip();var v;if(this.length>1)v=1;else{y&&(c=-c),n(c<=67108863,"Number is too big");var S=this.words[0]|0;v=S===c?0:S<c?-1:1}return this.negative!==0?-v|0:v},s.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var y=this.ucmp(c);return this.negative!==0?-y|0:y},s.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var y=0,v=this.length-1;v>=0;v--){var S=this.words[v]|0,E=c.words[v]|0;if(S!==E){S<E?y=-1:S>E&&(y=1);break}}return y},s.prototype.gtn=function(c){return this.cmpn(c)===1},s.prototype.gt=function(c){return this.cmp(c)===1},s.prototype.gten=function(c){return this.cmpn(c)>=0},s.prototype.gte=function(c){return this.cmp(c)>=0},s.prototype.ltn=function(c){return this.cmpn(c)===-1},s.prototype.lt=function(c){return this.cmp(c)===-1},s.prototype.lten=function(c){return this.cmpn(c)<=0},s.prototype.lte=function(c){return this.cmp(c)<=0},s.prototype.eqn=function(c){return this.cmpn(c)===0},s.prototype.eq=function(c){return this.cmp(c)===0},s.red=function(c){return new ie(c)},s.prototype.toRed=function(c){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(c){return this.red=c,this},s.prototype.forceRed=function(c){return n(!this.red,"Already a number in reduction context"),this._forceRed(c)},s.prototype.redAdd=function(c){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},s.prototype.redIAdd=function(c){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},s.prototype.redSub=function(c){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},s.prototype.redISub=function(c){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},s.prototype.redShl=function(c){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},s.prototype.redMul=function(c){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},s.prototype.redIMul=function(c){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(c){return n(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var j={k256:null,p224:null,p192:null,p25519:null};function z(w,c){this.name=w,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var c=new s(null);return c.words=new Array(Math.ceil(this.n/13)),c},z.prototype.ireduce=function(c){var y=c,v;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),v=y.bitLength();while(v>this.n);var S=v<this.n?-1:y.ucmp(this.p);return S===0?(y.words[0]=0,y.length=1):S>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},z.prototype.split=function(c,y){c.iushrn(this.n,0,y)},z.prototype.imulK=function(c){return c.imul(this.k)};function K(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(K,z),K.prototype.split=function(c,y){for(var v=4194303,S=Math.min(c.length,9),E=0;E<S;E++)y.words[E]=c.words[E];if(y.length=S,c.length<=9){c.words[0]=0,c.length=1;return}var k=c.words[9];for(y.words[y.length++]=k&v,E=10;E<c.length;E++){var L=c.words[E]|0;c.words[E-10]=(L&v)<<4|k>>>22,k=L}k>>>=22,c.words[E-10]=k,k===0&&c.length>10?c.length-=10:c.length-=9},K.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var y=0,v=0;v<c.length;v++){var S=c.words[v]|0;y+=S*977,c.words[v]=y&67108863,y=S*64+(y/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function X(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(X,z);function G(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(G,z);function re(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(re,z),re.prototype.imulK=function(c){for(var y=0,v=0;v<c.length;v++){var S=(c.words[v]|0)*19+y,E=S&67108863;S>>>=26,c.words[v]=E,y=S}return y!==0&&(c.words[c.length++]=y),c},s._prime=function(c){if(j[c])return j[c];var y;if(c==="k256")y=new K;else if(c==="p224")y=new X;else if(c==="p192")y=new G;else if(c==="p25519")y=new re;else throw new Error("Unknown prime "+c);return j[c]=y,y};function ie(w){if(typeof w=="string"){var c=s._prime(w);this.m=c.p,this.prime=c}else n(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}ie.prototype._verify1=function(c){n(c.negative===0,"red works only with positives"),n(c.red,"red works only with red numbers")},ie.prototype._verify2=function(c,y){n((c.negative|y.negative)===0,"red works only with positives"),n(c.red&&c.red===y.red,"red works only with red numbers")},ie.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(p(c,c.umod(this.m)._forceRed(this)),c)},ie.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},ie.prototype.add=function(c,y){this._verify2(c,y);var v=c.add(y);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},ie.prototype.iadd=function(c,y){this._verify2(c,y);var v=c.iadd(y);return v.cmp(this.m)>=0&&v.isub(this.m),v},ie.prototype.sub=function(c,y){this._verify2(c,y);var v=c.sub(y);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},ie.prototype.isub=function(c,y){this._verify2(c,y);var v=c.isub(y);return v.cmpn(0)<0&&v.iadd(this.m),v},ie.prototype.shl=function(c,y){return this._verify1(c),this.imod(c.ushln(y))},ie.prototype.imul=function(c,y){return this._verify2(c,y),this.imod(c.imul(y))},ie.prototype.mul=function(c,y){return this._verify2(c,y),this.imod(c.mul(y))},ie.prototype.isqr=function(c){return this.imul(c,c.clone())},ie.prototype.sqr=function(c){return this.mul(c,c)},ie.prototype.sqrt=function(c){if(c.isZero())return c.clone();var y=this.m.andln(3);if(n(y%2===1),y===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(c,v)}for(var S=this.m.subn(1),E=0;!S.isZero()&&S.andln(1)===0;)E++,S.iushrn(1);n(!S.isZero());var k=new s(1).toRed(this),L=k.redNeg(),_=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,_).cmp(L)!==0;)d.redIAdd(L);for(var A=this.pow(d,S),Y=this.pow(c,S.addn(1).iushrn(1)),ee=this.pow(c,S),N=E;ee.cmp(k)!==0;){for(var $=ee,V=0;$.cmp(k)!==0;V++)$=$.redSqr();n(V<N);var Q=this.pow(A,new s(1).iushln(N-V-1));Y=Y.redMul(Q),A=Q.redSqr(),ee=ee.redMul(A),N=V}return Y},ie.prototype.invm=function(c){var y=c._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},ie.prototype.pow=function(c,y){if(y.isZero())return new s(1).toRed(this);if(y.cmpn(1)===0)return c.clone();var v=4,S=new Array(1<<v);S[0]=new s(1).toRed(this),S[1]=c;for(var E=2;E<S.length;E++)S[E]=this.mul(S[E-1],c);var k=S[0],L=0,_=0,d=y.bitLength()%26;for(d===0&&(d=26),E=y.length-1;E>=0;E--){for(var A=y.words[E],Y=d-1;Y>=0;Y--){var ee=A>>Y&1;if(k!==S[0]&&(k=this.sqr(k)),ee===0&&L===0){_=0;continue}L<<=1,L|=ee,_++,!(_!==v&&(E!==0||Y!==0))&&(k=this.mul(k,S[L]),_=0,L=0)}d=26}return k},ie.prototype.convertTo=function(c){var y=c.umod(this.m);return y===c?y.clone():y},ie.prototype.convertFrom=function(c){var y=c.clone();return y.red=null,y},s.mont=function(c){return new oe(c)};function oe(w){ie.call(this,w),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(oe,ie),oe.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},oe.prototype.convertFrom=function(c){var y=this.imod(c.mul(this.rinv));return y.red=null,y},oe.prototype.imul=function(c,y){if(c.isZero()||y.isZero())return c.words[0]=0,c.length=1,c;var v=c.imul(y),S=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=v.isub(S).iushrn(this.shift),k=E;return E.cmp(this.m)>=0?k=E.isub(this.m):E.cmpn(0)<0&&(k=E.iadd(this.m)),k._forceRed(this)},oe.prototype.mul=function(c,y){if(c.isZero()||y.isZero())return new s(0)._forceRed(this);var v=c.mul(y),S=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=v.isub(S).iushrn(this.shift),k=E;return E.cmp(this.m)>=0?k=E.isub(this.m):E.cmpn(0)<0&&(k=E.iadd(this.m)),k._forceRed(this)},oe.prototype.invm=function(c){var y=this.imod(c._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(t,te)})(Yu);var _o=Yu.exports,wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.EVENTS=void 0;wi.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ns={},Ku={},Br={},kg=Qi;Qi.default=Qi;Qi.stable=jh;Qi.stableStringify=jh;var Ks="[...]",Dh="[Circular]",yn=[],fn=[];function Fh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Qi(t,e,r,n){typeof n>"u"&&(n=Fh()),vu(t,"",0,[],void 0,0,n);var i;try{fn.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Uh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yn.length!==0;){var s=yn.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Qn(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),yn.push([n,r,e,i])):fn.push([e,r,t]):(n[r]=t,yn.push([n,r,e]))}function vu(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){Qn(Dh,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Qn(Ks,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Qn(Ks,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)vu(t[a],a,a,n,t,s,o);else{var u=Object.keys(t);for(a=0;a<u.length;a++){var l=u[a];vu(t[l],l,a,n,t,s,o)}}n.pop()}}function Og(t,e){return t<e?-1:t>e?1:0}function jh(t,e,r,n){typeof n>"u"&&(n=Fh());var i=mu(t,"",0,[],void 0,0,n)||t,s;try{fn.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Uh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yn.length!==0;){var o=yn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function mu(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){Qn(Dh,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Qn(Ks,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Qn(Ks,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)mu(t[a],a,a,n,t,s,o);else{var u={},l=Object.keys(t).sort(Og);for(a=0;a<l.length;a++){var p=l[a];mu(t[p],p,a,n,t,s,o),u[p]=t[p]}if(typeof i<"u")yn.push([i,e,t]),i[e]=u;else return u}n.pop()}}function Uh(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(fn.length>0)for(var n=0;n<fn.length;n++){var i=fn[n];if(i[1]===e&&i[0]===r){r=i[2],fn.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(Br,"__esModule",{value:!0});Br.EthereumProviderError=Br.EthereumRpcError=void 0;const Ng=kg;class Wh extends Error{constructor(e,r,n){if(!Number.isInteger(e))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=e,n!==void 0&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return Ng.default(this.serialize(),Pg,2)}}Br.EthereumRpcError=Wh;class Lg extends Wh{constructor(e,r,n){if(!Bg(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}Br.EthereumProviderError=Lg;function Bg(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Pg(t,e){if(e!=="[Circular]")return e}var Xu={},Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.errorValues=Pr.errorCodes=void 0;Pr.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}};Pr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Pr,r=Br,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(m,C=i){if(Number.isInteger(m)){const T=m.toString();if(g(e.errorValues,T))return e.errorValues[T].message;if(l(m))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return C}t.getMessageFromCode=o;function a(m){if(!Number.isInteger(m))return!1;const C=m.toString();return!!(e.errorValues[C]||l(m))}t.isValidCode=a;function u(m,{fallbackError:C=s,shouldIncludeStack:T=!1}={}){var P,U;if(!C||!Number.isInteger(C.code)||typeof C.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(m instanceof r.EthereumRpcError)return m.serialize();const M={};if(m&&typeof m=="object"&&!Array.isArray(m)&&g(m,"code")&&a(m.code)){const D=m;M.code=D.code,D.message&&typeof D.message=="string"?(M.message=D.message,g(D,"data")&&(M.data=D.data)):(M.message=o(M.code),M.data={originalError:p(m)})}else{M.code=C.code;const D=(P=m)===null||P===void 0?void 0:P.message;M.message=D&&typeof D=="string"?D:C.message,M.data={originalError:p(m)}}const O=(U=m)===null||U===void 0?void 0:U.stack;return T&&m&&O&&typeof O=="string"&&(M.stack=O),M}t.serializeError=u;function l(m){return m>=-32099&&m<=-32e3}function p(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function g(m,C){return Object.prototype.hasOwnProperty.call(m,C)}})(Xu);var So={};Object.defineProperty(So,"__esModule",{value:!0});So.ethErrors=void 0;const ec=Br,Hh=Xu,_t=Pr;So.ethErrors={rpc:{parse:t=>$t(_t.errorCodes.rpc.parse,t),invalidRequest:t=>$t(_t.errorCodes.rpc.invalidRequest,t),invalidParams:t=>$t(_t.errorCodes.rpc.invalidParams,t),methodNotFound:t=>$t(_t.errorCodes.rpc.methodNotFound,t),internal:t=>$t(_t.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return $t(e,t)},invalidInput:t=>$t(_t.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>$t(_t.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>$t(_t.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>$t(_t.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>$t(_t.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>$t(_t.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Ni(_t.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Ni(_t.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Ni(_t.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Ni(_t.errorCodes.provider.disconnected,t),chainDisconnected:t=>Ni(_t.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ec.EthereumProviderError(e,r,n)}}};function $t(t,e){const[r,n]=Vh(e);return new ec.EthereumRpcError(t,r||Hh.getMessageFromCode(t),n)}function Ni(t,e){const[r,n]=Vh(e);return new ec.EthereumProviderError(t,r||Hh.getMessageFromCode(t),n)}function Vh(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Br;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=Xu;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=So;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Pr;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ku);var Be={},Eo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Eo);Object.defineProperty(Be,"__esModule",{value:!0});Be.EthereumAddressFromSignedMessageResponse=Be.SubmitEthereumTransactionResponse=Be.SignEthereumTransactionResponse=Be.SignEthereumMessageResponse=Be.isRequestEthereumAccountsResponse=Be.SelectProviderResponse=Be.WatchAssetReponse=Be.RequestEthereumAccountsResponse=Be.SwitchEthereumChainResponse=Be.AddEthereumChainResponse=Be.isErrorResponse=void 0;const yr=Eo;function $g(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}Be.isErrorResponse=$g;function Dg(t){return{method:yr.Web3Method.addEthereumChain,result:t}}Be.AddEthereumChainResponse=Dg;function Fg(t){return{method:yr.Web3Method.switchEthereumChain,result:t}}Be.SwitchEthereumChainResponse=Fg;function jg(t){return{method:yr.Web3Method.requestEthereumAccounts,result:t}}Be.RequestEthereumAccountsResponse=jg;function Ug(t){return{method:yr.Web3Method.watchAsset,result:t}}Be.WatchAssetReponse=Ug;function Wg(t){return{method:yr.Web3Method.selectProvider,result:t}}Be.SelectProviderResponse=Wg;function Hg(t){return t&&t.method===yr.Web3Method.requestEthereumAccounts}Be.isRequestEthereumAccountsResponse=Hg;function Vg(t){return{method:yr.Web3Method.signEthereumMessage,result:t}}Be.SignEthereumMessageResponse=Vg;function zg(t){return{method:yr.Web3Method.signEthereumTransaction,result:t}}Be.SignEthereumTransactionResponse=zg;function qg(t){return{method:yr.Web3Method.submitEthereumTransaction,result:t}}Be.SubmitEthereumTransactionResponse=qg;function Gg(t){return{method:yr.Web3Method.ethereumAddressFromSignedMessage,result:t}}Be.EthereumAddressFromSignedMessageResponse=Gg;var _i={};Object.defineProperty(_i,"__esModule",{value:!0});_i.LIB_VERSION=void 0;_i.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=Ku,r=Be,n=_i;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(p){return p!==void 0?(0,e.getMessageFromCode)(p):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(p="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${p}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(p,g){const m=(0,e.serializeError)(o(p),{shouldIncludeStack:!0}),C=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");C.searchParams.set("version",n.LIB_VERSION),C.searchParams.set("code",m.code.toString());const T=a(m.data,g);return T&&C.searchParams.set("method",T),C.searchParams.set("message",m.message),Object.assign(Object.assign({},m),{docUrl:C.href})}t.serializeError=s;function o(p){return typeof p=="string"?{message:p,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(p)?Object.assign(Object.assign({},p),{message:p.errorMessage,code:p.errorCode,data:{method:p.method,result:p.result}}):p}function a(p,g){var m;const C=(m=p)===null||m===void 0?void 0:m.method;if(C)return C;if(g!==void 0)return typeof g=="string"?g:Array.isArray(g)?g.length>0?g[0].method:void 0:g.method}function u(p){var g;if(typeof p=="number")return p;if(l(p))return(g=p.code)!==null&&g!==void 0?g:p.errorCode}t.getErrorCode=u;function l(p){return typeof p=="object"&&p!==null&&(typeof p.code=="number"||typeof p.errorCode=="number")}})(ns);var Si={},zh={exports:{}},wu={exports:{}};typeof Object.create=="function"?wu.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:wu.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var er=wu.exports,_u={exports:{}},is={},xo={};xo.byteLength=Qg;xo.toByteArray=Kg;xo.fromByteArray=ty;var lr=[],jt=[],Jg=typeof Uint8Array<"u"?Uint8Array:Array,Ra="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Dn=0,Zg=Ra.length;Dn<Zg;++Dn)lr[Dn]=Ra[Dn],jt[Ra.charCodeAt(Dn)]=Dn;jt["-".charCodeAt(0)]=62;jt["_".charCodeAt(0)]=63;function qh(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Qg(t){var e=qh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Yg(t,e,r){return(e+r)*3/4-r}function Kg(t){var e,r=qh(t),n=r[0],i=r[1],s=new Jg(Yg(t,n,i)),o=0,a=i>0?n-4:n,u;for(u=0;u<a;u+=4)e=jt[t.charCodeAt(u)]<<18|jt[t.charCodeAt(u+1)]<<12|jt[t.charCodeAt(u+2)]<<6|jt[t.charCodeAt(u+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=jt[t.charCodeAt(u)]<<2|jt[t.charCodeAt(u+1)]>>4,s[o++]=e&255),i===1&&(e=jt[t.charCodeAt(u)]<<10|jt[t.charCodeAt(u+1)]<<4|jt[t.charCodeAt(u+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Xg(t){return lr[t>>18&63]+lr[t>>12&63]+lr[t>>6&63]+lr[t&63]}function ey(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Xg(n));return i.join("")}function ty(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(ey(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(lr[e>>2]+lr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(lr[e>>10]+lr[e>>4&63]+lr[e<<2&63]+"=")),i.join("")}var tc={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */tc.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,u=(1<<a)-1,l=u>>1,p=-7,g=r?i-1:0,m=r?-1:1,C=t[e+g];for(g+=m,s=C&(1<<-p)-1,C>>=-p,p+=a;p>0;s=s*256+t[e+g],g+=m,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+g],g+=m,p-=8);if(s===0)s=1-l;else{if(s===u)return o?NaN:(C?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(C?-1:1)*o*Math.pow(2,s-n)};tc.write=function(t,e,r,n,i,s){var o,a,u,l=s*8-i-1,p=(1<<l)-1,g=p>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=n?0:s-1,T=n?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+g>=1?e+=m/u:e+=m*Math.pow(2,1-g),e*u>=2&&(o++,u/=2),o+g>=p?(a=0,o=p):o+g>=1?(a=(e*u-1)*Math.pow(2,i),o=o+g):(a=e*Math.pow(2,g-1)*Math.pow(2,i),o=0));i>=8;t[r+C]=a&255,C+=T,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+C]=o&255,C+=T,o/=256,l-=8);t[r+C-T]|=P*128};/*!
|
|
2
|
-
* The buffer module from node.js, for the browser.
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/(function(t){const e=xo,r=tc,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=O,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.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 b=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(b,f),b.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(b){if(b>i)throw new RangeError('The value "'+b+'" is invalid for option "size"');const f=new Uint8Array(b);return Object.setPrototypeOf(f,a.prototype),f}function a(b,f,h){if(typeof b=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(b)}return u(b,f,h)}a.poolSize=8192;function u(b,f,h){if(typeof b=="string")return m(b,f);if(ArrayBuffer.isView(b))return T(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(ut(b,ArrayBuffer)||b&&ut(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(b,SharedArrayBuffer)||b&&ut(b.buffer,SharedArrayBuffer)))return P(b,f,h);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const x=b.valueOf&&b.valueOf();if(x!=null&&x!==b)return a.from(x,f,h);const B=U(b);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return a.from(b[Symbol.toPrimitive]("string"),f,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}a.from=function(b,f,h){return u(b,f,h)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function p(b,f,h){return l(b),b<=0?o(b):f!==void 0?typeof h=="string"?o(b).fill(f,h):o(b).fill(f):o(b)}a.alloc=function(b,f,h){return p(b,f,h)};function g(b){return l(b),o(b<0?0:M(b)|0)}a.allocUnsafe=function(b){return g(b)},a.allocUnsafeSlow=function(b){return g(b)};function m(b,f){if((typeof f!="string"||f==="")&&(f="utf8"),!a.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const h=D(b,f)|0;let x=o(h);const B=x.write(b,f);return B!==h&&(x=x.slice(0,B)),x}function C(b){const f=b.length<0?0:M(b.length)|0,h=o(f);for(let x=0;x<f;x+=1)h[x]=b[x]&255;return h}function T(b){if(ut(b,Uint8Array)){const f=new Uint8Array(b);return P(f.buffer,f.byteOffset,f.byteLength)}return C(b)}function P(b,f,h){if(f<0||b.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<f+(h||0))throw new RangeError('"length" is outside of buffer bounds');let x;return f===void 0&&h===void 0?x=new Uint8Array(b):h===void 0?x=new Uint8Array(b,f):x=new Uint8Array(b,f,h),Object.setPrototypeOf(x,a.prototype),x}function U(b){if(a.isBuffer(b)){const f=M(b.length)|0,h=o(f);return h.length===0||b.copy(h,0,0,f),h}if(b.length!==void 0)return typeof b.length!="number"||Ce(b.length)?o(0):C(b);if(b.type==="Buffer"&&Array.isArray(b.data))return C(b.data)}function M(b){if(b>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return b|0}function O(b){return+b!=b&&(b=0),a.alloc(+b)}a.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==a.prototype},a.compare=function(f,h){if(ut(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),ut(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(f)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===h)return 0;let x=f.length,B=h.length;for(let F=0,H=Math.min(x,B);F<H;++F)if(f[F]!==h[F]){x=f[F],B=h[F];break}return x<B?-1:B<x?1:0},a.isEncoding=function(f){switch(String(f).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}},a.concat=function(f,h){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return a.alloc(0);let x;if(h===void 0)for(h=0,x=0;x<f.length;++x)h+=f[x].length;const B=a.allocUnsafe(h);let F=0;for(x=0;x<f.length;++x){let H=f[x];if(ut(H,Uint8Array))F+H.length>B.length?(a.isBuffer(H)||(H=a.from(H)),H.copy(B,F)):Uint8Array.prototype.set.call(B,H,F);else if(a.isBuffer(H))H.copy(B,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=H.length}return B};function D(b,f){if(a.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||ut(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const h=b.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&h===0)return 0;let B=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return ae(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Te(b).length;default:if(B)return x?-1:ae(b).length;f=(""+f).toLowerCase(),B=!0}}a.byteLength=D;function W(b,f,h){let x=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,f>>>=0,h<=f))return"";for(b||(b="utf8");;)switch(b){case"hex":return k(this,f,h);case"utf8":case"utf-8":return c(this,f,h);case"ascii":return S(this,f,h);case"latin1":case"binary":return E(this,f,h);case"base64":return w(this,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,f,h);default:if(x)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),x=!0}}a.prototype._isBuffer=!0;function j(b,f,h){const x=b[f];b[f]=b[h],b[h]=x}a.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<f;h+=2)j(this,h,h+1);return this},a.prototype.swap32=function(){const f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<f;h+=4)j(this,h,h+3),j(this,h+1,h+2);return this},a.prototype.swap64=function(){const f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<f;h+=8)j(this,h,h+7),j(this,h+1,h+6),j(this,h+2,h+5),j(this,h+3,h+4);return this},a.prototype.toString=function(){const f=this.length;return f===0?"":arguments.length===0?c(this,0,f):W.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(f){if(!a.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:a.compare(this,f)===0},a.prototype.inspect=function(){let f="";const h=t.INSPECT_MAX_BYTES;return f=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(f+=" ... "),"<Buffer "+f+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(f,h,x,B,F){if(ut(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(h===void 0&&(h=0),x===void 0&&(x=f?f.length:0),B===void 0&&(B=0),F===void 0&&(F=this.length),h<0||x>f.length||B<0||F>this.length)throw new RangeError("out of range index");if(B>=F&&h>=x)return 0;if(B>=F)return-1;if(h>=x)return 1;if(h>>>=0,x>>>=0,B>>>=0,F>>>=0,this===f)return 0;let H=F-B,de=x-h;const he=Math.min(H,de),ce=this.slice(B,F),Oe=f.slice(h,x);for(let ue=0;ue<he;++ue)if(ce[ue]!==Oe[ue]){H=ce[ue],de=Oe[ue];break}return H<de?-1:de<H?1:0};function z(b,f,h,x,B){if(b.length===0)return-1;if(typeof h=="string"?(x=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Ce(h)&&(h=B?0:b.length-1),h<0&&(h=b.length+h),h>=b.length){if(B)return-1;h=b.length-1}else if(h<0)if(B)h=0;else return-1;if(typeof f=="string"&&(f=a.from(f,x)),a.isBuffer(f))return f.length===0?-1:K(b,f,h,x,B);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(b,f,h):Uint8Array.prototype.lastIndexOf.call(b,f,h):K(b,[f],h,x,B);throw new TypeError("val must be string, number or Buffer")}function K(b,f,h,x,B){let F=1,H=b.length,de=f.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(b.length<2||f.length<2)return-1;F=2,H/=2,de/=2,h/=2}function he(Oe,ue){return F===1?Oe[ue]:Oe.readUInt16BE(ue*F)}let ce;if(B){let Oe=-1;for(ce=h;ce<H;ce++)if(he(b,ce)===he(f,Oe===-1?0:ce-Oe)){if(Oe===-1&&(Oe=ce),ce-Oe+1===de)return Oe*F}else Oe!==-1&&(ce-=ce-Oe),Oe=-1}else for(h+de>H&&(h=H-de),ce=h;ce>=0;ce--){let Oe=!0;for(let ue=0;ue<de;ue++)if(he(b,ce+ue)!==he(f,ue)){Oe=!1;break}if(Oe)return ce}return-1}a.prototype.includes=function(f,h,x){return this.indexOf(f,h,x)!==-1},a.prototype.indexOf=function(f,h,x){return z(this,f,h,x,!0)},a.prototype.lastIndexOf=function(f,h,x){return z(this,f,h,x,!1)};function X(b,f,h,x){h=Number(h)||0;const B=b.length-h;x?(x=Number(x),x>B&&(x=B)):x=B;const F=f.length;x>F/2&&(x=F/2);let H;for(H=0;H<x;++H){const de=parseInt(f.substr(H*2,2),16);if(Ce(de))return H;b[h+H]=de}return H}function G(b,f,h,x){return Re(ae(f,b.length-h),b,h,x)}function re(b,f,h,x){return Re(xe(f),b,h,x)}function ie(b,f,h,x){return Re(Te(f),b,h,x)}function oe(b,f,h,x){return Re(Pt(f,b.length-h),b,h,x)}a.prototype.write=function(f,h,x,B){if(h===void 0)B="utf8",x=this.length,h=0;else if(x===void 0&&typeof h=="string")B=h,x=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(x)?(x=x>>>0,B===void 0&&(B="utf8")):(B=x,x=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const F=this.length-h;if((x===void 0||x>F)&&(x=F),f.length>0&&(x<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let H=!1;for(;;)switch(B){case"hex":return X(this,f,h,x);case"utf8":case"utf-8":return G(this,f,h,x);case"ascii":case"latin1":case"binary":return re(this,f,h,x);case"base64":return ie(this,f,h,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,f,h,x);default:if(H)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),H=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(b,f,h){return f===0&&h===b.length?e.fromByteArray(b):e.fromByteArray(b.slice(f,h))}function c(b,f,h){h=Math.min(b.length,h);const x=[];let B=f;for(;B<h;){const F=b[B];let H=null,de=F>239?4:F>223?3:F>191?2:1;if(B+de<=h){let he,ce,Oe,ue;switch(de){case 1:F<128&&(H=F);break;case 2:he=b[B+1],(he&192)===128&&(ue=(F&31)<<6|he&63,ue>127&&(H=ue));break;case 3:he=b[B+1],ce=b[B+2],(he&192)===128&&(ce&192)===128&&(ue=(F&15)<<12|(he&63)<<6|ce&63,ue>2047&&(ue<55296||ue>57343)&&(H=ue));break;case 4:he=b[B+1],ce=b[B+2],Oe=b[B+3],(he&192)===128&&(ce&192)===128&&(Oe&192)===128&&(ue=(F&15)<<18|(he&63)<<12|(ce&63)<<6|Oe&63,ue>65535&&ue<1114112&&(H=ue))}}H===null?(H=65533,de=1):H>65535&&(H-=65536,x.push(H>>>10&1023|55296),H=56320|H&1023),x.push(H),B+=de}return v(x)}const y=4096;function v(b){const f=b.length;if(f<=y)return String.fromCharCode.apply(String,b);let h="",x=0;for(;x<f;)h+=String.fromCharCode.apply(String,b.slice(x,x+=y));return h}function S(b,f,h){let x="";h=Math.min(b.length,h);for(let B=f;B<h;++B)x+=String.fromCharCode(b[B]&127);return x}function E(b,f,h){let x="";h=Math.min(b.length,h);for(let B=f;B<h;++B)x+=String.fromCharCode(b[B]);return x}function k(b,f,h){const x=b.length;(!f||f<0)&&(f=0),(!h||h<0||h>x)&&(h=x);let B="";for(let F=f;F<h;++F)B+=ke[b[F]];return B}function L(b,f,h){const x=b.slice(f,h);let B="";for(let F=0;F<x.length-1;F+=2)B+=String.fromCharCode(x[F]+x[F+1]*256);return B}a.prototype.slice=function(f,h){const x=this.length;f=~~f,h=h===void 0?x:~~h,f<0?(f+=x,f<0&&(f=0)):f>x&&(f=x),h<0?(h+=x,h<0&&(h=0)):h>x&&(h=x),h<f&&(h=f);const B=this.subarray(f,h);return Object.setPrototypeOf(B,a.prototype),B};function _(b,f,h){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+f>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(f,h,x){f=f>>>0,h=h>>>0,x||_(f,h,this.length);let B=this[f],F=1,H=0;for(;++H<h&&(F*=256);)B+=this[f+H]*F;return B},a.prototype.readUintBE=a.prototype.readUIntBE=function(f,h,x){f=f>>>0,h=h>>>0,x||_(f,h,this.length);let B=this[f+--h],F=1;for(;h>0&&(F*=256);)B+=this[f+--h]*F;return B},a.prototype.readUint8=a.prototype.readUInt8=function(f,h){return f=f>>>0,h||_(f,1,this.length),this[f]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(f,h){return f=f>>>0,h||_(f,2,this.length),this[f]|this[f+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(f,h){return f=f>>>0,h||_(f,2,this.length),this[f]<<8|this[f+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(f,h){return f=f>>>0,h||_(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(f,h){return f=f>>>0,h||_(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},a.prototype.readBigUInt64LE=ft(function(f){f=f>>>0,q(f,"offset");const h=this[f],x=this[f+7];(h===void 0||x===void 0)&&Z(f,this.length-8);const B=h+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,F=this[++f]+this[++f]*2**8+this[++f]*2**16+x*2**24;return BigInt(B)+(BigInt(F)<<BigInt(32))}),a.prototype.readBigUInt64BE=ft(function(f){f=f>>>0,q(f,"offset");const h=this[f],x=this[f+7];(h===void 0||x===void 0)&&Z(f,this.length-8);const B=h*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],F=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+x;return(BigInt(B)<<BigInt(32))+BigInt(F)}),a.prototype.readIntLE=function(f,h,x){f=f>>>0,h=h>>>0,x||_(f,h,this.length);let B=this[f],F=1,H=0;for(;++H<h&&(F*=256);)B+=this[f+H]*F;return F*=128,B>=F&&(B-=Math.pow(2,8*h)),B},a.prototype.readIntBE=function(f,h,x){f=f>>>0,h=h>>>0,x||_(f,h,this.length);let B=h,F=1,H=this[f+--B];for(;B>0&&(F*=256);)H+=this[f+--B]*F;return F*=128,H>=F&&(H-=Math.pow(2,8*h)),H},a.prototype.readInt8=function(f,h){return f=f>>>0,h||_(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},a.prototype.readInt16LE=function(f,h){f=f>>>0,h||_(f,2,this.length);const x=this[f]|this[f+1]<<8;return x&32768?x|4294901760:x},a.prototype.readInt16BE=function(f,h){f=f>>>0,h||_(f,2,this.length);const x=this[f+1]|this[f]<<8;return x&32768?x|4294901760:x},a.prototype.readInt32LE=function(f,h){return f=f>>>0,h||_(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},a.prototype.readInt32BE=function(f,h){return f=f>>>0,h||_(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},a.prototype.readBigInt64LE=ft(function(f){f=f>>>0,q(f,"offset");const h=this[f],x=this[f+7];(h===void 0||x===void 0)&&Z(f,this.length-8);const B=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(x<<24);return(BigInt(B)<<BigInt(32))+BigInt(h+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),a.prototype.readBigInt64BE=ft(function(f){f=f>>>0,q(f,"offset");const h=this[f],x=this[f+7];(h===void 0||x===void 0)&&Z(f,this.length-8);const B=(h<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(B)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+x)}),a.prototype.readFloatLE=function(f,h){return f=f>>>0,h||_(f,4,this.length),r.read(this,f,!0,23,4)},a.prototype.readFloatBE=function(f,h){return f=f>>>0,h||_(f,4,this.length),r.read(this,f,!1,23,4)},a.prototype.readDoubleLE=function(f,h){return f=f>>>0,h||_(f,8,this.length),r.read(this,f,!0,52,8)},a.prototype.readDoubleBE=function(f,h){return f=f>>>0,h||_(f,8,this.length),r.read(this,f,!1,52,8)};function d(b,f,h,x,B,F){if(!a.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>B||f<F)throw new RangeError('"value" argument is out of bounds');if(h+x>b.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(f,h,x,B){if(f=+f,h=h>>>0,x=x>>>0,!B){const de=Math.pow(2,8*x)-1;d(this,f,h,x,de,0)}let F=1,H=0;for(this[h]=f&255;++H<x&&(F*=256);)this[h+H]=f/F&255;return h+x},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(f,h,x,B){if(f=+f,h=h>>>0,x=x>>>0,!B){const de=Math.pow(2,8*x)-1;d(this,f,h,x,de,0)}let F=x-1,H=1;for(this[h+F]=f&255;--F>=0&&(H*=256);)this[h+F]=f/H&255;return h+x},a.prototype.writeUint8=a.prototype.writeUInt8=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,1,255,0),this[h]=f&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,2,65535,0),this[h]=f&255,this[h+1]=f>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,2,65535,0),this[h]=f>>>8,this[h+1]=f&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,4,4294967295,0),this[h+3]=f>>>24,this[h+2]=f>>>16,this[h+1]=f>>>8,this[h]=f&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,4,4294967295,0),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4};function A(b,f,h,x,B){R(f,x,B,b,h,7);let F=Number(f&BigInt(4294967295));b[h++]=F,F=F>>8,b[h++]=F,F=F>>8,b[h++]=F,F=F>>8,b[h++]=F;let H=Number(f>>BigInt(32)&BigInt(4294967295));return b[h++]=H,H=H>>8,b[h++]=H,H=H>>8,b[h++]=H,H=H>>8,b[h++]=H,h}function Y(b,f,h,x,B){R(f,x,B,b,h,7);let F=Number(f&BigInt(4294967295));b[h+7]=F,F=F>>8,b[h+6]=F,F=F>>8,b[h+5]=F,F=F>>8,b[h+4]=F;let H=Number(f>>BigInt(32)&BigInt(4294967295));return b[h+3]=H,H=H>>8,b[h+2]=H,H=H>>8,b[h+1]=H,H=H>>8,b[h]=H,h+8}a.prototype.writeBigUInt64LE=ft(function(f,h=0){return A(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ft(function(f,h=0){return Y(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(f,h,x,B){if(f=+f,h=h>>>0,!B){const he=Math.pow(2,8*x-1);d(this,f,h,x,he-1,-he)}let F=0,H=1,de=0;for(this[h]=f&255;++F<x&&(H*=256);)f<0&&de===0&&this[h+F-1]!==0&&(de=1),this[h+F]=(f/H>>0)-de&255;return h+x},a.prototype.writeIntBE=function(f,h,x,B){if(f=+f,h=h>>>0,!B){const he=Math.pow(2,8*x-1);d(this,f,h,x,he-1,-he)}let F=x-1,H=1,de=0;for(this[h+F]=f&255;--F>=0&&(H*=256);)f<0&&de===0&&this[h+F+1]!==0&&(de=1),this[h+F]=(f/H>>0)-de&255;return h+x},a.prototype.writeInt8=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,1,127,-128),f<0&&(f=255+f+1),this[h]=f&255,h+1},a.prototype.writeInt16LE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,2,32767,-32768),this[h]=f&255,this[h+1]=f>>>8,h+2},a.prototype.writeInt16BE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,2,32767,-32768),this[h]=f>>>8,this[h+1]=f&255,h+2},a.prototype.writeInt32LE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,4,2147483647,-2147483648),this[h]=f&255,this[h+1]=f>>>8,this[h+2]=f>>>16,this[h+3]=f>>>24,h+4},a.prototype.writeInt32BE=function(f,h,x){return f=+f,h=h>>>0,x||d(this,f,h,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4},a.prototype.writeBigInt64LE=ft(function(f,h=0){return A(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ft(function(f,h=0){return Y(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(b,f,h,x,B,F){if(h+x>b.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function N(b,f,h,x,B){return f=+f,h=h>>>0,B||ee(b,f,h,4),r.write(b,f,h,x,23,4),h+4}a.prototype.writeFloatLE=function(f,h,x){return N(this,f,h,!0,x)},a.prototype.writeFloatBE=function(f,h,x){return N(this,f,h,!1,x)};function $(b,f,h,x,B){return f=+f,h=h>>>0,B||ee(b,f,h,8),r.write(b,f,h,x,52,8),h+8}a.prototype.writeDoubleLE=function(f,h,x){return $(this,f,h,!0,x)},a.prototype.writeDoubleBE=function(f,h,x){return $(this,f,h,!1,x)},a.prototype.copy=function(f,h,x,B){if(!a.isBuffer(f))throw new TypeError("argument should be a Buffer");if(x||(x=0),!B&&B!==0&&(B=this.length),h>=f.length&&(h=f.length),h||(h=0),B>0&&B<x&&(B=x),B===x||f.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(x<0||x>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),f.length-h<B-x&&(B=f.length-h+x);const F=B-x;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,x,B):Uint8Array.prototype.set.call(f,this.subarray(x,B),h),F},a.prototype.fill=function(f,h,x,B){if(typeof f=="string"){if(typeof h=="string"?(B=h,h=0,x=this.length):typeof x=="string"&&(B=x,x=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!a.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(f.length===1){const H=f.charCodeAt(0);(B==="utf8"&&H<128||B==="latin1")&&(f=H)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(h<0||this.length<h||this.length<x)throw new RangeError("Out of range index");if(x<=h)return this;h=h>>>0,x=x===void 0?this.length:x>>>0,f||(f=0);let F;if(typeof f=="number")for(F=h;F<x;++F)this[F]=f;else{const H=a.isBuffer(f)?f:a.from(f,B),de=H.length;if(de===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(F=0;F<x-h;++F)this[F+h]=H[F%de]}return this};const V={};function Q(b,f,h){V[b]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}Q("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Q("ERR_INVALID_ARG_TYPE",function(b,f){return`The "${b}" argument must be of type number. Received type ${typeof f}`},TypeError),Q("ERR_OUT_OF_RANGE",function(b,f,h){let x=`The value of "${b}" is out of range.`,B=h;return Number.isInteger(h)&&Math.abs(h)>2**32?B=ge(String(h)):typeof h=="bigint"&&(B=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(B=ge(B)),B+="n"),x+=` It must be ${f}. Received ${B}`,x},RangeError);function ge(b){let f="",h=b.length;const x=b[0]==="-"?1:0;for(;h>=x+4;h-=3)f=`_${b.slice(h-3,h)}${f}`;return`${b.slice(0,h)}${f}`}function I(b,f,h){q(f,"offset"),(b[f]===void 0||b[f+h]===void 0)&&Z(f,b.length-(h+1))}function R(b,f,h,x,B,F){if(b>h||b<f){const H=typeof f=="bigint"?"n":"";let de;throw F>3?f===0||f===BigInt(0)?de=`>= 0${H} and < 2${H} ** ${(F+1)*8}${H}`:de=`>= -(2${H} ** ${(F+1)*8-1}${H}) and < 2 ** ${(F+1)*8-1}${H}`:de=`>= ${f}${H} and <= ${h}${H}`,new V.ERR_OUT_OF_RANGE("value",de,b)}I(x,B,F)}function q(b,f){if(typeof b!="number")throw new V.ERR_INVALID_ARG_TYPE(f,"number",b)}function Z(b,f,h){throw Math.floor(b)!==b?(q(b,h),new V.ERR_OUT_OF_RANGE(h||"offset","an integer",b)):f<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE(h||"offset",`>= ${h?1:0} and <= ${f}`,b)}const fe=/[^+/0-9A-Za-z-_]/g;function ye(b){if(b=b.split("=")[0],b=b.trim().replace(fe,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function ae(b,f){f=f||1/0;let h;const x=b.length;let B=null;const F=[];for(let H=0;H<x;++H){if(h=b.charCodeAt(H),h>55295&&h<57344){if(!B){if(h>56319){(f-=3)>-1&&F.push(239,191,189);continue}else if(H+1===x){(f-=3)>-1&&F.push(239,191,189);continue}B=h;continue}if(h<56320){(f-=3)>-1&&F.push(239,191,189),B=h;continue}h=(B-55296<<10|h-56320)+65536}else B&&(f-=3)>-1&&F.push(239,191,189);if(B=null,h<128){if((f-=1)<0)break;F.push(h)}else if(h<2048){if((f-=2)<0)break;F.push(h>>6|192,h&63|128)}else if(h<65536){if((f-=3)<0)break;F.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((f-=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 xe(b){const f=[];for(let h=0;h<b.length;++h)f.push(b.charCodeAt(h)&255);return f}function Pt(b,f){let h,x,B;const F=[];for(let H=0;H<b.length&&!((f-=2)<0);++H)h=b.charCodeAt(H),x=h>>8,B=h%256,F.push(B),F.push(x);return F}function Te(b){return e.toByteArray(ye(b))}function Re(b,f,h,x){let B;for(B=0;B<x&&!(B+h>=f.length||B>=b.length);++B)f[B+h]=b[B];return B}function ut(b,f){return b instanceof f||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===f.name}function Ce(b){return b!==b}const ke=function(){const b="0123456789abcdef",f=new Array(256);for(let h=0;h<16;++h){const x=h*16;for(let B=0;B<16;++B)f[x+B]=b[h]+b[B]}return f}();function ft(b){return typeof BigInt>"u"?Ie:b}function Ie(){throw new Error("BigInt not supported")}})(is);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var r=is,n=r.Buffer;function i(o,a){for(var u in o)a[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,u){return n(o,a,u)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,u)},s.alloc=function(o,a,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof u=="string"?l.fill(a,u):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(_u,_u.exports);var jr=_u.exports,Gh=jr.Buffer;function Mo(t,e){this._block=Gh.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Mo.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Gh.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var a=s%n,u=Math.min(i-o,n-a),l=0;l<u;l++)r[a+l]=t[o+l];s+=u,o+=u,s%n===0&&this._update(r)}return this._len+=i,this};Mo.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=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 t?s.toString(t):s};Mo.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Ei=Mo,ry=er,Jh=Ei,ny=jr.Buffer,iy=[1518500249,1859775393,-1894007588,-899497514],sy=new Array(80);function ss(){this.init(),this._w=sy,Jh.call(this,64,56)}ry(ss,Jh);ss.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function oy(t){return t<<5|t>>>27}function ay(t){return t<<30|t>>>2}function uy(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}ss.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var u=0;u<80;++u){var l=~~(u/20),p=oy(r)+uy(l,n,i,s)+o+e[u]+iy[l]|0;o=s,s=i,i=ay(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=o+this._e|0};ss.prototype._hash=function(){var t=ny.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var cy=ss,ly=er,Zh=Ei,fy=jr.Buffer,hy=[1518500249,1859775393,-1894007588,-899497514],dy=new Array(80);function os(){this.init(),this._w=dy,Zh.call(this,64,56)}ly(os,Zh);os.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function py(t){return t<<1|t>>>31}function gy(t){return t<<5|t>>>27}function yy(t){return t<<30|t>>>2}function by(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}os.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=py(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var u=0;u<80;++u){var l=~~(u/20),p=gy(r)+by(l,n,i,s)+o+e[u]+hy[l]|0;o=s,s=i,i=yy(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=o+this._e|0};os.prototype._hash=function(){var t=fy.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var vy=os,my=er,Qh=Ei,wy=jr.Buffer,_y=[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],Sy=new Array(64);function as(){this.init(),this._w=Sy,Qh.call(this,64,56)}my(as,Qh);as.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 Ey(t,e,r){return r^t&(e^r)}function xy(t,e,r){return t&e|r&(t|e)}function My(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Cy(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Iy(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function Ry(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}as.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,u=this._g|0,l=this._h|0,p=0;p<16;++p)e[p]=t.readInt32BE(p*4);for(;p<64;++p)e[p]=Ry(e[p-2])+e[p-7]+Iy(e[p-15])+e[p-16]|0;for(var g=0;g<64;++g){var m=l+Cy(o)+Ey(o,a,u)+_y[g]+e[g]|0,C=My(r)+xy(r,n,i)|0;l=u,u=a,a=o,o=s+m|0,s=i,i=n,n=r,r=m+C|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=l+this._h|0};as.prototype._hash=function(){var t=wy.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Yh=as,Ay=er,Ty=Yh,ky=Ei,Oy=jr.Buffer,Ny=new Array(64);function Co(){this.init(),this._w=Ny,ky.call(this,64,56)}Ay(Co,Ty);Co.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};Co.prototype._hash=function(){var t=Oy.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Ly=Co,By=er,Kh=Ei,Py=jr.Buffer,hl=[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],$y=new Array(160);function us(){this.init(),this._w=$y,Kh.call(this,128,112)}By(us,Kh);us.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 dl(t,e,r){return r^t&(e^r)}function pl(t,e,r){return t&e|r&(t|e)}function gl(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function yl(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Dy(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function Fy(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function jy(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Uy(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function ht(t,e){return t>>>0<e>>>0?1:0}us.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,u=this._gh|0,l=this._hh|0,p=this._al|0,g=this._bl|0,m=this._cl|0,C=this._dl|0,T=this._el|0,P=this._fl|0,U=this._gl|0,M=this._hl|0,O=0;O<32;O+=2)e[O]=t.readInt32BE(O*4),e[O+1]=t.readInt32BE(O*4+4);for(;O<160;O+=2){var D=e[O-30],W=e[O-15*2+1],j=Dy(D,W),z=Fy(W,D);D=e[O-2*2],W=e[O-2*2+1];var K=jy(D,W),X=Uy(W,D),G=e[O-7*2],re=e[O-7*2+1],ie=e[O-16*2],oe=e[O-16*2+1],w=z+re|0,c=j+G+ht(w,z)|0;w=w+X|0,c=c+K+ht(w,X)|0,w=w+oe|0,c=c+ie+ht(w,oe)|0,e[O]=c,e[O+1]=w}for(var y=0;y<160;y+=2){c=e[y],w=e[y+1];var v=pl(r,n,i),S=pl(p,g,m),E=gl(r,p),k=gl(p,r),L=yl(o,T),_=yl(T,o),d=hl[y],A=hl[y+1],Y=dl(o,a,u),ee=dl(T,P,U),N=M+_|0,$=l+L+ht(N,M)|0;N=N+ee|0,$=$+Y+ht(N,ee)|0,N=N+A|0,$=$+d+ht(N,A)|0,N=N+w|0,$=$+c+ht(N,w)|0;var V=k+S|0,Q=E+v+ht(V,k)|0;l=u,M=U,u=a,U=P,a=o,P=T,T=C+N|0,o=s+$+ht(T,C)|0,s=i,C=m,i=n,m=g,n=r,g=p,p=N+V|0,r=$+Q+ht(p,N)|0}this._al=this._al+p|0,this._bl=this._bl+g|0,this._cl=this._cl+m|0,this._dl=this._dl+C|0,this._el=this._el+T|0,this._fl=this._fl+P|0,this._gl=this._gl+U|0,this._hl=this._hl+M|0,this._ah=this._ah+r+ht(this._al,p)|0,this._bh=this._bh+n+ht(this._bl,g)|0,this._ch=this._ch+i+ht(this._cl,m)|0,this._dh=this._dh+s+ht(this._dl,C)|0,this._eh=this._eh+o+ht(this._el,T)|0,this._fh=this._fh+a+ht(this._fl,P)|0,this._gh=this._gh+u+ht(this._gl,U)|0,this._hh=this._hh+l+ht(this._hl,M)|0};us.prototype._hash=function(){var t=Py.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Xh=us,Wy=er,Hy=Xh,Vy=Ei,zy=jr.Buffer,qy=new Array(160);function Io(){this.init(),this._w=qy,Vy.call(this,128,112)}Wy(Io,Hy);Io.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};Io.prototype._hash=function(){var t=zy.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var Gy=Io,Sn=zh.exports=function(e){e=e.toLowerCase();var r=Sn[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Sn.sha=cy;Sn.sha1=vy;Sn.sha224=Ly;Sn.sha256=Yh;Sn.sha384=Gy;Sn.sha512=Xh;var Jy=zh.exports,ne={},Zy=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},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;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},bl=typeof Symbol<"u"&&Symbol,Qy=Zy,Yy=function(){return typeof bl!="function"||typeof Symbol!="function"||typeof bl("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Qy()},vl={foo:{}},Ky=Object,Xy=function(){return{__proto__:vl}.foo===vl.foo&&!({__proto__:null}instanceof Ky)},eb="Function.prototype.bind called on incompatible ",tb=Object.prototype.toString,rb=Math.max,nb="[object Function]",ml=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},ib=function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},sb=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},ob=function(e){var r=this;if(typeof r!="function"||tb.apply(r)!==nb)throw new TypeError(eb+r);for(var n=ib(arguments,1),i,s=function(){if(this instanceof i){var p=r.apply(this,ml(n,arguments));return Object(p)===p?p:this}return r.apply(e,ml(n,arguments))},o=rb(0,r.length-n.length),a=[],u=0;u<o;u++)a[u]="$"+u;if(i=Function("binder","return function ("+sb(a,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var l=function(){};l.prototype=r.prototype,i.prototype=new l,l.prototype=null}return i},ab=ob,rc=Function.prototype.bind||ab,ub=Function.prototype.call,cb=Object.prototype.hasOwnProperty,lb=rc,fb=lb.call(ub,cb),_e,ii=SyntaxError,ed=Function,Yn=TypeError,Aa=function(t){try{return ed('"use strict"; return ('+t+").constructor;")()}catch{}},pn=Object.getOwnPropertyDescriptor;if(pn)try{pn({},"")}catch{pn=null}var Ta=function(){throw new Yn},hb=pn?function(){try{return arguments.callee,Ta}catch{try{return pn(arguments,"callee").get}catch{return Ta}}}():Ta,Fn=Yy(),db=Xy(),gt=Object.getPrototypeOf||(db?function(t){return t.__proto__}:null),qn={},pb=typeof Uint8Array>"u"||!gt?_e:gt(Uint8Array),gn={"%AggregateError%":typeof AggregateError>"u"?_e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?_e:ArrayBuffer,"%ArrayIteratorPrototype%":Fn&>?gt([][Symbol.iterator]()):_e,"%AsyncFromSyncIteratorPrototype%":_e,"%AsyncFunction%":qn,"%AsyncGenerator%":qn,"%AsyncGeneratorFunction%":qn,"%AsyncIteratorPrototype%":qn,"%Atomics%":typeof Atomics>"u"?_e:Atomics,"%BigInt%":typeof BigInt>"u"?_e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?_e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?_e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?_e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?_e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?_e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?_e:FinalizationRegistry,"%Function%":ed,"%GeneratorFunction%":qn,"%Int8Array%":typeof Int8Array>"u"?_e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?_e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?_e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Fn&>?gt(gt([][Symbol.iterator]())):_e,"%JSON%":typeof JSON=="object"?JSON:_e,"%Map%":typeof Map>"u"?_e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Fn||!gt?_e:gt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?_e:Promise,"%Proxy%":typeof Proxy>"u"?_e:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?_e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?_e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Fn||!gt?_e:gt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?_e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Fn&>?gt(""[Symbol.iterator]()):_e,"%Symbol%":Fn?Symbol:_e,"%SyntaxError%":ii,"%ThrowTypeError%":hb,"%TypedArray%":pb,"%TypeError%":Yn,"%Uint8Array%":typeof Uint8Array>"u"?_e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?_e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?_e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?_e:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?_e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?_e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?_e:WeakSet};if(gt)try{null.error}catch(t){var gb=gt(gt(t));gn["%Error.prototype%"]=gb}var yb=function t(e){var r;if(e==="%AsyncFunction%")r=Aa("async function () {}");else if(e==="%GeneratorFunction%")r=Aa("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Aa("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&>&&(r=gt(i.prototype))}return gn[e]=r,r},wl={"%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"]},cs=rc,Xs=fb,bb=cs.call(Function.call,Array.prototype.concat),vb=cs.call(Function.apply,Array.prototype.splice),_l=cs.call(Function.call,String.prototype.replace),eo=cs.call(Function.call,String.prototype.slice),mb=cs.call(Function.call,RegExp.prototype.exec),wb=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_b=/\\(\\)?/g,Sb=function(e){var r=eo(e,0,1),n=eo(e,-1);if(r==="%"&&n!=="%")throw new ii("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ii("invalid intrinsic syntax, expected opening `%`");var i=[];return _l(e,wb,function(s,o,a,u){i[i.length]=a?_l(u,_b,"$1"):o||s}),i},Eb=function(e,r){var n=e,i;if(Xs(wl,n)&&(i=wl[n],n="%"+i[0]+"%"),Xs(gn,n)){var s=gn[n];if(s===qn&&(s=yb(n)),typeof s>"u"&&!r)throw new Yn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new ii("intrinsic "+e+" does not exist!")},En=function(e,r){if(typeof e!="string"||e.length===0)throw new Yn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Yn('"allowMissing" argument must be a boolean');if(mb(/^%?[^%]*%?$/,e)===null)throw new ii("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Sb(e),i=n.length>0?n[0]:"",s=Eb("%"+i+"%",r),o=s.name,a=s.value,u=!1,l=s.alias;l&&(i=l[0],vb(n,bb([0,1],l)));for(var p=1,g=!0;p<n.length;p+=1){var m=n[p],C=eo(m,0,1),T=eo(m,-1);if((C==='"'||C==="'"||C==="`"||T==='"'||T==="'"||T==="`")&&C!==T)throw new ii("property names with quotes must have matching quotes");if((m==="constructor"||!g)&&(u=!0),i+="."+m,o="%"+i+"%",Xs(gn,o))a=gn[o];else if(a!=null){if(!(m in a)){if(!r)throw new Yn("base intrinsic for "+e+" exists, but the property is not available.");return}if(pn&&p+1>=n.length){var P=pn(a,m);g=!!P,g&&"get"in P&&!("originalValue"in P.get)?a=P.get:a=a[m]}else g=Xs(a,m),a=a[m];g&&!u&&(gn[o]=a)}}return a},td={exports:{}},xb=En,Su=xb("%Object.defineProperty%",!0),Eu=function(){if(Su)try{return Su({},"a",{value:1}),!0}catch{return!1}return!1};Eu.hasArrayLengthDefineBug=function(){if(!Eu())return null;try{return Su([],"length",{value:1}).length!==1}catch{return!0}};var rd=Eu,Mb=En,zs=Mb("%Object.getOwnPropertyDescriptor%",!0);if(zs)try{zs([],"length")}catch{zs=null}var nd=zs,Cb=rd(),nc=En,ji=Cb&&nc("%Object.defineProperty%",!0);if(ji)try{ji({},"a",{value:1})}catch{ji=!1}var Ib=nc("%SyntaxError%"),jn=nc("%TypeError%"),Sl=nd,Rb=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new jn("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new jn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new jn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new jn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new jn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new jn("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,u=!!Sl&&Sl(e,r);if(ji)ji(e,r,{configurable:o===null&&u?u.configurable:!o,enumerable:i===null&&u?u.enumerable:!i,value:n,writable:s===null&&u?u.writable:!s});else if(a||!i&&!s&&!o)e[r]=n;else throw new Ib("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},id=En,El=Rb,Ab=rd(),xl=nd,Ml=id("%TypeError%"),Tb=id("%Math.floor%"),kb=function(e,r){if(typeof e!="function")throw new Ml("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Tb(r)!==r)throw new Ml("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&xl){var o=xl(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!n)&&(Ab?El(e,"length",r,!0,!0):El(e,"length",r)),e};(function(t){var e=rc,r=En,n=kb,i=r("%TypeError%"),s=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(o,s),u=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}t.exports=function(m){if(typeof m!="function")throw new i("a function is required");var C=a(e,o,arguments);return n(C,1+l(0,m.length-(arguments.length-1)),!0)};var p=function(){return a(e,s,arguments)};u?u(t.exports,"apply",{value:p}):t.exports.apply=p})(td);var Ob=td.exports,sd=En,od=Ob,Nb=od(sd("String.prototype.indexOf")),Lb=function(e,r){var n=sd(e,!!r);return typeof n=="function"&&Nb(e,".prototype.")>-1?od(n):n},ic=typeof Map=="function"&&Map.prototype,ka=Object.getOwnPropertyDescriptor&&ic?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,to=ic&&ka&&typeof ka.get=="function"?ka.get:null,Cl=ic&&Map.prototype.forEach,sc=typeof Set=="function"&&Set.prototype,Oa=Object.getOwnPropertyDescriptor&&sc?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ro=sc&&Oa&&typeof Oa.get=="function"?Oa.get:null,Il=sc&&Set.prototype.forEach,Bb=typeof WeakMap=="function"&&WeakMap.prototype,Ui=Bb?WeakMap.prototype.has:null,Pb=typeof WeakSet=="function"&&WeakSet.prototype,Wi=Pb?WeakSet.prototype.has:null,$b=typeof WeakRef=="function"&&WeakRef.prototype,Rl=$b?WeakRef.prototype.deref:null,Db=Boolean.prototype.valueOf,Fb=Object.prototype.toString,jb=Function.prototype.toString,Ub=String.prototype.match,oc=String.prototype.slice,Nr=String.prototype.replace,Wb=String.prototype.toUpperCase,Al=String.prototype.toLowerCase,ad=RegExp.prototype.test,Tl=Array.prototype.concat,cr=Array.prototype.join,Hb=Array.prototype.slice,kl=Math.floor,xu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Na=Object.getOwnPropertySymbols,Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,si=typeof Symbol=="function"&&typeof Symbol.iterator=="object",xt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===si||"symbol")?Symbol.toStringTag:null,ud=Object.prototype.propertyIsEnumerable,Ol=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Nl(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ad.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-kl(-t):kl(t);if(n!==t){var i=String(n),s=oc.call(e,i.length+1);return Nr.call(i,r,"$&_")+"."+Nr.call(Nr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Nr.call(e,r,"$&_")}var Cu=yo,Ll=Cu.custom,Bl=ld(Ll)?Ll:null,Vb=function t(e,r,n,i){var s=r||{};if(Tr(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Tr(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Tr(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Tr(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Tr(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return hd(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return a?Nl(e,u):u}if(typeof e=="bigint"){var l=String(e)+"n";return a?Nl(e,l):l}var p=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=p&&p>0&&typeof e=="object")return Iu(e)?"[Array]":"[Object]";var g=uv(s,n);if(typeof i>"u")i=[];else if(fd(i,e)>=0)return"[Circular]";function m(w,c,y){if(c&&(i=Hb.call(i),i.push(c)),y){var v={depth:s.depth};return Tr(s,"quoteStyle")&&(v.quoteStyle=s.quoteStyle),t(w,v,n+1,i)}return t(w,s,n+1,i)}if(typeof e=="function"&&!Pl(e)){var C=Xb(e),T=Ts(e,m);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(T.length>0?" { "+cr.call(T,", ")+" }":"")}if(ld(e)){var P=si?Nr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Mu.call(e);return typeof e=="object"&&!si?Li(P):P}if(sv(e)){for(var U="<"+Al.call(String(e.nodeName)),M=e.attributes||[],O=0;O<M.length;O++)U+=" "+M[O].name+"="+cd(zb(M[O].value),"double",s);return U+=">",e.childNodes&&e.childNodes.length&&(U+="..."),U+="</"+Al.call(String(e.nodeName))+">",U}if(Iu(e)){if(e.length===0)return"[]";var D=Ts(e,m);return g&&!av(D)?"["+Ru(D,g)+"]":"[ "+cr.call(D,", ")+" ]"}if(Gb(e)){var W=Ts(e,m);return!("cause"in Error.prototype)&&"cause"in e&&!ud.call(e,"cause")?"{ ["+String(e)+"] "+cr.call(Tl.call("[cause]: "+m(e.cause),W),", ")+" }":W.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+cr.call(W,", ")+" }"}if(typeof e=="object"&&o){if(Bl&&typeof e[Bl]=="function"&&Cu)return Cu(e,{depth:p-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ev(e)){var j=[];return Cl&&Cl.call(e,function(w,c){j.push(m(c,e,!0)+" => "+m(w,e))}),$l("Map",to.call(e),j,g)}if(nv(e)){var z=[];return Il&&Il.call(e,function(w){z.push(m(w,e))}),$l("Set",ro.call(e),z,g)}if(tv(e))return La("WeakMap");if(iv(e))return La("WeakSet");if(rv(e))return La("WeakRef");if(Zb(e))return Li(m(Number(e)));if(Yb(e))return Li(m(xu.call(e)));if(Qb(e))return Li(Db.call(e));if(Jb(e))return Li(m(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===te)return"{ [object globalThis] }";if(!qb(e)&&!Pl(e)){var K=Ts(e,m),X=Ol?Ol(e)===Object.prototype:e instanceof Object||e.constructor===Object,G=e instanceof Object?"":"null prototype",re=!X&&xt&&Object(e)===e&&xt in e?oc.call(Ur(e),8,-1):G?"Object":"",ie=X||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",oe=ie+(re||G?"["+cr.call(Tl.call([],re||[],G||[]),": ")+"] ":"");return K.length===0?oe+"{}":g?oe+"{"+Ru(K,g)+"}":oe+"{ "+cr.call(K,", ")+" }"}return String(e)};function cd(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function zb(t){return Nr.call(String(t),/"/g,""")}function Iu(t){return Ur(t)==="[object Array]"&&(!xt||!(typeof t=="object"&&xt in t))}function qb(t){return Ur(t)==="[object Date]"&&(!xt||!(typeof t=="object"&&xt in t))}function Pl(t){return Ur(t)==="[object RegExp]"&&(!xt||!(typeof t=="object"&&xt in t))}function Gb(t){return Ur(t)==="[object Error]"&&(!xt||!(typeof t=="object"&&xt in t))}function Jb(t){return Ur(t)==="[object String]"&&(!xt||!(typeof t=="object"&&xt in t))}function Zb(t){return Ur(t)==="[object Number]"&&(!xt||!(typeof t=="object"&&xt in t))}function Qb(t){return Ur(t)==="[object Boolean]"&&(!xt||!(typeof t=="object"&&xt in t))}function ld(t){if(si)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Mu)return!1;try{return Mu.call(t),!0}catch{}return!1}function Yb(t){if(!t||typeof t!="object"||!xu)return!1;try{return xu.call(t),!0}catch{}return!1}var Kb=Object.prototype.hasOwnProperty||function(t){return t in this};function Tr(t,e){return Kb.call(t,e)}function Ur(t){return Fb.call(t)}function Xb(t){if(t.name)return t.name;var e=Ub.call(jb.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function fd(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function ev(t){if(!to||!t||typeof t!="object")return!1;try{to.call(t);try{ro.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function tv(t){if(!Ui||!t||typeof t!="object")return!1;try{Ui.call(t,Ui);try{Wi.call(t,Wi)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function rv(t){if(!Rl||!t||typeof t!="object")return!1;try{return Rl.call(t),!0}catch{}return!1}function nv(t){if(!ro||!t||typeof t!="object")return!1;try{ro.call(t);try{to.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function iv(t){if(!Wi||!t||typeof t!="object")return!1;try{Wi.call(t,Wi);try{Ui.call(t,Ui)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function sv(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function hd(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return hd(oc.call(t,0,e.maxStringLength),e)+n}var i=Nr.call(Nr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ov);return cd(i,"single",e)}function ov(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Wb.call(e.toString(16))}function Li(t){return"Object("+t+")"}function La(t){return t+" { ? }"}function $l(t,e,r,n){var i=n?Ru(r,n):cr.call(r,", ");return t+" ("+e+") {"+i+"}"}function av(t){for(var e=0;e<t.length;e++)if(fd(t[e],`
|
|
7
|
-
`)>=0)return!1;return!0}function uv(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=cr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:cr.call(Array(e+1),r)}}function Ru(t,e){if(t.length===0)return"";var r=`
|
|
8
|
-
`+e.prev+e.base;return r+cr.call(t,","+r)+`
|
|
9
|
-
`+e.prev}function Ts(t,e){var r=Iu(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Tr(t,i)?e(t[i],t):""}var s=typeof Na=="function"?Na(t):[],o;if(si){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var u in t)Tr(t,u)&&(r&&String(Number(u))===u&&u<t.length||si&&o["$"+u]instanceof Symbol||(ad.call(/[^\w$]/,u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if(typeof Na=="function")for(var l=0;l<s.length;l++)ud.call(t,s[l])&&n.push("["+e(s[l])+"]: "+e(t[s[l]],t));return n}var ac=En,xi=Lb,cv=Vb,lv=ac("%TypeError%"),ks=ac("%WeakMap%",!0),Os=ac("%Map%",!0),fv=xi("WeakMap.prototype.get",!0),hv=xi("WeakMap.prototype.set",!0),dv=xi("WeakMap.prototype.has",!0),pv=xi("Map.prototype.get",!0),gv=xi("Map.prototype.set",!0),yv=xi("Map.prototype.has",!0),uc=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},bv=function(t,e){var r=uc(t,e);return r&&r.value},vv=function(t,e,r){var n=uc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},mv=function(t,e){return!!uc(t,e)},wv=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new lv("Side channel does not contain "+cv(s))},get:function(s){if(ks&&s&&(typeof s=="object"||typeof s=="function")){if(e)return fv(e,s)}else if(Os){if(r)return pv(r,s)}else if(n)return bv(n,s)},has:function(s){if(ks&&s&&(typeof s=="object"||typeof s=="function")){if(e)return dv(e,s)}else if(Os){if(r)return yv(r,s)}else if(n)return mv(n,s);return!1},set:function(s,o){ks&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new ks),hv(e,s,o)):Os?(r||(r=new Os),gv(r,s,o)):(n||(n={key:{},next:null}),vv(n,s,o))}};return i},_v=String.prototype.replace,Sv=/%20/g,Ba={RFC1738:"RFC1738",RFC3986:"RFC3986"},cc={default:Ba.RFC3986,formatters:{RFC1738:function(t){return _v.call(t,Sv,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ba.RFC1738,RFC3986:Ba.RFC3986},Ev=cc,Pa=Object.prototype.hasOwnProperty,on=Array.isArray,nr=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),xv=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(on(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},dd=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},Mv=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(on(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Pa.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return on(e)&&!on(r)&&(i=dd(e,n)),on(e)&&on(r)?(r.forEach(function(s,o){if(Pa.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,n):e.push(s)}else e[o]=s}),e):Object.keys(r).reduce(function(s,o){var a=r[o];return Pa.call(s,o)?s[o]=t(s[o],a,n):s[o]=a,s},i)},Cv=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},Iv=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Rv=function(e,r,n,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var a="",u=0;u<o.length;++u){var l=o.charCodeAt(u);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===Ev.RFC1738&&(l===40||l===41)){a+=o.charAt(u);continue}if(l<128){a=a+nr[l];continue}if(l<2048){a=a+(nr[192|l>>6]+nr[128|l&63]);continue}if(l<55296||l>=57344){a=a+(nr[224|l>>12]+nr[128|l>>6&63]+nr[128|l&63]);continue}u+=1,l=65536+((l&1023)<<10|o.charCodeAt(u)&1023),a+=nr[240|l>>18]+nr[128|l>>12&63]+nr[128|l>>6&63]+nr[128|l&63]}return a},Av=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],o=s.obj[s.prop],a=Object.keys(o),u=0;u<a.length;++u){var l=a[u],p=o[l];typeof p=="object"&&p!==null&&n.indexOf(p)===-1&&(r.push({obj:o,prop:l}),n.push(p))}return xv(r),e},Tv=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},kv=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Ov=function(e,r){return[].concat(e,r)},Nv=function(e,r){if(on(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},pd={arrayToObject:dd,assign:Cv,combine:Ov,compact:Av,decode:Iv,encode:Rv,isBuffer:kv,isRegExp:Tv,maybeMap:Nv,merge:Mv},gd=wv,qs=pd,Hi=cc,Lv=Object.prototype.hasOwnProperty,Dl={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},mr=Array.isArray,Bv=Array.prototype.push,yd=function(t,e){Bv.apply(t,mr(e)?e:[e])},Pv=Date.prototype.toISOString,Fl=Hi.default,Et={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:qs.encode,encodeValuesOnly:!1,format:Fl,formatter:Hi.formatters[Fl],indices:!1,serializeDate:function(e){return Pv.call(e)},skipNulls:!1,strictNullHandling:!1},$v=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},$a={},Dv=function t(e,r,n,i,s,o,a,u,l,p,g,m,C,T,P,U){for(var M=e,O=U,D=0,W=!1;(O=O.get($a))!==void 0&&!W;){var j=O.get(e);if(D+=1,typeof j<"u"){if(j===D)throw new RangeError("Cyclic object value");W=!0}typeof O.get($a)>"u"&&(D=0)}if(typeof u=="function"?M=u(r,M):M instanceof Date?M=g(M):n==="comma"&&mr(M)&&(M=qs.maybeMap(M,function(v){return v instanceof Date?g(v):v})),M===null){if(s)return a&&!T?a(r,Et.encoder,P,"key",m):r;M=""}if($v(M)||qs.isBuffer(M)){if(a){var z=T?r:a(r,Et.encoder,P,"key",m);return[C(z)+"="+C(a(M,Et.encoder,P,"value",m))]}return[C(r)+"="+C(String(M))]}var K=[];if(typeof M>"u")return K;var X;if(n==="comma"&&mr(M))T&&a&&(M=qs.maybeMap(M,a)),X=[{value:M.length>0?M.join(",")||null:void 0}];else if(mr(u))X=u;else{var G=Object.keys(M);X=l?G.sort(l):G}for(var re=i&&mr(M)&&M.length===1?r+"[]":r,ie=0;ie<X.length;++ie){var oe=X[ie],w=typeof oe=="object"&&typeof oe.value<"u"?oe.value:M[oe];if(!(o&&w===null)){var c=mr(M)?typeof n=="function"?n(re,oe):re:re+(p?"."+oe:"["+oe+"]");U.set(e,D);var y=gd();y.set($a,U),yd(K,t(w,c,n,i,s,o,n==="comma"&&T&&mr(M)?null:a,u,l,p,g,m,C,T,P,y))}}return K},Fv=function(e){if(!e)return Et;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Et.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Hi.default;if(typeof e.format<"u"){if(!Lv.call(Hi.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Hi.formatters[n],s=Et.filter;return(typeof e.filter=="function"||mr(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Et.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Et.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Et.charsetSentinel,delimiter:typeof e.delimiter>"u"?Et.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Et.encode,encoder:typeof e.encoder=="function"?e.encoder:Et.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Et.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Et.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Et.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Et.strictNullHandling}},jv=function(t,e){var r=t,n=Fv(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):mr(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Dl?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var u=Dl[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=u==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=gd(),g=0;g<i.length;++g){var m=i[g];n.skipNulls&&r[m]===null||yd(o,Dv(r[m],m,u,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,p))}var C=o.join(n.delimiter),T=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),C.length>0?T+C:""},oi=pd,Au=Object.prototype.hasOwnProperty,Uv=Array.isArray,dt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:oi.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Wv=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},bd=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Hv="utf8=%26%2310003%3B",Vv="utf8=%E2%9C%93",zv=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,u,l=r.charset;if(r.charsetSentinel)for(u=0;u<o.length;++u)o[u].indexOf("utf8=")===0&&(o[u]===Vv?l="utf-8":o[u]===Hv&&(l="iso-8859-1"),a=u,u=o.length);for(u=0;u<o.length;++u)if(u!==a){var p=o[u],g=p.indexOf("]="),m=g===-1?p.indexOf("="):g+1,C,T;m===-1?(C=r.decoder(p,dt.decoder,l,"key"),T=r.strictNullHandling?null:""):(C=r.decoder(p.slice(0,m),dt.decoder,l,"key"),T=oi.maybeMap(bd(p.slice(m+1),r),function(P){return r.decoder(P,dt.decoder,l,"value")})),T&&r.interpretNumericEntities&&l==="iso-8859-1"&&(T=Wv(T)),p.indexOf("[]=")>-1&&(T=Uv(T)?[T]:T),Au.call(n,C)?n[C]=oi.combine(n[C],T):n[C]=T}return n},qv=function(t,e,r,n){for(var i=n?e:bd(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(u,10);!r.parseArrays&&u===""?o={0:i}:!isNaN(l)&&a!==u&&String(l)===u&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(o=[],o[l]=i):u!=="__proto__"&&(o[u]=i)}i=o}return i},Gv=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=n.depth>0&&o.exec(s),l=u?s.slice(0,u.index):s,p=[];if(l){if(!n.plainObjects&&Au.call(Object.prototype,l)&&!n.allowPrototypes)return;p.push(l)}for(var g=0;n.depth>0&&(u=a.exec(s))!==null&&g<n.depth;){if(g+=1,!n.plainObjects&&Au.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;p.push(u[1])}return u&&p.push("["+s.slice(u.index)+"]"),qv(p,r,n,i)}},Jv=function(e){if(!e)return dt;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?dt.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?dt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:dt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:dt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:dt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:dt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:dt.comma,decoder:typeof e.decoder=="function"?e.decoder:dt.decoder,delimiter:typeof e.delimiter=="string"||oi.isRegExp(e.delimiter)?e.delimiter:dt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:dt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:dt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:dt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:dt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:dt.strictNullHandling}},Zv=function(t,e){var r=Jv(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?zv(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o<s.length;++o){var a=s[o],u=Gv(a,n[a],r,typeof t=="string");i=oi.merge(i,u,r)}return r.allowSparse===!0?i:oi.compact(i)},Qv=jv,Yv=Zv,Kv=cc,Xv={formats:Kv,parse:Yv,stringify:Qv},ls={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return n=>n}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function r(n){return Math.floor(n)}t.IntNumber=r,t.RegExpString=e(),function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(ls);var em=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ne,"__esModule",{value:!0});ne.isInIFrame=ne.createQrUrl=ne.getFavicon=ne.range=ne.isBigNumber=ne.ensureParsedJSONObject=ne.ensureBN=ne.ensureRegExpString=ne.ensureIntNumber=ne.ensureBuffer=ne.ensureAddressString=ne.ensureEvenLengthHexString=ne.ensureHexString=ne.isHexString=ne.prepend0x=ne.strip0x=ne.has0xPrefix=ne.hexStringFromIntNumber=ne.intNumberFromHexString=ne.bigIntStringFromBN=ne.hexStringFromBuffer=ne.hexStringToUint8Array=ne.uint8ArrayToHex=ne.randomBytesHex=void 0;const kr=em(_o),tm=Xv,xn=ns,Vt=ls,vd=/^[0-9]*$/,md=/^[a-f0-9]*$/;function rm(t){return wd(crypto.getRandomValues(new Uint8Array(t)))}ne.randomBytesHex=rm;function wd(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}ne.uint8ArrayToHex=wd;function nm(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}ne.hexStringToUint8Array=nm;function im(t,e=!1){const r=t.toString("hex");return(0,Vt.HexString)(e?"0x"+r:r)}ne.hexStringFromBuffer=im;function sm(t){return(0,Vt.BigIntString)(t.toString(10))}ne.bigIntStringFromBN=sm;function om(t){return(0,Vt.IntNumber)(new kr.default(hs(t,!1),16).toNumber())}ne.intNumberFromHexString=om;function am(t){return(0,Vt.HexString)("0x"+new kr.default(t).toString(16))}ne.hexStringFromIntNumber=am;function lc(t){return t.startsWith("0x")||t.startsWith("0X")}ne.has0xPrefix=lc;function Ro(t){return lc(t)?t.slice(2):t}ne.strip0x=Ro;function _d(t){return lc(t)?"0x"+t.slice(2):"0x"+t}ne.prepend0x=_d;function fs(t){if(typeof t!="string")return!1;const e=Ro(t).toLowerCase();return md.test(e)}ne.isHexString=fs;function Sd(t,e=!1){if(typeof t=="string"){const r=Ro(t).toLowerCase();if(md.test(r))return(0,Vt.HexString)(e?"0x"+r:r)}throw xn.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}ne.ensureHexString=Sd;function hs(t,e=!1){let r=Sd(t,!1);return r.length%2===1&&(r=(0,Vt.HexString)("0"+r)),e?(0,Vt.HexString)("0x"+r):r}ne.ensureEvenLengthHexString=hs;function um(t){if(typeof t=="string"){const e=Ro(t).toLowerCase();if(fs(e)&&e.length===40)return(0,Vt.AddressString)(_d(e))}throw xn.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}ne.ensureAddressString=um;function cm(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string")if(fs(t)){const e=hs(t,!1);return Buffer.from(e,"hex")}else return Buffer.from(t,"utf8");throw xn.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}ne.ensureBuffer=cm;function Ed(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Vt.IntNumber)(t);if(typeof t=="string"){if(vd.test(t))return(0,Vt.IntNumber)(Number(t));if(fs(t))return(0,Vt.IntNumber)(new kr.default(hs(t,!1),16).toNumber())}throw xn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}ne.ensureIntNumber=Ed;function lm(t){if(t instanceof RegExp)return(0,Vt.RegExpString)(t.toString());throw xn.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}ne.ensureRegExpString=lm;function fm(t){if(t!==null&&(kr.default.isBN(t)||xd(t)))return new kr.default(t.toString(10),10);if(typeof t=="number")return new kr.default(Ed(t));if(typeof t=="string"){if(vd.test(t))return new kr.default(t,10);if(fs(t))return new kr.default(hs(t,!1),16)}throw xn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}ne.ensureBN=fm;function hm(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw xn.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}ne.ensureParsedJSONObject=hm;function xd(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}ne.isBigNumber=xd;function dm(t,e){return Array.from({length:e-t},(r,n)=>t+n)}ne.range=dm;function pm(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}ne.getFavicon=pm;function gm(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,tm.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}ne.createQrUrl=gm;function ym(){try{return window.frameElement!==null}catch{return!1}}ne.isInIFrame=ym;Object.defineProperty(Si,"__esModule",{value:!0});Si.Session=void 0;const jl=Jy,Ul=ne,Wl="session:id",Hl="session:secret",Vl="session:linked";class fc{constructor(e,r,n,i){this._storage=e,this._id=r||(0,Ul.randomBytesHex)(16),this._secret=n||(0,Ul.randomBytesHex)(32),this._key=new jl.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(Wl),n=e.getItem(Vl),i=e.getItem(Hl);return r&&i?new fc(e,r,i,n==="1"):null}static hash(e){return new jl.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Wl,this._id),this._storage.setItem(Hl,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Vl,this._linked?"1":"0")}}Si.Session=fc;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.WalletSDKRelayAbstract=Xt.APP_VERSION_KEY=Xt.LOCAL_STORAGE_ADDRESSES_KEY=Xt.WALLET_USER_NAME_KEY=void 0;const zl=ns;Xt.WALLET_USER_NAME_KEY="walletUsername";Xt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Xt.APP_VERSION_KEY="AppVersion";class bm{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw zl.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,zl.serializeError)(s,e.method);return i})}}Xt.WalletSDKRelayAbstract=bm;var Tu={exports:{}},Md=Zu.EventEmitter,Da,ql;function vm(){if(ql)return Da;ql=1;function t(T,P){var U=Object.keys(T);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);P&&(M=M.filter(function(O){return Object.getOwnPropertyDescriptor(T,O).enumerable})),U.push.apply(U,M)}return U}function e(T){for(var P=1;P<arguments.length;P++){var U=arguments[P]!=null?arguments[P]:{};P%2?t(Object(U),!0).forEach(function(M){r(T,M,U[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(U)):t(Object(U)).forEach(function(M){Object.defineProperty(T,M,Object.getOwnPropertyDescriptor(U,M))})}return T}function r(T,P,U){return P=o(P),P in T?Object.defineProperty(T,P,{value:U,enumerable:!0,configurable:!0,writable:!0}):T[P]=U,T}function n(T,P){if(!(T instanceof P))throw new TypeError("Cannot call a class as a function")}function i(T,P){for(var U=0;U<P.length;U++){var M=P[U];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(T,o(M.key),M)}}function s(T,P,U){return P&&i(T.prototype,P),U&&i(T,U),Object.defineProperty(T,"prototype",{writable:!1}),T}function o(T){var P=a(T,"string");return typeof P=="symbol"?P:String(P)}function a(T,P){if(typeof T!="object"||T===null)return T;var U=T[Symbol.toPrimitive];if(U!==void 0){var M=U.call(T,P||"default");if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(T)}var u=is,l=u.Buffer,p=yo,g=p.inspect,m=g&&g.custom||"inspect";function C(T,P,U){l.prototype.copy.call(T,P,U)}return Da=function(){function T(){n(this,T),this.head=null,this.tail=null,this.length=0}return s(T,[{key:"push",value:function(U){var M={data:U,next:null};this.length>0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(U){var M={data:U,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var U=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,U}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(U){if(this.length===0)return"";for(var M=this.head,O=""+M.data;M=M.next;)O+=U+M.data;return O}},{key:"concat",value:function(U){if(this.length===0)return l.alloc(0);for(var M=l.allocUnsafe(U>>>0),O=this.head,D=0;O;)C(O.data,M,D),D+=O.data.length,O=O.next;return M}},{key:"consume",value:function(U,M){var O;return U<this.head.data.length?(O=this.head.data.slice(0,U),this.head.data=this.head.data.slice(U)):U===this.head.data.length?O=this.shift():O=M?this._getString(U):this._getBuffer(U),O}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(U){var M=this.head,O=1,D=M.data;for(U-=D.length;M=M.next;){var W=M.data,j=U>W.length?W.length:U;if(j===W.length?D+=W:D+=W.slice(0,U),U-=j,U===0){j===W.length?(++O,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=W.slice(j));break}++O}return this.length-=O,D}},{key:"_getBuffer",value:function(U){var M=l.allocUnsafe(U),O=this.head,D=1;for(O.data.copy(M),U-=O.data.length;O=O.next;){var W=O.data,j=U>W.length?W.length:U;if(W.copy(M,M.length-U,0,j),U-=j,U===0){j===W.length?(++D,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=W.slice(j));break}++D}return this.length-=D,M}},{key:m,value:function(U,M){return g(this,e(e({},M),{},{depth:0,customInspect:!1}))}}]),T}(),Da}function mm(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(ku,this,t)):process.nextTick(ku,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Gs,r):(r._writableState.errorEmitted=!0,process.nextTick(Gl,r,s)):process.nextTick(Gl,r,s):e?(process.nextTick(Gs,r),e(s)):process.nextTick(Gs,r)}),this)}function Gl(t,e){ku(t,e),Gs(t)}function Gs(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function wm(){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 ku(t,e){t.emit("error",e)}function _m(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var Cd={destroy:mm,undestroy:wm,errorOrDestroy:_m},Mn={};function Sm(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Id={};function qt(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){Sm(o,s);function o(a,u,l){return s.call(this,n(a,u,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,Id[t]=i}function Jl(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Em(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function xm(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Mm(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}qt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);qt("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&Em(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(xm(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Jl(e,"type"));else{var s=Mm(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(Jl(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);qt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");qt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});qt("ERR_STREAM_PREMATURE_CLOSE","Premature close");qt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});qt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");qt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");qt("ERR_STREAM_WRITE_AFTER_END","write after end");qt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);qt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);qt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Mn.codes=Id;var Cm=Mn.codes.ERR_INVALID_OPT_VALUE;function Im(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Rm(t,e,r,n){var i=Im(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Cm(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var Rd={getHighWaterMark:Rm},Am=Tm;function Tm(t,e){if(Fa("noDeprecation"))return t;var r=!1;function n(){if(!r){if(Fa("throwDeprecation"))throw new Error(e);Fa("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function Fa(t){try{if(!te.localStorage)return!1}catch{return!1}var e=te.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var ja,Zl;function Ad(){if(Zl)return ja;Zl=1,ja=X;function t(N){var $=this;this.next=null,this.entry=null,this.finish=function(){ee($,N)}}var e;X.WritableState=z;var r={deprecate:Am},n=Md,i=is.Buffer,s=(typeof te<"u"?te:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(N){return i.from(N)}function a(N){return i.isBuffer(N)||N instanceof s}var u=Cd,l=Rd,p=l.getHighWaterMark,g=Mn.codes,m=g.ERR_INVALID_ARG_TYPE,C=g.ERR_METHOD_NOT_IMPLEMENTED,T=g.ERR_MULTIPLE_CALLBACK,P=g.ERR_STREAM_CANNOT_PIPE,U=g.ERR_STREAM_DESTROYED,M=g.ERR_STREAM_NULL_VALUES,O=g.ERR_STREAM_WRITE_AFTER_END,D=g.ERR_UNKNOWN_ENCODING,W=u.errorOrDestroy;er(X,n);function j(){}function z(N,$,V){e=e||ai(),N=N||{},typeof V!="boolean"&&(V=$ instanceof e),this.objectMode=!!N.objectMode,V&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=p(this,N,"writableHighWaterMark",V),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=N.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ge){v($,ge)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=N.emitClose!==!1,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}z.prototype.getBuffer=function(){for(var $=this.bufferedRequest,V=[];$;)V.push($),$=$.next;return V},function(){try{Object.defineProperty(z.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var K;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(K=Function.prototype[Symbol.hasInstance],Object.defineProperty(X,Symbol.hasInstance,{value:function($){return K.call(this,$)?!0:this!==X?!1:$&&$._writableState instanceof z}})):K=function($){return $ instanceof this};function X(N){e=e||ai();var $=this instanceof e;if(!$&&!K.call(X,this))return new X(N);this._writableState=new z(N,this,$),this.writable=!0,N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final)),n.call(this)}X.prototype.pipe=function(){W(this,new P)};function G(N,$){var V=new O;W(N,V),process.nextTick($,V)}function re(N,$,V,Q){var ge;return V===null?ge=new M:typeof V!="string"&&!$.objectMode&&(ge=new m("chunk",["string","Buffer"],V)),ge?(W(N,ge),process.nextTick(Q,ge),!1):!0}X.prototype.write=function(N,$,V){var Q=this._writableState,ge=!1,I=!Q.objectMode&&a(N);return I&&!i.isBuffer(N)&&(N=o(N)),typeof $=="function"&&(V=$,$=null),I?$="buffer":$||($=Q.defaultEncoding),typeof V!="function"&&(V=j),Q.ending?G(this,V):(I||re(this,Q,N,V))&&(Q.pendingcb++,ge=oe(this,Q,I,N,$,V)),ge},X.prototype.cork=function(){this._writableState.corked++},X.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,!N.writing&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&k(this,N))},X.prototype.setDefaultEncoding=function($){if(typeof $=="string"&&($=$.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf(($+"").toLowerCase())>-1))throw new D($);return this._writableState.defaultEncoding=$,this},Object.defineProperty(X.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ie(N,$,V){return!N.objectMode&&N.decodeStrings!==!1&&typeof $=="string"&&($=i.from($,V)),$}Object.defineProperty(X.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function oe(N,$,V,Q,ge,I){if(!V){var R=ie($,Q,ge);Q!==R&&(V=!0,ge="buffer",Q=R)}var q=$.objectMode?1:Q.length;$.length+=q;var Z=$.length<$.highWaterMark;if(Z||($.needDrain=!0),$.writing||$.corked){var fe=$.lastBufferedRequest;$.lastBufferedRequest={chunk:Q,encoding:ge,isBuf:V,callback:I,next:null},fe?fe.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else w(N,$,!1,q,Q,ge,I);return Z}function w(N,$,V,Q,ge,I,R){$.writelen=Q,$.writecb=R,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new U("write")):V?N._writev(ge,$.onwrite):N._write(ge,I,$.onwrite),$.sync=!1}function c(N,$,V,Q,ge){--$.pendingcb,V?(process.nextTick(ge,Q),process.nextTick(A,N,$),N._writableState.errorEmitted=!0,W(N,Q)):(ge(Q),N._writableState.errorEmitted=!0,W(N,Q),A(N,$))}function y(N){N.writing=!1,N.writecb=null,N.length-=N.writelen,N.writelen=0}function v(N,$){var V=N._writableState,Q=V.sync,ge=V.writecb;if(typeof ge!="function")throw new T;if(y(V),$)c(N,V,Q,$,ge);else{var I=L(V)||N.destroyed;!I&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&k(N,V),Q?process.nextTick(S,N,V,I,ge):S(N,V,I,ge)}}function S(N,$,V,Q){V||E(N,$),$.pendingcb--,Q(),A(N,$)}function E(N,$){$.length===0&&$.needDrain&&($.needDrain=!1,N.emit("drain"))}function k(N,$){$.bufferProcessing=!0;var V=$.bufferedRequest;if(N._writev&&V&&V.next){var Q=$.bufferedRequestCount,ge=new Array(Q),I=$.corkedRequestsFree;I.entry=V;for(var R=0,q=!0;V;)ge[R]=V,V.isBuf||(q=!1),V=V.next,R+=1;ge.allBuffers=q,w(N,$,!0,$.length,ge,"",I.finish),$.pendingcb++,$.lastBufferedRequest=null,I.next?($.corkedRequestsFree=I.next,I.next=null):$.corkedRequestsFree=new t($),$.bufferedRequestCount=0}else{for(;V;){var Z=V.chunk,fe=V.encoding,ye=V.callback,ae=$.objectMode?1:Z.length;if(w(N,$,!1,ae,Z,fe,ye),V=V.next,$.bufferedRequestCount--,$.writing)break}V===null&&($.lastBufferedRequest=null)}$.bufferedRequest=V,$.bufferProcessing=!1}X.prototype._write=function(N,$,V){V(new C("_write()"))},X.prototype._writev=null,X.prototype.end=function(N,$,V){var Q=this._writableState;return typeof N=="function"?(V=N,N=null,$=null):typeof $=="function"&&(V=$,$=null),N!=null&&this.write(N,$),Q.corked&&(Q.corked=1,this.uncork()),Q.ending||Y(this,Q,V),this},Object.defineProperty(X.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function L(N){return N.ending&&N.length===0&&N.bufferedRequest===null&&!N.finished&&!N.writing}function _(N,$){N._final(function(V){$.pendingcb--,V&&W(N,V),$.prefinished=!0,N.emit("prefinish"),A(N,$)})}function d(N,$){!$.prefinished&&!$.finalCalled&&(typeof N._final=="function"&&!$.destroyed?($.pendingcb++,$.finalCalled=!0,process.nextTick(_,N,$)):($.prefinished=!0,N.emit("prefinish")))}function A(N,$){var V=L($);if(V&&(d(N,$),$.pendingcb===0&&($.finished=!0,N.emit("finish"),$.autoDestroy))){var Q=N._readableState;(!Q||Q.autoDestroy&&Q.endEmitted)&&N.destroy()}return V}function Y(N,$,V){$.ending=!0,A(N,$),V&&($.finished?process.nextTick(V):N.once("finish",V)),$.ended=!0,N.writable=!1}function ee(N,$,V){var Q=N.entry;for(N.entry=null;Q;){var ge=Q.callback;$.pendingcb--,ge(V),Q=Q.next}$.corkedRequestsFree.next=N}return Object.defineProperty(X.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function($){this._writableState&&(this._writableState.destroyed=$)}}),X.prototype.destroy=u.destroy,X.prototype._undestroy=u.undestroy,X.prototype._destroy=function(N,$){$(N)},ja}var Ua,Ql;function ai(){if(Ql)return Ua;Ql=1;var t=Object.keys||function(l){var p=[];for(var g in l)p.push(g);return p};Ua=o;var e=kd(),r=Ad();er(o,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(l){if(!(this instanceof o))return new o(l);e.call(this,l),r.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(u,this)}function u(l){l.end()}return Object.defineProperty(o.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)}}),Ua}var Wa={},Yl;function Kl(){if(Yl)return Wa;Yl=1;var t=jr.Buffer,e=t.isEncoding||function(M){switch(M=""+M,M&&M.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(M){if(!M)return"utf8";for(var O;;)switch(M){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return M;default:if(O)return;M=(""+M).toLowerCase(),O=!0}}function n(M){var O=r(M);if(typeof O!="string"&&(t.isEncoding===e||!e(M)))throw new Error("Unknown encoding: "+M);return O||M}Wa.StringDecoder=i;function i(M){this.encoding=n(M);var O;switch(this.encoding){case"utf16le":this.text=g,this.end=m,O=4;break;case"utf8":this.fillLast=u,O=4;break;case"base64":this.text=C,this.end=T,O=3;break;default:this.write=P,this.end=U;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(O)}i.prototype.write=function(M){if(M.length===0)return"";var O,D;if(this.lastNeed){if(O=this.fillLast(M),O===void 0)return"";D=this.lastNeed,this.lastNeed=0}else D=0;return D<M.length?O?O+this.text(M,D):this.text(M,D):O||""},i.prototype.end=p,i.prototype.text=l,i.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length};function s(M){return M<=127?0:M>>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function o(M,O,D){var W=O.length-1;if(W<D)return 0;var j=s(O[W]);return j>=0?(j>0&&(M.lastNeed=j-1),j):--W<D||j===-2?0:(j=s(O[W]),j>=0?(j>0&&(M.lastNeed=j-2),j):--W<D||j===-2?0:(j=s(O[W]),j>=0?(j>0&&(j===2?j=0:M.lastNeed=j-3),j):0))}function a(M,O,D){if((O[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&O.length>1){if((O[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&O.length>2&&(O[2]&192)!==128)return M.lastNeed=2,"�"}}function u(M){var O=this.lastTotal-this.lastNeed,D=a(this,M);if(D!==void 0)return D;if(this.lastNeed<=M.length)return M.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,O,0,M.length),this.lastNeed-=M.length}function l(M,O){var D=o(this,M,O);if(!this.lastNeed)return M.toString("utf8",O);this.lastTotal=D;var W=M.length-(D-this.lastNeed);return M.copy(this.lastChar,0,W),M.toString("utf8",O,W)}function p(M){var O=M&&M.length?this.write(M):"";return this.lastNeed?O+"�":O}function g(M,O){if((M.length-O)%2===0){var D=M.toString("utf16le",O);if(D){var W=D.charCodeAt(D.length-1);if(W>=55296&&W<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],D.slice(0,-1)}return D}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",O,M.length-1)}function m(M){var O=M&&M.length?this.write(M):"";if(this.lastNeed){var D=this.lastTotal-this.lastNeed;return O+this.lastChar.toString("utf16le",0,D)}return O}function C(M,O){var D=(M.length-O)%3;return D===0?M.toString("base64",O):(this.lastNeed=3-D,this.lastTotal=3,D===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",O,M.length-D))}function T(M){var O=M&&M.length?this.write(M):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function P(M){return M.toString(this.encoding)}function U(M){return M&&M.length?this.write(M):""}return Wa}var Xl=Mn.codes.ERR_STREAM_PREMATURE_CLOSE;function km(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function Om(){}function Nm(t){return t.setHeader&&typeof t.abort=="function"}function Td(t,e,r){if(typeof e=="function")return Td(t,null,e);e||(e={}),r=km(r||Om);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){i=!1,o=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,u=!0,i||r.call(t)},p=function(T){r.call(t,T)},g=function(){var T;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(T=new Xl),r.call(t,T);if(i&&!o)return(!t._writableState||!t._writableState.ended)&&(T=new Xl),r.call(t,T)},m=function(){t.req.on("finish",a)};return Nm(t)?(t.on("complete",a),t.on("abort",g),t.req?m():t.on("request",m)):i&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",p),t.on("close",g),function(){t.removeListener("complete",a),t.removeListener("abort",g),t.removeListener("request",m),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",p),t.removeListener("close",g)}}var hc=Td,Ha,ef;function Lm(){if(ef)return Ha;ef=1;var t;function e(D,W,j){return W=r(W),W in D?Object.defineProperty(D,W,{value:j,enumerable:!0,configurable:!0,writable:!0}):D[W]=j,D}function r(D){var W=n(D,"string");return typeof W=="symbol"?W:String(W)}function n(D,W){if(typeof D!="object"||D===null)return D;var j=D[Symbol.toPrimitive];if(j!==void 0){var z=j.call(D,W||"default");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(W==="string"?String:Number)(D)}var i=hc,s=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),p=Symbol("handlePromise"),g=Symbol("stream");function m(D,W){return{value:D,done:W}}function C(D){var W=D[s];if(W!==null){var j=D[g].read();j!==null&&(D[l]=null,D[s]=null,D[o]=null,W(m(j,!1)))}}function T(D){process.nextTick(C,D)}function P(D,W){return function(j,z){D.then(function(){if(W[u]){j(m(void 0,!0));return}W[p](j,z)},z)}}var U=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((t={get stream(){return this[g]},next:function(){var W=this,j=this[a];if(j!==null)return Promise.reject(j);if(this[u])return Promise.resolve(m(void 0,!0));if(this[g].destroyed)return new Promise(function(G,re){process.nextTick(function(){W[a]?re(W[a]):G(m(void 0,!0))})});var z=this[l],K;if(z)K=new Promise(P(z,this));else{var X=this[g].read();if(X!==null)return Promise.resolve(m(X,!1));K=new Promise(this[p])}return this[l]=K,K}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var W=this;return new Promise(function(j,z){W[g].destroy(null,function(K){if(K){z(K);return}j(m(void 0,!0))})})}),t),U),O=function(W){var j,z=Object.create(M,(j={},e(j,g,{value:W,writable:!0}),e(j,s,{value:null,writable:!0}),e(j,o,{value:null,writable:!0}),e(j,a,{value:null,writable:!0}),e(j,u,{value:W._readableState.endEmitted,writable:!0}),e(j,p,{value:function(X,G){var re=z[g].read();re?(z[l]=null,z[s]=null,z[o]=null,X(m(re,!1))):(z[s]=X,z[o]=G)},writable:!0}),j));return z[l]=null,i(W,function(K){if(K&&K.code!=="ERR_STREAM_PREMATURE_CLOSE"){var X=z[o];X!==null&&(z[l]=null,z[s]=null,z[o]=null,X(K)),z[a]=K;return}var G=z[s];G!==null&&(z[l]=null,z[s]=null,z[o]=null,G(m(void 0,!0))),z[u]=!0}),W.on("readable",T.bind(null,z)),z};return Ha=O,Ha}var Va,tf;function Bm(){return tf||(tf=1,Va=function(){throw new Error("Readable.from is not available in the browser")}),Va}var za,rf;function kd(){if(rf)return za;rf=1,za=G;var t;G.ReadableState=X,Zu.EventEmitter;var e=function(R,q){return R.listeners(q).length},r=Md,n=is.Buffer,i=(typeof te<"u"?te:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(I){return n.from(I)}function o(I){return n.isBuffer(I)||I instanceof i}var a=yo,u;a&&a.debuglog?u=a.debuglog("stream"):u=function(){};var l=vm(),p=Cd,g=Rd,m=g.getHighWaterMark,C=Mn.codes,T=C.ERR_INVALID_ARG_TYPE,P=C.ERR_STREAM_PUSH_AFTER_EOF,U=C.ERR_METHOD_NOT_IMPLEMENTED,M=C.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,O,D,W;er(G,r);var j=p.errorOrDestroy,z=["error","close","destroy","pause","resume"];function K(I,R,q){if(typeof I.prependListener=="function")return I.prependListener(R,q);!I._events||!I._events[R]?I.on(R,q):Array.isArray(I._events[R])?I._events[R].unshift(q):I._events[R]=[q,I._events[R]]}function X(I,R,q){t=t||ai(),I=I||{},typeof q!="boolean"&&(q=R instanceof t),this.objectMode=!!I.objectMode,q&&(this.objectMode=this.objectMode||!!I.readableObjectMode),this.highWaterMark=m(this,I,"readableHighWaterMark",q),this.buffer=new l,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=I.emitClose!==!1,this.autoDestroy=!!I.autoDestroy,this.destroyed=!1,this.defaultEncoding=I.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,I.encoding&&(O||(O=Kl().StringDecoder),this.decoder=new O(I.encoding),this.encoding=I.encoding)}function G(I){if(t=t||ai(),!(this instanceof G))return new G(I);var R=this instanceof t;this._readableState=new X(I,this,R),this.readable=!0,I&&(typeof I.read=="function"&&(this._read=I.read),typeof I.destroy=="function"&&(this._destroy=I.destroy)),r.call(this)}Object.defineProperty(G.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),G.prototype.destroy=p.destroy,G.prototype._undestroy=p.undestroy,G.prototype._destroy=function(I,R){R(I)},G.prototype.push=function(I,R){var q=this._readableState,Z;return q.objectMode?Z=!0:typeof I=="string"&&(R=R||q.defaultEncoding,R!==q.encoding&&(I=n.from(I,R),R=""),Z=!0),re(this,I,R,!1,Z)},G.prototype.unshift=function(I){return re(this,I,null,!0,!1)};function re(I,R,q,Z,fe){u("readableAddChunk",R);var ye=I._readableState;if(R===null)ye.reading=!1,v(I,ye);else{var ae;if(fe||(ae=oe(ye,R)),ae)j(I,ae);else if(ye.objectMode||R&&R.length>0)if(typeof R!="string"&&!ye.objectMode&&Object.getPrototypeOf(R)!==n.prototype&&(R=s(R)),Z)ye.endEmitted?j(I,new M):ie(I,ye,R,!0);else if(ye.ended)j(I,new P);else{if(ye.destroyed)return!1;ye.reading=!1,ye.decoder&&!q?(R=ye.decoder.write(R),ye.objectMode||R.length!==0?ie(I,ye,R,!1):k(I,ye)):ie(I,ye,R,!1)}else Z||(ye.reading=!1,k(I,ye))}return!ye.ended&&(ye.length<ye.highWaterMark||ye.length===0)}function ie(I,R,q,Z){R.flowing&&R.length===0&&!R.sync?(R.awaitDrain=0,I.emit("data",q)):(R.length+=R.objectMode?1:q.length,Z?R.buffer.unshift(q):R.buffer.push(q),R.needReadable&&S(I)),k(I,R)}function oe(I,R){var q;return!o(R)&&typeof R!="string"&&R!==void 0&&!I.objectMode&&(q=new T("chunk",["string","Buffer","Uint8Array"],R)),q}G.prototype.isPaused=function(){return this._readableState.flowing===!1},G.prototype.setEncoding=function(I){O||(O=Kl().StringDecoder);var R=new O(I);this._readableState.decoder=R,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,Z="";q!==null;)Z+=R.write(q.data),q=q.next;return this._readableState.buffer.clear(),Z!==""&&this._readableState.buffer.push(Z),this._readableState.length=Z.length,this};var w=1073741824;function c(I){return I>=w?I=w:(I--,I|=I>>>1,I|=I>>>2,I|=I>>>4,I|=I>>>8,I|=I>>>16,I++),I}function y(I,R){return I<=0||R.length===0&&R.ended?0:R.objectMode?1:I!==I?R.flowing&&R.length?R.buffer.head.data.length:R.length:(I>R.highWaterMark&&(R.highWaterMark=c(I)),I<=R.length?I:R.ended?R.length:(R.needReadable=!0,0))}G.prototype.read=function(I){u("read",I),I=parseInt(I,10);var R=this._readableState,q=I;if(I!==0&&(R.emittedReadable=!1),I===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return u("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?V(this):S(this),null;if(I=y(I,R),I===0&&R.ended)return R.length===0&&V(this),null;var Z=R.needReadable;u("need readable",Z),(R.length===0||R.length-I<R.highWaterMark)&&(Z=!0,u("length less than watermark",Z)),R.ended||R.reading?(Z=!1,u("reading or ended",Z)):Z&&(u("do read"),R.reading=!0,R.sync=!0,R.length===0&&(R.needReadable=!0),this._read(R.highWaterMark),R.sync=!1,R.reading||(I=y(q,R)));var fe;return I>0?fe=$(I,R):fe=null,fe===null?(R.needReadable=R.length<=R.highWaterMark,I=0):(R.length-=I,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),q!==I&&R.ended&&V(this)),fe!==null&&this.emit("data",fe),fe};function v(I,R){if(u("onEofChunk"),!R.ended){if(R.decoder){var q=R.decoder.end();q&&q.length&&(R.buffer.push(q),R.length+=R.objectMode?1:q.length)}R.ended=!0,R.sync?S(I):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,E(I)))}}function S(I){var R=I._readableState;u("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(u("emitReadable",R.flowing),R.emittedReadable=!0,process.nextTick(E,I))}function E(I){var R=I._readableState;u("emitReadable_",R.destroyed,R.length,R.ended),!R.destroyed&&(R.length||R.ended)&&(I.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,N(I)}function k(I,R){R.readingMore||(R.readingMore=!0,process.nextTick(L,I,R))}function L(I,R){for(;!R.reading&&!R.ended&&(R.length<R.highWaterMark||R.flowing&&R.length===0);){var q=R.length;if(u("maybeReadMore read 0"),I.read(0),q===R.length)break}R.readingMore=!1}G.prototype._read=function(I){j(this,new U("_read()"))},G.prototype.pipe=function(I,R){var q=this,Z=this._readableState;switch(Z.pipesCount){case 0:Z.pipes=I;break;case 1:Z.pipes=[Z.pipes,I];break;default:Z.pipes.push(I);break}Z.pipesCount+=1,u("pipe count=%d opts=%j",Z.pipesCount,R);var fe=(!R||R.end!==!1)&&I!==process.stdout&&I!==process.stderr,ye=fe?xe:Ie;Z.endEmitted?process.nextTick(ye):q.once("end",ye),I.on("unpipe",ae);function ae(b,f){u("onunpipe"),b===q&&f&&f.hasUnpiped===!1&&(f.hasUnpiped=!0,Re())}function xe(){u("onend"),I.end()}var Pt=_(q);I.on("drain",Pt);var Te=!1;function Re(){u("cleanup"),I.removeListener("close",ke),I.removeListener("finish",ft),I.removeListener("drain",Pt),I.removeListener("error",Ce),I.removeListener("unpipe",ae),q.removeListener("end",xe),q.removeListener("end",Ie),q.removeListener("data",ut),Te=!0,Z.awaitDrain&&(!I._writableState||I._writableState.needDrain)&&Pt()}q.on("data",ut);function ut(b){u("ondata");var f=I.write(b);u("dest.write",f),f===!1&&((Z.pipesCount===1&&Z.pipes===I||Z.pipesCount>1&&ge(Z.pipes,I)!==-1)&&!Te&&(u("false write response, pause",Z.awaitDrain),Z.awaitDrain++),q.pause())}function Ce(b){u("onerror",b),Ie(),I.removeListener("error",Ce),e(I,"error")===0&&j(I,b)}K(I,"error",Ce);function ke(){I.removeListener("finish",ft),Ie()}I.once("close",ke);function ft(){u("onfinish"),I.removeListener("close",ke),Ie()}I.once("finish",ft);function Ie(){u("unpipe"),q.unpipe(I)}return I.emit("pipe",q),Z.flowing||(u("pipe resume"),q.resume()),I};function _(I){return function(){var q=I._readableState;u("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&e(I,"data")&&(q.flowing=!0,N(I))}}G.prototype.unpipe=function(I){var R=this._readableState,q={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return I&&I!==R.pipes?this:(I||(I=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,I&&I.emit("unpipe",this,q),this);if(!I){var Z=R.pipes,fe=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var ye=0;ye<fe;ye++)Z[ye].emit("unpipe",this,{hasUnpiped:!1});return this}var ae=ge(R.pipes,I);return ae===-1?this:(R.pipes.splice(ae,1),R.pipesCount-=1,R.pipesCount===1&&(R.pipes=R.pipes[0]),I.emit("unpipe",this,q),this)},G.prototype.on=function(I,R){var q=r.prototype.on.call(this,I,R),Z=this._readableState;return I==="data"?(Z.readableListening=this.listenerCount("readable")>0,Z.flowing!==!1&&this.resume()):I==="readable"&&!Z.endEmitted&&!Z.readableListening&&(Z.readableListening=Z.needReadable=!0,Z.flowing=!1,Z.emittedReadable=!1,u("on readable",Z.length,Z.reading),Z.length?S(this):Z.reading||process.nextTick(A,this)),q},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(I,R){var q=r.prototype.removeListener.call(this,I,R);return I==="readable"&&process.nextTick(d,this),q},G.prototype.removeAllListeners=function(I){var R=r.prototype.removeAllListeners.apply(this,arguments);return(I==="readable"||I===void 0)&&process.nextTick(d,this),R};function d(I){var R=I._readableState;R.readableListening=I.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:I.listenerCount("data")>0&&I.resume()}function A(I){u("readable nexttick read 0"),I.read(0)}G.prototype.resume=function(){var I=this._readableState;return I.flowing||(u("resume"),I.flowing=!I.readableListening,Y(this,I)),I.paused=!1,this};function Y(I,R){R.resumeScheduled||(R.resumeScheduled=!0,process.nextTick(ee,I,R))}function ee(I,R){u("resume",R.reading),R.reading||I.read(0),R.resumeScheduled=!1,I.emit("resume"),N(I),R.flowing&&!R.reading&&I.read(0)}G.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function N(I){var R=I._readableState;for(u("flow",R.flowing);R.flowing&&I.read()!==null;);}G.prototype.wrap=function(I){var R=this,q=this._readableState,Z=!1;I.on("end",function(){if(u("wrapped end"),q.decoder&&!q.ended){var ae=q.decoder.end();ae&&ae.length&&R.push(ae)}R.push(null)}),I.on("data",function(ae){if(u("wrapped data"),q.decoder&&(ae=q.decoder.write(ae)),!(q.objectMode&&ae==null)&&!(!q.objectMode&&(!ae||!ae.length))){var xe=R.push(ae);xe||(Z=!0,I.pause())}});for(var fe in I)this[fe]===void 0&&typeof I[fe]=="function"&&(this[fe]=function(xe){return function(){return I[xe].apply(I,arguments)}}(fe));for(var ye=0;ye<z.length;ye++)I.on(z[ye],this.emit.bind(this,z[ye]));return this._read=function(ae){u("wrapped _read",ae),Z&&(Z=!1,I.resume())},this},typeof Symbol=="function"&&(G.prototype[Symbol.asyncIterator]=function(){return D===void 0&&(D=Lm()),D(this)}),Object.defineProperty(G.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(G.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(G.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){this._readableState&&(this._readableState.flowing=R)}}),G._fromList=$,Object.defineProperty(G.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $(I,R){if(R.length===0)return null;var q;return R.objectMode?q=R.buffer.shift():!I||I>=R.length?(R.decoder?q=R.buffer.join(""):R.buffer.length===1?q=R.buffer.first():q=R.buffer.concat(R.length),R.buffer.clear()):q=R.buffer.consume(I,R.decoder),q}function V(I){var R=I._readableState;u("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,process.nextTick(Q,R,I))}function Q(I,R){if(u("endReadableNT",I.endEmitted,I.length),!I.endEmitted&&I.length===0&&(I.endEmitted=!0,R.readable=!1,R.emit("end"),I.autoDestroy)){var q=R._writableState;(!q||q.autoDestroy&&q.finished)&&R.destroy()}}typeof Symbol=="function"&&(G.from=function(I,R){return W===void 0&&(W=Bm()),W(G,I,R)});function ge(I,R){for(var q=0,Z=I.length;q<Z;q++)if(I[q]===R)return q;return-1}return za}var Od=Er,Ao=Mn.codes,Pm=Ao.ERR_METHOD_NOT_IMPLEMENTED,$m=Ao.ERR_MULTIPLE_CALLBACK,Dm=Ao.ERR_TRANSFORM_ALREADY_TRANSFORMING,Fm=Ao.ERR_TRANSFORM_WITH_LENGTH_0,To=ai();er(Er,To);function jm(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new $m);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Er(t){if(!(this instanceof Er))return new Er(t);To.call(this,t),this._transformState={afterTransform:jm.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Um)}function Um(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){nf(t,e,r)}):nf(this,null,null)}Er.prototype.push=function(t,e){return this._transformState.needTransform=!1,To.prototype.push.call(this,t,e)};Er.prototype._transform=function(t,e,r){r(new Pm("_transform()"))};Er.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Er.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Er.prototype._destroy=function(t,e){To.prototype._destroy.call(this,t,function(r){e(r)})};function nf(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new Fm;if(t._transformState.transforming)throw new Dm;return t.push(null)}var Wm=Yi,Nd=Od;er(Yi,Nd);function Yi(t){if(!(this instanceof Yi))return new Yi(t);Nd.call(this,t)}Yi.prototype._transform=function(t,e,r){r(null,t)};var qa;function Hm(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Ld=Mn.codes,Vm=Ld.ERR_MISSING_ARGS,zm=Ld.ERR_STREAM_DESTROYED;function sf(t){if(t)throw t}function qm(t){return t.setHeader&&typeof t.abort=="function"}function Gm(t,e,r,n){n=Hm(n);var i=!1;t.on("close",function(){i=!0}),qa===void 0&&(qa=hc),qa(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,qm(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(o||new zm("pipe"))}}}function of(t){t()}function Jm(t,e){return t.pipe(e)}function Zm(t){return!t.length||typeof t[t.length-1]!="function"?sf:t.pop()}function Qm(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=Zm(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Vm("streams");var i,s=e.map(function(o,a){var u=a<e.length-1,l=a>0;return Gm(o,u,l,function(p){i||(i=p),p&&s.forEach(of),!u&&(s.forEach(of),n(i))})});return e.reduce(Jm)}var Ym=Qm;(function(t,e){e=t.exports=kd(),e.Stream=e,e.Readable=e,e.Writable=Ad(),e.Duplex=ai(),e.Transform=Od,e.PassThrough=Wm,e.finished=hc,e.pipeline=Ym})(Tu,Tu.exports);var Bd=Tu.exports;const{Transform:Km}=Bd;var Xm=t=>class Pd extends Km{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}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 Pd(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:e1}=Bd;var t1=t=>class $d extends e1{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}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 $d(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const r1=Xm,n1=t1;var i1=function(t){const e=r1(t),r=n1(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Dd={};const af=[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];Dd.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],p=t[8]^t[18]^t[28]^t[38]^t[48],g=t[9]^t[19]^t[29]^t[39]^t[49];let m=p^(i<<1|s>>>31),C=g^(s<<1|i>>>31);const T=t[0]^m,P=t[1]^C,U=t[10]^m,M=t[11]^C,O=t[20]^m,D=t[21]^C,W=t[30]^m,j=t[31]^C,z=t[40]^m,K=t[41]^C;m=r^(o<<1|a>>>31),C=n^(a<<1|o>>>31);const X=t[2]^m,G=t[3]^C,re=t[12]^m,ie=t[13]^C,oe=t[22]^m,w=t[23]^C,c=t[32]^m,y=t[33]^C,v=t[42]^m,S=t[43]^C;m=i^(u<<1|l>>>31),C=s^(l<<1|u>>>31);const E=t[4]^m,k=t[5]^C,L=t[14]^m,_=t[15]^C,d=t[24]^m,A=t[25]^C,Y=t[34]^m,ee=t[35]^C,N=t[44]^m,$=t[45]^C;m=o^(p<<1|g>>>31),C=a^(g<<1|p>>>31);const V=t[6]^m,Q=t[7]^C,ge=t[16]^m,I=t[17]^C,R=t[26]^m,q=t[27]^C,Z=t[36]^m,fe=t[37]^C,ye=t[46]^m,ae=t[47]^C;m=u^(r<<1|n>>>31),C=l^(n<<1|r>>>31);const xe=t[8]^m,Pt=t[9]^C,Te=t[18]^m,Re=t[19]^C,ut=t[28]^m,Ce=t[29]^C,ke=t[38]^m,ft=t[39]^C,Ie=t[48]^m,b=t[49]^C,f=T,h=P,x=M<<4|U>>>28,B=U<<4|M>>>28,F=O<<3|D>>>29,H=D<<3|O>>>29,de=j<<9|W>>>23,he=W<<9|j>>>23,ce=z<<18|K>>>14,Oe=K<<18|z>>>14,ue=X<<1|G>>>31,Pe=G<<1|X>>>31,Tn=ie<<12|re>>>20,$e=re<<12|ie>>>20,De=oe<<10|w>>>22,kn=w<<10|oe>>>22,Fe=y<<13|c>>>19,je=c<<13|y>>>19,On=v<<2|S>>>30,Ue=S<<2|v>>>30,We=k<<30|E>>>2,Nn=E<<30|k>>>2,He=L<<6|_>>>26,Ve=_<<6|L>>>26,Ln=A<<11|d>>>21,ze=d<<11|A>>>21,qe=Y<<15|ee>>>17,Bn=ee<<15|Y>>>17,Ge=$<<29|N>>>3,Je=N<<29|$>>>3,Pn=V<<28|Q>>>4,Ze=Q<<28|V>>>4,Qe=I<<23|ge>>>9,$n=ge<<23|I>>>9,Ye=R<<25|q>>>7,Ke=q<<25|R>>>7,Wr=Z<<21|fe>>>11,Hr=fe<<21|Z>>>11,Vr=ae<<24|ye>>>8,zr=ye<<24|ae>>>8,qr=xe<<27|Pt>>>5,Gr=Pt<<27|xe>>>5,Jr=Te<<20|Re>>>12,Zr=Re<<20|Te>>>12,Qr=Ce<<7|ut>>>25,Yr=ut<<7|Ce>>>25,Kr=ke<<8|ft>>>24,Xr=ft<<8|ke>>>24,en=Ie<<14|b>>>18,tn=b<<14|Ie>>>18;t[0]=f^~Tn&Ln,t[1]=h^~$e&ze,t[10]=Pn^~Jr&F,t[11]=Ze^~Zr&H,t[20]=ue^~He&Ye,t[21]=Pe^~Ve&Ke,t[30]=qr^~x&De,t[31]=Gr^~B&kn,t[40]=We^~Qe&Qr,t[41]=Nn^~$n&Yr,t[2]=Tn^~Ln&Wr,t[3]=$e^~ze&Hr,t[12]=Jr^~F&Fe,t[13]=Zr^~H&je,t[22]=He^~Ye&Kr,t[23]=Ve^~Ke&Xr,t[32]=x^~De&qe,t[33]=B^~kn&Bn,t[42]=Qe^~Qr&de,t[43]=$n^~Yr&he,t[4]=Ln^~Wr&en,t[5]=ze^~Hr&tn,t[14]=F^~Fe&Ge,t[15]=H^~je&Je,t[24]=Ye^~Kr&ce,t[25]=Ke^~Xr&Oe,t[34]=De^~qe&Vr,t[35]=kn^~Bn&zr,t[44]=Qr^~de&On,t[45]=Yr^~he&Ue,t[6]=Wr^~en&f,t[7]=Hr^~tn&h,t[16]=Fe^~Ge&Pn,t[17]=je^~Je&Ze,t[26]=Kr^~ce&ue,t[27]=Xr^~Oe&Pe,t[36]=qe^~Vr&qr,t[37]=Bn^~zr&Gr,t[46]=de^~On&We,t[47]=he^~Ue&Nn,t[8]=en^~f&Tn,t[9]=tn^~h&$e,t[18]=Ge^~Pn&Jr,t[19]=Je^~Ze&Zr,t[28]=ce^~ue&He,t[29]=Oe^~Pe&Ve,t[38]=Vr^~qr&x,t[39]=zr^~Gr&B,t[48]=On^~We&Qe,t[49]=Ue^~Nn&$n,t[0]^=af[e*2],t[1]^=af[e*2+1]}};const no=Dd;function Mi(){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}Mi.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};Mi.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(no.p1600(this.state),this.count=0)};Mi.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&no.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),no.p1600(this.state),this.count=0,this.squeezing=!0};Mi.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=Buffer.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(no.p1600(this.state),this.count=0);return e};Mi.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var s1=Mi,o1=i1(s1);const a1=o1,u1=_o;function Fd(t){return Buffer.allocUnsafe(t).fill(0)}function jd(t,e,r){const n=Fd(e);return t=ko(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function c1(t,e){return jd(t,e,!0)}function ko(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if(typeof t=="string")Ud(t)?t=Buffer.from(h1(Wd(t)),"hex"):t=Buffer.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=Buffer.allocUnsafe(0);else if(u1.isBN(t))t=t.toArrayLike(Buffer);else if(t.toArray)t=Buffer.from(t.toArray());else throw new Error("invalid type");return t}function l1(t){return t=ko(t),"0x"+t.toString("hex")}function f1(t,e){return t=ko(t),e||(e=256),a1("keccak"+e).update(t).digest()}function h1(t){return t.length%2?"0"+t:t}function Ud(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Wd(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var Hd={zeros:Fd,setLength:jd,setLengthRight:c1,isHexString:Ud,stripHexPrefix:Wd,toBuffer:ko,bufferToHex:l1,keccak:f1};const bn=Hd,hn=_o;function Vd(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Kn(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function uf(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function zd(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function an(t){var e=typeof t;if(e==="string")return bn.isHexString(t)?new hn(bn.stripHexPrefix(t),16):new hn(t,10);if(e==="number")return new hn(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function ar(t,e){var r,n,i,s;if(t==="address")return ar("uint160",an(e));if(t==="bool")return ar("uint8",e?1:0);if(t==="string")return ar("bytes",new Buffer(e,"utf8"));if(p1(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=zd(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(ar(t,e[s]));if(r==="dynamic"){var o=ar("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([ar("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,bn.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Kn(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return bn.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Kn(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=an(e),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(t.startsWith("int")){if(r=Kn(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=an(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=uf(t),n=an(e),n<0)throw new Error("Supplied ufixed is negative");return ar("uint256",n.mul(new hn(2).pow(new hn(r[1]))))}else if(t.startsWith("fixed"))return r=uf(t),ar("int256",an(e).mul(new hn(2).pow(new hn(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function d1(t){return t==="string"||t==="bytes"||zd(t)==="dynamic"}function p1(t){return t.lastIndexOf("]")===t.length-1}function g1(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=Vd(t[s]),a=e[s],u=ar(o,a);d1(o)?(r.push(ar("uint256",i)),n.push(u),i+=u.length):r.push(u)}return Buffer.concat(r.concat(n))}function qd(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<t.length;s++){var o=Vd(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new Buffer(a,"utf8"));else if(o==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(o==="address")i.push(bn.setLength(a,20));else if(o.startsWith("bytes")){if(r=Kn(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(bn.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Kn(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=an(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=Kn(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=an(a),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: "+o)}return Buffer.concat(i)}function y1(t,e){return bn.keccak(qd(t,e))}var b1={rawEncode:g1,solidityPack:qd,soliditySHA3:y1};const Qt=Hd,Vi=b1,Gd={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"]},Ga={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,u,l)=>{if(r[u]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Qt.keccak(this.encodeData(u,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${u}`);if(u==="bytes")return["bytes32",Qt.keccak(l)];if(u==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",Qt.keccak(l)];if(u.lastIndexOf("]")===u.length-1){const p=u.slice(0,u.lastIndexOf("[")),g=l.map(m=>o(a,p,m));return["bytes32",Qt.keccak(Vi.rawEncode(g.map(([m])=>m),g.map(([,m])=>m)))]}return[u,l]};for(const a of r[t]){const[u,l]=o(a.name,a.type,e[a.name]);i.push(u),s.push(l)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Qt.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Qt.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=Qt.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Vi.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return Qt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Qt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Gd.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Qt.keccak(Buffer.concat(n))}};var v1={TYPED_MESSAGE_SCHEMA:Gd,TypedDataUtils:Ga,hashForSignTypedDataLegacy:function(t){return m1(t.data)},hashForSignTypedData_v3:function(t){return Ga.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Ga.hash(t.data)}};function m1(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?Qt.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Vi.soliditySHA3(["bytes32","bytes32"],[Vi.soliditySHA3(new Array(t.length).fill("string"),i),Vi.soliditySHA3(n,r)])}var ui={};Object.defineProperty(ui,"__esModule",{value:!0});ui.filterFromParam=ui.FilterPolyfill=void 0;const Gn=ls,Mt=ne,w1=5*60*1e3,un={jsonrpc:"2.0",id:0};class _1{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Gn.IntNumber)(1),this.provider=e}async newFilter(e){const r=Jd(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Mt.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Mt.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Mt.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Mt.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Mt.intNumberFromHexString)(e);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(Ns())}async getFilterLogs(e){const r=(0,Mt.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},un),{method:"eth_getLogs",params:[cf(n)]})):Ns()}makeFilterId(){return(0,Gn.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(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(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return Ns();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return Ls();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},un),{method:"eth_getLogs",params:[cf(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Mt.intNumberFromHexString)(l.blockNumber||"0x0")),u=Math.max(...a);if(u&&u>n){const l=(0,Gn.IntNumber)(u+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return Ns();const n=await this.getCurrentBlockHeight();if(r>n)return Ls();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Mt.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Gn.IntNumber)(o))))).filter(o=>!!o),s=(0,Gn.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},un),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Ls())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},w1);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},un),{method:"eth_blockNumber",params:[]}));return(0,Mt.intNumberFromHexString)((0,Mt.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},un),{method:"eth_getBlockByNumber",params:[(0,Mt.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Mt.ensureHexString)(r.result.hash):null}}ui.FilterPolyfill=_1;function Jd(t){return{fromBlock:lf(t.fromBlock),toBlock:lf(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}ui.filterFromParam=Jd;function cf(t){const e={fromBlock:ff(t.fromBlock),toBlock:ff(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function lf(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Gn.IntNumber)(0);if((0,Mt.isHexString)(t))return(0,Mt.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function ff(t){return t==="latest"?t:(0,Mt.hexStringFromIntNumber)(t)}function Ns(){return Object.assign(Object.assign({},un),{error:{code:-32e3,message:"filter not found"}})}function Ls(){return Object.assign(Object.assign({},un),{result:[]})}var Zd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(Zd);var Oo={},Qd={},No={},dc=S1;function S1(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const hf=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const u=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)u[l-1]=arguments[l];o?(u.unshift(o),s(u)):i(u)}else o?s(o):i(a)}):n.push(function(o){if(e.multiArgs){const a=new Array(arguments.length-1);for(let u=0;u<arguments.length;u++)a[u]=arguments[u];i(a)}else i(o)}),t.apply(this,n)})};var E1=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):hf(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?hf(s,e):s}return n},ds={},x1=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ds,"__esModule",{value:!0});ds.BaseBlockTracker=void 0;const M1=x1(_n),C1=1e3,I1=(t,e)=>t+e,df=["sync","latest"];class R1 extends M1.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*C1,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(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){df.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return df.map(e=>this.listenerCount(e)).reduce(I1)}_newPotentialLatest(e){const r=this._currentBlock;r&&pf(e)<=pf(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}ds.BaseBlockTracker=R1;function pf(t){return Number.parseInt(t,16)}var Yd={},Kd={},wt={};class Xd extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...o}=e,{path:a}=e,u=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function A1(t){return zt(t)&&typeof t[Symbol.iterator]=="function"}function zt(t){return typeof t=="object"&&t!=null}function gf(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function lt(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function T1(t){const{done:e,value:r}=t.next();return e?void 0:r}function k1(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:u=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${lt(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:u}}function*Ou(t,e,r,n){A1(t)||(t=[t]);for(const i of t){const s=k1(i,e,r,n);s&&(yield s)}}function*pc(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&zt(e.schema)&&zt(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let u="valid";for(const l of e.validator(t,a))l.explanation=r.message,u="not_valid",yield[l,void 0];for(let[l,p,g]of e.entries(t,a)){const m=pc(p,g,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,p],coerce:s,mask:o,message:r.message});for(const C of m)C[0]?(u=C[0].refinement!=null?"not_refined":"not_valid",yield[C[0],void 0]):s&&(p=C[1],l===void 0?t=p:t instanceof Map?t.set(l,p):t instanceof Set?t.add(p):zt(t)&&(p!==void 0||l in t)&&(t[l]=p))}if(u!=="not_valid")for(const l of e.refiner(t,a))l.explanation=r.message,u="not_refined",yield[l,void 0];u==="valid"&&(yield[void 0,t])}class ot{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=u=>u,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(u,l)=>{const p=i(u,l);return Ou(p,l,this,u)}:this.validator=()=>[],s?this.refiner=(u,l)=>{const p=s(u,l);return Ou(p,l,this,u)}:this.refiner=()=>[]}assert(e,r){return ep(e,this,r)}create(e,r){return tp(e,this,r)}is(e){return gc(e,this)}mask(e,r){return rp(e,this,r)}validate(e,r={}){return Ci(e,this,r)}}function ep(t,e,r){const n=Ci(t,e,{message:r});if(n[0])throw n[0]}function tp(t,e,r){const n=Ci(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function rp(t,e,r){const n=Ci(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function gc(t,e){return!Ci(t,e)[0]}function Ci(t,e,r={}){const n=pc(t,e,r),i=T1(n);return i[0]?[new Xd(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function O1(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?bc(n):ps(n)}function kt(t,e){return new ot({type:t,schema:null,validator:e})}function N1(t,e){return new ot({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function L1(t){return new ot({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function B1(t){let e;return new ot({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function P1(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return bc(n);default:return ps(n)}}function $1(t){const e=t instanceof ot?{...t.schema}:{...t};for(const r in e)e[r]=np(e[r]);return ps(e)}function D1(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return ps(n)}function F1(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),kt(t,e)}function j1(){return kt("any",()=>!0)}function U1(t){return new ot({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${lt(e)}`}})}function W1(){return kt("bigint",t=>typeof t=="bigint")}function H1(){return kt("boolean",t=>typeof t=="boolean")}function V1(){return kt("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${lt(t)}`)}function z1(t){const e={},r=t.map(n=>lt(n)).join();for(const n of t)e[n]=n;return new ot({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${lt(n)}`}})}function q1(){return kt("func",t=>typeof t=="function"||`Expected a function, but received: ${lt(t)}`)}function G1(t){return kt("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${lt(e)}`)}function J1(){return kt("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${lt(t)}`)}function Z1(t){return new ot({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function Q1(t){const e=lt(t),r=typeof t;return new ot({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${lt(n)}`}})}function Y1(t,e){return new ot({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${lt(r)}`}})}function yc(){return kt("never",()=>!1)}function K1(t){return new ot({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function X1(){return kt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${lt(t)}`)}function ps(t){const e=t?Object.keys(t):[],r=yc();return new ot({type:"object",schema:t||null,*entries(n){if(t&&zt(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return zt(n)||`Expected an object, but received: ${lt(n)}`},coercer(n){return zt(n)?{...n}:n}})}function np(t){return new ot({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function ew(t,e){return new ot({type:"record",schema:null,*entries(r){if(zt(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return zt(r)||`Expected an object, but received: ${lt(r)}`}})}function tw(){return kt("regexp",t=>t instanceof RegExp)}function rw(t){return new ot({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${lt(e)}`}})}function ip(){return kt("string",t=>typeof t=="string"||`Expected a string, but received: ${lt(t)}`)}function nw(t){const e=yc();return new ot({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${lt(r)}`}})}function bc(t){const e=Object.keys(t);return new ot({type:"type",schema:t,*entries(r){if(zt(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return zt(r)||`Expected an object, but received: ${lt(r)}`},coercer(r){return zt(r)?{...r}:r}})}function iw(t){const e=t.map(r=>r.type).join(" | ");return new ot({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=pc(r,s,n),[a]=o;if(a[0])for(const[u]of o)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${lt(r)}`,...i]}})}function sp(){return kt("unknown",()=>!0)}function vc(t,e,r){return new ot({...t,coercer:(n,i)=>gc(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function sw(t,e,r={}){return vc(t,sp(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&gf(n)&&gf(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function ow(t){return vc(t,ip(),e=>e.trim())}function aw(t){return Cn(t,"empty",e=>{const r=op(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function op(t){return t instanceof Map||t instanceof Set?t.size:t.length}function uw(t,e,r={}){const{exclusive:n}=r;return Cn(t,"max",i=>n?i<e:i<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${i}\``)}function cw(t,e,r={}){const{exclusive:n}=r;return Cn(t,"min",i=>n?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function lw(t){return Cn(t,"nonempty",e=>op(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function fw(t,e){return Cn(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function hw(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Cn(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Cn(t,e,r){return new ot({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=Ou(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const dw=Object.freeze(Object.defineProperty({__proto__:null,Struct:ot,StructError:Xd,any:j1,array:U1,assert:ep,assign:O1,bigint:W1,boolean:H1,coerce:vc,create:tp,date:V1,defaulted:sw,define:kt,deprecated:N1,dynamic:L1,empty:aw,enums:z1,func:q1,instance:G1,integer:J1,intersection:Z1,is:gc,lazy:B1,literal:Q1,map:Y1,mask:rp,max:uw,min:cw,never:yc,nonempty:lw,nullable:K1,number:X1,object:ps,omit:P1,optional:np,partial:$1,pattern:fw,pick:D1,record:ew,refine:Cn,regexp:tw,set:rw,size:hw,string:ip,struct:F1,trimmed:ow,tuple:nw,type:bc,union:iw,unknown:sp,validate:Ci},Symbol.toStringTag,{value:"Module"})),In=mi(dw);Object.defineProperty(wt,"__esModule",{value:!0});wt.assertExhaustive=wt.assertStruct=wt.assert=wt.AssertionError=void 0;const pw=In;function gw(t){return typeof t=="object"&&t!==null&&"message"in t}function yw(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function bw(t){const e=gw(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function ap(t,e){return yw(t)?new t({message:e}):t({message:e})}class mc extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}wt.AssertionError=mc;function vw(t,e="Assertion failed.",r=mc){if(!t)throw e instanceof Error?e:ap(r,e)}wt.assert=vw;function mw(t,e,r="Assertion failed",n=mc){try{(0,pw.assert)(t,e)}catch(i){throw ap(n,`${r}: ${bw(i)}.`)}}wt.assertStruct=mw;function ww(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}wt.assertExhaustive=ww;var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.base64=void 0;const _w=In,Sw=wt,Ew=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,Sw.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,_w.pattern)(t,a)};gs.base64=Ew;var Ee={},ys={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=In,r=wt;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=n;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,r.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function u(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=u})(ys);Object.defineProperty(Ee,"__esModule",{value:!0});Ee.createDataView=Ee.concatBytes=Ee.valueToBytes=Ee.stringToBytes=Ee.numberToBytes=Ee.signedBigIntToBytes=Ee.bigIntToBytes=Ee.hexToBytes=Ee.bytesToString=Ee.bytesToNumber=Ee.bytesToSignedBigInt=Ee.bytesToBigInt=Ee.bytesToHex=Ee.assertIsBytes=Ee.isBytes=void 0;const Nt=wt,Nu=ys,yf=48,bf=58,vf=87;function xw(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const Mw=xw();function wc(t){return t instanceof Uint8Array}Ee.isBytes=wc;function Ii(t){(0,Nt.assert)(wc(t),"Value must be a Uint8Array.")}Ee.assertIsBytes=Ii;function up(t){if(Ii(t),t.length===0)return"0x";const e=Mw(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,Nu.add0x)(r.join(""))}Ee.bytesToHex=up;function cp(t){Ii(t);const e=up(t);return BigInt(e)}Ee.bytesToBigInt=cp;function Cw(t){Ii(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(t.length*8,e)}Ee.bytesToSignedBigInt=Cw;function Iw(t){Ii(t);const e=cp(t);return(0,Nt.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}Ee.bytesToNumber=Iw;function Rw(t){return Ii(t),new TextDecoder().decode(t)}Ee.bytesToString=Rw;function Lo(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,Nu.assertIsHexString)(t);const r=(0,Nu.remove0x)(t).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const o=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),u=o-(o<bf?yf:vf),l=a-(a<bf?yf:vf);i[s]=u*16+l}return i}Ee.hexToBytes=Lo;function lp(t){(0,Nt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Nt.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Lo(e)}Ee.bigIntToBytes=lp;function Aw(t,e){(0,Nt.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function Tw(t,e){(0,Nt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Nt.assert)(typeof e=="number","Byte length must be a number."),(0,Nt.assert)(e>0,"Byte length must be greater than 0."),(0,Nt.assert)(Aw(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}Ee.signedBigIntToBytes=Tw;function fp(t){(0,Nt.assert)(typeof t=="number","Value must be a number."),(0,Nt.assert)(t>=0,"Value must be a non-negative number."),(0,Nt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Lo(e)}Ee.numberToBytes=fp;function hp(t){return(0,Nt.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}Ee.stringToBytes=hp;function dp(t){if(typeof t=="bigint")return lp(t);if(typeof t=="number")return fp(t);if(typeof t=="string")return t.startsWith("0x")?Lo(t):hp(t);if(wc(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}Ee.valueToBytes=dp;function kw(t){const e=new Array(t.length);let r=0;for(let i=0;i<t.length;i++){const s=dp(t[i]);e[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n}Ee.concatBytes=kw;function Ow(t){if(typeof Buffer<"u"&&t instanceof Buffer){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}Ee.createDataView=Ow;var Bo={};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.ChecksumStruct=void 0;const mf=In,Nw=gs;Bo.ChecksumStruct=(0,mf.size)((0,Nw.base64)((0,mf.string)(),{paddingRequired:!0}),44,44);var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.createHex=hr.createBytes=hr.createBigInt=hr.createNumber=void 0;const tt=In,Lw=wt,pp=Ee,Po=ys,gp=(0,tt.union)([(0,tt.number)(),(0,tt.bigint)(),(0,tt.string)(),Po.StrictHexStruct]),Bw=(0,tt.coerce)((0,tt.number)(),gp,Number),Pw=(0,tt.coerce)((0,tt.bigint)(),gp,BigInt);(0,tt.union)([Po.StrictHexStruct,(0,tt.instance)(Uint8Array)]);const $w=(0,tt.coerce)((0,tt.instance)(Uint8Array),(0,tt.union)([Po.StrictHexStruct]),pp.hexToBytes),Dw=(0,tt.coerce)(Po.StrictHexStruct,(0,tt.instance)(Uint8Array),pp.bytesToHex);function Fw(t){try{const e=(0,tt.create)(t,Bw);return(0,Lw.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof tt.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}hr.createNumber=Fw;function jw(t){try{return(0,tt.create)(t,Pw)}catch(e){throw e instanceof tt.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}hr.createBigInt=jw;function Uw(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,tt.create)(t,$w)}catch(e){throw e instanceof tt.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}hr.createBytes=Uw;function Ww(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,tt.create)(t,Dw)}catch(e){throw e instanceof tt.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}hr.createHex=Ww;var ci={},yp=te&&te.__classPrivateFieldSet||function(t,e,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 e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ct=te&&te.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Jt,ir;Object.defineProperty(ci,"__esModule",{value:!0});ci.FrozenSet=ci.FrozenMap=void 0;class _c{constructor(e){Jt.set(this,void 0),yp(this,Jt,new Map(e),"f"),Object.freeze(this)}get size(){return Ct(this,Jt,"f").size}[(Jt=new WeakMap,Symbol.iterator)](){return Ct(this,Jt,"f")[Symbol.iterator]()}entries(){return Ct(this,Jt,"f").entries()}forEach(e,r){return Ct(this,Jt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}get(e){return Ct(this,Jt,"f").get(e)}has(e){return Ct(this,Jt,"f").has(e)}keys(){return Ct(this,Jt,"f").keys()}values(){return Ct(this,Jt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}ci.FrozenMap=_c;class Sc{constructor(e){ir.set(this,void 0),yp(this,ir,new Set(e),"f"),Object.freeze(this)}get size(){return Ct(this,ir,"f").size}[(ir=new WeakMap,Symbol.iterator)](){return Ct(this,ir,"f")[Symbol.iterator]()}entries(){return Ct(this,ir,"f").entries()}forEach(e,r){return Ct(this,ir,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Ct(this,ir,"f").has(e)}keys(){return Ct(this,ir,"f").keys()}values(){return Ct(this,ir,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}ci.FrozenSet=Sc;Object.freeze(_c);Object.freeze(_c.prototype);Object.freeze(Sc);Object.freeze(Sc.prototype);var bp={},Ec={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function r(l){return l==null}t.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=n;const i=(l,p)=>Object.hasOwnProperty.call(l,p);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let p=l;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(l)===p}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var p;return l.split("").reduce((m,C)=>o(C)?m+1:m+2,0)+((p=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}t.calculateStringSize=a;function u(l){return l.toString().length}t.calculateNumberSize=u})(Ec);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=In,r=wt,n=Ec;t.JsonStruct=(0,e.define)("Json",j=>{const[z]=W(j,!0);return z?!0:"Expected a valid JSON-serializable value"});function i(j){return(0,e.is)(j,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(j){return(0,e.is)(j,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(j,z){(0,r.assertStruct)(j,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",z)}t.assertIsJsonRpcNotification=o;function a(j){return(0,e.is)(j,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function u(j,z){(0,r.assertStruct)(j,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",z)}t.assertIsJsonRpcRequest=u,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function l(j){return(0,e.is)(j,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function p(j,z){(0,r.assertStruct)(j,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",z)}t.assertIsPendingJsonRpcResponse=p;function g(j){return(0,e.is)(j,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=g;function m(j,z){(0,r.assertStruct)(j,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",z)}t.assertIsJsonRpcResponse=m;function C(j){return(0,e.is)(j,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=C;function T(j,z){(0,r.assertStruct)(j,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",z)}t.assertIsJsonRpcSuccess=T;function P(j){return(0,e.is)(j,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=P;function U(j,z){(0,r.assertStruct)(j,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",z)}t.assertIsJsonRpcFailure=U;function M(j){return(0,e.is)(j,t.JsonRpcErrorStruct)}t.isJsonRpcError=M;function O(j,z){(0,r.assertStruct)(j,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",z)}t.assertIsJsonRpcError=O;function D(j){const{permitEmptyString:z,permitFractions:K,permitNull:X}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},j);return re=>!!(typeof re=="number"&&(K||Number.isInteger(re))||typeof re=="string"&&(z||re.length>0)||X&&re===null)}t.getJsonRpcIdValidator=D;function W(j,z=!1){const K=new Set;function X(G,re){if(G===void 0)return[!1,0];if(G===null)return[!0,re?0:n.JsonSize.Null];const ie=typeof G;try{if(ie==="function")return[!1,0];if(ie==="string"||G instanceof String)return[!0,re?0:(0,n.calculateStringSize)(G)+n.JsonSize.Quote*2];if(ie==="boolean"||G instanceof Boolean)return re?[!0,0]:[!0,G==!0?n.JsonSize.True:n.JsonSize.False];if(ie==="number"||G instanceof Number)return re?[!0,0]:[!0,(0,n.calculateNumberSize)(G)];if(G instanceof Date)return re?[!0,0]:[!0,isNaN(G.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(G)&&!Array.isArray(G))return[!1,0];if(K.has(G))return[!1,0];K.add(G);try{return[!0,Object.entries(G).reduce((oe,[w,c],y,v)=>{let[S,E]=X(c,re);if(!S)throw new Error("JSON validation did not pass. Validation process stopped.");if(K.delete(G),re)return 0;const k=Array.isArray(G)?0:w.length+n.JsonSize.Comma+n.JsonSize.Colon*2,L=y<v.length-1?n.JsonSize.Comma:0;return oe+k+E+L},re?0:n.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return X(j,z)}t.validateJsonAndGetSize=W})(bp);var li={},Lu={exports:{}},Ja,wf;function Hw(){if(wf)return Ja;wf=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;Ja=function(p,g){g=g||{};var m=typeof p;if(m==="string"&&p.length>0)return o(p);if(m==="number"&&isFinite(p))return g.long?u(p):a(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function o(p){if(p=String(p),!(p.length>100)){var g=/^(-?(?:\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(g){var m=parseFloat(g[1]),C=(g[2]||"ms").toLowerCase();switch(C){case"years":case"year":case"yrs":case"yr":case"y":return m*s;case"weeks":case"week":case"w":return m*i;case"days":case"day":case"d":return m*n;case"hours":case"hour":case"hrs":case"hr":case"h":return m*r;case"minutes":case"minute":case"mins":case"min":case"m":return m*e;case"seconds":case"second":case"secs":case"sec":case"s":return m*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function a(p){var g=Math.abs(p);return g>=n?Math.round(p/n)+"d":g>=r?Math.round(p/r)+"h":g>=e?Math.round(p/e)+"m":g>=t?Math.round(p/t)+"s":p+"ms"}function u(p){var g=Math.abs(p);return g>=n?l(p,g,n,"day"):g>=r?l(p,g,r,"hour"):g>=e?l(p,g,e,"minute"):g>=t?l(p,g,t,"second"):p+" ms"}function l(p,g,m,C){var T=g>=m*1.5;return Math.round(p/m)+" "+C+(T?"s":"")}return Ja}function Vw(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=o,r.humanize=Hw(),r.destroy=l,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let g=0;for(let m=0;m<p.length;m++)g=(g<<5)-g+p.charCodeAt(m),g|=0;return r.colors[Math.abs(g)%r.colors.length]}r.selectColor=e;function r(p){let g,m=null,C,T;function P(...U){if(!P.enabled)return;const M=P,O=Number(new Date),D=O-(g||O);M.diff=D,M.prev=g,M.curr=O,g=O,U[0]=r.coerce(U[0]),typeof U[0]!="string"&&U.unshift("%O");let W=0;U[0]=U[0].replace(/%([a-zA-Z%])/g,(z,K)=>{if(z==="%%")return"%";W++;const X=r.formatters[K];if(typeof X=="function"){const G=U[W];z=X.call(M,G),U.splice(W,1),W--}return z}),r.formatArgs.call(M,U),(M.log||r.log).apply(M,U)}return P.namespace=p,P.useColors=r.useColors(),P.color=r.selectColor(p),P.extend=n,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(C!==r.namespaces&&(C=r.namespaces,T=r.enabled(p)),T),set:U=>{m=U}}),typeof r.init=="function"&&r.init(P),P}function n(p,g){const m=r(this.namespace+(typeof g>"u"?":":g)+p);return m.log=this.log,m}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let g;const m=(typeof p=="string"?p:"").split(/[\s,]+/),C=m.length;for(g=0;g<C;g++)m[g]&&(p=m[g].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(a),...r.skips.map(a).map(g=>"-"+g)].join(",");return r.enable(""),p}function o(p){if(p[p.length-1]==="*")return!0;let g,m;for(g=0,m=r.skips.length;g<m;g++)if(r.skips[g].test(p))return!1;for(g=0,m=r.names.length;g<m;g++)if(r.names[g].test(p))return!0;return!1}function a(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function u(p){return p instanceof Error?p.stack||p.message:p}function l(){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 zw=Vw;(function(t,e){e.formatArgs=n,e.save=i,e.load=s,e.useColors=r,e.storage=o(),e.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){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 n(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;u.splice(1,0,l,"color: inherit");let p=0,g=0;u[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(p++,m==="%c"&&(g=p))}),u.splice(g,0,l)}e.log=console.debug||console.log||(()=>{});function i(u){try{u?e.storage.setItem("debug",u):e.storage.removeItem("debug")}catch{}}function s(){let u;try{u=e.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u={}.DEBUG),u}function o(){try{return localStorage}catch{}}t.exports=zw(e);const{formatters:a}=t.exports;a.j=function(u){try{return JSON.stringify(u)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Lu,Lu.exports);var qw=Lu.exports,Gw=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(li,"__esModule",{value:!0});li.createModuleLogger=li.createProjectLogger=void 0;const Jw=Gw(qw),Zw=(0,Jw.default)("metamask");function Qw(t){return Zw.extend(t)}li.createProjectLogger=Qw;function Yw(t,e){return t.extend(e)}li.createModuleLogger=Yw;var dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.hexToBigInt=dr.hexToNumber=dr.bigIntToHex=dr.numberToHex=void 0;const Xn=wt,Ki=ys,Kw=t=>((0,Xn.assert)(typeof t=="number","Value must be a number."),(0,Xn.assert)(t>=0,"Value must be a non-negative number."),(0,Xn.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Ki.add0x)(t.toString(16)));dr.numberToHex=Kw;const Xw=t=>((0,Xn.assert)(typeof t=="bigint","Value must be a bigint."),(0,Xn.assert)(t>=0,"Value must be a non-negative bigint."),(0,Ki.add0x)(t.toString(16)));dr.bigIntToHex=Xw;const e_=t=>{(0,Ki.assertIsHexString)(t);const e=parseInt(t,16);return(0,Xn.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};dr.hexToNumber=e_;const t_=t=>((0,Ki.assertIsHexString)(t),BigInt((0,Ki.add0x)(t)));dr.hexToBigInt=t_;var vp={};Object.defineProperty(vp,"__esModule",{value:!0});var mp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(mp);var wp={},Bu={exports:{}};const r_="2.0.0",_p=256,n_=Number.MAX_SAFE_INTEGER||9007199254740991,i_=16,s_=_p-6,o_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var $o={MAX_LENGTH:_p,MAX_SAFE_COMPONENT_LENGTH:i_,MAX_SAFE_BUILD_LENGTH:s_,MAX_SAFE_INTEGER:n_,RELEASE_TYPES:o_,SEMVER_SPEC_VERSION:r_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const a_=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Do=a_;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=$o,s=Do;e=t.exports={};const o=e.re=[],a=e.safeRe=[],u=e.src=[],l=e.t={};let p=0;const g="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[g,n]],C=P=>{for(const[U,M]of m)P=P.split(`${U}*`).join(`${U}{0,${M}}`).split(`${U}+`).join(`${U}{1,${M}}`);return P},T=(P,U,M)=>{const O=C(U),D=p++;s(P,D,U),l[P]=D,u[D]=U,o[D]=new RegExp(U,M?"g":void 0),a[D]=new RegExp(O,M?"g":void 0)};T("NUMERICIDENTIFIER","0|[1-9]\\d*"),T("NUMERICIDENTIFIERLOOSE","\\d+"),T("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),T("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),T("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),T("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),T("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),T("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),T("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),T("BUILDIDENTIFIER",`${g}+`),T("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),T("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),T("FULL",`^${u[l.FULLPLAIN]}$`),T("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),T("LOOSE",`^${u[l.LOOSEPLAIN]}$`),T("GTLT","((?:<|>)?=?)"),T("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),T("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),T("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),T("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),T("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),T("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),T("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),T("COERCERTL",u[l.COERCE],!0),T("LONETILDE","(?:~>?)"),T("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",T("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),T("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),T("LONECARET","(?:\\^)"),T("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",T("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),T("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),T("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),T("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),T("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",T("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),T("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),T("STAR","(<|>)?=?\\s*\\*"),T("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),T("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Bu,Bu.exports);var bs=Bu.exports;const u_=Object.freeze({loose:!0}),c_=Object.freeze({}),l_=t=>t?typeof t!="object"?u_:t:c_;var xc=l_;const _f=/^[0-9]+$/,Sp=(t,e)=>{const r=_f.test(t),n=_f.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},f_=(t,e)=>Sp(e,t);var Ep={compareIdentifiers:Sp,rcompareIdentifiers:f_};const Bs=Do,{MAX_LENGTH:Sf,MAX_SAFE_INTEGER:Ps}=$o,{safeRe:Ef,t:xf}=bs,h_=xc,{compareIdentifiers:Un}=Ep;let d_=class or{constructor(e,r){if(r=h_(r),e instanceof or){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Sf)throw new TypeError(`version is longer than ${Sf} characters`);Bs("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?Ef[xf.LOOSE]:Ef[xf.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ps||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ps||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ps||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<Ps)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(e){if(Bs("SemVer.compare",this.version,this.options,e),!(e instanceof or)){if(typeof e=="string"&&e===this.version)return 0;e=new or(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof or||(e=new or(e,this.options)),Un(this.major,e.major)||Un(this.minor,e.minor)||Un(this.patch,e.patch)}comparePre(e){if(e instanceof or||(e=new or(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=e.prerelease[r];if(Bs("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 Un(n,i)}while(++r)}compareBuild(e){e instanceof or||(e=new or(e,this.options));let r=0;do{const n=this.build[r],i=e.build[r];if(Bs("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 Un(n,i)}while(++r)}inc(e,r,n){switch(e){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"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(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(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]),Un(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var At=d_;const Mf=At,p_=(t,e,r=!1)=>{if(t instanceof Mf)return t;try{return new Mf(t,e)}catch(n){if(!r)return null;throw n}};var Ri=p_;const g_=Ri,y_=(t,e)=>{const r=g_(t,e);return r?r.version:null};var b_=y_;const v_=Ri,m_=(t,e)=>{const r=v_(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var w_=m_;const Cf=At,__=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Cf(t instanceof Cf?t.version:t,r).inc(e,n,i).version}catch{return null}};var S_=__;const If=Ri,E_=(t,e)=>{const r=If(t,null,!0),n=If(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const p=u?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var x_=E_;const M_=At,C_=(t,e)=>new M_(t,e).major;var I_=C_;const R_=At,A_=(t,e)=>new R_(t,e).minor;var T_=A_;const k_=At,O_=(t,e)=>new k_(t,e).patch;var N_=O_;const L_=Ri,B_=(t,e)=>{const r=L_(t,e);return r&&r.prerelease.length?r.prerelease:null};var P_=B_;const Rf=At,$_=(t,e,r)=>new Rf(t,r).compare(new Rf(e,r));var tr=$_;const D_=tr,F_=(t,e,r)=>D_(e,t,r);var j_=F_;const U_=tr,W_=(t,e)=>U_(t,e,!0);var H_=W_;const Af=At,V_=(t,e,r)=>{const n=new Af(t,r),i=new Af(e,r);return n.compare(i)||n.compareBuild(i)};var Mc=V_;const z_=Mc,q_=(t,e)=>t.sort((r,n)=>z_(r,n,e));var G_=q_;const J_=Mc,Z_=(t,e)=>t.sort((r,n)=>J_(n,r,e));var Q_=Z_;const Y_=tr,K_=(t,e,r)=>Y_(t,e,r)>0;var Fo=K_;const X_=tr,e2=(t,e,r)=>X_(t,e,r)<0;var Cc=e2;const t2=tr,r2=(t,e,r)=>t2(t,e,r)===0;var xp=r2;const n2=tr,i2=(t,e,r)=>n2(t,e,r)!==0;var Mp=i2;const s2=tr,o2=(t,e,r)=>s2(t,e,r)>=0;var Ic=o2;const a2=tr,u2=(t,e,r)=>a2(t,e,r)<=0;var Rc=u2;const c2=xp,l2=Mp,f2=Fo,h2=Ic,d2=Cc,p2=Rc,g2=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return c2(t,r,n);case"!=":return l2(t,r,n);case">":return f2(t,r,n);case">=":return h2(t,r,n);case"<":return d2(t,r,n);case"<=":return p2(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Cp=g2;const y2=At,b2=Ri,{safeRe:$s,t:Ds}=bs,v2=(t,e)=>{if(t instanceof y2)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match($s[Ds.COERCE]);else{let n;for(;(n=$s[Ds.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),$s[Ds.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;$s[Ds.COERCERTL].lastIndex=-1}return r===null?null:b2(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var m2=v2,Za,Tf;function w2(){return Tf||(Tf=1,Za=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Za}var _2=Me;Me.Node=vn;Me.create=Me;function Me(t){var e=this;if(e instanceof Me||(e=new Me),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}Me.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Me.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Me.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Me.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)E2(this,arguments[t]);return this.length};Me.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)x2(this,arguments[t]);return this.length};Me.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Me.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Me.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};Me.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};Me.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};Me.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};Me.prototype.map=function(t,e){e=e||this;for(var r=new Me,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};Me.prototype.mapReverse=function(t,e){e=e||this;for(var r=new Me,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};Me.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};Me.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};Me.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Me.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Me.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Me;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(;i!==null&&n<e;n++,i=i.next)r.push(i.value);return r};Me.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Me;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};Me.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(var s=[],n=0;i&&n<e;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=S2(this,i,r[n]);return s};Me.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function S2(t,e,r){var n=e===t.head?new vn(r,null,e,t):new vn(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function E2(t,e){t.tail=new vn(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function x2(t,e){t.head=new vn(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function vn(t,e,r,n){if(!(this instanceof vn))return new vn(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{w2()(Me)}catch{}const M2=_2,cn=Symbol("max"),wr=Symbol("length"),Wn=Symbol("lengthCalculator"),zi=Symbol("allowStale"),dn=Symbol("maxAge"),br=Symbol("dispose"),kf=Symbol("noDisposeOnSet"),pt=Symbol("lruList"),Yt=Symbol("cache"),Ip=Symbol("updateAgeOnGet"),Qa=()=>1;class C2{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[cn]=e.max||1/0;const r=e.length||Qa;if(this[Wn]=typeof r!="function"?Qa:r,this[zi]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[dn]=e.maxAge||0,this[br]=e.dispose,this[kf]=e.noDisposeOnSet||!1,this[Ip]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[cn]=e||1/0,Bi(this)}get max(){return this[cn]}set allowStale(e){this[zi]=!!e}get allowStale(){return this[zi]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[dn]=e,Bi(this)}get maxAge(){return this[dn]}set lengthCalculator(e){typeof e!="function"&&(e=Qa),e!==this[Wn]&&(this[Wn]=e,this[wr]=0,this[pt].forEach(r=>{r.length=this[Wn](r.value,r.key),this[wr]+=r.length})),Bi(this)}get lengthCalculator(){return this[Wn]}get length(){return this[wr]}get itemCount(){return this[pt].length}rforEach(e,r){r=r||this;for(let n=this[pt].tail;n!==null;){const i=n.prev;Of(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[pt].head;n!==null;){const i=n.next;Of(this,e,n,r),n=i}}keys(){return this[pt].toArray().map(e=>e.key)}values(){return this[pt].toArray().map(e=>e.value)}reset(){this[br]&&this[pt]&&this[pt].length&&this[pt].forEach(e=>this[br](e.key,e.value)),this[Yt]=new Map,this[pt]=new M2,this[wr]=0}dump(){return this[pt].map(e=>io(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[pt]}set(e,r,n){if(n=n||this[dn],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Wn](r,e);if(this[Yt].has(e)){if(s>this[cn])return ei(this,this[Yt].get(e)),!1;const u=this[Yt].get(e).value;return this[br]&&(this[kf]||this[br](e,u.value)),u.now=i,u.maxAge=n,u.value=r,this[wr]+=s-u.length,u.length=s,this.get(e),Bi(this),!0}const o=new I2(e,r,s,i,n);return o.length>this[cn]?(this[br]&&this[br](e,r),!1):(this[wr]+=o.length,this[pt].unshift(o),this[Yt].set(e,this[pt].head),Bi(this),!0)}has(e){if(!this[Yt].has(e))return!1;const r=this[Yt].get(e).value;return!io(this,r)}get(e){return Ya(this,e,!0)}peek(e){return Ya(this,e,!1)}pop(){const e=this[pt].tail;return e?(ei(this,e),e.value):null}del(e){ei(this,this[Yt].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Yt].forEach((e,r)=>Ya(this,r,!1))}}const Ya=(t,e,r)=>{const n=t[Yt].get(e);if(n){const i=n.value;if(io(t,i)){if(ei(t,n),!t[zi])return}else r&&(t[Ip]&&(n.value.now=Date.now()),t[pt].unshiftNode(n));return i.value}},io=(t,e)=>{if(!e||!e.maxAge&&!t[dn])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[dn]&&r>t[dn]},Bi=t=>{if(t[wr]>t[cn])for(let e=t[pt].tail;t[wr]>t[cn]&&e!==null;){const r=e.prev;ei(t,e),e=r}},ei=(t,e)=>{if(e){const r=e.value;t[br]&&t[br](r.key,r.value),t[wr]-=r.length,t[Yt].delete(r.key),t[pt].removeNode(e)}};class I2{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const Of=(t,e,r,n)=>{let i=r.value;io(t,i)&&(ei(t,r),t[zi]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var R2=C2,Ka,Nf;function rr(){if(Nf)return Ka;Nf=1;class t{constructor(c,y){if(y=n(y),c instanceof t)return c.loose===!!y.loose&&c.includePrerelease===!!y.includePrerelease?c:new t(c.raw,y);if(c instanceof i)return this.raw=c.value,this.set=[[c]],this.format(),this;if(this.options=y,this.loose=!!y.loose,this.includePrerelease=!!y.includePrerelease,this.raw=c.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(v=>this.parseRange(v.trim())).filter(v=>v.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const v=this.set[0];if(this.set=this.set.filter(S=>!T(S[0])),this.set.length===0)this.set=[v];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&P(S[0])){this.set=[S];break}}}this.format()}format(){return this.range=this.set.map(c=>c.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(c){const v=((this.options.includePrerelease&&m)|(this.options.loose&&C))+":"+c,S=r.get(v);if(S)return S;const E=this.options.loose,k=E?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];c=c.replace(k,ie(this.options.includePrerelease)),s("hyphen replace",c),c=c.replace(a[u.COMPARATORTRIM],l),s("comparator trim",c),c=c.replace(a[u.TILDETRIM],p),s("tilde trim",c),c=c.replace(a[u.CARETTRIM],g),s("caret trim",c);let L=c.split(" ").map(Y=>M(Y,this.options)).join(" ").split(/\s+/).map(Y=>re(Y,this.options));E&&(L=L.filter(Y=>(s("loose invalid filter",Y,this.options),!!Y.match(a[u.COMPARATORLOOSE])))),s("range list",L);const _=new Map,d=L.map(Y=>new i(Y,this.options));for(const Y of d){if(T(Y))return[Y];_.set(Y.value,Y)}_.size>1&&_.has("")&&_.delete("");const A=[..._.values()];return r.set(v,A),A}intersects(c,y){if(!(c instanceof t))throw new TypeError("a Range is required");return this.set.some(v=>U(v,y)&&c.set.some(S=>U(S,y)&&v.every(E=>S.every(k=>E.intersects(k,y)))))}test(c){if(!c)return!1;if(typeof c=="string")try{c=new o(c,this.options)}catch{return!1}for(let y=0;y<this.set.length;y++)if(oe(this.set[y],c,this.options))return!0;return!1}}Ka=t;const e=R2,r=new e({max:1e3}),n=xc,i=jo(),s=Do,o=At,{safeRe:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:p,caretTrimReplace:g}=bs,{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:C}=$o,T=w=>w.value==="<0.0.0-0",P=w=>w.value==="",U=(w,c)=>{let y=!0;const v=w.slice();let S=v.pop();for(;y&&v.length;)y=v.every(E=>S.intersects(E,c)),S=v.pop();return y},M=(w,c)=>(s("comp",w,c),w=j(w,c),s("caret",w),w=D(w,c),s("tildes",w),w=K(w,c),s("xrange",w),w=G(w,c),s("stars",w),w),O=w=>!w||w.toLowerCase()==="x"||w==="*",D=(w,c)=>w.trim().split(/\s+/).map(y=>W(y,c)).join(" "),W=(w,c)=>{const y=c.loose?a[u.TILDELOOSE]:a[u.TILDE];return w.replace(y,(v,S,E,k,L)=>{s("tilde",w,v,S,E,k,L);let _;return O(S)?_="":O(E)?_=`>=${S}.0.0 <${+S+1}.0.0-0`:O(k)?_=`>=${S}.${E}.0 <${S}.${+E+1}.0-0`:L?(s("replaceTilde pr",L),_=`>=${S}.${E}.${k}-${L} <${S}.${+E+1}.0-0`):_=`>=${S}.${E}.${k} <${S}.${+E+1}.0-0`,s("tilde return",_),_})},j=(w,c)=>w.trim().split(/\s+/).map(y=>z(y,c)).join(" "),z=(w,c)=>{s("caret",w,c);const y=c.loose?a[u.CARETLOOSE]:a[u.CARET],v=c.includePrerelease?"-0":"";return w.replace(y,(S,E,k,L,_)=>{s("caret",w,S,E,k,L,_);let d;return O(E)?d="":O(k)?d=`>=${E}.0.0${v} <${+E+1}.0.0-0`:O(L)?E==="0"?d=`>=${E}.${k}.0${v} <${E}.${+k+1}.0-0`:d=`>=${E}.${k}.0${v} <${+E+1}.0.0-0`:_?(s("replaceCaret pr",_),E==="0"?k==="0"?d=`>=${E}.${k}.${L}-${_} <${E}.${k}.${+L+1}-0`:d=`>=${E}.${k}.${L}-${_} <${E}.${+k+1}.0-0`:d=`>=${E}.${k}.${L}-${_} <${+E+1}.0.0-0`):(s("no pr"),E==="0"?k==="0"?d=`>=${E}.${k}.${L}${v} <${E}.${k}.${+L+1}-0`:d=`>=${E}.${k}.${L}${v} <${E}.${+k+1}.0-0`:d=`>=${E}.${k}.${L} <${+E+1}.0.0-0`),s("caret return",d),d})},K=(w,c)=>(s("replaceXRanges",w,c),w.split(/\s+/).map(y=>X(y,c)).join(" ")),X=(w,c)=>{w=w.trim();const y=c.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return w.replace(y,(v,S,E,k,L,_)=>{s("xRange",w,v,S,E,k,L,_);const d=O(E),A=d||O(k),Y=A||O(L),ee=Y;return S==="="&&ee&&(S=""),_=c.includePrerelease?"-0":"",d?S===">"||S==="<"?v="<0.0.0-0":v="*":S&&ee?(A&&(k=0),L=0,S===">"?(S=">=",A?(E=+E+1,k=0,L=0):(k=+k+1,L=0)):S==="<="&&(S="<",A?E=+E+1:k=+k+1),S==="<"&&(_="-0"),v=`${S+E}.${k}.${L}${_}`):A?v=`>=${E}.0.0${_} <${+E+1}.0.0-0`:Y&&(v=`>=${E}.${k}.0${_} <${E}.${+k+1}.0-0`),s("xRange return",v),v})},G=(w,c)=>(s("replaceStars",w,c),w.trim().replace(a[u.STAR],"")),re=(w,c)=>(s("replaceGTE0",w,c),w.trim().replace(a[c.includePrerelease?u.GTE0PRE:u.GTE0],"")),ie=w=>(c,y,v,S,E,k,L,_,d,A,Y,ee,N)=>(O(v)?y="":O(S)?y=`>=${v}.0.0${w?"-0":""}`:O(E)?y=`>=${v}.${S}.0${w?"-0":""}`:k?y=`>=${y}`:y=`>=${y}${w?"-0":""}`,O(d)?_="":O(A)?_=`<${+d+1}.0.0-0`:O(Y)?_=`<${d}.${+A+1}.0-0`:ee?_=`<=${d}.${A}.${Y}-${ee}`:w?_=`<${d}.${A}.${+Y+1}-0`:_=`<=${_}`,`${y} ${_}`.trim()),oe=(w,c,y)=>{for(let v=0;v<w.length;v++)if(!w[v].test(c))return!1;if(c.prerelease.length&&!y.includePrerelease){for(let v=0;v<w.length;v++)if(s(w[v].semver),w[v].semver!==i.ANY&&w[v].semver.prerelease.length>0){const S=w[v].semver;if(S.major===c.major&&S.minor===c.minor&&S.patch===c.patch)return!0}return!1}return!0};return Ka}var Xa,Lf;function jo(){if(Lf)return Xa;Lf=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(p,g){if(g=r(g),p instanceof e){if(p.loose===!!g.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),o("comparator",p,g),this.options=g,this.loose=!!g.loose,this.parse(p),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(p){const g=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],m=p.match(g);if(!m)throw new TypeError(`Invalid comparator: ${p}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new a(m[2],this.options.loose):this.semver=t}toString(){return this.value}test(p){if(o("Comparator.test",p,this.options.loose),this.semver===t||p===t)return!0;if(typeof p=="string")try{p=new a(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,g){if(!(p instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(p.value,g).test(this.value):p.operator===""?p.value===""?!0:new u(this.value,g).test(p.semver):(g=r(g),g.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!g.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,g)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,g)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}Xa=e;const r=xc,{safeRe:n,t:i}=bs,s=Cp,o=Do,a=At,u=rr();return Xa}const A2=rr(),T2=(t,e,r)=>{try{e=new A2(e,r)}catch{return!1}return e.test(t)};var Uo=T2;const k2=rr(),O2=(t,e)=>new k2(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var N2=O2;const L2=At,B2=rr(),P2=(t,e,r)=>{let n=null,i=null,s=null;try{s=new B2(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new L2(n,r))}),n};var $2=P2;const D2=At,F2=rr(),j2=(t,e,r)=>{let n=null,i=null,s=null;try{s=new F2(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new D2(n,r))}),n};var U2=j2;const eu=At,W2=rr(),Bf=Fo,H2=(t,e)=>{t=new W2(t,e);let r=new eu("0.0.0");if(t.test(r)||(r=new eu("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){const i=t.set[n];let s=null;i.forEach(o=>{const a=new eu(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Bf(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Bf(r,s))&&(r=s)}return r&&t.test(r)?r:null};var V2=H2;const z2=rr(),q2=(t,e)=>{try{return new z2(t,e).range||"*"}catch{return null}};var G2=q2;const J2=At,Rp=jo(),{ANY:Z2}=Rp,Q2=rr(),Y2=Uo,Pf=Fo,$f=Cc,K2=Rc,X2=Ic,eS=(t,e,r,n)=>{t=new J2(t,n),e=new Q2(e,n);let i,s,o,a,u;switch(r){case">":i=Pf,s=K2,o=$f,a=">",u=">=";break;case"<":i=$f,s=X2,o=Pf,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Y2(t,e,n))return!1;for(let l=0;l<e.set.length;++l){const p=e.set[l];let g=null,m=null;if(p.forEach(C=>{C.semver===Z2&&(C=new Rp(">=0.0.0")),g=g||C,m=m||C,i(C.semver,g.semver,n)?g=C:o(C.semver,m.semver,n)&&(m=C)}),g.operator===a||g.operator===u||(!m.operator||m.operator===a)&&s(t,m.semver))return!1;if(m.operator===u&&o(t,m.semver))return!1}return!0};var Ac=eS;const tS=Ac,rS=(t,e,r)=>tS(t,e,">",r);var nS=rS;const iS=Ac,sS=(t,e,r)=>iS(t,e,"<",r);var oS=sS;const Df=rr(),aS=(t,e,r)=>(t=new Df(t,r),e=new Df(e,r),t.intersects(e,r));var uS=aS;const cS=Uo,lS=tr;var fS=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((p,g)=>lS(p,g,r));for(const p of o)cS(p,e,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[p,g]of n)p===g?a.push(p):!g&&p===o[0]?a.push("*"):g?p===o[0]?a.push(`<=${g}`):a.push(`${p} - ${g}`):a.push(`>=${p}`);const u=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e};const Ff=rr(),Tc=jo(),{ANY:tu}=Tc,Pi=Uo,kc=tr,hS=(t,e,r={})=>{if(t===e)return!0;t=new Ff(t,r),e=new Ff(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=pS(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},dS=[new Tc(">=0.0.0-0")],jf=[new Tc(">=0.0.0")],pS=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===tu){if(e.length===1&&e[0].semver===tu)return!0;r.includePrerelease?t=dS:t=jf}if(e.length===1&&e[0].semver===tu){if(r.includePrerelease)return!0;e=jf}const n=new Set;let i,s;for(const C of t)C.operator===">"||C.operator===">="?i=Uf(i,C,r):C.operator==="<"||C.operator==="<="?s=Wf(s,C,r):n.add(C.semver);if(n.size>1)return null;let o;if(i&&s){if(o=kc(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const C of n){if(i&&!Pi(C,String(i),r)||s&&!Pi(C,String(s),r))return null;for(const T of e)if(!Pi(C,String(T),r))return!1;return!0}let a,u,l,p,g=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(const C of e){if(p=p||C.operator===">"||C.operator===">=",l=l||C.operator==="<"||C.operator==="<=",i){if(m&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===m.major&&C.semver.minor===m.minor&&C.semver.patch===m.patch&&(m=!1),C.operator===">"||C.operator===">="){if(a=Uf(i,C,r),a===C&&a!==i)return!1}else if(i.operator===">="&&!Pi(i.semver,String(C),r))return!1}if(s){if(g&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===g.major&&C.semver.minor===g.minor&&C.semver.patch===g.patch&&(g=!1),C.operator==="<"||C.operator==="<="){if(u=Wf(s,C,r),u===C&&u!==s)return!1}else if(s.operator==="<="&&!Pi(s.semver,String(C),r))return!1}if(!C.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&p&&!i&&o!==0||m||g)},Uf=(t,e,r)=>{if(!t)return e;const n=kc(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Wf=(t,e,r)=>{if(!t)return e;const n=kc(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var gS=hS;const ru=bs,Hf=$o,yS=At,Vf=Ep,bS=Ri,vS=b_,mS=w_,wS=S_,_S=x_,SS=I_,ES=T_,xS=N_,MS=P_,CS=tr,IS=j_,RS=H_,AS=Mc,TS=G_,kS=Q_,OS=Fo,NS=Cc,LS=xp,BS=Mp,PS=Ic,$S=Rc,DS=Cp,FS=m2,jS=jo(),US=rr(),WS=Uo,HS=N2,VS=$2,zS=U2,qS=V2,GS=G2,JS=Ac,ZS=nS,QS=oS,YS=uS,KS=fS,XS=gS;var eE={parse:bS,valid:vS,clean:mS,inc:wS,diff:_S,major:SS,minor:ES,patch:xS,prerelease:MS,compare:CS,rcompare:IS,compareLoose:RS,compareBuild:AS,sort:TS,rsort:kS,gt:OS,lt:NS,eq:LS,neq:BS,gte:PS,lte:$S,cmp:DS,coerce:FS,Comparator:jS,Range:US,satisfies:WS,toComparators:HS,maxSatisfying:VS,minSatisfying:zS,minVersion:qS,validRange:GS,outside:JS,gtr:ZS,ltr:QS,intersects:YS,simplifyRange:KS,subset:XS,SemVer:yS,re:ru.re,src:ru.src,tokens:ru.t,SEMVER_SPEC_VERSION:Hf.SEMVER_SPEC_VERSION,RELEASE_TYPES:Hf.RELEASE_TYPES,compareIdentifiers:Vf.compareIdentifiers,rcompareIdentifiers:Vf.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=eE,r=In,n=wt;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",g=>(0,e.valid)(g)===null?`Expected SemVer version, got "${g}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",g=>(0,e.validRange)(g)===null?`Expected SemVer range, got "${g}"`:!0);function i(g){return(0,r.is)(g,t.VersionStruct)}t.isValidSemVerVersion=i;function s(g){return(0,r.is)(g,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(g){(0,n.assertStruct)(g,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(g){(0,n.assertStruct)(g,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function u(g,m){return(0,e.gt)(g,m)}t.gtVersion=u;function l(g,m){return(0,e.gtr)(g,m)}t.gtRange=l;function p(g,m){return(0,e.satisfies)(g,m,{includePrerelease:!0})}t.satisfiesVersionRange=p})(wp);(function(t){var e=te&&te.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(wt,t),r(gs,t),r(Ee,t),r(Bo,t),r(hr,t),r(ci,t),r(ys,t),r(bp,t),r(li,t),r(Ec,t),r(dr,t),r(vp,t),r(mp,t),r(wp,t)})(Kd);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Kd;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Yd);var Ap=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(No,"__esModule",{value:!0});No.PollingBlockTracker=void 0;const tE=Ap(dc),rE=Ap(E1),nE=ds,zf=Yd,qf=(0,zf.createModuleLogger)(zf.projectLogger,"polling-block-tracker"),iE=(0,tE.default)(),sE=1e3;class oE extends nE.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*sE,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Gf(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:
|
|
10
|
-
${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Gf(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:iE(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),qf("Making request",e);const r=await(0,rE.default)(n=>this._provider.sendAsync(e,n))();if(qf("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
11
|
-
${r.error.message}`);return r.result}}No.PollingBlockTracker=oE;function Gf(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var Wo={},aE=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.SubscribeBlockTracker=void 0;const uE=aE(dc),cE=ds,lE=(0,uE.default)();class fE extends cE.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:lE(),method:e,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(e,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)}}Wo.SubscribeBlockTracker=fE;var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});(function(t){var e=te&&te.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(No,t),r(Wo,t),r(Tp,t)})(Qd);var Oc={},Ho={},vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.getUniqueId=void 0;const kp=4294967295;let nu=Math.floor(Math.random()*kp);function hE(){return nu=(nu+1)%kp,nu}vs.getUniqueId=hE;Object.defineProperty(Ho,"__esModule",{value:!0});Ho.createIdRemapMiddleware=void 0;const dE=vs;function pE(){return(t,e,r,n)=>{const i=t.id,s=dE.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}Ho.createIdRemapMiddleware=pE;var Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.createAsyncMiddleware=void 0;function gE(t){return async(e,r,n,i)=>{let s;const o=new Promise(p=>{s=p});let a=null,u=!1;const l=async()=>{u=!0,n(p=>{a=p,s()}),await o};try{await t(e,r,l),u?(await o,a(null)):i(null)}catch(p){a?a(p):i(p)}}}Vo.createAsyncMiddleware=gE;var zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.createScaffoldMiddleware=void 0;function yE(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}zo.createScaffoldMiddleware=yE;var ms={},bE=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ms,"__esModule",{value:!0});ms.JsonRpcEngine=void 0;const vE=bE(_n),Dt=Ku;class vr extends vE.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,o,a]=await vr._runAllMiddleware(e,r,this._middleware);return o?(await vr._runReturnHandlers(a),i(s)):n(async u=>{try{await vr._runReturnHandlers(a)}catch(l){return u(l)}return u()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const o=new Dt.EthereumRpcError(Dt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new Dt.EthereumRpcError(Dt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(o,{id:e.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Dt.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await vr._runAllMiddleware(e,r,this._middleware);if(vr._checkForCompletion(e,r,i),await vr._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await vr._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=u=>{const l=u||r.error;l&&(r.error=Dt.serializeError(l)),s([l,!0])},a=u=>{r.error?o(r.error):(u&&(typeof u!="function"&&o(new Dt.EthereumRpcError(Dt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof u}" for request:
|
|
12
|
-
${iu(e)}`,{request:e})),i.push(u)),s([null,!1]))};try{n(e,r,a,o)}catch(u){o(u)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new Dt.EthereumRpcError(Dt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
13
|
-
${iu(e)}`,{request:e});if(!n)throw new Dt.EthereumRpcError(Dt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
14
|
-
${iu(e)}`,{request:e})}}ms.JsonRpcEngine=vr;function iu(t){return JSON.stringify(t,null,2)}var qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.mergeMiddleware=void 0;const mE=ms;function wE(t){const e=new mE.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}qo.mergeMiddleware=wE;(function(t){var e=te&&te.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ho,t),r(Vo,t),r(zo,t),r(vs,t),r(ms,t),r(qo,t)})(Oc);var Op={},Nc={},Pu=function(t,e){return Pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Pu(t,e)};function Np(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Pu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var so=function(){return so=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},so.apply(this,arguments)};function Lp(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Bp(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Pp(t,e){return function(r,n){e(r,n,t)}}function _E(t,e,r,n,i,s){function o(M){if(M!==void 0&&typeof M!="function")throw new TypeError("Function expected");return M}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,p=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),g,m=!1,C=r.length-1;C>=0;C--){var T={};for(var P in n)T[P]=P==="access"?{}:n[P];for(var P in n.access)T.access[P]=n.access[P];T.addInitializer=function(M){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(M||null))};var U=(0,r[C])(a==="accessor"?{get:p.get,set:p.set}:p[u],T);if(a==="accessor"){if(U===void 0)continue;if(U===null||typeof U!="object")throw new TypeError("Object expected");(g=o(U.get))&&(p.get=g),(g=o(U.set))&&(p.set=g),(g=o(U.init))&&i.unshift(g)}else(g=o(U))&&(a==="field"?i.unshift(g):p[u]=g)}l&&Object.defineProperty(l,n.name,p),m=!0}function SE(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function EE(t){return typeof t=="symbol"?t:"".concat(t)}function xE(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function $p(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Dp(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(g){o(g)}}function u(p){try{l(n.throw(p))}catch(g){o(g)}}function l(p){p.done?s(p.value):i(p.value).then(a,u)}l((n=n.apply(t,e||[])).next())})}function Fp(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return u([l,p])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Go=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function jp(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Go(e,t,r)}function oo(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lc(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Up(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Lc(arguments[e]));return t}function Wp(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Hp(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function fi(t){return this instanceof fi?(this.v=t,this):new fi(t)}function Vp(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(m){n[m]&&(i[m]=function(C){return new Promise(function(T,P){s.push([m,C,T,P])>1||a(m,C)})})}function a(m,C){try{u(n[m](C))}catch(T){g(s[0][3],T)}}function u(m){m.value instanceof fi?Promise.resolve(m.value.v).then(l,p):g(s[0][2],m)}function l(m){a("next",m)}function p(m){a("throw",m)}function g(m,C){m(C),s.shift(),s.length&&a(s[0][0],s[0][1])}}function zp(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:fi(t[i](o)),done:!1}:s?s(o):o}:s}}function qp(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof oo=="function"?oo(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,u){o=t[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(l){s({value:l,done:a})},o)}}function Gp(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var ME=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function Jp(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Go(e,t,r);return ME(e,t),e}function Zp(t){return t&&t.__esModule?t:{default:t}}function Qp(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Yp(t,e,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 e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function Kp(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Xp(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var CE=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function e0(t){function e(n){t.error=t.hasError?new CE(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const IE={__extends:Np,__assign:so,__rest:Lp,__decorate:Bp,__param:Pp,__metadata:$p,__awaiter:Dp,__generator:Fp,__createBinding:Go,__exportStar:jp,__values:oo,__read:Lc,__spread:Up,__spreadArrays:Wp,__spreadArray:Hp,__await:fi,__asyncGenerator:Vp,__asyncDelegator:zp,__asyncValues:qp,__makeTemplateObject:Gp,__importStar:Jp,__importDefault:Zp,__classPrivateFieldGet:Qp,__classPrivateFieldSet:Yp,__classPrivateFieldIn:Kp,__addDisposableResource:Xp,__disposeResources:e0},RE=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Xp,get __assign(){return so},__asyncDelegator:zp,__asyncGenerator:Vp,__asyncValues:qp,__await:fi,__awaiter:Dp,__classPrivateFieldGet:Qp,__classPrivateFieldIn:Kp,__classPrivateFieldSet:Yp,__createBinding:Go,__decorate:Bp,__disposeResources:e0,__esDecorate:_E,__exportStar:jp,__extends:Np,__generator:Fp,__importDefault:Zp,__importStar:Jp,__makeTemplateObject:Gp,__metadata:$p,__param:Pp,__propKey:EE,__read:Lc,__rest:Lp,__runInitializers:SE,__setFunctionName:xE,__spread:Up,__spreadArray:Hp,__spreadArrays:Wp,__values:oo,default:IE},Symbol.toStringTag,{value:"Module"})),Bc=mi(RE);var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});var Jf=Bc,AE=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Jf.__awaiter(this,void 0,void 0,function(){var r,n,i;return Jf.__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,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.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 e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();Jo.default=AE;Object.defineProperty(Nc,"__esModule",{value:!0});var Zf=Bc,TE=Jo,kE=function(){function t(){this._semaphore=new TE.default(1)}return t.prototype.acquire=function(){return Zf.__awaiter(this,void 0,void 0,function(){var e,r;return Zf.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();Nc.default=kE;var Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.withTimeout=void 0;var Fs=Bc;function OE(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Fs.__awaiter(n,void 0,void 0,function(){var o,a,u;return Fs.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},e),[4,t.acquire()];case 1:return a=l.sent(),o?(u=Array.isArray(a)?a[1]:a,u()):i(a),[2]}})})})},runExclusive:function(i){return Fs.__awaiter(this,void 0,void 0,function(){var s,o;return Fs.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}Zo.withTimeout=OE;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=Nc;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Jo;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Zo;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Op);var NE=BE,LE=Object.prototype.hasOwnProperty;function BE(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)LE.call(r,n)&&(t[n]=r[n])}return t}const PE=NE,$E=dc();var DE=pe;function pe(t){const e=this;e.currentProvider=t}pe.prototype.getBalance=ws(2,"eth_getBalance");pe.prototype.getCode=ws(2,"eth_getCode");pe.prototype.getTransactionCount=ws(2,"eth_getTransactionCount");pe.prototype.getStorageAt=ws(3,"eth_getStorageAt");pe.prototype.call=ws(2,"eth_call");pe.prototype.protocolVersion=we("eth_protocolVersion");pe.prototype.syncing=we("eth_syncing");pe.prototype.coinbase=we("eth_coinbase");pe.prototype.mining=we("eth_mining");pe.prototype.hashrate=we("eth_hashrate");pe.prototype.gasPrice=we("eth_gasPrice");pe.prototype.accounts=we("eth_accounts");pe.prototype.blockNumber=we("eth_blockNumber");pe.prototype.getBlockTransactionCountByHash=we("eth_getBlockTransactionCountByHash");pe.prototype.getBlockTransactionCountByNumber=we("eth_getBlockTransactionCountByNumber");pe.prototype.getUncleCountByBlockHash=we("eth_getUncleCountByBlockHash");pe.prototype.getUncleCountByBlockNumber=we("eth_getUncleCountByBlockNumber");pe.prototype.sign=we("eth_sign");pe.prototype.sendTransaction=we("eth_sendTransaction");pe.prototype.sendRawTransaction=we("eth_sendRawTransaction");pe.prototype.estimateGas=we("eth_estimateGas");pe.prototype.getBlockByHash=we("eth_getBlockByHash");pe.prototype.getBlockByNumber=we("eth_getBlockByNumber");pe.prototype.getTransactionByHash=we("eth_getTransactionByHash");pe.prototype.getTransactionByBlockHashAndIndex=we("eth_getTransactionByBlockHashAndIndex");pe.prototype.getTransactionByBlockNumberAndIndex=we("eth_getTransactionByBlockNumberAndIndex");pe.prototype.getTransactionReceipt=we("eth_getTransactionReceipt");pe.prototype.getUncleByBlockHashAndIndex=we("eth_getUncleByBlockHashAndIndex");pe.prototype.getUncleByBlockNumberAndIndex=we("eth_getUncleByBlockNumberAndIndex");pe.prototype.getCompilers=we("eth_getCompilers");pe.prototype.compileLLL=we("eth_compileLLL");pe.prototype.compileSolidity=we("eth_compileSolidity");pe.prototype.compileSerpent=we("eth_compileSerpent");pe.prototype.newFilter=we("eth_newFilter");pe.prototype.newBlockFilter=we("eth_newBlockFilter");pe.prototype.newPendingTransactionFilter=we("eth_newPendingTransactionFilter");pe.prototype.uninstallFilter=we("eth_uninstallFilter");pe.prototype.getFilterChanges=we("eth_getFilterChanges");pe.prototype.getFilterLogs=we("eth_getFilterLogs");pe.prototype.getLogs=we("eth_getLogs");pe.prototype.getWork=we("eth_getWork");pe.prototype.submitWork=we("eth_submitWork");pe.prototype.submitHashrate=we("eth_submitHashrate");pe.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(FE(t),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return e(n);e(null,i.result)})};function we(t){return function(){const e=this;var r=[].slice.call(arguments),n=r.pop();e.sendAsync({method:t,params:r},n)}}function ws(t,e){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<t&&n.push("latest"),r.sendAsync({method:e,params:n},i)}}function FE(t){return PE({id:$E(),jsonrpc:"2.0",params:[]},t)}const Qf=(t,e,r,n)=>function(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...l)=>{e.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):e.errorFirst?i.push((l,p)=>{l?a(l):o(p)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},Yf=new WeakMap;var jE=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(o,a)=>{let u=Yf.get(o);if(u||(u={},Yf.set(o,u)),a in u)return u[a];const l=T=>typeof T=="string"||typeof a=="symbol"?a===T:T.test(a),p=Reflect.getOwnPropertyDescriptor(o,a),g=p===void 0||p.writable||p.configurable,C=(e.include?e.include.some(l):!e.exclude.some(l))&&g;return u[a]=C,C},i=new WeakMap,s=new Proxy(t,{apply(o,a,u){const l=i.get(o);if(l)return Reflect.apply(l,a,u);const p=e.excludeMain?o:Qf(o,e,s,o);return i.set(o,p),Reflect.apply(p,a,u)},get(o,a){const u=o[a];if(!n(o,a)||u===Function.prototype[a])return u;const l=i.get(u);if(l)return l;if(typeof u=="function"){const p=Qf(u,e,s,o);return i.set(u,p),p}return u}});return s};const UE=_n.default;let WE=class extends UE{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Pc=WE;const HE=Pc;let VE=class extends HE{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var zE=VE,_s={minBlockRef:qE,maxBlockRef:GE,sortBlockRefs:$c,bnToHex:JE,blockRefIsNumber:ZE,hexToInt:ao,incrementHexInt:QE,intToHex:t0,unsafeRandomBytes:YE};function qE(...t){return $c(t)[0]}function GE(...t){const e=$c(t);return e[e.length-1]}function $c(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:ao(e)-ao(r))}function JE(t){return"0x"+t.toString(16)}function ZE(t){return t&&!["earliest","latest","pending"].includes(t)}function ao(t){return t==null?t:Number.parseInt(t,16)}function QE(t){if(t==null)return t;const e=ao(t);return t0(e+1)}function t0(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function YE(t){let e="0x";for(let r=0;r<t;r++)e+=Kf(),e+=Kf();return e}function Kf(){return Math.floor(Math.random()*16).toString(16)}const KE=DE,XE=jE,e3=zE,{bnToHex:wR,hexToInt:js,incrementHexInt:t3,minBlockRef:r3,blockRefIsNumber:n3}=_s;let i3=class extends e3{constructor({provider:e,params:r}){super(),this.type="log",this.ethQuery=new KE(e),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:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=r3(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=t3(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(u=>this.matchLog(u));this.addResults(a)}async _fetchLogs(e){return await XE(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(js(this.params.fromBlock)>=js(e.blockNumber)||n3(this.params.toBlock)&&js(this.params.toBlock)<=js(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(p=>p.toLowerCase()),a.includes(o))})}};var s3=i3,Dc=o3;async function o3({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Xf(e),s=Xf(r)-n+1,o=Array(s).fill().map((u,l)=>n+l).map(a3);return await Promise.all(o.map(u=>c3(t,"eth_getBlockByNumber",[u,!1])))}function Xf(t){return t==null?t:Number.parseInt(t,16)}function a3(t){return t==null?t:"0x"+t.toString(16)}function u3(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function c3(t,e,r){for(let n=0;n<3;n++)try{return await u3(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}const l3=Pc,f3=Dc,{incrementHexInt:h3}=_s;let d3=class extends l3{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=h3(e),o=(await f3({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var p3=d3;const g3=Pc,y3=Dc,{incrementHexInt:b3}=_s;let v3=class extends g3{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=b3(e),i=await y3({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var m3=v3;const w3=Op.Mutex,{createAsyncMiddleware:_3,createScaffoldMiddleware:S3}=Oc,E3=s3,x3=p3,M3=m3,{intToHex:r0,hexToInt:su}=_s;var C3=I3;function I3({blockTracker:t,provider:e}){let r=0,n={};const i=new w3,s=R3({mutex:i}),o=S3({eth_newFilter:s(ou(u)),eth_newBlockFilter:s(ou(l)),eth_newPendingTransactionFilter:s(ou(p)),eth_uninstallFilter:s(Js(C)),eth_getFilterChanges:s(Js(g)),eth_getFilterLogs:s(Js(m))}),a=async({oldBlock:O,newBlock:D})=>{if(n.length===0)return;const W=await i.acquire();try{await Promise.all(Hn(n).map(async j=>{try{await j.update({oldBlock:O,newBlock:D})}catch(z){console.error(z)}}))}catch(j){console.error(j)}W()};return o.newLogFilter=u,o.newBlockFilter=l,o.newPendingTransactionFilter=p,o.uninstallFilter=C,o.getFilterChanges=g,o.getFilterLogs=m,o.destroy=()=>{U()},o;async function u(O){const D=new E3({provider:e,params:O});return await T(D),D}async function l(){const O=new x3({provider:e});return await T(O),O}async function p(){const O=new M3({provider:e});return await T(O),O}async function g(O){const D=su(O),W=n[D];if(!W)throw new Error(`No filter for index "${D}"`);return W.getChangesAndClear()}async function m(O){const D=su(O),W=n[D];if(!W)throw new Error(`No filter for index "${D}"`);let j=[];return W.type==="log"&&(j=W.getAllResults()),j}async function C(O){const D=su(O),j=!!n[D];return j&&await P(D),j}async function T(O){const D=Hn(n).length,W=await t.getLatestBlock();await O.initialize({currentBlock:W}),r++,n[r]=O,O.id=r,O.idHex=r0(r);const j=Hn(n).length;return M({prevFilterCount:D,newFilterCount:j}),r}async function P(O){const D=Hn(n).length;delete n[O];const W=Hn(n).length;M({prevFilterCount:D,newFilterCount:W})}async function U(){const O=Hn(n).length;n={},M({prevFilterCount:O,newFilterCount:0})}function M({prevFilterCount:O,newFilterCount:D}){if(O===0&&D>0){t.on("sync",a);return}if(O>0&&D===0){t.removeListener("sync",a);return}}}function ou(t){return Js(async(...e)=>{const r=await t(...e);return r0(r.id)})}function Js(t){return _3(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function R3({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function Hn(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const A3=_n.default,{createAsyncMiddleware:eh,createScaffoldMiddleware:T3}=Oc,k3=C3,{unsafeRandomBytes:O3,incrementHexInt:N3}=_s,L3=Dc;var B3=P3;function P3({blockTracker:t,provider:e}){const r={},n=k3({blockTracker:t,provider:e});let i=!1;const s=new A3,o=T3({eth_subscribe:eh(a),eth_unsubscribe:eh(u)});return o.destroy=p,{events:s,middleware:o};async function a(g,m){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=g.params[0],T=O3(16);let P;switch(C){case"newHeads":P=U({subId:T});break;case"logs":const O=g.params[1],D=await n.newLogFilter(O);P=M({subId:T,filter:D});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${C}"`)}r[T]=P,m.result=T;return;function U({subId:O}){const D={type:C,destroy:async()=>{t.removeListener("sync",D.update)},update:async({oldBlock:W,newBlock:j})=>{const z=j,K=N3(W);(await L3({provider:e,fromBlock:K,toBlock:z})).map($3).filter(re=>re!==null).forEach(re=>{l(O,re)})}};return t.on("sync",D.update),D}function M({subId:O,filter:D}){return D.on("update",j=>l(O,j)),{type:C,destroy:async()=>await n.uninstallFilter(D.idHex)}}}async function u(g,m){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=g.params[0],T=r[C];if(!T){m.result=!1;return}delete r[C],await T.destroy(),m.result=!0}function l(g,m){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:g,result:m}})}function p(){s.removeAllListeners();for(const g in r)r[g].destroy(),delete r[g];i=!0}}function $3(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Oo,"__esModule",{value:!0});Oo.SubscriptionManager=void 0;const D3=Qd,F3=B3,th=()=>{};class j3{constructor(e){const r=new D3.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=F3({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,th,th),r}destroy(){this.subscriptionMiddleware.destroy()}}Oo.SubscriptionManager=j3;var Fc=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ni,"__esModule",{value:!0});ni.CoinbaseWalletProvider=void 0;const U3=Fc(_n),W3=Fc(_o),au=wi,Ne=ns,rh=Si,nh=Xt,uu=Eo,H3=Be,ve=ne,cu=Fc(v1),V3=ui,Ae=Zd,z3=Oo,ih="DefaultChainId",sh="DefaultJsonRpcUrl";class q3 extends U3.default{constructor(e){var r,n;super(),this._filterPolyfill=new V3.FilterPolyfill(this),this._subscriptionManager=new z3.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=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,ve.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(nh.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(u=>(0,ve.ensureAddressString)(u)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var u;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,p=(u=a.data.data.jsonRpcUrl)!==null&&u!==void 0?u:this.jsonRpcUrl;this.updateProviderInfo(p,Number(l))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,ve.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 e;return(e=this._storage.getItem(sh))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(sh,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(ih,r.toString(10)),((0,ve.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,r,n,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,r,n,i,s,o){var a,u;if((0,ve.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),p=l.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!p&&await l.requestEthereumAccounts().promise;const g=await l.addEthereumChain(e.toString(),r,s,n,i,o).promise;return((a=g.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((u=g.result)===null||u===void 0?void 0:u.isApproved)===!0}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,H3.isErrorResponse)(n)&&n.errorCode)throw n.errorCode===Ne.standardErrorCodes.provider.unsupportedChain?Ne.standardErrors.provider.unsupportedChain(e):Ne.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode});const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(au.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?rh.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send(Ae.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,Ne.serializeError)(i,e)})}catch(n){throw(0,Ne.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,Ne.serializeError)(n,e)})}catch(n){return Promise.reject((0,Ne.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,Ne.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,Ne.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Ne.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw Ne.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Ne.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});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(e){var r;const i=await(await this.initializeRelay()).scanQRCode((0,ve.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,Ne.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",uu.Web3Method.scanQRCode);return i.result}async genericRequest(e,r){var n;const s=await(await this.initializeRelay()).genericRequest(e,r).promise;if(typeof s.result!="string")throw(0,Ne.serializeError)((n=s.errorMessage)!==null&&n!==void 0?n:"result was not a string",uu.Web3Method.generic);return s.result}async selectProvider(e){var r;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,Ne.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",uu.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),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(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,ve.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(nh.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case Ae.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Ae.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Ae.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case Ae.JSONRPCMethod.net_version:return this._net_version();case Ae.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case Ae.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Ae.JSONRPCMethod.eth_sign:return this._eth_sign(n);case Ae.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case Ae.JSONRPCMethod.personal_sign:return this._personal_sign(n);case Ae.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case Ae.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case Ae.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case Ae.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case Ae.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case Ae.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Ae.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case Ae.JSONRPCMethod.eth_signTypedData_v4:case Ae.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case Ae.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case Ae.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case Ae.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case Ae.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case Ae.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case Ae.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Ae.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Ae.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case Ae.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case Ae.JSONRPCMethod.eth_subscribe:case Ae.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,ve.ensureAddressString)(e);return this._addresses.map(i=>(0,ve.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(au.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,ve.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,ve.ensureAddressString)(e.to):null,i=e.value!=null?(0,ve.ensureBN)(e.value):new W3.default(0),s=e.data?(0,ve.ensureBuffer)(e.data):Buffer.alloc(0),o=e.nonce!=null?(0,ve.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,ve.ensureBN)(e.gasPrice):null,u=e.maxFeePerGas!=null?(0,ve.ensureBN)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,ve.ensureBN)(e.maxPriorityFeePerGas):null,p=e.gas!=null?(0,ve.ensureBN)(e.gas):null,g=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:u,maxPriorityFeePerGas:l,gasLimit:p,chainId:g}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Ne.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Ne.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Ne.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,ve.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(ih);if(!e)return(0,ve.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,ve.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(au.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?rh.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Ne.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(e){this._requireAuthorization();const r=(0,ve.ensureAddressString)(e[0]),n=(0,ve.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,ve.ensureBuffer)(e[0]),n=(0,ve.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,ve.ensureBuffer)(e[0]),n=(0,ve.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,ve.ensureBuffer)(e[0]),n=(0,ve.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Ne.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,ve.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Ne.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,ve.ensureParsedJSONObject)(e[0]),n=(0,ve.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=cu.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,ve.ensureAddressString)(e[0]),n=(0,ve.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=cu.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,ve.ensureAddressString)(e[0]),n=(0,ve.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=cu.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[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(e){var r,n,i,s;const o=e[0];if(((r=o.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(!o.chainName||o.chainName.trim()==="")throw Ne.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw Ne.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.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(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw Ne.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Ne.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Ne.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Ne.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(e){const r=(0,ve.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[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(e){const r=(0,ve.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,ve.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}ni.CoinbaseWalletProvider=q3;var Qo={},Yo={},Ss,be,n0,i0,ln,oh,s0,$u,o0,ti={},a0=[],G3=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ko=Array.isArray;function _r(t,e){for(var r in e)t[r]=e[r];return t}function u0(t){var e=t.parentNode;e&&e.removeChild(t)}function Du(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Ss.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return qi(t,o,n,i,null)}function qi(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++n0};return i==null&&be.vnode!=null&&be.vnode(s),s}function J3(){return{current:null}}function Es(t){return t.children}function Gi(t,e){this.props=t,this.context=e}function Xi(t,e){if(e==null)return t.__?Xi(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__d||r.__e;return typeof t.type=="function"?Xi(t):null}function c0(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return c0(t)}}function Fu(t){(!t.__d&&(t.__d=!0)&&ln.push(t)&&!uo.__r++||oh!==be.debounceRendering)&&((oh=be.debounceRendering)||s0)(uo)}function uo(){var t,e,r,n,i,s,o,a,u;for(ln.sort($u);t=ln.shift();)t.__d&&(e=ln.length,n=void 0,i=void 0,s=void 0,a=(o=(r=t).__v).__e,(u=r.__P)&&(n=[],i=[],(s=_r({},o)).__v=o.__v+1,jc(u,o,s,r.__n,u.ownerSVGElement!==void 0,o.__h!=null?[a]:null,n,a??Xi(o),o.__h,i),p0(n,o,i),o.__e!=a&&c0(o)),ln.length>e&&ln.sort($u));uo.__r=0}function l0(t,e,r,n,i,s,o,a,u,l,p){var g,m,C,T,P,U,M,O,D,W=0,j=n&&n.__k||a0,z=j.length,K=z,X=e.length;for(r.__k=[],g=0;g<X;g++)(T=r.__k[g]=(T=e[g])==null||typeof T=="boolean"||typeof T=="function"?null:typeof T=="string"||typeof T=="number"||typeof T=="bigint"?qi(null,T,null,null,T):Ko(T)?qi(Es,{children:T},null,null,null):T.__b>0?qi(T.type,T.props,T.key,T.ref?T.ref:null,T.__v):T)!=null?(T.__=r,T.__b=r.__b+1,(O=Z3(T,j,M=g+W,K))===-1?C=ti:(C=j[O]||ti,j[O]=void 0,K--),jc(t,T,C,i,s,o,a,u,l,p),P=T.__e,(m=T.ref)&&C.ref!=m&&(C.ref&&Uc(C.ref,null,T),p.push(m,T.__c||P,T)),P!=null&&(U==null&&(U=P),(D=C===ti||C.__v===null)?O==-1&&W--:O!==M&&(O===M+1?W++:O>M?K>X-M?W+=O-M:W--:W=O<M&&O==M-1?O-M:0),M=g+W,typeof T.type!="function"||O===M&&C.__k!==T.__k?typeof T.type=="function"||O===M&&!D?T.__d!==void 0?(u=T.__d,T.__d=void 0):u=P.nextSibling:u=d0(t,P,u):u=f0(T,u,t),typeof r.type=="function"&&(r.__d=u))):(C=j[g])&&C.key==null&&C.__e&&(C.__e==u&&(C.__=n,u=Xi(C)),ju(C,C,!1),j[g]=null);for(r.__e=U,g=z;g--;)j[g]!=null&&(typeof r.type=="function"&&j[g].__e!=null&&j[g].__e==r.__d&&(r.__d=j[g].__e.nextSibling),ju(j[g],j[g]))}function f0(t,e,r){for(var n,i=t.__k,s=0;i&&s<i.length;s++)(n=i[s])&&(n.__=t,e=typeof n.type=="function"?f0(n,e,r):d0(r,n.__e,e));return e}function h0(t,e){return e=e||[],t==null||typeof t=="boolean"||(Ko(t)?t.some(function(r){h0(r,e)}):e.push(t)),e}function d0(t,e,r){return r==null||r.parentNode!==t?t.insertBefore(e,null):e==r&&e.parentNode!=null||t.insertBefore(e,r),e.nextSibling}function Z3(t,e,r,n){var i=t.key,s=t.type,o=r-1,a=r+1,u=e[r];if(u===null||u&&i==u.key&&s===u.type)return r;if(n>(u!=null?1:0))for(;o>=0||a<e.length;){if(o>=0){if((u=e[o])&&i==u.key&&s===u.type)return o;o--}if(a<e.length){if((u=e[a])&&i==u.key&&s===u.type)return a;a++}}return-1}function Q3(t,e,r,n,i){var s;for(s in r)s==="children"||s==="key"||s in e||co(t,s,null,r[s],n);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||r[s]===e[s]||co(t,s,e[s],r[s],n)}function ah(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||G3.test(e)?r:r+"px"}function co(t,e,r,n,i){var s;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||ah(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||ah(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=Date.now(),t.addEventListener(e,s?ch:uh,s)):t.removeEventListener(e,s?ch:uh,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,r))}}function uh(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(be.event?be.event(t):t)}function ch(t){return this.l[t.type+!0](be.event?be.event(t):t)}function jc(t,e,r,n,i,s,o,a,u,l){var p,g,m,C,T,P,U,M,O,D,W,j,z,K,X,G=e.type;if(e.constructor!==void 0)return null;r.__h!=null&&(u=r.__h,a=e.__e=r.__e,e.__h=null,s=[a]),(p=be.__b)&&p(e);e:if(typeof G=="function")try{if(M=e.props,O=(p=G.contextType)&&n[p.__c],D=p?O?O.props.value:p.__:n,r.__c?U=(g=e.__c=r.__c).__=g.__E:("prototype"in G&&G.prototype.render?e.__c=g=new G(M,D):(e.__c=g=new Gi(M,D),g.constructor=G,g.render=K3),O&&O.sub(g),g.props=M,g.state||(g.state={}),g.context=D,g.__n=n,m=g.__d=!0,g.__h=[],g._sb=[]),g.__s==null&&(g.__s=g.state),G.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=_r({},g.__s)),_r(g.__s,G.getDerivedStateFromProps(M,g.__s))),C=g.props,T=g.state,g.__v=e,m)G.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(G.getDerivedStateFromProps==null&&M!==C&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(M,D),!g.__e&&(g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(M,g.__s,D)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(g.props=M,g.state=g.__s,g.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(re){re&&(re.__=e)}),W=0;W<g._sb.length;W++)g.__h.push(g._sb[W]);g._sb=[],g.__h.length&&o.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(M,g.__s,D),g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(C,T,P)})}if(g.context=D,g.props=M,g.__P=t,g.__e=!1,j=be.__r,z=0,"prototype"in G&&G.prototype.render){for(g.state=g.__s,g.__d=!1,j&&j(e),p=g.render(g.props,g.state,g.context),K=0;K<g._sb.length;K++)g.__h.push(g._sb[K]);g._sb=[]}else do g.__d=!1,j&&j(e),p=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++z<25);g.state=g.__s,g.getChildContext!=null&&(n=_r(_r({},n),g.getChildContext())),m||g.getSnapshotBeforeUpdate==null||(P=g.getSnapshotBeforeUpdate(C,T)),l0(t,Ko(X=p!=null&&p.type===Es&&p.key==null?p.props.children:p)?X:[X],e,r,n,i,s,o,a,u,l),g.base=e.__e,e.__h=null,g.__h.length&&o.push(g),U&&(g.__E=g.__=null)}catch(re){e.__v=null,(u||s!=null)&&(e.__e=a,e.__h=!!u,s[s.indexOf(a)]=null),be.__e(re,e,r)}else s==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=Y3(r.__e,e,r,n,i,s,o,u,l);(p=be.diffed)&&p(e)}function p0(t,e,r){for(var n=0;n<r.length;n++)Uc(r[n],r[++n],r[++n]);be.__c&&be.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){be.__e(s,i.__v)}})}function Y3(t,e,r,n,i,s,o,a,u){var l,p,g,m=r.props,C=e.props,T=e.type,P=0;if(T==="svg"&&(i=!0),s!=null){for(;P<s.length;P++)if((l=s[P])&&"setAttribute"in l==!!T&&(T?l.localName===T:l.nodeType===3)){t=l,s[P]=null;break}}if(t==null){if(T===null)return document.createTextNode(C);t=i?document.createElementNS("http://www.w3.org/2000/svg",T):document.createElement(T,C.is&&C),s=null,a=!1}if(T===null)m===C||a&&t.data===C||(t.data=C);else{if(s=s&&Ss.call(t.childNodes),p=(m=r.props||ti).dangerouslySetInnerHTML,g=C.dangerouslySetInnerHTML,!a){if(s!=null)for(m={},P=0;P<t.attributes.length;P++)m[t.attributes[P].name]=t.attributes[P].value;(g||p)&&(g&&(p&&g.__html==p.__html||g.__html===t.innerHTML)||(t.innerHTML=g&&g.__html||""))}if(Q3(t,C,m,i,a),g)e.__k=[];else if(l0(t,Ko(P=e.props.children)?P:[P],e,r,n,i&&T!=="foreignObject",s,o,s?s[0]:r.__k&&Xi(r,0),a,u),s!=null)for(P=s.length;P--;)s[P]!=null&&u0(s[P]);a||("value"in C&&(P=C.value)!==void 0&&(P!==t.value||T==="progress"&&!P||T==="option"&&P!==m.value)&&co(t,"value",P,m.value,!1),"checked"in C&&(P=C.checked)!==void 0&&P!==t.checked&&co(t,"checked",P,m.checked,!1))}return t}function Uc(t,e,r){try{typeof t=="function"?t(e):t.current=e}catch(n){be.__e(n,r)}}function ju(t,e,r){var n,i;if(be.unmount&&be.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Uc(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){be.__e(s,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&ju(n[i],e,r||typeof t.type!="function");r||t.__e==null||u0(t.__e),t.__=t.__e=t.__d=void 0}function K3(t,e,r){return this.constructor(t,r)}function g0(t,e,r){var n,i,s,o;be.__&&be.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],o=[],jc(e,t=(!n&&r||e).__k=Du(Es,null,[t]),i||ti,ti,e.ownerSVGElement!==void 0,!n&&r?[r]:i?null:e.firstChild?Ss.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,o),p0(s,t,o)}function y0(t,e){g0(t,e,y0)}function X3(t,e,r){var n,i,s,o,a=_r({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?n=e[s]:s=="ref"?i=e[s]:a[s]=e[s]===void 0&&o!==void 0?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Ss.call(arguments,2):r),qi(t.type,a,n||t.key,i||t.ref,null)}function e4(t,e){var r={__c:e="__cC"+o0++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,Fu(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Ss=a0.slice,be={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},n0=0,i0=function(t){return t!=null&&t.constructor===void 0},Gi.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=_r({},this.state),typeof t=="function"&&(t=t(_r({},r),this.props)),t&&_r(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Fu(this))},Gi.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Fu(this))},Gi.prototype.render=Es,ln=[],s0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,$u=function(t,e){return t.__v.__b-e.__v.__b},uo.__r=0,o0=0;const t4=Object.freeze(Object.defineProperty({__proto__:null,Component:Gi,Fragment:Es,cloneElement:X3,createContext:e4,createElement:Du,createRef:J3,h:Du,hydrate:y0,get isValidElement(){return i0},get options(){return be},render:g0,toChildArray:h0},Symbol.toStringTag,{value:"Module"})),Bt=mi(t4);function hi(t){return typeof t=="function"}var lh=!1,Ut={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}lh=t},get useDeprecatedSynchronousErrorHandling(){return lh}};function Jn(t){setTimeout(function(){throw t},0)}var lo={closed:!0,next:function(t){},error:function(t){if(Ut.useDeprecatedSynchronousErrorHandling)throw t;Jn(t)},complete:function(){}},It=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Wc(t){return t!==null&&typeof t=="object"}var r4=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
15
|
-
`+e.map(function(r,n){return n+1+") "+r.toString()}).join(`
|
|
16
|
-
`):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),Ji=r4,rt=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,s=r._unsubscribe,o=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(n!==null)for(var a=0;a<n.length;++a){var u=n[a];u.remove(this)}if(hi(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(g){e=g instanceof Ji?fh(g.errors):[g]}}if(It(o))for(var a=-1,l=o.length;++a<l;){var p=o[a];if(Wc(p))try{p.unsubscribe()}catch(m){e=e||[],m instanceof Ji?e=e.concat(fh(m.errors)):e.push(m)}}if(e)throw new Ji(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||typeof r.unsubscribe!="function")return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;r=new t,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(i===null)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return r;var s=this._subscriptions;return s===null?this._subscriptions=[r]:s.push(r),r},t.prototype.remove=function(e){var r=this._subscriptions;if(r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();function fh(t){return t.reduce(function(e,r){return e.concat(r instanceof Ji?r.errors:r)},[])}var fo=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),se=function(t){J(e,t);function e(r,n,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=lo;break;case 1:if(!r){s.destination=lo;break}if(typeof r=="object"){r instanceof e?(s.syncErrorThrowable=r.syncErrorThrowable,s.destination=r,r.add(s)):(s.syncErrorThrowable=!0,s.destination=new hh(s,r));break}default:s.syncErrorThrowable=!0,s.destination=new hh(s,r,n,i);break}return s}return e.prototype[fo]=function(){return this},e.create=function(r,n,i){var s=new e(r,n,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},e}(rt),hh=function(t){J(e,t);function e(r,n,i,s){var o=t.call(this)||this;o._parentSubscriber=r;var a,u=o;return hi(n)?a=n:n&&(a=n.next,i=n.error,s=n.complete,n!==lo&&(u=Object.create(n),hi(u.unsubscribe)&&o.add(u.unsubscribe.bind(u)),u.unsubscribe=o.unsubscribe.bind(o))),o._context=u,o._next=a,o._error=i,o._complete=s,o}return e.prototype.next=function(r){if(!this.isStopped&&this._next){var n=this._parentSubscriber;!Ut.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?this.__tryOrUnsub(this._next,r):this.__tryOrSetError(n,this._next,r)&&this.unsubscribe()}},e.prototype.error=function(r){if(!this.isStopped){var n=this._parentSubscriber,i=Ut.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!n.syncErrorThrowable?(this.__tryOrUnsub(this._error,r),this.unsubscribe()):(this.__tryOrSetError(n,this._error,r),this.unsubscribe());else if(n.syncErrorThrowable)i?(n.syncErrorValue=r,n.syncErrorThrown=!0):Jn(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;Jn(r)}}},e.prototype.complete=function(){var r=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var i=function(){return r._complete.call(r._context)};!Ut.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(n,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(r,n){try{r.call(this._context,n)}catch(i){if(this.unsubscribe(),Ut.useDeprecatedSynchronousErrorHandling)throw i;Jn(i)}},e.prototype.__tryOrSetError=function(r,n,i){if(!Ut.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(s){return Ut.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=s,r.syncErrorThrown=!0,!0):(Jn(s),!0)}return!1},e.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},e}(se);function Hc(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;n&&n instanceof se?t=n:t=null}return!0}function n4(t,e,r){if(t){if(t instanceof se)return t;if(t[fo])return t[fo]()}return!t&&!e&&!r?new se(lo):new se(t,e,r)}var Ai=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $r(t){return t}function Uu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return b0(t)}function b0(t){return t.length===0?$r:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var me=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this.operator,s=n4(e,r,n);if(i?s.add(i.call(s,this.source)):s.add(this.source||Ut.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),Ut.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){Ut.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=r),Hc(e)?e.error(r):console.warn(r)}},t.prototype.forEach=function(e,r){var n=this;return r=dh(r),new r(function(i,s){var o;o=n.subscribe(function(a){try{e(a)}catch(u){s(u),o&&o.unsubscribe()}},s,i)})},t.prototype._subscribe=function(e){var r=this.source;return r&&r.subscribe(e)},t.prototype[Ai]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.length===0?this:b0(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=dh(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t}();function dh(t){if(t||(t=Ut.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var i4=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Or=i4,v0=function(t){J(e,t);function e(r,n){var i=t.call(this)||this;return i.subject=r,i.subscriber=n,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var r=this.subject,n=r.observers;if(this.subject=null,!(!n||n.length===0||r.isStopped||r.closed)){var i=n.indexOf(this.subscriber);i!==-1&&n.splice(i,1)}}},e}(rt),m0=function(t){J(e,t);function e(r){var n=t.call(this,r)||this;return n.destination=r,n}return e}(se),bt=function(t){J(e,t);function e(){var r=t.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype[fo]=function(){return new m0(this)},e.prototype.lift=function(r){var n=new ph(this,this);return n.operator=r,n},e.prototype.next=function(r){if(this.closed)throw new Or;if(!this.isStopped)for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].next(r)},e.prototype.error=function(r){if(this.closed)throw new Or;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].error(r);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new Or;this.isStopped=!0;for(var r=this.observers,n=r.length,i=r.slice(),s=0;s<n;s++)i[s].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(r){if(this.closed)throw new Or;return t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){if(this.closed)throw new Or;return this.hasError?(r.error(this.thrownError),rt.EMPTY):this.isStopped?(r.complete(),rt.EMPTY):(this.observers.push(r),new v0(this,r))},e.prototype.asObservable=function(){var r=new me;return r.source=this,r},e.create=function(r,n){return new ph(r,n)},e}(me),ph=function(t){J(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n=this.destination;n&&n.next&&n.next(r)},e.prototype.error=function(r){var n=this.destination;n&&n.error&&this.destination.error(r)},e.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},e.prototype._subscribe=function(r){var n=this.source;return n?this.source.subscribe(r):rt.EMPTY},e}(bt);function Vc(){return function(e){return e.lift(new s4(e))}}var s4=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,r){var n=this.connectable;n._refCount++;var i=new o4(e,n),s=r.subscribe(i);return i.closed||(i.connection=n.connect()),s},t}(),o4=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,s=r._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(se),w0=function(t){J(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new rt,r.add(this.source.subscribe(new u4(this.getSubject(),this))),r.closed&&(this._connection=null,r=rt.EMPTY)),r},e.prototype.refCount=function(){return Vc()(this)},e}(me),a4=function(){var t=w0.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),u4=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._error=function(r){this._unsubscribe(),t.prototype._error.call(this,r)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},e}(m0);function c4(t,e,r,n){return function(i){return i.lift(new l4(t,e,r,n))}}var l4=function(){function t(e,r,n,i){this.keySelector=e,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(e,r){return r.subscribe(new f4(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),f4=function(t){J(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.keySelector=n,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},e.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(n),o;if(this.elementSelector)try{o=this.elementSelector(r)}catch(l){this.error(l)}else o=r;if(!s){s=this.subjectSelector?this.subjectSelector():new bt,i.set(n,s);var a=new Wu(n,s,this);if(this.destination.next(a),this.durationSelector){var u=void 0;try{u=this.durationSelector(new Wu(n,s))}catch(l){this.error(l);return}this.add(u.subscribe(new h4(n,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,s){i.error(r)}),n.clear()),this.destination.error(r)},e.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},e.prototype.removeGroup=function(r){this.groups.delete(r)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(se),h4=function(t){J(e,t);function e(r,n,i){var s=t.call(this,n)||this;return s.key=r,s.group=n,s.parent=i,s}return e.prototype._next=function(r){this.complete()},e.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},e}(se),Wu=function(t){J(e,t);function e(r,n,i){var s=t.call(this)||this;return s.key=r,s.groupSubject=n,s.refCountSubscription=i,s}return e.prototype._subscribe=function(r){var n=new rt,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&n.add(new d4(s)),n.add(o.subscribe(r)),n},e}(me),d4=function(t){J(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,r.count++,n}return e.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},e}(rt),_0=function(t){J(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Or;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(bt),p4=function(t){J(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(rt),xs=function(t){J(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s=void 0;try{this.work(r)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},e}(p4),g4=function(t){J(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(xs),Hu=function(){function t(e,r){r===void 0&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,e).schedule(n,r)},t.now=function(){return Date.now()},t}(),Ms=function(t){J(e,t);function e(r,n){n===void 0&&(n=Hu.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Hu),y4=function(t){J(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ms),S0=new y4(g4),E0=S0,di=new me(function(t){return t.complete()});function Ti(t){return t?b4(t):di}function b4(t){return new me(function(e){return t.schedule(function(){return e.complete()})})}function Lt(t){return t&&typeof t.schedule=="function"}var x0=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function zc(t,e){return new me(function(r){var n=new rt,i=0;return n.add(e.schedule(function(){if(i===t.length){r.complete();return}r.next(t[i++]),r.closed||n.add(this.schedule())})),n})}function Cs(t,e){return e?zc(t,e):new me(x0(t))}function Xo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Lt(r)?(t.pop(),zc(t,r)):Cs(t)}function qc(t,e){return e?new me(function(r){return e.schedule(v4,0,{error:t,subscriber:r})}):new me(function(r){return r.error(t)})}function v4(t){var e=t.error,r=t.subscriber;r.error(e)}var Vu;Vu||(Vu={});var Sr=function(){function t(e,r,n){this.kind=e,this.value=r,this.error=n,this.hasValue=e==="N"}return t.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},t.prototype.do=function(e,r,n){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return r&&r(this.error);case"C":return n&&n()}},t.prototype.accept=function(e,r,n){return e&&typeof e.next=="function"?this.observe(e):this.do(e,r,n)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return Xo(this.value);case"E":return qc(this.error);case"C":return Ti()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return typeof e<"u"?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function m4(t,e){return e===void 0&&(e=0),function(n){return n.lift(new w4(t,e))}}var w4=function(){function t(e,r){r===void 0&&(r=0),this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return r.subscribe(new M0(e,this.scheduler,this.delay))},t}(),M0=function(t){J(e,t);function e(r,n,i){i===void 0&&(i=0);var s=t.call(this,r)||this;return s.scheduler=n,s.delay=i,s}return e.dispatch=function(r){var n=r.notification,i=r.destination;n.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(r){var n=this.destination;n.add(this.scheduler.schedule(e.dispatch,this.delay,new _4(r,this.destination)))},e.prototype._next=function(r){this.scheduleMessage(Sr.createNext(r))},e.prototype._error=function(r){this.scheduleMessage(Sr.createError(r)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(Sr.createComplete()),this.unsubscribe()},e}(se),_4=function(){function t(e,r){this.notification=e,this.destination=r}return t}(),Gc=function(t){J(e,t);function e(r,n,i){r===void 0&&(r=Number.POSITIVE_INFINITY),n===void 0&&(n=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=r<1?1:r,s._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return e.prototype.nextInfiniteTimeWindow=function(r){if(!this.isStopped){var n=this._events;n.push(r),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,r)},e.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new S4(this._getNow(),r)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new Or;if(this.isStopped||this.hasError?a=rt.EMPTY:(this.observers.push(r),a=new v0(this,r)),s&&r.add(r=new M0(r,s)),n)for(var u=0;u<o&&!r.closed;u++)r.next(i[u]);else for(var u=0;u<o&&!r.closed;u++)r.next(i[u].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),a},e.prototype._getNow=function(){return(this.scheduler||E0).now()},e.prototype._trimBufferThenGetEvents=function(){for(var r=this._getNow(),n=this._bufferSize,i=this._windowTime,s=this._events,o=s.length,a=0;a<o&&!(r-s[a].time<i);)a++;return o>n&&(a=Math.max(a,o-n)),a>0&&s.splice(0,a),s},e}(bt),S4=function(){function t(e,r){this.time=e,this.value=r}return t}(),ki=function(t){J(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return e.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),rt.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),rt.EMPTY):t.prototype._subscribe.call(this,r)},e.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},e.prototype.error=function(r){this.hasCompleted||t.prototype.error.call(this,r)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(bt),E4=1,x4=function(){return Promise.resolve()}(),zu={};function gh(t){return t in zu?(delete zu[t],!0):!1}var yh={setImmediate:function(t){var e=E4++;return zu[e]=!0,x4.then(function(){return gh(e)&&t()}),e},clearImmediate:function(t){gh(t)}},M4=function(t){J(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=yh.setImmediate(r.flush.bind(r,null))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(yh.clearImmediate(n),r.scheduled=void 0)},e}(xs),C4=function(t){J(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(Ms),C0=new C4(M4),Zs=C0,I0=new Ms(xs),Rt=I0,I4=function(t){J(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},e}(xs),R4=function(t){J(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(Ms),R0=new R4(I4),A4=R0,T4=function(t){J(e,t);function e(r,n){r===void 0&&(r=A0),n===void 0&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,s,o;(o=n[0])&&o.delay<=i&&(n.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=n.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(Ms),A0=function(t){J(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var s=t.call(this,r,n)||this;return s.scheduler=r,s.work=n,s.index=i,s.active=!0,s.index=r.index=i,s}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var s=r.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(xs);function ur(){}function k4(t){return!!t&&(t instanceof me||typeof t.lift=="function"&&typeof t.subscribe=="function")}var O4=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),pi=O4,N4=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Is=N4,L4=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),T0=L4;function Gt(t,e){return function(n){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new B4(t,e))}}var B4=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new P4(e,this.project,this.thisArg))},t}(),P4=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.project=n,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(se);function k0(t,e,r){if(e)if(Lt(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return k0(t,r).apply(void 0,n).pipe(Gt(function(s){return It(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=this,o,a={context:s,subject:o,callbackFunc:t,scheduler:r};return new me(function(u){if(r){var p={args:n,subscriber:u,params:a};return r.schedule($4,0,p)}else{if(!o){o=new ki;var l=function(){for(var g=[],m=0;m<arguments.length;m++)g[m]=arguments[m];o.next(g.length<=1?g[0]:g),o.complete()};try{t.apply(s,n.concat([l]))}catch(g){Hc(o)?o.error(g):console.warn(g)}}return o.subscribe(u)}})}}function $4(t){var e=this,r=t.args,n=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new ki;var l=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];var m=p.length<=1?p[0]:p;e.add(a.schedule(D4,0,{value:m,subject:u}))};try{s.apply(o,r.concat([l]))}catch(p){u.error(p)}}this.add(u.subscribe(n))}function D4(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function O0(t,e,r){if(e)if(Lt(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return O0(t,r).apply(void 0,n).pipe(Gt(function(s){return It(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s={subject:void 0,args:n,callbackFunc:t,scheduler:r,context:this};return new me(function(o){var a=s.context,u=s.subject;if(r)return r.schedule(F4,0,{params:s,subscriber:o,context:a});if(!u){u=s.subject=new ki;var l=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];var m=p.shift();if(m){u.error(m);return}u.next(p.length<=1?p[0]:p),u.complete()};try{t.apply(a,n.concat([l]))}catch(p){Hc(u)?u.error(p):console.warn(p)}}return u.subscribe(o)})}}function F4(t){var e=this,r=t.params,n=t.subscriber,i=t.context,s=r.callbackFunc,o=r.args,a=r.scheduler,u=r.subject;if(!u){u=r.subject=new ki;var l=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];var m=p.shift();if(m)e.add(a.schedule(bh,0,{err:m,subject:u}));else{var C=p.length<=1?p[0]:p;e.add(a.schedule(j4,0,{value:C,subject:u}))}};try{s.apply(i,o.concat([l]))}catch(p){this.add(a.schedule(bh,0,{err:p,subject:u}))}}this.add(u.subscribe(n))}function j4(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function bh(t){var e=t.err,r=t.subject;r.error(e)}var Rn=function(t){J(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(n)},e.prototype.notifyError=function(r,n){this.destination.error(r)},e.prototype.notifyComplete=function(r){this.destination.complete()},e}(se),U4=function(t){J(e,t);function e(r,n,i){var s=t.call(this)||this;return s.parent=r,s.outerValue=n,s.outerIndex=i,s.index=0,s}return e.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this.index++,this)},e.prototype._error=function(r){this.parent.notifyError(r,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(se),W4=function(t){return function(e){return t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,Jn),e}};function H4(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Dr=H4(),V4=function(t){return function(e){var r=t[Dr]();do{var n=void 0;try{n=r.next()}catch(i){return e.error(i),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}while(!0);return typeof r.return=="function"&&e.add(function(){r.return&&r.return()}),e}},z4=function(t){return function(e){var r=t[Ai]();if(typeof r.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(e)}},N0=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function L0(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var es=function(t){if(t&&typeof t[Ai]=="function")return z4(t);if(N0(t))return x0(t);if(L0(t))return W4(t);if(t&&typeof t[Dr]=="function")return V4(t);var e=Wc(t)?"an invalid object":"'"+t+"'",r="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)};function xr(t,e,r,n,i){if(i===void 0&&(i=new U4(t,r,n)),!i.closed)return e instanceof me?e.subscribe(i):es(e)(i)}var vh={};function q4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return Lt(t[t.length-1])&&(n=t.pop()),typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&It(t[0])&&(t=t[0]),Cs(t,n).lift(new Jc(r))}var Jc=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new G4(e,this.resultSelector))},t}(),G4=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.resultSelector=n,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(r){this.values.push(vh),this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{this.active=n,this.toRespond=n;for(var i=0;i<n;i++){var s=r[i];this.add(xr(this,s,void 0,i))}}},e.prototype.notifyComplete=function(r){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(r,n,i){var s=this.values,o=s[i],a=this.toRespond?o===vh?--this.toRespond:this.toRespond:0;s[i]=n,a===0&&(this.resultSelector?this._tryResultSelector(s):this.destination.next(s.slice()))},e.prototype._tryResultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Rn);function J4(t,e){return new me(function(r){var n=new rt;return n.add(e.schedule(function(){var i=t[Ai]();n.add(i.subscribe({next:function(s){n.add(e.schedule(function(){return r.next(s)}))},error:function(s){n.add(e.schedule(function(){return r.error(s)}))},complete:function(){n.add(e.schedule(function(){return r.complete()}))}}))})),n})}function Z4(t,e){return new me(function(r){var n=new rt;return n.add(e.schedule(function(){return t.then(function(i){n.add(e.schedule(function(){r.next(i),n.add(e.schedule(function(){return r.complete()}))}))},function(i){n.add(e.schedule(function(){return r.error(i)}))})})),n})}function Q4(t,e){if(!t)throw new Error("Iterable cannot be null");return new me(function(r){var n=new rt,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(e.schedule(function(){i=t[Dr](),n.add(e.schedule(function(){if(!r.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(u){r.error(u);return}o?r.complete():(r.next(s),this.schedule())}}))})),n})}function Y4(t){return t&&typeof t[Ai]=="function"}function K4(t){return t&&typeof t[Dr]=="function"}function B0(t,e){if(t!=null){if(Y4(t))return J4(t,e);if(L0(t))return Z4(t,e);if(N0(t))return zc(t,e);if(K4(t)||typeof t=="string")return Q4(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function Cr(t,e){return e?B0(t,e):t instanceof me?t:new me(es(t))}var nt=function(t){J(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,n}return e.prototype._next=function(r){this.parent.notifyNext(r)},e.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(se),it=function(t){J(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(se);function st(t,e){if(!e.closed){if(t instanceof me)return t.subscribe(e);var r;try{r=es(t)(e)}catch(n){e.error(n)}return r}}function mn(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?function(n){return n.pipe(mn(function(i,s){return Cr(t(i,s)).pipe(Gt(function(o,a){return e(i,o,s,a)}))},r))}:(typeof e=="number"&&(r=e),function(n){return n.lift(new X4(t,r))})}var X4=function(){function t(e,r){r===void 0&&(r=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=r}return t.prototype.call=function(e,r){return r.subscribe(new ex(e,this.project,this.concurrent))},t}(),ex=function(t){J(e,t);function e(r,n,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,r)||this;return s.project=n,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(r){this.active<this.concurrent?this._tryNext(r):this.buffer.push(r)},e.prototype._tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.active++,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new nt(this),i=this.destination;i.add(n);var s=st(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(it),tx=mn;function Zc(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),mn($r,t)}function P0(){return Zc(1)}function ts(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return P0()(Xo.apply(void 0,t))}function Qc(t){return new me(function(e){var r;try{r=t()}catch(i){e.error(i);return}var n=r?Cr(r):Ti();return n.subscribe(e)})}function rx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=t[0];if(It(r))return Us(r,null);if(Wc(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return Us(n.map(function(s){return r[s]}),n)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&It(t[0])?t[0]:t,Us(t,null).pipe(Gt(function(s){return i.apply(void 0,s)}))}return Us(t,null)}function Us(t,e){return new me(function(r){var n=t.length;if(n===0){r.complete();return}for(var i=new Array(n),s=0,o=0,a=function(l){var p=Cr(t[l]),g=!1;r.add(p.subscribe({next:function(m){g||(g=!0,o++),i[l]=m},error:function(m){return r.error(m)},complete:function(){s++,(s===n||!g)&&(o===n&&r.next(e?e.reduce(function(m,C,T){return m[C]=i[T],m},{}):i),r.complete())}}))},u=0;u<n;u++)a(u)})}function $0(t,e,r,n){return hi(r)&&(n=r,r=void 0),n?$0(t,e,r).pipe(Gt(function(i){return It(i)?n.apply(void 0,i):n(i)})):new me(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}D0(t,e,s,i,r)})}function D0(t,e,r,n,i){var s;if(sx(t)){var o=t;t.addEventListener(e,r,i),s=function(){return o.removeEventListener(e,r,i)}}else if(ix(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(nx(t)){var u=t;t.addListener(e,r),s=function(){return u.removeListener(e,r)}}else if(t&&t.length)for(var l=0,p=t.length;l<p;l++)D0(t[l],e,r,n,i);else throw new TypeError("Invalid event target");n.add(s)}function nx(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function ix(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function sx(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function F0(t,e,r){return r?F0(t,e).pipe(Gt(function(n){return It(n)?r.apply(void 0,n):r(n)})):new me(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},s;try{s=t(i)}catch(o){n.error(o);return}if(hi(e))return function(){return e(i,s)}})}function ox(t,e,r,n,i){var s,o;if(arguments.length==1){var a=t;o=a.initialState,e=a.condition,r=a.iterate,s=a.resultSelector||$r,i=a.scheduler}else n===void 0||Lt(n)?(o=t,s=$r,i=n):(o=t,s=n);return new me(function(u){var l=o;if(i)return i.schedule(ax,0,{subscriber:u,iterate:r,condition:e,resultSelector:s,state:l});do{if(e){var p=void 0;try{p=e(l)}catch(m){u.error(m);return}if(!p){u.complete();break}}var g=void 0;try{g=s(l)}catch(m){u.error(m);return}if(u.next(g),u.closed)break;try{l=r(l)}catch(m){u.error(m);return}}while(!0)})}function ax(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(s){e.error(s);return}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(s){e.error(s);return}if(!n){e.complete();return}if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(s){e.error(s);return}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function ux(t,e,r){return e===void 0&&(e=di),r===void 0&&(r=di),Qc(function(){return t()?e:r})}function gi(t){return!It(t)&&t-parseFloat(t)+1>=0}function cx(t,e){return t===void 0&&(t=0),e===void 0&&(e=Rt),(!gi(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=Rt),new me(function(r){return r.add(e.schedule(lx,t,{subscriber:r,counter:0,period:t})),r})}function lx(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function j0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return Lt(i)?(n=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(r=t.pop())):typeof i=="number"&&(r=t.pop()),n===null&&t.length===1&&t[0]instanceof me?t[0]:Zc(r)(Cs(t,n))}var U0=new me(ur);function fx(){return U0}function qu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return di;var r=t[0],n=t.slice(1);return t.length===1&&It(r)?qu.apply(void 0,r):new me(function(i){var s=function(){return i.add(qu.apply(void 0,n).subscribe(i))};return Cr(r).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function hx(t,e){return e?new me(function(r){var n=Object.keys(t),i=new rt;return i.add(e.schedule(dx,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}):new me(function(r){for(var n=Object.keys(t),i=0;i<n.length&&!r.closed;i++){var s=n[i];t.hasOwnProperty(s)&&r.next([s,t[s]])}r.complete()})}function dx(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,s=t.obj;if(!n.closed)if(r<e.length){var o=e[r];n.next([o,s[o]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:s}))}else n.complete()}function W0(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function Fr(t,e){return function(n){return n.lift(new px(t,e))}}var px=function(){function t(e,r){this.predicate=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new gx(e,this.predicate,this.thisArg))},t}(),gx=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.thisArg=i,s.count=0,s}return e.prototype._next=function(r){var n;try{n=this.predicate.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}n&&this.destination.next(r)},e}(se);function yx(t,e,r){return[Fr(e,r)(new me(es(t))),Fr(W0(e,r))(new me(es(t)))]}function H0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(It(t[0]))t=t[0];else return t[0];return Cs(t,void 0).lift(new bx)}var bx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new vx(e))},t}(),vx=function(t){J(e,t);function e(r){var n=t.call(this,r)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return e.prototype._next=function(r){this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{for(var i=0;i<n&&!this.hasFirst;i++){var s=r[i],o=xr(this,s,void 0,i);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var s=0;s<this.subscriptions.length;s++)if(s!==i){var o=this.subscriptions[s];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(n)},e}(Rn);function mx(t,e,r){return t===void 0&&(t=0),new me(function(n){e===void 0&&(e=t,t=0);var i=0,s=t;if(r)return r.schedule(wx,0,{index:i,count:e,start:t,subscriber:n});do{if(i++>=e){n.complete();break}if(n.next(s++),n.closed)break}while(!0)})}function wx(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;if(r>=n){i.complete();return}i.next(e),!i.closed&&(t.index=r+1,t.start=e+1,this.schedule(t))}function V0(t,e,r){t===void 0&&(t=0);var n=-1;return gi(e)?n=Number(e)<1&&1||Number(e):Lt(e)&&(r=e),Lt(r)||(r=Rt),new me(function(i){var s=gi(t)?t:+t-r.now();return r.schedule(_x,s,{index:0,period:n,subscriber:i})})}function _x(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(r===-1)return n.complete();t.index=e+1,this.schedule(t,r)}}function Sx(t,e){return new me(function(r){var n;try{n=t()}catch(a){r.error(a);return}var i;try{i=e(n)}catch(a){r.error(a);return}var s=i?Cr(i):di,o=s.subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function z0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return typeof r=="function"&&t.pop(),Cs(t,void 0).lift(new q0(r))}var q0=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Ex(e,this.resultSelector))},t}(),Ex=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.resultSelector=n,s.iterators=[],s.active=0,s.resultSelector=typeof n=="function"?n:void 0,s}return e.prototype._next=function(r){var n=this.iterators;It(r)?n.push(new Mx(r)):typeof r[Dr]=="function"?n.push(new xx(r[Dr]())):n.push(new Cx(this.destination,this,r))},e.prototype._complete=function(){var r=this.iterators,n=r.length;if(this.unsubscribe(),n===0){this.destination.complete();return}this.active=n;for(var i=0;i<n;i++){var s=r[i];if(s.stillUnsubscribed){var o=this.destination;o.add(s.subscribe())}else this.active--}},e.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},e.prototype.checkIterators=function(){for(var r=this.iterators,n=r.length,i=this.destination,s=0;s<n;s++){var o=r[s];if(typeof o.hasValue=="function"&&!o.hasValue())return}for(var a=!1,u=[],s=0;s<n;s++){var o=r[s],l=o.next();if(o.hasCompleted()&&(a=!0),l.done){i.complete();return}u.push(l.value)}this.resultSelector?this._tryresultSelector(u):i.next(u),a&&i.complete()},e.prototype._tryresultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(se),xx=function(){function t(e){this.iterator=e,this.nextResult=e.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},t.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},t}(),Mx=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[Dr]=function(){return this},t.prototype.next=function(e){var r=this.index++,n=this.array;return r<this.length?{value:n[r],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Cx=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.parent=n,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[Dr]=function(){return this},e.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},e.prototype.subscribe=function(){return st(this.observable,new nt(this))},e}(it);const Ix=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:pi,AsyncSubject:ki,BehaviorSubject:_0,ConnectableObservable:w0,EMPTY:di,EmptyError:Is,GroupedObservable:Wu,NEVER:U0,Notification:Sr,get NotificationKind(){return Vu},ObjectUnsubscribedError:Or,Observable:me,ReplaySubject:Gc,Scheduler:Hu,Subject:bt,Subscriber:se,Subscription:rt,TimeoutError:T0,UnsubscriptionError:Ji,VirtualAction:A0,VirtualTimeScheduler:T4,animationFrame:A4,animationFrameScheduler:R0,asap:Zs,asapScheduler:C0,async:Rt,asyncScheduler:I0,bindCallback:k0,bindNodeCallback:O0,combineLatest:q4,concat:ts,config:Ut,defer:Qc,empty:Ti,forkJoin:rx,from:Cr,fromEvent:$0,fromEventPattern:F0,generate:ox,identity:$r,iif:ux,interval:cx,isObservable:k4,merge:j0,never:fx,noop:ur,observable:Ai,of:Xo,onErrorResumeNext:qu,pairs:hx,partition:yx,pipe:Uu,queue:E0,queueScheduler:S0,race:H0,range:mx,scheduled:B0,throwError:qc,timer:V0,using:Sx,zip:z0},Symbol.toStringTag,{value:"Module"})),ea=mi(Ix);var ta={},Mr,Le,lu,mh,yi=0,G0=[],Qs=[],wh=be.__b,_h=be.__r,Sh=be.diffed,Eh=be.__c,xh=be.unmount;function An(t,e){be.__h&&be.__h(Le,t,yi||e),yi=0;var r=Le.__H||(Le.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Qs}),r.__[t]}function J0(t){return yi=1,Z0(Y0,t)}function Z0(t,e,r){var n=An(Mr++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):Y0(void 0,e),function(a){var u=n.__N?n.__N[0]:n.__[0],l=n.t(u,a);u!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Le,!Le.u)){var i=function(a,u,l){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(m){return m.__c});if(p.every(function(m){return!m.__N}))return!s||s.call(this,a,u,l);var g=!1;return p.forEach(function(m){if(m.__N){var C=m.__[0];m.__=m.__N,m.__N=void 0,C!==m.__[0]&&(g=!0)}}),!(!g&&n.__c.props===a)&&(!s||s.call(this,a,u,l))};Le.u=!0;var s=Le.shouldComponentUpdate,o=Le.componentWillUpdate;Le.componentWillUpdate=function(a,u,l){if(this.__e){var p=s;s=void 0,i(a,u,l),s=p}o&&o.call(this,a,u,l)},Le.shouldComponentUpdate=i}return n.__N||n.__}function Rx(t,e){var r=An(Mr++,3);!be.__s&&Kc(r.__H,e)&&(r.__=t,r.i=e,Le.__H.__h.push(r))}function Q0(t,e){var r=An(Mr++,4);!be.__s&&Kc(r.__H,e)&&(r.__=t,r.i=e,Le.__h.push(r))}function Ax(t){return yi=5,Yc(function(){return{current:t}},[])}function Tx(t,e,r){yi=6,Q0(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Yc(t,e){var r=An(Mr++,7);return Kc(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function kx(t,e){return yi=8,Yc(function(){return t},e)}function Ox(t){var e=Le.context[t.__c],r=An(Mr++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Le)),e.props.value):t.__}function Nx(t,e){be.useDebugValue&&be.useDebugValue(e?e(t):t)}function Lx(t){var e=An(Mr++,10),r=J0();return e.__=t,Le.componentDidCatch||(Le.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Bx(){var t=An(Mr++,11);if(!t.__){for(var e=Le.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function Px(){for(var t;t=G0.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ys),t.__H.__h.forEach(Gu),t.__H.__h=[]}catch(e){t.__H.__h=[],be.__e(e,t.__v)}}be.__b=function(t){Le=null,wh&&wh(t)},be.__r=function(t){_h&&_h(t),Mr=0;var e=(Le=t.__c).__H;e&&(lu===Le?(e.__h=[],Le.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Qs,r.__N=r.i=void 0})):(e.__h.forEach(Ys),e.__h.forEach(Gu),e.__h=[],Mr=0)),lu=Le},be.diffed=function(t){Sh&&Sh(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(G0.push(e)!==1&&mh===be.requestAnimationFrame||((mh=be.requestAnimationFrame)||$x)(Px)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Qs&&(r.__=r.__V),r.i=void 0,r.__V=Qs})),lu=Le=null},be.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Ys),r.__h=r.__h.filter(function(n){return!n.__||Gu(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],be.__e(n,r.__v)}}),Eh&&Eh(t,e)},be.unmount=function(t){xh&&xh(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ys(n)}catch(i){e=i}}),r.__H=void 0,e&&be.__e(e,r.__v))};var Mh=typeof requestAnimationFrame=="function";function $x(t){var e,r=function(){clearTimeout(n),Mh&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);Mh&&(e=requestAnimationFrame(r))}function Ys(t){var e=Le,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Le=e}function Gu(t){var e=Le;t.__c=t.__(),Le=e}function Kc(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Y0(t,e){return typeof e=="function"?e(t):e}const Dx=Object.freeze(Object.defineProperty({__proto__:null,useCallback:kx,useContext:Ox,useDebugValue:Nx,useEffect:Rx,useErrorBoundary:Lx,useId:Bx,useImperativeHandle:Tx,useLayoutEffect:Q0,useMemo:Yc,useReducer:Z0,useRef:Ax,useState:J0},Symbol.toStringTag,{value:"Module"})),Rs=mi(Dx);var pr={},ra={};Object.defineProperty(ra,"__esModule",{value:!0});ra.CloseIcon=void 0;const Ch=Bt;function Fx(t){return(0,Ch.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ch.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"}))}ra.CloseIcon=Fx;var Xc={};Object.defineProperty(Xc,"__esModule",{value:!0});Xc.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var el={};Object.defineProperty(el,"__esModule",{value:!0});el.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var na={};Object.defineProperty(na,"__esModule",{value:!0});na.QRCodeIcon=void 0;const sr=Bt;function jx(t){return(0,sr.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,sr.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,sr.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,sr.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,sr.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,sr.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,sr.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,sr.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,sr.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,sr.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}na.QRCodeIcon=jx;var tl={};Object.defineProperty(tl,"__esModule",{value:!0});const Ux=`
|
|
17
|
-
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
-
<path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>
|
|
19
|
-
<path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>
|
|
20
|
-
<path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>
|
|
21
|
-
</svg>
|
|
22
|
-
`;tl.default=Ux;var rl={};Object.defineProperty(rl,"__esModule",{value:!0});rl.default=`
|
|
23
|
-
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
24
|
-
<circle cx="50" cy="50" r="50" fill="white"/>
|
|
25
|
-
<circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
|
|
26
|
-
<circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
|
|
27
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>
|
|
28
|
-
</svg>
|
|
29
|
-
`;var ia={};Object.defineProperty(ia,"__esModule",{value:!0});ia.StatusDotIcon=void 0;const Ih=Bt;function Wx(t){return(0,Ih.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ih.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}ia.StatusDotIcon=Wx;var sa={};function K0(t){this.mode=Ot.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);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))}K0.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}};function gr(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}gr.prototype={addData:function(t){var e=new K0(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){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(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=gr.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+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[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=et.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var u=a*i,l=this.modules[s][a];l&&(n.beginFill(0,100),n.moveTo(u,o),n.lineTo(u+i,o),n.lineTo(u+i,o+i),n.lineTo(u,o+i),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=et.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[n+s][i+o]=!0:this.modules[n+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=et.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>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=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=et.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(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=!t&&(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]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var u=!1;s<t.length&&(u=(t[s]>>>i&1)==1);var l=et.getMask(e,n,o-a);l&&(u=!u),this.modules[n][o-a]=u,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};gr.PAD0=236;gr.PAD1=17;gr.createData=function(t,e,r){for(var n=fr.getRSBlocks(t,e),i=new X0,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),et.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(gr.PAD0,8),i.getLengthInBits()>=a*8));)i.put(gr.PAD1,8);return gr.createBytes(i,n)};gr.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var u=e[a].dataCount,l=e[a].totalCount-u;n=Math.max(n,u),i=Math.max(i,l),s[a]=new Array(u);for(var p=0;p<s[a].length;p++)s[a][p]=255&t.buffer[p+r];r+=u;var g=et.getErrorCorrectPolynomial(l),m=new ri(s[a],g.getLength()-1),C=m.mod(g);o[a]=new Array(g.getLength()-1);for(var p=0;p<o[a].length;p++){var T=p+C.getLength()-o[a].length;o[a][p]=T>=0?C.get(T):0}}for(var P=0,p=0;p<e.length;p++)P+=e[p].totalCount;for(var U=new Array(P),M=0,p=0;p<n;p++)for(var a=0;a<e.length;a++)p<s[a].length&&(U[M++]=s[a][p]);for(var p=0;p<i;p++)for(var a=0;a<e.length;a++)p<o[a].length&&(U[M++]=o[a][p]);return U};var Ot={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Lr={L:1,M:0,Q:3,H:2},Ir={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},et={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(t){for(var e=t<<10;et.getBCHDigit(e)-et.getBCHDigit(et.G15)>=0;)e^=et.G15<<et.getBCHDigit(e)-et.getBCHDigit(et.G15);return(t<<10|e)^et.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;et.getBCHDigit(e)-et.getBCHDigit(et.G18)>=0;)e^=et.G18<<et.getBCHDigit(e)-et.getBCHDigit(et.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return et.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Ir.PATTERN000:return(e+r)%2==0;case Ir.PATTERN001:return e%2==0;case Ir.PATTERN010:return r%3==0;case Ir.PATTERN011:return(e+r)%3==0;case Ir.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Ir.PATTERN101:return e*r%2+e*r%3==0;case Ir.PATTERN110:return(e*r%2+e*r%3)%2==0;case Ir.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new ri([1],0),r=0;r<t;r++)e=e.multiply(new ri([1,yt.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Ot.MODE_NUMBER:return 10;case Ot.MODE_ALPHA_NUM:return 9;case Ot.MODE_8BIT_BYTE:return 8;case Ot.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Ot.MODE_NUMBER:return 12;case Ot.MODE_ALPHA_NUM:return 11;case Ot.MODE_8BIT_BYTE:return 16;case Ot.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Ot.MODE_NUMBER:return 14;case Ot.MODE_ALPHA_NUM:return 13;case Ot.MODE_8BIT_BYTE:return 16;case Ot.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||a==0&&u==0||o==t.isDark(n+a,i+u)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var l=0;t.isDark(n,i)&&l++,t.isDark(n+1,i)&&l++,t.isDark(n,i+1)&&l++,t.isDark(n+1,i+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var p=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&p++;var g=Math.abs(100*p/e/e-50)/5;return r+=g*10,r}},yt={glog:function(t){if(t<1)throw new Error("glog("+t+")");return yt.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return yt.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var mt=0;mt<8;mt++)yt.EXP_TABLE[mt]=1<<mt;for(var mt=8;mt<256;mt++)yt.EXP_TABLE[mt]=yt.EXP_TABLE[mt-4]^yt.EXP_TABLE[mt-5]^yt.EXP_TABLE[mt-6]^yt.EXP_TABLE[mt-8];for(var mt=0;mt<255;mt++)yt.LOG_TABLE[yt.EXP_TABLE[mt]]=mt;function ri(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}ri.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=yt.gexp(yt.glog(this.get(r))+yt.glog(t.get(n)));return new ri(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=yt.glog(this.get(0))-yt.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=yt.gexp(yt.glog(t.get(n))+e);return new ri(r,0).mod(t)}};function fr(t,e){this.totalCount=t,this.dataCount=e}fr.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]];fr.getRSBlocks=function(t,e){var r=fr.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var o=r[s*3+0],a=r[s*3+1],u=r[s*3+2],l=0;l<o;l++)i.push(new fr(a,u));return i};fr.getRsBlockTable=function(t,e){switch(e){case Lr.L:return fr.RS_BLOCK_TABLE[(t-1)*4+0];case Lr.M:return fr.RS_BLOCK_TABLE[(t-1)*4+1];case Lr.Q:return fr.RS_BLOCK_TABLE[(t-1)*4+2];case Lr.H:return fr.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function X0(){this.buffer=[],this.length=0}X0.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var fu=[[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 eg(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];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(u){switch(u){case"L":return Lr.L;case"M":return Lr.M;case"Q":return Lr.Q;case"H":return Lr.H;default:throw new Error("Unknwon error correction level: "+u)}}function n(u,l){for(var p=i(u),g=1,m=0,C=0,T=fu.length;C<=T;C++){var P=fu[C];if(!P)throw new Error("Content too long: expected "+m+" but got "+p);switch(l){case"L":m=P[0];break;case"M":m=P[1];break;case"Q":m=P[2];break;case"H":m=P[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(p<=m)break;g++}if(g>fu.length)throw new Error("Content too long");return g}function i(u){var l=encodeURI(u).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=u?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new gr(o,a),this.qrcode.addData(s),this.qrcode.make()}eg.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r
|
|
30
|
-
`:"",o=e.width,a=e.height,u=r.length,l=o/(u+2*e.padding),p=a/(u+2*e.padding),g=typeof e.join<"u"?!!e.join:!1,m=typeof e.swap<"u"?!!e.swap:!1,C=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,T=typeof e.predefined<"u"?!!e.predefined:!1,P=T?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+l+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",U=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,M="",O="",D=0;D<u;D++)for(var W=0;W<u;W++){var j=r[W][D];if(j){var z=W*l+e.padding*l,K=D*p+e.padding*p;if(m){var X=z;z=K,K=X}if(g){var G=l+z,re=p+K;z=Number.isInteger(z)?Number(z):z.toFixed(2),K=Number.isInteger(K)?Number(K):K.toFixed(2),G=Number.isInteger(G)?Number(G):G.toFixed(2),re=Number.isInteger(re)?Number(re):re.toFixed(2),O+="M"+z+","+K+" V"+re+" H"+G+" V"+K+" H"+z+" Z "}else T?M+=i+'<use x="'+z.toString()+'" y="'+K.toString()+'" href="#qrmodule" />'+s:M+=i+'<rect x="'+z.toString()+'" y="'+K.toString()+'" width="'+l+'" height="'+p+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}g&&(M=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+O+'" />');let ie="";if(this.options.image!==void 0&&this.options.image.svg){const w=o*this.options.image.width/100,c=a*this.options.image.height/100,y=o/2-w/2,v=a/2-c/2;ie+=`<svg x="${y}" y="${v}" width="${w}" height="${c}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,ie+=this.options.image.svg+s,ie+="</svg>"}var oe="";switch(t.container){case"svg":C&&(oe+='<?xml version="1.0" standalone="yes"?>'+s),oe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,oe+=P+U+M,oe+=ie,oe+="</svg>";break;case"svg-viewbox":C&&(oe+='<?xml version="1.0" standalone="yes"?>'+s),oe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,oe+=P+U+M,oe+=ie,oe+="</svg>";break;case"g":oe+='<g width="'+o+'" height="'+a+'">'+s,oe+=P+U+M,oe+=ie,oe+="</g>";break;default:oe+=(P+U+M+ie).replace(/^\s+/,"");break}return oe};var Hx=eg,Vx=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sa,"__esModule",{value:!0});sa.QRCode=void 0;const zx=Bt,Rh=Rs,qx=Vx(Hx),Gx=t=>{const[e,r]=(0,Rh.useState)("");return(0,Rh.useEffect)(()=>{var n,i;const s=new qx.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,zx.h)("img",{src:e,alt:"QR Code"}):null};sa.QRCode=Gx;var oa={},nl={};Object.defineProperty(nl,"__esModule",{value:!0});nl.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 Jx=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oa,"__esModule",{value:!0});oa.Spinner=void 0;const Ws=Bt,Zx=Jx(nl),Qx=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,Ws.h)("div",{class:"-cbwsdk-spinner"},(0,Ws.h)("style",null,Zx.default),(0,Ws.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Ws.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};oa.Spinner=Qx;var il={};Object.defineProperty(il,"__esModule",{value:!0});il.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}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-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 Oi=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.CoinbaseAppSteps=pr.CoinbaseWalletSteps=pr.ConnectItem=pr.ConnectContent=void 0;const Ht=Oi(bo),le=Bt,Ah=Rs,Yx=ne,Kx=_i,Xx=ra,e5=Oi(Xc),t5=Oi(el),tg=na,r5=Oi(tl),n5=Oi(rl),i5=ia,s5=sa,o5=oa,a5=Oi(il),Th={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:t5.default,steps:ng},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:e5.default,steps:ig}},u5=t=>{switch(t){case"coinbase-app":return r5.default;case"coinbase-wallet-app":default:return n5.default}},Ju=t=>t==="light"?"#FFFFFF":"#0A0B0D";function c5(t){const{theme:e}=t,[r,n]=(0,Ah.useState)("coinbase-wallet-app"),i=(0,Ah.useCallback)(l=>{n(l)},[]),s=(0,Yx.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=Th[r];if(!r)return null;const a=o.steps,u=r==="coinbase-app";return(0,le.h)("div",{"data-testid":"connect-content",class:(0,Ht.default)("-cbwsdk-connect-content",e)},(0,le.h)("style",null,a5.default),(0,le.h)("div",{class:"-cbwsdk-connect-content-header"},(0,le.h)("h2",{class:(0,Ht.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,le.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,le.h)(Xx.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,le.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,le.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,le.h)("div",null,Object.entries(Th).map(([l,p])=>(0,le.h)(rg,{key:l,title:p.title,description:p.description,icon:p.icon,selected:r===l,onClick:()=>i(l),theme:e}))),u&&(0,le.h)("div",{class:(0,Ht.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,le.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,le.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,le.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,le.h)(s5.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:u5(r),width:25,height:25}}),(0,le.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Kx.LIB_VERSION}),(0,le.h)("input",{type:"hidden",value:s})),(0,le.h)(a,{theme:e}),!t.isConnected&&(0,le.h)("div",{"data-testid":"connecting-spinner",class:(0,Ht.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,le.h)(o5.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,le.h)("p",null,"Connecting...")))))}pr.ConnectContent=c5;function rg({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,le.h)("div",{onClick:s,class:(0,Ht.default)("-cbwsdk-connect-item",i,{selected:n})},(0,le.h)("div",null,(0,le.h)("img",{src:r,alt:t})),(0,le.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,le.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,le.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}pr.ConnectItem=rg;function ng({theme:t}){return(0,le.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,le.h)("span",null,"Tap ",(0,le.h)("strong",null,"Scan")," "),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(tg.QRCodeIcon,{fill:Ju(t)})))))}pr.CoinbaseWalletSteps=ng;function ig({theme:t}){return(0,le.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,le.h)("span",null,"Tap ",(0,le.h)("strong",null,"More")),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(i5.StatusDotIcon,{fill:Ju(t)})),(0,le.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,le.h)("strong",null,"Scan")),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(tg.QRCodeIcon,{fill:Ju(t)})))))}pr.CoinbaseAppSteps=ig;var aa={},ua={};Object.defineProperty(ua,"__esModule",{value:!0});ua.ArrowLeftIcon=void 0;const kh=Bt;function l5(t){return(0,kh.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,kh.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"}))}ua.ArrowLeftIcon=l5;var ca={};Object.defineProperty(ca,"__esModule",{value:!0});ca.LaptopIcon=void 0;const hu=Bt;function f5(t){return(0,hu.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,hu.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,hu.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"}))}ca.LaptopIcon=f5;var la={};Object.defineProperty(la,"__esModule",{value:!0});la.SafeIcon=void 0;const Oh=Bt;function h5(t){return(0,Oh.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Oh.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"}))}la.SafeIcon=h5;var sl={};Object.defineProperty(sl,"__esModule",{value:!0});sl.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 sg=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(aa,"__esModule",{value:!0});aa.TryExtensionContent=void 0;const rn=sg(bo),at=Bt,du=Rs,d5=ua,p5=ca,g5=la,y5=sg(sl);function b5({theme:t}){const[e,r]=(0,du.useState)(!1),n=(0,du.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,du.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,at.h)("div",{class:(0,rn.default)("-cbwsdk-try-extension",t)},(0,at.h)("style",null,y5.default),(0,at.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,at.h)("h3",{class:(0,rn.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,at.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,at.h)("button",{class:(0,rn.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,at.h)("div",null,!e&&(0,at.h)(d5.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,at.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,at.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,at.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,at.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,at.h)("span",{class:(0,rn.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,at.h)(p5.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,at.h)("div",{class:(0,rn.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,at.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,at.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,at.h)("span",{class:(0,rn.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,at.h)(g5.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,at.h)("div",{class:(0,rn.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}aa.TryExtensionContent=b5;var ol={};Object.defineProperty(ol,"__esModule",{value:!0});ol.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 og=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ta,"__esModule",{value:!0});ta.ConnectDialog=void 0;const pu=og(bo),nn=Bt,gu=Rs,v5=pr,m5=aa,w5=og(ol),_5=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,gu.useState)(!e),[s,o]=(0,gu.useState)(!e);(0,gu.useEffect)(()=>{const u=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):u.push(window.setTimeout(()=>{i(!0)},360)),()=>{u.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,nn.h)("div",{class:(0,pu.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,nn.h)("style",null,w5.default),(0,nn.h)("div",{class:(0,pu.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,nn.h)("div",{class:"-cbwsdk-connect-dialog"},(0,nn.h)("div",{class:(0,pu.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,nn.h)(v5.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,nn.h)(m5.TryExtensionContent,{theme:a}))))};ta.ConnectDialog=_5;Object.defineProperty(Yo,"__esModule",{value:!0});Yo.LinkFlow=void 0;const yu=Bt,Nh=ea,S5=ta;class E5{constructor(e){this.extensionUI$=new Nh.BehaviorSubject({}),this.subscriptions=new Nh.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,yu.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,yu.render)((0,yu.h)(S5.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}Yo.LinkFlow=E5;var ag={},al={};Object.defineProperty(al,"__esModule",{value:!0});al.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(t){var e=te&&te.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(bo),n=Bt,i=Rs,s=e(al),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(g){switch(g){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class u{constructor(m){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=m.darkMode}attach(m){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",m.appendChild(this.root),this.render()}presentItem(m){const C=this.nextItemKey++;return this.items.set(C,m),this.render(),()=>{this.items.delete(C),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([m,C])=>(0,n.h)(t.SnackbarInstance,Object.assign({},C,{key:m}))))),this.root)}}t.Snackbar=u;const l=g=>(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"},g.children));t.SnackbarContainer=l;const p=({autoExpand:g,message:m,menuItems:C,appSrc:T})=>{const[P,U]=(0,i.useState)(!0),[M,O]=(0,i.useState)(g??!1);(0,i.useEffect)(()=>{const W=[window.setTimeout(()=>{U(!1)},1),window.setTimeout(()=>{O(!0)},1e4)];return()=>{W.forEach(window.clearTimeout)}});const D=()=>{O(!M)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",P&&"-cbwsdk-snackbar-instance-hidden",M&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:D},(0,n.h)("img",{src:a(T),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},m),(0,n.h)("div",{class:"-gear-container"},!M&&(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"}))),C&&C.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},C.map((W,j)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",W.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:W.onClick,key:j},(0,n.h)("svg",{width:W.svgWidth,height:W.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":W.defaultFillRule,"clip-rule":W.defaultClipRule,d:W.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",W.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},W.info)))))};t.SnackbarInstance=p})(ag);var fa={},ul={};Object.defineProperty(ul,"__esModule",{value:!0});ul.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 x5=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fa,"__esModule",{value:!0});fa.injectCssReset=void 0;const M5=x5(ul);function C5(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(M5.default)),document.documentElement.appendChild(t)}fa.injectCssReset=C5;Object.defineProperty(Qo,"__esModule",{value:!0});Qo.WalletSDKUI=void 0;const I5=Yo,R5=ag,A5=fa;class T5{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new R5.Snackbar({darkMode:e.darkMode}),this.linkFlow=new I5.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,A5.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,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:e.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,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:e.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:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Qo.WalletSDKUI=T5;var ha={},da={};Object.defineProperty(da,"__esModule",{value:!0});var Zn;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Zn||(Zn={}));function ug(t,e,r){if(!r||typeof r.value!==Zn.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Zn.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:Zn.boolTrue,writable:Zn.boolTrue}),n}}}da.bind=ug;da.default=ug;function cg(t){return function(r){return r.lift(new k5(t))}}var k5=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new O5(e,this.durationSelector))},t}(),O5=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(o){return this.destination.error(o)}var s=st(n,new nt(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,s=r.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(it);function N5(t,e){return e===void 0&&(e=Rt),cg(function(){return V0(t,e)})}function L5(t){return function(r){return r.lift(new B5(t))}}var B5=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new P5(e,this.closingNotifier))},t}(),P5=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(st(n,new nt(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(it);function $5(t,e){return e===void 0&&(e=null),function(n){return n.lift(new D5(t,e))}}var D5=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=F5:this.subscriberClass=j5}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),F5=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(se),j5=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.bufferSize=n,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(r){var n=this,i=n.bufferSize,s=n.startBufferEvery,o=n.buffers,a=n.count;this.count++,a%s===0&&o.push([]);for(var u=o.length;u--;){var l=o[u];l.push(r),l.length===i&&(o.splice(u,1),this.destination.next(l))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var s=n.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(se);function U5(t){var e=arguments.length,r=Rt;Lt(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new W5(t,n,i,r))}}var W5=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new V5(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),H5=function(){function t(){this.buffer=[]}return t}(),V5=function(t){J(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var u=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var l={subscriber:a,context:u,bufferTimeSpan:n};a.add(u.closeAction=o.schedule(Lh,n,l))}else{var p={subscriber:a,context:u},g={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(u.closeAction=o.schedule(lg,n,p)),a.add(o.schedule(z5,i,g))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s,o=0;o<i;o++){var a=n[o],u=a.buffer;u.push(r),u.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(r){this.contexts.length=0,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var s=n.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(Lh,i,s))}},e.prototype.openContext=function(){var r=new H5;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(se);function Lh(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function z5(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,s=n.openContext(),o=this;n.closed||(n.add(s.closeAction=i.schedule(lg,r,{subscriber:n,context:s})),o.schedule(t,e))}function lg(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function q5(t,e){return function(n){return n.lift(new G5(t,e))}}var G5=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new J5(e,this.openings,this.closingSelector))},t}(),J5=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(xr(s,n)),s}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s=0;s<i;s++)n[s].buffer.push(r)},e.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,s=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],s=new rt,o={buffer:i,subscription:s};n.push(o);var a=xr(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Rn);function Z5(t){return function(e){return e.lift(new Q5(t))}}var Q5=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Y5(e,this.closingSelector))},t}(),Y5=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}r=new rt,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(st(i,new nt(this))),this.subscribing=!1},e}(it);function K5(t){return function(r){var n=new X5(t),i=r.lift(n);return n.caught=i}}var X5=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new eM(e,this.selector,this.caught))},t}(),eM=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.selector=n,s.caught=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new nt(this);this.add(i);var s=st(n,i);s!==i&&this.add(s)}},e}(it);function tM(t){return function(e){return e.lift(new Jc(t))}}function rM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&It(t[0])&&(t=t[0].slice()),function(n){return n.lift.call(Cr([n].concat(t)),new Jc(r))}}function nM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(ts.apply(void 0,[r].concat(t)))}}function fg(t,e){return mn(t,e,1)}function iM(t,e){return fg(function(){return t},e)}function sM(t){return function(e){return e.lift(new oM(t,e))}}var oM=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new aM(e,this.predicate,this.source))},t}(),aM=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},e.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(se);function uM(t){return function(e){return e.lift(new cM(t))}}var cM=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new lM(e,this.durationSelector))},t}(),lM=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=st(n,new nt(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,r)}},e}(it);function fM(t,e){return e===void 0&&(e=Rt),function(r){return r.lift(new hM(t,e))}}var hM=function(){function t(e,r){this.dueTime=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new dM(e,this.dueTime,this.scheduler))},t}(),dM=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.dueTime=n,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(pM,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},e.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},e}(se);function pM(t){t.debouncedNext()}function As(t){return t===void 0&&(t=null),function(e){return e.lift(new gM(t))}}var gM=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,r){return r.subscribe(new yM(e,this.defaultValue))},t}(),yM=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return e.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(se);function hg(t){return t instanceof Date&&!isNaN(+t)}function bM(t,e){e===void 0&&(e=Rt);var r=hg(t),n=r?+t-e.now():Math.abs(t);return function(i){return i.lift(new vM(n,e))}}var vM=function(){function t(e,r){this.delay=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new mM(e,this.delay,this.scheduler))},t}(),mM=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.delay=n,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(r){for(var n=r.source,i=n.queue,s=r.scheduler,o=r.destination;i.length>0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new wM(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(Sr.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(Sr.createComplete()),this.unsubscribe()},e}(se),wM=function(){function t(e,r){this.time=e,this.notification=r}return t}();function _M(t,e){return e?function(r){return new EM(r,e).lift(new Bh(t))}:function(r){return r.lift(new Bh(t))}}var Bh=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new SM(e,this.delayDurationSelector))},t}(),SM=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(r),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=xr(this,r,n);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(Rn),EM=function(t){J(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new xM(r,this.source))},e}(me),xM=function(t){J(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(se);function MM(){return function(e){return e.lift(new CM)}}var CM=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new IM(e))},t}(),IM=function(t){J(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(se);function RM(t,e){return function(r){return r.lift(new AM(t,e))}}var AM=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new TM(e,this.keySelector,this.flushes))},t}(),TM=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=n,s.values=new Set,i&&s.add(st(i,new nt(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(s){i.error(s);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(it);function dg(t,e){return function(r){return r.lift(new kM(t,e))}}var kM=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new OM(e,this.compare,this.keySelector))},t}(),OM=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=i,s.hasKey=!1,typeof n=="function"&&(s.compare=n),s}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=n,this.destination.next(r))},e}(se);function NM(t,e){return dg(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function pa(t){return t===void 0&&(t=PM),function(e){return e.lift(new LM(t))}}var LM=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new BM(e,this.errorFactory))},t}(),BM=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(se);function PM(){return new Is}function cl(t){return function(e){return t===0?Ti():e.lift(new $M(t))}}var $M=function(){function t(e){if(this.total=e,this.total<0)throw new pi}return t.prototype.call=function(e,r){return r.subscribe(new DM(e,this.total))},t}(),DM=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(se);function FM(t,e){if(t<0)throw new pi;var r=arguments.length>=2;return function(n){return n.pipe(Fr(function(i,s){return s===t}),cl(1),r?As(e):pa(function(){return new pi}))}}function jM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return ts(r,Xo.apply(void 0,t))}}function UM(t,e){return function(r){return r.lift(new WM(t,e,r))}}var WM=function(){function t(e,r,n){this.predicate=e,this.thisArg=r,this.source=n}return t.prototype.call=function(e,r){return r.subscribe(new HM(e,this.predicate,this.thisArg,this.source))},t}(),HM=function(t){J(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},e.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(se);function VM(){return function(t){return t.lift(new zM)}}var zM=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new qM(e))},t}(),qM=function(t){J(e,t);function e(r){var n=t.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return e.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(st(r,new nt(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(it);function pg(t,e){return e?function(r){return r.pipe(pg(function(n,i){return Cr(t(n,i)).pipe(Gt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new GM(t))}}var GM=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new JM(e,this.project))},t}(),JM=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},e.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new nt(this),i=this.destination;i.add(n);var s=st(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(it);function ZM(t,e,r){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new QM(t,e,r))}}var QM=function(){function t(e,r,n){this.project=e,this.concurrent=r,this.scheduler=n}return t.prototype.call=function(e,r){return r.subscribe(new YM(e,this.project,this.concurrent,this.scheduler))},t}(),YM=function(t){J(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.project=n,o.concurrent=i,o.scheduler=s,o.index=0,o.active=0,o.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.dispatch=function(r){var n=r.subscriber,i=r.result,s=r.value,o=r.index;n.subscribeToProjection(i,s,o)},e.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var s=this.project,o=s(r,i);if(!this.scheduler)this.subscribeToProjection(o,r,i);else{var a={subscriber:this,result:o,value:r,index:i},u=this.destination;u.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(l){n.error(l)}}else this.buffer.push(r)},e.prototype.subscribeToProjection=function(r,n,i){this.active++;var s=this.destination;s.add(st(r,new nt(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this._next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(it);function KM(t){return function(e){return e.lift(new XM(t))}}var XM=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new eC(e,this.callback))},t}(),eC=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new rt(n)),i}return e}(se);function tC(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new gg(t,r,!1,e))}}var gg=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new rC(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),rC=function(t){J(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,s=n.thisArg,o=this.index++;try{var a=i.call(s||this,r,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:r)}catch(u){this.destination.error(u)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(se);function nC(t,e){return function(r){return r.lift(new gg(t,r,!0,e))}}function iC(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Fr(function(i,s){return t(i,s,n)}):$r,cl(1),r?As(e):pa(function(){return new Is}))}}function sC(){return function(e){return e.lift(new oC)}}var oC=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new aC(e))},t}(),aC=function(t){J(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(se);function uC(){return function(t){return t.lift(new cC)}}var cC=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new lC(e))},t}(),lC=function(t){J(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(se);function ho(t){return function(r){return t===0?Ti():r.lift(new fC(t))}}var fC=function(){function t(e){if(this.total=e,this.total<0)throw new pi}return t.prototype.call=function(e,r){return r.subscribe(new hC(e,this.total))},t}(),hC=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,s=this.count++;if(n.length<i)n.push(r);else{var o=s%i;n[o]=r}},e.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=n++%i;r.next(s[a])}r.complete()},e}(se);function dC(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Fr(function(i,s){return t(i,s,n)}):$r,ho(1),r?As(e):pa(function(){return new Is}))}}function pC(t){return function(e){return e.lift(new gC(t))}}var gC=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new yC(e,this.value))},t}(),yC=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(se);function bC(){return function(e){return e.lift(new vC)}}var vC=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new mC(e))},t}(),mC=function(t){J(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(Sr.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(Sr.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(Sr.createComplete()),r.complete()},e}(se);function po(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new wC(t,e,r))}}var wC=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new _C(e,this.accumulator,this.seed,this.hasSeed))},t}(),_C=function(t){J(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(se);function ga(t,e){return arguments.length>=2?function(n){return Uu(po(t,e),ho(1),As(e))(n)}:function(n){return Uu(po(function(i,s,o){return t(i,s,o+1)}),ho(1))(n)}}function SC(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return ga(e)}function EC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(j0.apply(void 0,[r].concat(t)))}}function xC(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?mn(function(){return t},e,r):(typeof e=="number"&&(r=e),mn(function(){return t},r))}function MC(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new CC(t,e,r))}}var CC=function(){function t(e,r,n){this.accumulator=e,this.seed=r,this.concurrent=n}return t.prototype.call=function(e,r){return r.subscribe(new IC(e,this.accumulator,this.seed,this.concurrent))},t}(),IC=function(t){J(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o.acc=i,o.concurrent=s,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,r,n)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(r)},e.prototype._innerSub=function(r){var n=new nt(this),i=this.destination;i.add(n);var s=st(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(it);function RC(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r<n?r:n};return ga(e)}function wn(t,e){return function(n){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return n.lift(new AC(i,e));var s=Object.create(n,a4);return s.source=n,s.subjectFactory=i,s}}var AC=function(){function t(e,r){this.subjectFactory=e,this.selector=r}return t.prototype.call=function(e,r){var n=this.selector,i=this.subjectFactory(),s=n(i).subscribe(e);return s.add(r.subscribe(i)),s},t}();function TC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&It(t[0])&&(t=t[0]),function(r){return r.lift(new kC(t))}}var kC=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,r){return r.subscribe(new OC(e,this.nextSources))},t}(),OC=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new nt(this),i=this.destination;i.add(n);var s=st(r,n);s!==n&&i.add(s)}else this.destination.complete()},e}(it);function NC(){return function(t){return t.lift(new LC)}}var LC=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new BC(e))},t}(),BC=function(t){J(e,t);function e(r){var n=t.call(this,r)||this;return n.hasPrev=!1,n}return e.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},e}(se);function PC(t,e){return function(r){return[Fr(t,e)(r),Fr(W0(t,e))(r)]}}function $C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return Gt(DC(t,r))(n)}}function DC(t,e){var r=function(n){for(var i=n,s=0;s<e;s++){var o=i!=null?i[t[s]]:void 0;if(o!==void 0)i=o;else return}return i};return r}function FC(t){return t?wn(function(){return new bt},t):wn(new bt)}function jC(t){return function(e){return wn(new _0(t))(e)}}function UC(){return function(t){return wn(new ki)(t)}}function WC(t,e,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,s=new Gc(t,e,n);return function(o){return wn(function(){return s},i)(o)}}function HC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return t.length===1&&It(t[0])&&(t=t[0]),n.lift.call(H0.apply(void 0,[n].concat(t)))}}function VC(t){return t===void 0&&(t=-1),function(e){return t===0?Ti():t<0?e.lift(new Ph(-1,e)):e.lift(new Ph(t-1,e))}}var Ph=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new zC(e,this.count,this.source))},t}(),zC=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(se);function qC(t){return function(e){return e.lift(new GC(t))}}var GC=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new JC(e,this.notifier,r))},t}(),JC=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new bt;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=st(r,new nt(this))},e}(it);function ZC(t){return t===void 0&&(t=-1),function(e){return e.lift(new QC(t,e))}}var QC=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new YC(e,this.count,this.source))},t}(),YC=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,s=n.count;if(s===0)return t.prototype.error.call(this,r);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(se);function KC(t){return function(e){return e.lift(new XC(t,e))}}var XC=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new eI(e,this.notifier,this.source))},t}(),eI=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new bt;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=st(i,new nt(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(it);function tI(t){return function(e){return e.lift(new rI(t))}}var rI=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new nI(e),i=r.subscribe(n);return i.add(st(this.notifier,new nt(n))),i},t}(),nI=function(t){J(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(it);function iI(t,e){return e===void 0&&(e=Rt),function(r){return r.lift(new sI(t,e))}}var sI=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new oI(e,this.period,this.scheduler))},t}(),oI=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.period=n,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(aI,n,{subscriber:s,period:n})),s}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(se);function aI(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function uI(t,e){return function(r){return r.lift(new cI(t,e))}}var cI=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new lI(e,this.compareTo,this.comparator))},t}(),lI=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.compareTo=n,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(n.subscribe(new fI(r,s))),s}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,s=r.comparator;n.length>0&&i.length>0;){var o=n.shift(),a=i.shift(),u=!1;try{u=s?s(o,a):o===a}catch(l){this.destination.error(l)}u||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(se),fI=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(se);function hI(){return new bt}function dI(){return function(t){return Vc()(wn(hI)(t))}}function pI(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(gI(n))}}function gI(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,s=t.refCount,o=t.scheduler,a,u=0,l,p=!1,g=!1;return function(C){u++;var T;!a||p?(p=!1,a=new Gc(r,i,o),T=a.subscribe(this),l=C.subscribe({next:function(P){a.next(P)},error:function(P){p=!0,a.error(P)},complete:function(){g=!0,l=void 0,a.complete()}}),g&&(l=void 0)):T=a.subscribe(this),this.add(function(){u--,T.unsubscribe(),T=void 0,l&&!g&&s&&u===0&&(l.unsubscribe(),l=void 0,a=void 0)})}}function yI(t){return function(e){return e.lift(new bI(t,e))}}var bI=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new vI(e,this.predicate,this.source))},t}(),vI=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new Is)},e}(se);function mI(t){return function(e){return e.lift(new wI(t))}}var wI=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new _I(e,this.total))},t}(),_I=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(se);function SI(t){return function(e){return e.lift(new EI(t))}}var EI=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new pi}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new se(e)):r.subscribe(new xI(e,this._skipCount))},t}(),xI=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i<n)this._ring[i]=r;else{var s=i%n,o=this._ring,a=o[s];o[s]=r,this.destination.next(a)}},e}(se);function MI(t){return function(e){return e.lift(new CI(t))}}var CI=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new II(e,this.notifier))},t}(),II=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;i.hasValue=!1;var s=new nt(i);i.add(s),i.innerSubscription=s;var o=st(n,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(r){this.hasValue&&t.prototype._next.call(this,r)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(it);function RI(t){return function(e){return e.lift(new AI(t))}}var AI=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,r){return r.subscribe(new TI(e,this.predicate))},t}(),TI=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return e.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},e.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=!!n}catch(i){this.destination.error(i)}},e}(se);function kI(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Lt(r)?(t.pop(),function(n){return ts(t,n,r)}):function(n){return ts(t,n)}}var OI=function(t){J(e,t);function e(r,n,i){n===void 0&&(n=0),i===void 0&&(i=Zs);var s=t.call(this)||this;return s.source=r,s.delayTime=n,s.scheduler=i,(!gi(n)||n<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=Zs),s}return e.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=Zs),new e(r,n,i)},e.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},e.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,n,{source:i,subscriber:r})},e}(me);function NI(t,e){return e===void 0&&(e=0),function(n){return n.lift(new LI(t,e))}}var LI=function(){function t(e,r){this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return new OI(r,this.delay,this.scheduler).subscribe(e)},t}();function rs(t,e){return typeof e=="function"?function(r){return r.pipe(rs(function(n,i){return Cr(t(n,i)).pipe(Gt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new BI(t))}}var BI=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new PI(e,this.project))},t}(),PI=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.index=0,i}return e.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this._innerSub(n)},e.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new nt(this),s=this.destination;s.add(i),this.innerSubscription=st(r,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(r){this.destination.next(r)},e}(it);function $I(){return rs($r)}function DI(t,e){return e?rs(function(){return t},e):rs(function(){return t})}function FI(t){return function(e){return e.lift(new jI(t))}}var jI=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new UI(e),i=st(this.notifier,new nt(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},t}(),UI=function(t){J(e,t);function e(r){var n=t.call(this,r)||this;return n.seenValue=!1,n}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(it);function WI(t,e){return e===void 0&&(e=!1),function(r){return r.lift(new HI(t,e))}}var HI=function(){function t(e,r){this.predicate=e,this.inclusive=r}return t.prototype.call=function(e,r){return r.subscribe(new VI(e,this.predicate,this.inclusive))},t}(),VI=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.inclusive=i,s.index=0,s}return e.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(s){n.error(s);return}this.nextOrComplete(r,i)},e.prototype.nextOrComplete=function(r,n){var i=this.destination;n?i.next(r):(this.inclusive&&i.next(r),i.complete())},e}(se);function zI(t,e,r){return function(i){return i.lift(new qI(t,e,r))}}var qI=function(){function t(e,r,n){this.nextOrObserver=e,this.error=r,this.complete=n}return t.prototype.call=function(e,r){return r.subscribe(new GI(e,this.nextOrObserver,this.error,this.complete))},t}(),GI=function(t){J(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o._tapNext=ur,o._tapError=ur,o._tapComplete=ur,o._tapError=i||ur,o._tapComplete=s||ur,hi(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||ur,o._tapError=n.error||ur,o._tapComplete=n.complete||ur),o}return e.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},e.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},e}(se),yg={leading:!0,trailing:!1};function JI(t,e){return e===void 0&&(e=yg),function(r){return r.lift(new ZI(t,!!e.leading,!!e.trailing))}}var ZI=function(){function t(e,r,n){this.durationSelector=e,this.leading=r,this.trailing=n}return t.prototype.call=function(e,r){return r.subscribe(new QI(e,this.durationSelector,this.leading,this.trailing))},t}(),QI=function(t){J(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.destination=r,o.durationSelector=n,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},e.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=st(n,new nt(this)))},e.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},e.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(it);function YI(t,e,r){return e===void 0&&(e=Rt),r===void 0&&(r=yg),function(n){return n.lift(new KI(t,e,r.leading,r.trailing))}}var KI=function(){function t(e,r,n,i){this.duration=e,this.scheduler=r,this.leading=n,this.trailing=i}return t.prototype.call=function(e,r){return r.subscribe(new XI(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),XI=function(t){J(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.duration=n,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(e6,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},e}(se);function e6(t){var e=t.subscriber;e.clearThrottle()}function t6(t){return t===void 0&&(t=Rt),function(e){return Qc(function(){return e.pipe(po(function(r,n){var i=r.current;return{value:n,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),Gt(function(r){var n=r.current,i=r.last,s=r.value;return new r6(s,n-i)}))})}}var r6=function(){function t(e,r){this.value=e,this.interval=r}return t}();function bg(t,e,r){return r===void 0&&(r=Rt),function(n){var i=hg(t),s=i?+t-r.now():Math.abs(t);return n.lift(new n6(s,i,e,r))}}var n6=function(){function t(e,r,n,i){this.waitFor=e,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new i6(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),i6=function(t){J(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.absoluteTimeout=n,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(r){var n=r.withObservable;r._unsubscribeAndRecycle(),r.add(st(n,new nt(r)))},e.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,r)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(it);function s6(t,e){return e===void 0&&(e=Rt),bg(t,qc(new T0),e)}function o6(t){return t===void 0&&(t=Rt),Gt(function(e){return new a6(e,t.now())})}var a6=function(){function t(e,r){this.value=e,this.timestamp=r}return t}();function u6(t,e,r){return r===0?[e]:(t.push(e),t)}function c6(){return ga(u6,[])}function l6(t){return function(r){return r.lift(new f6(t))}}var f6=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,r){var n=new h6(e),i=r.subscribe(n);return i.closed||n.add(st(this.windowBoundaries,new nt(n))),i},t}(),h6=function(t){J(e,t);function e(r){var n=t.call(this,r)||this;return n.window=new bt,r.next(n.window),n}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new bt;n.next(i)},e}(it);function d6(t,e){return e===void 0&&(e=0),function(n){return n.lift(new p6(t,e))}}var p6=function(){function t(e,r){this.windowSize=e,this.startWindowEvery=r}return t.prototype.call=function(e,r){return r.subscribe(new g6(e,this.windowSize,this.startWindowEvery))},t}(),g6=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.destination=r,s.windowSize=n,s.startWindowEvery=i,s.windows=[new bt],s.count=0,r.next(s.windows[0]),s}return e.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,u=0;u<a&&!this.closed;u++)o[u].next(r);var l=this.count-s+1;if(l>=0&&l%n===0&&!this.closed&&o.shift().complete(),++this.count%n===0&&!this.closed){var p=new bt;o.push(p),i.next(p)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(se);function y6(t){var e=Rt,r=null,n=Number.POSITIVE_INFINITY;return Lt(arguments[3])&&(e=arguments[3]),Lt(arguments[2])?e=arguments[2]:gi(arguments[2])&&(n=Number(arguments[2])),Lt(arguments[1])?e=arguments[1]:gi(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new b6(t,r,n,e))}}var b6=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new m6(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),v6=function(t){J(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(bt),m6=function(t){J(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var u=a.openWindow();if(i!==null&&i>=0){var l={subscriber:a,window:u,context:null},p={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(vg,n,l)),a.add(o.schedule(_6,i,p))}else{var g={subscriber:a,window:u,windowTimeSpan:n};a.add(o.schedule(w6,n,g))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,s=0;s<i;s++){var o=n[s];o.closed||(o.next(r),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new v6;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(se);function w6(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function _6(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},u={subscriber:r,window:s,context:a};a.subscription=n.schedule(vg,e,u),o.add(a.subscription),o.schedule(t,i)}function vg(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}function S6(t,e){return function(r){return r.lift(new E6(t,e))}}var E6=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new x6(e,this.openings,this.closingSelector))},t}(),x6=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.openings=n,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=xr(s,n,n)),s}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,s=0;s<i;s++)n[s].window.next(r)},e.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,s=-1;++s<i;){var o=n[s];o.window.error(r),o.subscription.unsubscribe()}t.prototype._error.call(this,r)},e.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(r,n,i,s,o){if(r===this.openings){var a=void 0;try{var u=this.closingSelector;a=u(n)}catch(C){return this.error(C)}var l=new bt,p=new rt,g={window:l,subscription:p};this.contexts.push(g);var m=xr(this,a,g);m.closed?this.closeWindow(this.contexts.length-1):(m.context=g,p.add(m)),this.destination.next(l)}else this.closeWindow(this.contexts.indexOf(r))},e.prototype.notifyError=function(r){this.error(r)},e.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},e.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],s=i.window,o=i.subscription;n.splice(r,1),s.complete(),o.unsubscribe()}},e}(Rn);function M6(t){return function(r){return r.lift(new C6(t))}}var C6=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new I6(e,this.closingSelector))},t}(),I6=function(t){J(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return e.prototype.notifyNext=function(r,n,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(r){this.openWindow(r)},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new bt;this.destination.next(i);var s;try{var o=this.closingSelector;s=o()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=xr(this,s))},e}(Rn);function R6(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){var n;typeof t[t.length-1]=="function"&&(n=t.pop());var i=t;return r.lift(new A6(i,n))}}var A6=function(){function t(e,r){this.observables=e,this.project=r}return t.prototype.call=function(e,r){return r.subscribe(new T6(e,this.observables,this.project))},t}(),T6=function(t){J(e,t);function e(r,n,i){var s=t.call(this,r)||this;s.observables=n,s.project=i,s.toRespond=[];var o=n.length;s.values=new Array(o);for(var a=0;a<o;a++)s.toRespond.push(a);for(var a=0;a<o;a++){var u=n[a];s.add(xr(s,u,void 0,a))}return s}return e.prototype.notifyNext=function(r,n,i){this.values[i]=n;var s=this.toRespond;if(s.length>0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Rn);function k6(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(z0.apply(void 0,[n].concat(t)))}}function O6(t){return function(e){return e.lift(new q0(t))}}const N6=Object.freeze(Object.defineProperty({__proto__:null,audit:cg,auditTime:N5,buffer:L5,bufferCount:$5,bufferTime:U5,bufferToggle:q5,bufferWhen:Z5,catchError:K5,combineAll:tM,combineLatest:rM,concat:nM,concatAll:P0,concatMap:fg,concatMapTo:iM,count:sM,debounce:uM,debounceTime:fM,defaultIfEmpty:As,delay:bM,delayWhen:_M,dematerialize:MM,distinct:RM,distinctUntilChanged:dg,distinctUntilKeyChanged:NM,elementAt:FM,endWith:jM,every:UM,exhaust:VM,exhaustMap:pg,expand:ZM,filter:Fr,finalize:KM,find:tC,findIndex:nC,first:iC,flatMap:tx,groupBy:c4,ignoreElements:sC,isEmpty:uC,last:dC,map:Gt,mapTo:pC,materialize:bC,max:SC,merge:EC,mergeAll:Zc,mergeMap:mn,mergeMapTo:xC,mergeScan:MC,min:RC,multicast:wn,observeOn:m4,onErrorResumeNext:TC,pairwise:NC,partition:PC,pluck:$C,publish:FC,publishBehavior:jC,publishLast:UC,publishReplay:WC,race:HC,reduce:ga,refCount:Vc,repeat:VC,repeatWhen:qC,retry:ZC,retryWhen:KC,sample:tI,sampleTime:iI,scan:po,sequenceEqual:uI,share:dI,shareReplay:pI,single:yI,skip:mI,skipLast:SI,skipUntil:MI,skipWhile:RI,startWith:kI,subscribeOn:NI,switchAll:$I,switchMap:rs,switchMapTo:DI,take:cl,takeLast:ho,takeUntil:FI,takeWhile:WI,tap:zI,throttle:JI,throttleTime:YI,throwIfEmpty:pa,timeInterval:t6,timeout:s6,timeoutWith:bg,timestamp:o6,toArray:c6,window:l6,windowCount:d6,windowTime:y6,windowToggle:S6,windowWhen:M6,withLatestFrom:R6,zip:k6,zipAll:O6},Symbol.toStringTag,{value:"Module"})),ll=mi(N6);var ya={},Wt={};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ClientMessagePublishEvent=Wt.ClientMessageSetSessionConfig=Wt.ClientMessageGetSessionConfig=Wt.ClientMessageIsLinked=Wt.ClientMessageHostSession=void 0;function L6(t){return Object.assign({type:"HostSession"},t)}Wt.ClientMessageHostSession=L6;function B6(t){return Object.assign({type:"IsLinked"},t)}Wt.ClientMessageIsLinked=B6;function P6(t){return Object.assign({type:"GetSessionConfig"},t)}Wt.ClientMessageGetSessionConfig=P6;function $6(t){return Object.assign({type:"SetSessionConfig"},t)}Wt.ClientMessageSetSessionConfig=$6;function D6(t){return Object.assign({type:"PublishEvent"},t)}Wt.ClientMessagePublishEvent=D6;var mg={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=ea,r=ll;var n;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(n=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=o.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable(o=>{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(u){o.error(u);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=u=>{this.clearWebSocket(),o.error(new Error(`websocket error ${u.code}: ${u.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=u=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=u=>{this.incomingDataSubject.next(u.data)}}).pipe((0,r.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(mg);var ba={};Object.defineProperty(ba,"__esModule",{value:!0});ba.isServerMessageFail=void 0;function F6(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}ba.isServerMessageFail=F6;Object.defineProperty(ya,"__esModule",{value:!0});ya.WalletSDKConnection=void 0;const Zt=ea,Se=ll,$i=Si,Vn=ls,Di=Wt,Fi=wi,Hs=mg,bu=ba,$h=1e4,j6=6e4;class U6{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new Zt.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Vn.IntNumber)(1),this.connectedSubject=new Zt.BehaviorSubject(!1),this.linkedSubject=new Zt.BehaviorSubject(!1),this.sessionConfigSubject=new Zt.ReplaySubject(1);const o=new Hs.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,Se.tap)(a=>{var u;return(u=this.diagnostic)===null||u===void 0?void 0:u.log(Fi.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:$i.Session.hash(e)})}),(0,Se.skip)(1),(0,Se.filter)(a=>a===Hs.ConnectionState.DISCONNECTED&&!this.destroyed),(0,Se.delay)(5e3),(0,Se.filter)(a=>!this.destroyed),(0,Se.flatMap)(a=>o.connect()),(0,Se.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,Se.skip)(2),(0,Se.switchMap)(a=>(0,Zt.iif)(()=>a===Hs.ConnectionState.CONNECTED,this.authenticate().pipe((0,Se.tap)(u=>this.sendIsLinked()),(0,Se.tap)(u=>this.sendGetSessionConfig()),(0,Se.map)(u=>!0)),(0,Zt.of)(!1))),(0,Se.distinctUntilChanged)(),(0,Se.catchError)(a=>(0,Zt.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,Se.skip)(1),(0,Se.switchMap)(a=>(0,Zt.iif)(()=>a===Hs.ConnectionState.CONNECTED,(0,Zt.timer)(0,$h)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,Se.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,Se.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var u;const l=a;(u=this.diagnostic)===null||u===void 0||u.log(Fi.EVENTS.LINKED,{sessionIdHash:$i.Session.hash(e),linked:l.linked,type:a.type,onlineGuests:l.onlineGuests}),this.linkedSubject.next(l.linked||l.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,Se.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var u;const l=a;(u=this.diagnostic)===null||u===void 0||u.log(Fi.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:$i.Session.hash(e),metadata_keys:l&&l.metadata?Object.keys(l.metadata):void 0}),this.sessionConfigSubject.next({webhookId:l.webhookId,webhookUrl:l.webhookUrl,metadata:l.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Fi.EVENTS.STARTED_CONNECTING,{sessionIdHash:$i.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Fi.EVENTS.DISCONNECTED,{sessionIdHash:$i.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,Se.filter)(e=>e),(0,Se.take)(1),(0,Se.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Se.filter)(e=>e),(0,Se.take)(1),(0,Se.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Se.filter)(e=>{if(e.type!=="Event")return!1;const r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,Se.map)(e=>e))}setSessionMetadata(e,r){const n=(0,Di.ClientMessageSetSessionConfig)({id:(0,Vn.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,Se.flatMap)(i=>this.makeRequest(n)),(0,Se.map)(i=>{if((0,bu.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){const i=(0,Di.ClientMessagePublishEvent)({id:(0,Vn.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,Se.flatMap)(s=>this.makeRequest(i)),(0,Se.map)(s=>{if((0,bu.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>$h*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,r=j6){const n=e.id;try{this.sendData(e)}catch(i){return(0,Zt.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,Se.timeoutWith)(r,(0,Zt.throwError)(new Error(`request ${n} timed out`))),(0,Se.filter)(i=>i.id===n),(0,Se.take)(1))}authenticate(){const e=(0,Di.ClientMessageHostSession)({id:(0,Vn.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,Se.map)(r=>{if((0,bu.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Di.ClientMessageIsLinked)({id:(0,Vn.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Di.ClientMessageGetSessionConfig)({id:(0,Vn.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}ya.WalletSDKConnection=U6;var bi={};Object.defineProperty(bi,"__esModule",{value:!0});bi.decrypt=bi.encrypt=void 0;const go=ne;async function W6(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,go.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),o=16,a=s.slice(s.byteLength-o),u=s.slice(0,s.byteLength-o),l=new Uint8Array(a),p=new Uint8Array(u),g=new Uint8Array([...r,...l,...p]);return(0,go.uint8ArrayToHex)(g)}bi.encrypt=W6;function H6(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((r,n)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,go.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,go.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),u=s.slice(28),l=new Uint8Array([...u,...a]),p={name:"AES-GCM",iv:new Uint8Array(o)};try{const g=await window.crypto.subtle.decrypt(p,i,l),m=new TextDecoder;r(m.decode(g))}catch(g){n(g)}})()})}bi.decrypt=H6;var va={},ma={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(ma);Object.defineProperty(va,"__esModule",{value:!0});va.Web3RequestCanceledMessage=void 0;const V6=ma;function z6(t){return{type:V6.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}va.Web3RequestCanceledMessage=z6;var wa={};Object.defineProperty(wa,"__esModule",{value:!0});wa.Web3RequestMessage=void 0;const q6=ma;function G6(t){return Object.assign({type:q6.RelayMessageType.WEB3_REQUEST},t)}wa.Web3RequestMessage=G6;var vi={};Object.defineProperty(vi,"__esModule",{value:!0});vi.isWeb3ResponseMessage=vi.Web3ResponseMessage=void 0;const wg=ma;function J6(t){return Object.assign({type:wg.RelayMessageType.WEB3_RESPONSE},t)}vi.Web3ResponseMessage=J6;function Z6(t){return t&&t.type===wg.RelayMessageType.WEB3_RESPONSE}vi.isWeb3ResponseMessage=Z6;var Q6=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Y6=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_g=te&&te.__decorate||function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},K6=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Q6(e,t,r);return Y6(e,t),e},X6=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ha,"__esModule",{value:!0});ha.WalletSDKRelay=void 0;const Sg=X6(da),sn=ea,ct=ll,St=wi,eR=ya,zn=ns,tR=ls,Xe=ne,Rr=K6(bi),Ar=Si,Vs=Xt,vt=Eo,rR=va,nR=wa,Ft=Be,Tt=vi;class Kt extends Vs.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new sn.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new sn.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();if(this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=Ar.Session.load(this.storage)||new Ar.Session(this.storage).save(),r=new eR.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,ct.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,ct.skip)(1),(0,ct.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(Vs.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const l=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(St.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:l})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,ct.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,ct.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,ct.mergeMap)(i=>Rr.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(Vs.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,ct.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,ct.mergeMap)(i=>Rr.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(Vs.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,ct.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,ct.mergeMap)(i=>(0,sn.zip)(Rr.decrypt(i.metadata.ChainId,e.secret),Rr.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,ct.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,ct.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,ct.mergeMap)(i=>Rr.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),Kt.accountRequestCallbackIds.size>0&&(Array.from(Kt.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,Tt.Web3ResponseMessage)({id:s,response:(0,Ft.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),Kt.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,ct.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,ct.mergeMap)(i=>Rr.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,ct.timeout)(1e3),(0,ct.catchError)(e=>(0,sn.of)(null))).subscribe(e=>{var r,n,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(St.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(St.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=Ar.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(St.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ar.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new sn.Subscription;const{session:a,ui:u,connection:l}=this.subscribe();this._session=a,this.connection=l,this.ui=u,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(St.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:vt.Web3Method.signEthereumMessage,params:{message:(0,Xe.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:vt.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,Xe.hexStringFromBuffer)(e,!0),signature:(0,Xe.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:vt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Xe.bigIntStringFromBN)(e.weiValue),data:(0,Xe.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Xe.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,Xe.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,Xe.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,Xe.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:vt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Xe.bigIntStringFromBN)(e.weiValue),data:(0,Xe.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Xe.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,Xe.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,Xe.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,Xe.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:vt.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,Xe.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:vt.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,Xe.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:vt.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,Xe.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,u=>{if(r==null||r(),u.errorMessage)return a(new Error(u.errorMessage));o(u)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;const i=(0,nR.Web3RequestMessage)({id:e,request:r}),s=Ar.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(St.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ar.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(St.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ar.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,rR.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new sn.Observable(s=>{Rr.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,ct.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,sn.from)(Rr.decrypt(e.data,this.session.secret)).pipe((0,ct.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,Tt.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(St.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(St.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Ft.isRequestEthereumAccountsResponse)(n)){Kt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Kt.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,zn.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:e,response:{method:r,errorMessage:o,errorCode:i}}))}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:vt.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Xe.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(r,l=>{if(this.ui.hideRequestEthereumAccounts(),l.errorMessage)return o(new Error(l.errorMessage));s(l)});const u=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(u&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u)){let l;try{(0,Xe.isInIFrame)()&&window.top?l=window.top.location:l=window.location}catch{l=window.location}l.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(l.href)}`;return}if(this.ui.inlineAccountsResponse()){const l=p=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:r,response:(0,Ft.RequestEthereumAccountsResponse)(p)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:l})}else{const l=zn.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(l)})}Kt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:vt.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,Xe.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,p=>{if(p.errorMessage)return a(new Error(p.errorMessage));o(p)});const u=p=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:n,response:(0,Ft.SelectProviderResponse)(tR.ProviderType.Unselected)}))},l=p=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:n,response:(0,Ft.SelectProviderResponse)(p)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:u,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:vt.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let u=null;const l=(0,Xe.randomBytesHex)(8),p=m=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,m),u==null||u()};this.ui.inlineWatchAsset()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const g=new Promise((m,C)=>{this.relayEventManager.callbacks.set(l,U=>{if(u==null||u(),U.errorMessage)return C(new Error(U.errorMessage));m(U)});const T=U=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:l,response:(0,Ft.WatchAssetReponse)(!1)}))},P=()=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:l,response:(0,Ft.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:P,onCancel:T,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:p,promise:g}}addEthereumChain(e,r,n,i,s,o){const a={method:vt.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let u=null;const l=(0,Xe.randomBytesHex)(8),p=m=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,m),u==null||u()};return this.ui.inlineAddEthereumChain(e)||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((m,C)=>{this.relayEventManager.callbacks.set(l,U=>{if(u==null||u(),U.errorMessage)return C(new Error(U.errorMessage));m(U)});const T=U=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:l,response:(0,Ft.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},P=U=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:l,response:(0,Ft.AddEthereumChainResponse)({isApproved:!0,rpcUrl:U})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:T,onApprove:P,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:p}}switchEthereumChain(e,r){const n={method:vt.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,Xe.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,u)=>{this.relayEventManager.callbacks.set(i,g=>{if((0,Ft.isErrorResponse)(g)&&g.errorCode)return u(zn.standardErrors.provider.custom({code:g.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(g.errorMessage)return u(new Error(g.errorMessage));a(g)});const l=g=>{var m;if(g){const C=(m=(0,zn.getErrorCode)(g))!==null&&m!==void 0?m:zn.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,vt.Web3Method.switchEthereumChain,g instanceof Error?g:zn.standardErrors.provider.unsupportedChain(e),C)}else this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:i,response:(0,Ft.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},p=g=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:i,response:(0,Ft.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:g})}))};this.ui.switchEthereumChain({onCancel:l,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Ar.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,Tt.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case vt.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case vt.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case vt.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case vt.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}Kt.accountRequestCallbackIds=new Set;_g([Sg.default],Kt.prototype,"resetAndReload",null);_g([Sg.default],Kt.prototype,"handleIncomingEvent",null);ha.WalletSDKRelay=Kt;var _a={};Object.defineProperty(_a,"__esModule",{value:!0});_a.WalletSDKRelayEventManager=void 0;const iR=ne;class sR{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,iR.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}_a.WalletSDKRelayEventManager=sR;Object.defineProperty(Zi,"__esModule",{value:!0});Zi.CoinbaseWalletSDK=void 0;const oR=vo,aR=mo,uR=wo,cR=ni,lR=Qo,fR=ha,hR=_a,dR=ne,Eg=_i;class Sa{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||aR.LINK_API_URL;let o;if(e.uiConstructor?o=e.uiConstructor:o=l=>new lR.WalletSDKUI(l),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),u=`${a.protocol}//${a.host}`;this._storage=new uR.ScopedLocalStorage(`-walletlink:${u}`),this._storage.setItem("version",Sa.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new hR.WalletSDKRelayEventManager,this._relay=new fR.WalletSDKRelay({linkAPIUrl:s,version:Eg.LIB_VERSION,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,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 e||s.setConnectDisabled(!0),new cR.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,dR.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 e;const r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,oR.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Zi.CoinbaseWalletSDK=Sa;Sa.VERSION=Eg.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Zi,r=ni;var n=Zi;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=ni;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Qu);const pR=xg(Qu),xR=Mg({__proto__:null,default:pR},[Qu]);export{xR as i};
|