File: /var/www/html/testConnect/assets/index.415c20d0.js
const Nl=function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))e(t);new MutationObserver(t=>{for(const n of t)if(n.type==="childList")for(const c of n.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&e(c)}).observe(document,{childList:!0,subtree:!0});function o(t){const n={};return t.integrity&&(n.integrity=t.integrity),t.referrerpolicy&&(n.referrerPolicy=t.referrerpolicy),t.crossorigin==="use-credentials"?n.credentials="include":t.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function e(t){if(t.ep)return;t.ep=!0;const n=o(t);fetch(t.href,n)}};Nl();function aa(i,r){const o=Object.create(null),e=i.split(",");for(let t=0;t<e.length;t++)o[e[t]]=!0;return r?t=>!!o[t.toLowerCase()]:t=>!!o[t]}const Bl="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ll=aa(Bl);function mf(i){return!!i||i===""}function ua(i){if(lt(i)){const r={};for(let o=0;o<i.length;o++){const e=i[o],t=Ut(e)?ql(e):ua(e);if(t)for(const n in t)r[n]=t[n]}return r}else{if(Ut(i))return i;if(qt(i))return i}}const jl=/;(?![^(]*\))/g,Ul=/:(.+)/;function ql(i){const r={};return i.split(jl).forEach(o=>{if(o){const e=o.split(Ul);e.length>1&&(r[e[0].trim()]=e[1].trim())}}),r}function To(i){let r="";if(Ut(i))r=i;else if(lt(i))for(let o=0;o<i.length;o++){const e=To(i[o]);e&&(r+=e+" ")}else if(qt(i))for(const o in i)i[o]&&(r+=o+" ");return r.trim()}const gf=i=>Ut(i)?i:i==null?"":lt(i)||qt(i)&&(i.toString===wf||!gt(i.toString))?JSON.stringify(i,bf,2):String(i),bf=(i,r)=>r&&r.__v_isRef?bf(i,r.value):Xn(r)?{[`Map(${r.size})`]:[...r.entries()].reduce((o,[e,t])=>(o[`${e} =>`]=t,o),{})}:vf(r)?{[`Set(${r.size})`]:[...r.values()]}:qt(r)&&!lt(r)&&!_f(r)?String(r):r,At={},Yn=[],Ir=()=>{},Fl=()=>!1,Dl=/^on[^a-z]/,Po=i=>Dl.test(i),fa=i=>i.startsWith("onUpdate:"),Jt=Object.assign,ca=(i,r)=>{const o=i.indexOf(r);o>-1&&i.splice(o,1)},zl=Object.prototype.hasOwnProperty,Et=(i,r)=>zl.call(i,r),lt=Array.isArray,Xn=i=>Co(i)==="[object Map]",vf=i=>Co(i)==="[object Set]",gt=i=>typeof i=="function",Ut=i=>typeof i=="string",la=i=>typeof i=="symbol",qt=i=>i!==null&&typeof i=="object",yf=i=>qt(i)&>(i.then)&>(i.catch),wf=Object.prototype.toString,Co=i=>wf.call(i),Hl=i=>Co(i).slice(8,-1),_f=i=>Co(i)==="[object Object]",ha=i=>Ut(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,so=aa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Io=i=>{const r=Object.create(null);return o=>r[o]||(r[o]=i(o))},Wl=/-(\w)/g,ti=Io(i=>i.replace(Wl,(r,o)=>o?o.toUpperCase():"")),Kl=/\B([A-Z])/g,fi=Io(i=>i.replace(Kl,"-$1").toLowerCase()),xf=Io(i=>i.charAt(0).toUpperCase()+i.slice(1)),Yo=Io(i=>i?`on${xf(i)}`:""),Bi=(i,r)=>!Object.is(i,r),Xo=(i,r)=>{for(let o=0;o<i.length;o++)i[o](r)},mo=(i,r,o)=>{Object.defineProperty(i,r,{configurable:!0,enumerable:!1,value:o})},$l=i=>{const r=parseFloat(i);return isNaN(r)?i:r};let Va;const Vl=()=>Va||(Va=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let jr;class Mf{constructor(r=!1){this.active=!0,this.effects=[],this.cleanups=[],!r&&jr&&(this.parent=jr,this.index=(jr.scopes||(jr.scopes=[])).push(this)-1)}run(r){if(this.active){const o=jr;try{return jr=this,r()}finally{jr=o}}}on(){jr=this}off(){jr=this.parent}stop(r){if(this.active){let o,e;for(o=0,e=this.effects.length;o<e;o++)this.effects[o].stop();for(o=0,e=this.cleanups.length;o<e;o++)this.cleanups[o]();if(this.scopes)for(o=0,e=this.scopes.length;o<e;o++)this.scopes[o].stop(!0);if(this.parent&&!r){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.active=!1}}}function Ef(i){return new Mf(i)}function Gl(i,r=jr){r&&r.active&&r.effects.push(i)}const da=i=>{const r=new Set(i);return r.w=0,r.n=0,r},Sf=i=>(i.w&Sn)>0,kf=i=>(i.n&Sn)>0,Jl=({deps:i})=>{if(i.length)for(let r=0;r<i.length;r++)i[r].w|=Sn},Zl=i=>{const{deps:r}=i;if(r.length){let o=0;for(let e=0;e<r.length;e++){const t=r[e];Sf(t)&&!kf(t)?t.delete(i):r[o++]=t,t.w&=~Sn,t.n&=~Sn}r.length=o}},_s=new WeakMap;let Mi=0,Sn=1;const xs=30;let Tr;const Bn=Symbol(""),Ms=Symbol("");class pa{constructor(r,o=null,e){this.fn=r,this.scheduler=o,this.active=!0,this.deps=[],this.parent=void 0,Gl(this,e)}run(){if(!this.active)return this.fn();let r=Tr,o=_n;for(;r;){if(r===this)return;r=r.parent}try{return this.parent=Tr,Tr=this,_n=!0,Sn=1<<++Mi,Mi<=xs?Jl(this):Ga(this),this.fn()}finally{Mi<=xs&&Zl(this),Sn=1<<--Mi,Tr=this.parent,_n=o,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Tr===this?this.deferStop=!0:this.active&&(Ga(this),this.onStop&&this.onStop(),this.active=!1)}}function Ga(i){const{deps:r}=i;if(r.length){for(let o=0;o<r.length;o++)r[o].delete(i);r.length=0}}let _n=!0;const Af=[];function ci(){Af.push(_n),_n=!1}function li(){const i=Af.pop();_n=i===void 0?!0:i}function dr(i,r,o){if(_n&&Tr){let e=_s.get(i);e||_s.set(i,e=new Map);let t=e.get(o);t||e.set(o,t=da()),Rf(t)}}function Rf(i,r){let o=!1;Mi<=xs?kf(i)||(i.n|=Sn,o=!Sf(i)):o=!i.has(Tr),o&&(i.add(Tr),Tr.deps.push(i))}function rn(i,r,o,e,t,n){const c=_s.get(i);if(!c)return;let p=[];if(r==="clear")p=[...c.values()];else if(o==="length"&<(i))c.forEach((a,f)=>{(f==="length"||f>=e)&&p.push(a)});else switch(o!==void 0&&p.push(c.get(o)),r){case"add":lt(i)?ha(o)&&p.push(c.get("length")):(p.push(c.get(Bn)),Xn(i)&&p.push(c.get(Ms)));break;case"delete":lt(i)||(p.push(c.get(Bn)),Xn(i)&&p.push(c.get(Ms)));break;case"set":Xn(i)&&p.push(c.get(Bn));break}if(p.length===1)p[0]&&Es(p[0]);else{const a=[];for(const f of p)f&&a.push(...f);Es(da(a))}}function Es(i,r){const o=lt(i)?i:[...i];for(const e of o)e.computed&&Ja(e);for(const e of o)e.computed||Ja(e)}function Ja(i,r){(i!==Tr||i.allowRecurse)&&(i.scheduler?i.scheduler():i.run())}const Yl=aa("__proto__,__v_isRef,__isVue"),Tf=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(la)),Xl=ma(),Ql=ma(!1,!0),eh=ma(!0),Za=th();function th(){const i={};return["includes","indexOf","lastIndexOf"].forEach(r=>{i[r]=function(...o){const e=St(this);for(let n=0,c=this.length;n<c;n++)dr(e,"get",n+"");const t=e[r](...o);return t===-1||t===!1?e[r](...o.map(St)):t}}),["push","pop","shift","unshift","splice"].forEach(r=>{i[r]=function(...o){ci();const e=St(this)[r].apply(this,o);return li(),e}}),i}function ma(i=!1,r=!1){return function(e,t,n){if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return r;if(t==="__v_raw"&&n===(i?r?bh:Nf:r?Of:If).get(e))return e;const c=lt(e);if(!i&&c&&Et(Za,t))return Reflect.get(Za,t,n);const p=Reflect.get(e,t,n);return(la(t)?Tf.has(t):Yl(t))||(i||dr(e,"get",t),r)?p:Lt(p)?c&&ha(t)?p:p.value:qt(p)?i?Bf(p):Wi(p):p}}const rh=Pf(),nh=Pf(!0);function Pf(i=!1){return function(o,e,t,n){let c=o[e];if(Li(c)&&Lt(c)&&!Lt(t))return!1;if(!i&&!Li(t)&&(Ss(t)||(t=St(t),c=St(c)),!lt(o)&&Lt(c)&&!Lt(t)))return c.value=t,!0;const p=lt(o)&&ha(e)?Number(e)<o.length:Et(o,e),a=Reflect.set(o,e,t,n);return o===St(n)&&(p?Bi(t,c)&&rn(o,"set",e,t):rn(o,"add",e,t)),a}}function ih(i,r){const o=Et(i,r);i[r];const e=Reflect.deleteProperty(i,r);return e&&o&&rn(i,"delete",r,void 0),e}function oh(i,r){const o=Reflect.has(i,r);return(!la(r)||!Tf.has(r))&&dr(i,"has",r),o}function sh(i){return dr(i,"iterate",lt(i)?"length":Bn),Reflect.ownKeys(i)}const Cf={get:Xl,set:rh,deleteProperty:ih,has:oh,ownKeys:sh},ah={get:eh,set(i,r){return!0},deleteProperty(i,r){return!0}},uh=Jt({},Cf,{get:Ql,set:nh}),ga=i=>i,Oo=i=>Reflect.getPrototypeOf(i);function Ji(i,r,o=!1,e=!1){i=i.__v_raw;const t=St(i),n=St(r);o||(r!==n&&dr(t,"get",r),dr(t,"get",n));const{has:c}=Oo(t),p=e?ga:o?ya:ji;if(c.call(t,r))return p(i.get(r));if(c.call(t,n))return p(i.get(n));i!==t&&i.get(r)}function Zi(i,r=!1){const o=this.__v_raw,e=St(o),t=St(i);return r||(i!==t&&dr(e,"has",i),dr(e,"has",t)),i===t?o.has(i):o.has(i)||o.has(t)}function Yi(i,r=!1){return i=i.__v_raw,!r&&dr(St(i),"iterate",Bn),Reflect.get(i,"size",i)}function Ya(i){i=St(i);const r=St(this);return Oo(r).has.call(r,i)||(r.add(i),rn(r,"add",i,i)),this}function Xa(i,r){r=St(r);const o=St(this),{has:e,get:t}=Oo(o);let n=e.call(o,i);n||(i=St(i),n=e.call(o,i));const c=t.call(o,i);return o.set(i,r),n?Bi(r,c)&&rn(o,"set",i,r):rn(o,"add",i,r),this}function Qa(i){const r=St(this),{has:o,get:e}=Oo(r);let t=o.call(r,i);t||(i=St(i),t=o.call(r,i)),e&&e.call(r,i);const n=r.delete(i);return t&&rn(r,"delete",i,void 0),n}function eu(){const i=St(this),r=i.size!==0,o=i.clear();return r&&rn(i,"clear",void 0,void 0),o}function Xi(i,r){return function(e,t){const n=this,c=n.__v_raw,p=St(c),a=r?ga:i?ya:ji;return!i&&dr(p,"iterate",Bn),c.forEach((f,s)=>e.call(t,a(f),a(s),n))}}function Qi(i,r,o){return function(...e){const t=this.__v_raw,n=St(t),c=Xn(n),p=i==="entries"||i===Symbol.iterator&&c,a=i==="keys"&&c,f=t[i](...e),s=o?ga:r?ya:ji;return!r&&dr(n,"iterate",a?Ms:Bn),{next(){const{value:u,done:h}=f.next();return h?{value:u,done:h}:{value:p?[s(u[0]),s(u[1])]:s(u),done:h}},[Symbol.iterator](){return this}}}}function hn(i){return function(...r){return i==="delete"?!1:this}}function fh(){const i={get(n){return Ji(this,n)},get size(){return Yi(this)},has:Zi,add:Ya,set:Xa,delete:Qa,clear:eu,forEach:Xi(!1,!1)},r={get(n){return Ji(this,n,!1,!0)},get size(){return Yi(this)},has:Zi,add:Ya,set:Xa,delete:Qa,clear:eu,forEach:Xi(!1,!0)},o={get(n){return Ji(this,n,!0)},get size(){return Yi(this,!0)},has(n){return Zi.call(this,n,!0)},add:hn("add"),set:hn("set"),delete:hn("delete"),clear:hn("clear"),forEach:Xi(!0,!1)},e={get(n){return Ji(this,n,!0,!0)},get size(){return Yi(this,!0)},has(n){return Zi.call(this,n,!0)},add:hn("add"),set:hn("set"),delete:hn("delete"),clear:hn("clear"),forEach:Xi(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=Qi(n,!1,!1),o[n]=Qi(n,!0,!1),r[n]=Qi(n,!1,!0),e[n]=Qi(n,!0,!0)}),[i,o,r,e]}const[ch,lh,hh,dh]=fh();function ba(i,r){const o=r?i?dh:hh:i?lh:ch;return(e,t,n)=>t==="__v_isReactive"?!i:t==="__v_isReadonly"?i:t==="__v_raw"?e:Reflect.get(Et(o,t)&&t in e?o:e,t,n)}const ph={get:ba(!1,!1)},mh={get:ba(!1,!0)},gh={get:ba(!0,!1)},If=new WeakMap,Of=new WeakMap,Nf=new WeakMap,bh=new WeakMap;function vh(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function yh(i){return i.__v_skip||!Object.isExtensible(i)?0:vh(Hl(i))}function Wi(i){return Li(i)?i:va(i,!1,Cf,ph,If)}function wh(i){return va(i,!1,uh,mh,Of)}function Bf(i){return va(i,!0,ah,gh,Nf)}function va(i,r,o,e,t){if(!qt(i)||i.__v_raw&&!(r&&i.__v_isReactive))return i;const n=t.get(i);if(n)return n;const c=yh(i);if(c===0)return i;const p=new Proxy(i,c===2?e:o);return t.set(i,p),p}function xn(i){return Li(i)?xn(i.__v_raw):!!(i&&i.__v_isReactive)}function Li(i){return!!(i&&i.__v_isReadonly)}function Ss(i){return!!(i&&i.__v_isShallow)}function Lf(i){return xn(i)||Li(i)}function St(i){const r=i&&i.__v_raw;return r?St(r):i}function ri(i){return mo(i,"__v_skip",!0),i}const ji=i=>qt(i)?Wi(i):i,ya=i=>qt(i)?Bf(i):i;function jf(i){_n&&Tr&&(i=St(i),Rf(i.dep||(i.dep=da())))}function Uf(i,r){i=St(i),i.dep&&Es(i.dep)}function Lt(i){return!!(i&&i.__v_isRef===!0)}function kt(i){return _h(i,!1)}function _h(i,r){return Lt(i)?i:new xh(i,r)}class xh{constructor(r,o){this.__v_isShallow=o,this.dep=void 0,this.__v_isRef=!0,this._rawValue=o?r:St(r),this._value=o?r:ji(r)}get value(){return jf(this),this._value}set value(r){r=this.__v_isShallow?r:St(r),Bi(r,this._rawValue)&&(this._rawValue=r,this._value=this.__v_isShallow?r:ji(r),Uf(this))}}function ar(i){return Lt(i)?i.value:i}const Mh={get:(i,r,o)=>ar(Reflect.get(i,r,o)),set:(i,r,o,e)=>{const t=i[r];return Lt(t)&&!Lt(o)?(t.value=o,!0):Reflect.set(i,r,o,e)}};function qf(i){return xn(i)?i:new Proxy(i,Mh)}function Eh(i){const r=lt(i)?new Array(i.length):{};for(const o in i)r[o]=kh(i,o);return r}class Sh{constructor(r,o,e){this._object=r,this._key=o,this._defaultValue=e,this.__v_isRef=!0}get value(){const r=this._object[this._key];return r===void 0?this._defaultValue:r}set value(r){this._object[this._key]=r}}function kh(i,r,o){const e=i[r];return Lt(e)?e:new Sh(i,r,o)}class Ah{constructor(r,o,e,t){this._setter=o,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new pa(r,()=>{this._dirty||(this._dirty=!0,Uf(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!t,this.__v_isReadonly=e}get value(){const r=St(this);return jf(r),(r._dirty||!r._cacheable)&&(r._dirty=!1,r._value=r.effect.run()),r._value}set value(r){this._setter(r)}}function Rh(i,r,o=!1){let e,t;const n=gt(i);return n?(e=i,t=Ir):(e=i.get,t=i.set),new Ah(e,t,n||!t,o)}function Mn(i,r,o,e){let t;try{t=e?i(...e):i()}catch(n){No(n,r,o)}return t}function yr(i,r,o,e){if(gt(i)){const n=Mn(i,r,o,e);return n&&yf(n)&&n.catch(c=>{No(c,r,o)}),n}const t=[];for(let n=0;n<i.length;n++)t.push(yr(i[n],r,o,e));return t}function No(i,r,o,e=!0){const t=r?r.vnode:null;if(r){let n=r.parent;const c=r.proxy,p=o;for(;n;){const f=n.ec;if(f){for(let s=0;s<f.length;s++)if(f[s](i,c,p)===!1)return}n=n.parent}const a=r.appContext.config.errorHandler;if(a){Mn(a,null,10,[i,c,p]);return}}Th(i,o,t,e)}function Th(i,r,o,e=!0){console.error(i)}let go=!1,ks=!1;const cr=[];let en=0;const Ai=[];let Ei=null,Vn=0;const Ri=[];let mn=null,Gn=0;const Ff=Promise.resolve();let wa=null,As=null;function _a(i){const r=wa||Ff;return i?r.then(this?i.bind(this):i):r}function Ph(i){let r=en+1,o=cr.length;for(;r<o;){const e=r+o>>>1;Ui(cr[e])<i?r=e+1:o=e}return r}function Df(i){(!cr.length||!cr.includes(i,go&&i.allowRecurse?en+1:en))&&i!==As&&(i.id==null?cr.push(i):cr.splice(Ph(i.id),0,i),zf())}function zf(){!go&&!ks&&(ks=!0,wa=Ff.then(Kf))}function Ch(i){const r=cr.indexOf(i);r>en&&cr.splice(r,1)}function Hf(i,r,o,e){lt(i)?o.push(...i):(!r||!r.includes(i,i.allowRecurse?e+1:e))&&o.push(i),zf()}function Ih(i){Hf(i,Ei,Ai,Vn)}function Oh(i){Hf(i,mn,Ri,Gn)}function Bo(i,r=null){if(Ai.length){for(As=r,Ei=[...new Set(Ai)],Ai.length=0,Vn=0;Vn<Ei.length;Vn++)Ei[Vn]();Ei=null,Vn=0,As=null,Bo(i,r)}}function Wf(i){if(Bo(),Ri.length){const r=[...new Set(Ri)];if(Ri.length=0,mn){mn.push(...r);return}for(mn=r,mn.sort((o,e)=>Ui(o)-Ui(e)),Gn=0;Gn<mn.length;Gn++)mn[Gn]();mn=null,Gn=0}}const Ui=i=>i.id==null?1/0:i.id;function Kf(i){ks=!1,go=!0,Bo(i),cr.sort((o,e)=>Ui(o)-Ui(e));const r=Ir;try{for(en=0;en<cr.length;en++){const o=cr[en];o&&o.active!==!1&&Mn(o,null,14)}}finally{en=0,cr.length=0,Wf(),go=!1,wa=null,(cr.length||Ai.length||Ri.length)&&Kf(i)}}function Nh(i,r,...o){if(i.isUnmounted)return;const e=i.vnode.props||At;let t=o;const n=r.startsWith("update:"),c=n&&r.slice(7);if(c&&c in e){const s=`${c==="modelValue"?"model":c}Modifiers`,{number:u,trim:h}=e[s]||At;h&&(t=o.map(v=>v.trim())),u&&(t=o.map($l))}let p,a=e[p=Yo(r)]||e[p=Yo(ti(r))];!a&&n&&(a=e[p=Yo(fi(r))]),a&&yr(a,i,6,t);const f=e[p+"Once"];if(f){if(!i.emitted)i.emitted={};else if(i.emitted[p])return;i.emitted[p]=!0,yr(f,i,6,t)}}function $f(i,r,o=!1){const e=r.emitsCache,t=e.get(i);if(t!==void 0)return t;const n=i.emits;let c={},p=!1;if(!gt(i)){const a=f=>{const s=$f(f,r,!0);s&&(p=!0,Jt(c,s))};!o&&r.mixins.length&&r.mixins.forEach(a),i.extends&&a(i.extends),i.mixins&&i.mixins.forEach(a)}return!n&&!p?(e.set(i,null),null):(lt(n)?n.forEach(a=>c[a]=null):Jt(c,n),e.set(i,c),c)}function Lo(i,r){return!i||!Po(r)?!1:(r=r.slice(2).replace(/Once$/,""),Et(i,r[0].toLowerCase()+r.slice(1))||Et(i,fi(r))||Et(i,r))}let nr=null,Vf=null;function bo(i){const r=nr;return nr=i,Vf=i&&i.type.__scopeId||null,r}function bn(i,r=nr,o){if(!r||i._n)return i;const e=(...t)=>{e._d&&lu(-1);const n=bo(r),c=i(...t);return bo(n),e._d&&lu(1),c};return e._n=!0,e._c=!0,e._d=!0,e}function Qo(i){const{type:r,vnode:o,proxy:e,withProxy:t,props:n,propsOptions:[c],slots:p,attrs:a,emit:f,render:s,renderCache:u,data:h,setupState:v,ctx:b,inheritAttrs:y}=i;let _,E;const S=bo(i);try{if(o.shapeFlag&4){const O=t||e;_=Fr(s.call(O,O,u,n,v,h,b)),E=a}else{const O=r;_=Fr(O.length>1?O(n,{attrs:a,slots:p,emit:f}):O(n,null)),E=r.props?a:Bh(a)}}catch(O){Ci.length=0,No(O,i,1),_=Tt(wr)}let k=_;if(E&&y!==!1){const O=Object.keys(E),{shapeFlag:M}=k;O.length&&M&7&&(c&&O.some(fa)&&(E=Lh(E,c)),k=nn(k,E))}return o.dirs&&(k=nn(k),k.dirs=k.dirs?k.dirs.concat(o.dirs):o.dirs),o.transition&&(k.transition=o.transition),_=k,bo(S),_}const Bh=i=>{let r;for(const o in i)(o==="class"||o==="style"||Po(o))&&((r||(r={}))[o]=i[o]);return r},Lh=(i,r)=>{const o={};for(const e in i)(!fa(e)||!(e.slice(9)in r))&&(o[e]=i[e]);return o};function jh(i,r,o){const{props:e,children:t,component:n}=i,{props:c,children:p,patchFlag:a}=r,f=n.emitsOptions;if(r.dirs||r.transition)return!0;if(o&&a>=0){if(a&1024)return!0;if(a&16)return e?tu(e,c,f):!!c;if(a&8){const s=r.dynamicProps;for(let u=0;u<s.length;u++){const h=s[u];if(c[h]!==e[h]&&!Lo(f,h))return!0}}}else return(t||p)&&(!p||!p.$stable)?!0:e===c?!1:e?c?tu(e,c,f):!0:!!c;return!1}function tu(i,r,o){const e=Object.keys(r);if(e.length!==Object.keys(i).length)return!0;for(let t=0;t<e.length;t++){const n=e[t];if(r[n]!==i[n]&&!Lo(o,n))return!0}return!1}function Uh({vnode:i,parent:r},o){for(;r&&r.subTree===i;)(i=r.vnode).el=o,r=r.parent}const qh=i=>i.__isSuspense;function Fh(i,r){r&&r.pendingBranch?lt(i)?r.effects.push(...i):r.effects.push(i):Oh(i)}function Kr(i,r){if(zt){let o=zt.provides;const e=zt.parent&&zt.parent.provides;e===o&&(o=zt.provides=Object.create(e)),o[i]=r}}function ir(i,r,o=!1){const e=zt||nr;if(e){const t=e.parent==null?e.vnode.appContext&&e.vnode.appContext.provides:e.parent.provides;if(t&&i in t)return t[i];if(arguments.length>1)return o&>(r)?r.call(e.proxy):r}}function $r(i,r){return xa(i,null,r)}const ru={};function En(i,r,o){return xa(i,r,o)}function xa(i,r,{immediate:o,deep:e,flush:t,onTrack:n,onTrigger:c}=At){const p=zt;let a,f=!1,s=!1;if(Lt(i)?(a=()=>i.value,f=Ss(i)):xn(i)?(a=()=>i,e=!0):lt(i)?(s=!0,f=i.some(E=>xn(E)||Ss(E)),a=()=>i.map(E=>{if(Lt(E))return E.value;if(xn(E))return Jn(E);if(gt(E))return Mn(E,p,2)})):gt(i)?r?a=()=>Mn(i,p,2):a=()=>{if(!(p&&p.isUnmounted))return u&&u(),yr(i,p,3,[h])}:a=Ir,r&&e){const E=a;a=()=>Jn(E())}let u,h=E=>{u=_.onStop=()=>{Mn(E,p,4)}};if(Fi)return h=Ir,r?o&&yr(r,p,3,[a(),s?[]:void 0,h]):a(),Ir;let v=s?[]:ru;const b=()=>{if(!!_.active)if(r){const E=_.run();(e||f||(s?E.some((S,k)=>Bi(S,v[k])):Bi(E,v)))&&(u&&u(),yr(r,p,3,[E,v===ru?void 0:v,h]),v=E)}else _.run()};b.allowRecurse=!!r;let y;t==="sync"?y=b:t==="post"?y=()=>tr(b,p&&p.suspense):y=()=>Ih(b);const _=new pa(a,y);return r?o?b():v=_.run():t==="post"?tr(_.run.bind(_),p&&p.suspense):_.run(),()=>{_.stop(),p&&p.scope&&ca(p.scope.effects,_)}}function Dh(i,r,o){const e=this.proxy,t=Ut(i)?i.includes(".")?Gf(e,i):()=>e[i]:i.bind(e,e);let n;gt(r)?n=r:(n=r.handler,o=r);const c=zt;ni(this);const p=xa(t,n.bind(e),o);return c?ni(c):Ln(),p}function Gf(i,r){const o=r.split(".");return()=>{let e=i;for(let t=0;t<o.length&&e;t++)e=e[o[t]];return e}}function Jn(i,r){if(!qt(i)||i.__v_skip||(r=r||new Set,r.has(i)))return i;if(r.add(i),Lt(i))Jn(i.value,r);else if(lt(i))for(let o=0;o<i.length;o++)Jn(i[o],r);else if(vf(i)||Xn(i))i.forEach(o=>{Jn(o,r)});else if(_f(i))for(const o in i)Jn(i[o],r);return i}function zh(){const i={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Qt(()=>{i.isMounted=!0}),Xf(()=>{i.isUnmounting=!0}),i}const br=[Function,Array],Hh={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:br,onEnter:br,onAfterEnter:br,onEnterCancelled:br,onBeforeLeave:br,onLeave:br,onAfterLeave:br,onLeaveCancelled:br,onBeforeAppear:br,onAppear:br,onAfterAppear:br,onAppearCancelled:br},setup(i,{slots:r}){const o=Aa(),e=zh();let t;return()=>{const n=r.default&&Zf(r.default(),!0);if(!n||!n.length)return;let c=n[0];if(n.length>1){for(const y of n)if(y.type!==wr){c=y;break}}const p=St(i),{mode:a}=p;if(e.isLeaving)return es(c);const f=nu(c);if(!f)return es(c);const s=Rs(f,p,e,o);Ts(f,s);const u=o.subTree,h=u&&nu(u);let v=!1;const{getTransitionKey:b}=f.type;if(b){const y=b();t===void 0?t=y:y!==t&&(t=y,v=!0)}if(h&&h.type!==wr&&(!In(f,h)||v)){const y=Rs(h,p,e,o);if(Ts(h,y),a==="out-in")return e.isLeaving=!0,y.afterLeave=()=>{e.isLeaving=!1,o.update()},es(c);a==="in-out"&&f.type!==wr&&(y.delayLeave=(_,E,S)=>{const k=Jf(e,h);k[String(h.key)]=h,_._leaveCb=()=>{E(),_._leaveCb=void 0,delete s.delayedLeave},s.delayedLeave=S})}return c}}},Wh=Hh;function Jf(i,r){const{leavingVNodes:o}=i;let e=o.get(r.type);return e||(e=Object.create(null),o.set(r.type,e)),e}function Rs(i,r,o,e){const{appear:t,mode:n,persisted:c=!1,onBeforeEnter:p,onEnter:a,onAfterEnter:f,onEnterCancelled:s,onBeforeLeave:u,onLeave:h,onAfterLeave:v,onLeaveCancelled:b,onBeforeAppear:y,onAppear:_,onAfterAppear:E,onAppearCancelled:S}=r,k=String(i.key),O=Jf(o,i),M=(L,F)=>{L&&yr(L,e,9,F)},C=(L,F)=>{const V=F[1];M(L,F),lt(L)?L.every(H=>H.length<=1)&&V():L.length<=1&&V()},N={mode:n,persisted:c,beforeEnter(L){let F=p;if(!o.isMounted)if(t)F=y||p;else return;L._leaveCb&&L._leaveCb(!0);const V=O[k];V&&In(i,V)&&V.el._leaveCb&&V.el._leaveCb(),M(F,[L])},enter(L){let F=a,V=f,H=s;if(!o.isMounted)if(t)F=_||a,V=E||f,H=S||s;else return;let z=!1;const R=L._enterCb=l=>{z||(z=!0,l?M(H,[L]):M(V,[L]),N.delayedLeave&&N.delayedLeave(),L._enterCb=void 0)};F?C(F,[L,R]):R()},leave(L,F){const V=String(i.key);if(L._enterCb&&L._enterCb(!0),o.isUnmounting)return F();M(u,[L]);let H=!1;const z=L._leaveCb=R=>{H||(H=!0,F(),R?M(b,[L]):M(v,[L]),L._leaveCb=void 0,O[V]===i&&delete O[V])};O[V]=i,h?C(h,[L,z]):z()},clone(L){return Rs(L,r,o,e)}};return N}function es(i){if(jo(i))return i=nn(i),i.children=null,i}function nu(i){return jo(i)?i.children?i.children[0]:void 0:i}function Ts(i,r){i.shapeFlag&6&&i.component?Ts(i.component.subTree,r):i.shapeFlag&128?(i.ssContent.transition=r.clone(i.ssContent),i.ssFallback.transition=r.clone(i.ssFallback)):i.transition=r}function Zf(i,r=!1,o){let e=[],t=0;for(let n=0;n<i.length;n++){let c=i[n];const p=o==null?c.key:String(o)+String(c.key!=null?c.key:n);c.type===rr?(c.patchFlag&128&&t++,e=e.concat(Zf(c.children,r,p))):(r||c.type!==wr)&&e.push(p!=null?nn(c,{key:p}):c)}if(t>1)for(let n=0;n<e.length;n++)e[n].patchFlag=-2;return e}function pr(i){return gt(i)?{setup:i,name:i.name}:i}const Ti=i=>!!i.type.__asyncLoader,jo=i=>i.type.__isKeepAlive;function Kh(i,r){Yf(i,"a",r)}function $h(i,r){Yf(i,"da",r)}function Yf(i,r,o=zt){const e=i.__wdc||(i.__wdc=()=>{let t=o;for(;t;){if(t.isDeactivated)return;t=t.parent}return i()});if(Uo(r,e,o),o){let t=o.parent;for(;t&&t.parent;)jo(t.parent.vnode)&&Vh(e,r,o,t),t=t.parent}}function Vh(i,r,o,e){const t=Uo(r,i,e,!0);cn(()=>{ca(e[r],t)},o)}function Uo(i,r,o=zt,e=!1){if(o){const t=o[i]||(o[i]=[]),n=r.__weh||(r.__weh=(...c)=>{if(o.isUnmounted)return;ci(),ni(o);const p=yr(r,o,i,c);return Ln(),li(),p});return e?t.unshift(n):t.push(n),n}}const fn=i=>(r,o=zt)=>(!Fi||i==="sp")&&Uo(i,r,o),Gh=fn("bm"),Qt=fn("m"),Jh=fn("bu"),Zh=fn("u"),Xf=fn("bum"),cn=fn("um"),Yh=fn("sp"),Xh=fn("rtg"),Qh=fn("rtc");function ed(i,r=zt){Uo("ec",i,r)}function Rn(i,r,o,e){const t=i.dirs,n=r&&r.dirs;for(let c=0;c<t.length;c++){const p=t[c];n&&(p.oldValue=n[c].value);let a=p.dir[e];a&&(ci(),yr(a,o,8,[i.el,p,i,r]),li())}}const td=Symbol();function rd(i,r,o={},e,t){if(nr.isCE||nr.parent&&Ti(nr.parent)&&nr.parent.isCE)return Tt("slot",r==="default"?null:{name:r},e&&e());let n=i[r];n&&n._c&&(n._d=!1),Vt();const c=n&&Qf(n(o)),p=jn(rr,{key:o.key||`_${r}`},c||(e?e():[]),c&&i._===1?64:-2);return!t&&p.scopeId&&(p.slotScopeIds=[p.scopeId+"-s"]),n&&n._c&&(n._d=!0),p}function Qf(i){return i.some(r=>wo(r)?!(r.type===wr||r.type===rr&&!Qf(r.children)):!0)?i:null}const Ps=i=>i?cc(i)?Ra(i)||i.proxy:Ps(i.parent):null,vo=Jt(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>Ps(i.parent),$root:i=>Ps(i.root),$emit:i=>i.emit,$options:i=>tc(i),$forceUpdate:i=>i.f||(i.f=()=>Df(i.update)),$nextTick:i=>i.n||(i.n=_a.bind(i.proxy)),$watch:i=>Dh.bind(i)}),nd={get({_:i},r){const{ctx:o,setupState:e,data:t,props:n,accessCache:c,type:p,appContext:a}=i;let f;if(r[0]!=="$"){const v=c[r];if(v!==void 0)switch(v){case 1:return e[r];case 2:return t[r];case 4:return o[r];case 3:return n[r]}else{if(e!==At&&Et(e,r))return c[r]=1,e[r];if(t!==At&&Et(t,r))return c[r]=2,t[r];if((f=i.propsOptions[0])&&Et(f,r))return c[r]=3,n[r];if(o!==At&&Et(o,r))return c[r]=4,o[r];Cs&&(c[r]=0)}}const s=vo[r];let u,h;if(s)return r==="$attrs"&&dr(i,"get",r),s(i);if((u=p.__cssModules)&&(u=u[r]))return u;if(o!==At&&Et(o,r))return c[r]=4,o[r];if(h=a.config.globalProperties,Et(h,r))return h[r]},set({_:i},r,o){const{data:e,setupState:t,ctx:n}=i;return t!==At&&Et(t,r)?(t[r]=o,!0):e!==At&&Et(e,r)?(e[r]=o,!0):Et(i.props,r)||r[0]==="$"&&r.slice(1)in i?!1:(n[r]=o,!0)},has({_:{data:i,setupState:r,accessCache:o,ctx:e,appContext:t,propsOptions:n}},c){let p;return!!o[c]||i!==At&&Et(i,c)||r!==At&&Et(r,c)||(p=n[0])&&Et(p,c)||Et(e,c)||Et(vo,c)||Et(t.config.globalProperties,c)},defineProperty(i,r,o){return o.get!=null?i._.accessCache[r]=0:Et(o,"value")&&this.set(i,r,o.value,null),Reflect.defineProperty(i,r,o)}};let Cs=!0;function id(i){const r=tc(i),o=i.proxy,e=i.ctx;Cs=!1,r.beforeCreate&&iu(r.beforeCreate,i,"bc");const{data:t,computed:n,methods:c,watch:p,provide:a,inject:f,created:s,beforeMount:u,mounted:h,beforeUpdate:v,updated:b,activated:y,deactivated:_,beforeDestroy:E,beforeUnmount:S,destroyed:k,unmounted:O,render:M,renderTracked:C,renderTriggered:N,errorCaptured:L,serverPrefetch:F,expose:V,inheritAttrs:H,components:z,directives:R,filters:l}=r;if(f&&od(f,e,null,i.appContext.config.unwrapInjectedRef),c)for(const m in c){const g=c[m];gt(g)&&(e[m]=g.bind(o))}if(t){const m=t.call(o,o);qt(m)&&(i.data=Wi(m))}if(Cs=!0,n)for(const m in n){const g=n[m],w=gt(g)?g.bind(o,o):gt(g.get)?g.get.bind(o,o):Ir,A=!gt(g)&>(g.set)?g.set.bind(o):Ir,P=It({get:w,set:A});Object.defineProperty(e,m,{enumerable:!0,configurable:!0,get:()=>P.value,set:T=>P.value=T})}if(p)for(const m in p)ec(p[m],e,o,m);if(a){const m=gt(a)?a.call(o):a;Reflect.ownKeys(m).forEach(g=>{Kr(g,m[g])})}s&&iu(s,i,"c");function d(m,g){lt(g)?g.forEach(w=>m(w.bind(o))):g&&m(g.bind(o))}if(d(Gh,u),d(Qt,h),d(Jh,v),d(Zh,b),d(Kh,y),d($h,_),d(ed,L),d(Qh,C),d(Xh,N),d(Xf,S),d(cn,O),d(Yh,F),lt(V))if(V.length){const m=i.exposed||(i.exposed={});V.forEach(g=>{Object.defineProperty(m,g,{get:()=>o[g],set:w=>o[g]=w})})}else i.exposed||(i.exposed={});M&&i.render===Ir&&(i.render=M),H!=null&&(i.inheritAttrs=H),z&&(i.components=z),R&&(i.directives=R)}function od(i,r,o=Ir,e=!1){lt(i)&&(i=Is(i));for(const t in i){const n=i[t];let c;qt(n)?"default"in n?c=ir(n.from||t,n.default,!0):c=ir(n.from||t):c=ir(n),Lt(c)&&e?Object.defineProperty(r,t,{enumerable:!0,configurable:!0,get:()=>c.value,set:p=>c.value=p}):r[t]=c}}function iu(i,r,o){yr(lt(i)?i.map(e=>e.bind(r.proxy)):i.bind(r.proxy),r,o)}function ec(i,r,o,e){const t=e.includes(".")?Gf(o,e):()=>o[e];if(Ut(i)){const n=r[i];gt(n)&&En(t,n)}else if(gt(i))En(t,i.bind(o));else if(qt(i))if(lt(i))i.forEach(n=>ec(n,r,o,e));else{const n=gt(i.handler)?i.handler.bind(o):r[i.handler];gt(n)&&En(t,n,i)}}function tc(i){const r=i.type,{mixins:o,extends:e}=r,{mixins:t,optionsCache:n,config:{optionMergeStrategies:c}}=i.appContext,p=n.get(r);let a;return p?a=p:!t.length&&!o&&!e?a=r:(a={},t.length&&t.forEach(f=>yo(a,f,c,!0)),yo(a,r,c)),n.set(r,a),a}function yo(i,r,o,e=!1){const{mixins:t,extends:n}=r;n&&yo(i,n,o,!0),t&&t.forEach(c=>yo(i,c,o,!0));for(const c in r)if(!(e&&c==="expose")){const p=sd[c]||o&&o[c];i[c]=p?p(i[c],r[c]):r[c]}return i}const sd={data:ou,props:Cn,emits:Cn,methods:Cn,computed:Cn,beforeCreate:Zt,created:Zt,beforeMount:Zt,mounted:Zt,beforeUpdate:Zt,updated:Zt,beforeDestroy:Zt,beforeUnmount:Zt,destroyed:Zt,unmounted:Zt,activated:Zt,deactivated:Zt,errorCaptured:Zt,serverPrefetch:Zt,components:Cn,directives:Cn,watch:ud,provide:ou,inject:ad};function ou(i,r){return r?i?function(){return Jt(gt(i)?i.call(this,this):i,gt(r)?r.call(this,this):r)}:r:i}function ad(i,r){return Cn(Is(i),Is(r))}function Is(i){if(lt(i)){const r={};for(let o=0;o<i.length;o++)r[i[o]]=i[o];return r}return i}function Zt(i,r){return i?[...new Set([].concat(i,r))]:r}function Cn(i,r){return i?Jt(Jt(Object.create(null),i),r):r}function ud(i,r){if(!i)return r;if(!r)return i;const o=Jt(Object.create(null),i);for(const e in r)o[e]=Zt(i[e],r[e]);return o}function fd(i,r,o,e=!1){const t={},n={};mo(n,qo,1),i.propsDefaults=Object.create(null),rc(i,r,t,n);for(const c in i.propsOptions[0])c in t||(t[c]=void 0);o?i.props=e?t:wh(t):i.type.props?i.props=t:i.props=n,i.attrs=n}function cd(i,r,o,e){const{props:t,attrs:n,vnode:{patchFlag:c}}=i,p=St(t),[a]=i.propsOptions;let f=!1;if((e||c>0)&&!(c&16)){if(c&8){const s=i.vnode.dynamicProps;for(let u=0;u<s.length;u++){let h=s[u];if(Lo(i.emitsOptions,h))continue;const v=r[h];if(a)if(Et(n,h))v!==n[h]&&(n[h]=v,f=!0);else{const b=ti(h);t[b]=Os(a,p,b,v,i,!1)}else v!==n[h]&&(n[h]=v,f=!0)}}}else{rc(i,r,t,n)&&(f=!0);let s;for(const u in p)(!r||!Et(r,u)&&((s=fi(u))===u||!Et(r,s)))&&(a?o&&(o[u]!==void 0||o[s]!==void 0)&&(t[u]=Os(a,p,u,void 0,i,!0)):delete t[u]);if(n!==p)for(const u in n)(!r||!Et(r,u)&&!0)&&(delete n[u],f=!0)}f&&rn(i,"set","$attrs")}function rc(i,r,o,e){const[t,n]=i.propsOptions;let c=!1,p;if(r)for(let a in r){if(so(a))continue;const f=r[a];let s;t&&Et(t,s=ti(a))?!n||!n.includes(s)?o[s]=f:(p||(p={}))[s]=f:Lo(i.emitsOptions,a)||(!(a in e)||f!==e[a])&&(e[a]=f,c=!0)}if(n){const a=St(o),f=p||At;for(let s=0;s<n.length;s++){const u=n[s];o[u]=Os(t,a,u,f[u],i,!Et(f,u))}}return c}function Os(i,r,o,e,t,n){const c=i[o];if(c!=null){const p=Et(c,"default");if(p&&e===void 0){const a=c.default;if(c.type!==Function&>(a)){const{propsDefaults:f}=t;o in f?e=f[o]:(ni(t),e=f[o]=a.call(null,r),Ln())}else e=a}c[0]&&(n&&!p?e=!1:c[1]&&(e===""||e===fi(o))&&(e=!0))}return e}function nc(i,r,o=!1){const e=r.propsCache,t=e.get(i);if(t)return t;const n=i.props,c={},p=[];let a=!1;if(!gt(i)){const s=u=>{a=!0;const[h,v]=nc(u,r,!0);Jt(c,h),v&&p.push(...v)};!o&&r.mixins.length&&r.mixins.forEach(s),i.extends&&s(i.extends),i.mixins&&i.mixins.forEach(s)}if(!n&&!a)return e.set(i,Yn),Yn;if(lt(n))for(let s=0;s<n.length;s++){const u=ti(n[s]);su(u)&&(c[u]=At)}else if(n)for(const s in n){const u=ti(s);if(su(u)){const h=n[s],v=c[u]=lt(h)||gt(h)?{type:h}:h;if(v){const b=fu(Boolean,v.type),y=fu(String,v.type);v[0]=b>-1,v[1]=y<0||b<y,(b>-1||Et(v,"default"))&&p.push(u)}}}const f=[c,p];return e.set(i,f),f}function su(i){return i[0]!=="$"}function au(i){const r=i&&i.toString().match(/^\s*function (\w+)/);return r?r[1]:i===null?"null":""}function uu(i,r){return au(i)===au(r)}function fu(i,r){return lt(r)?r.findIndex(o=>uu(o,i)):gt(r)&&uu(r,i)?0:-1}const ic=i=>i[0]==="_"||i==="$stable",Ma=i=>lt(i)?i.map(Fr):[Fr(i)],ld=(i,r,o)=>{if(r._n)return r;const e=bn((...t)=>Ma(r(...t)),o);return e._c=!1,e},oc=(i,r,o)=>{const e=i._ctx;for(const t in i){if(ic(t))continue;const n=i[t];if(gt(n))r[t]=ld(t,n,e);else if(n!=null){const c=Ma(n);r[t]=()=>c}}},sc=(i,r)=>{const o=Ma(r);i.slots.default=()=>o},hd=(i,r)=>{if(i.vnode.shapeFlag&32){const o=r._;o?(i.slots=St(r),mo(r,"_",o)):oc(r,i.slots={})}else i.slots={},r&&sc(i,r);mo(i.slots,qo,1)},dd=(i,r,o)=>{const{vnode:e,slots:t}=i;let n=!0,c=At;if(e.shapeFlag&32){const p=r._;p?o&&p===1?n=!1:(Jt(t,r),!o&&p===1&&delete t._):(n=!r.$stable,oc(r,t)),c=r}else r&&(sc(i,r),c={default:1});if(n)for(const p in t)!ic(p)&&!(p in c)&&delete t[p]};function ac(){return{app:null,config:{isNativeTag:Fl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let pd=0;function md(i,r){return function(e,t=null){gt(e)||(e=Object.assign({},e)),t!=null&&!qt(t)&&(t=null);const n=ac(),c=new Set;let p=!1;const a=n.app={_uid:pd++,_component:e,_props:t,_container:null,_context:n,_instance:null,version:Bd,get config(){return n.config},set config(f){},use(f,...s){return c.has(f)||(f&>(f.install)?(c.add(f),f.install(a,...s)):gt(f)&&(c.add(f),f(a,...s))),a},mixin(f){return n.mixins.includes(f)||n.mixins.push(f),a},component(f,s){return s?(n.components[f]=s,a):n.components[f]},directive(f,s){return s?(n.directives[f]=s,a):n.directives[f]},mount(f,s,u){if(!p){const h=Tt(e,t);return h.appContext=n,s&&r?r(h,f):i(h,f,u),p=!0,a._container=f,f.__vue_app__=a,Ra(h.component)||h.component.proxy}},unmount(){p&&(i(null,a._container),delete a._container.__vue_app__)},provide(f,s){return n.provides[f]=s,a}};return a}}function Ns(i,r,o,e,t=!1){if(lt(i)){i.forEach((h,v)=>Ns(h,r&&(lt(r)?r[v]:r),o,e,t));return}if(Ti(e)&&!t)return;const n=e.shapeFlag&4?Ra(e.component)||e.component.proxy:e.el,c=t?null:n,{i:p,r:a}=i,f=r&&r.r,s=p.refs===At?p.refs={}:p.refs,u=p.setupState;if(f!=null&&f!==a&&(Ut(f)?(s[f]=null,Et(u,f)&&(u[f]=null)):Lt(f)&&(f.value=null)),gt(a))Mn(a,p,12,[c,s]);else{const h=Ut(a),v=Lt(a);if(h||v){const b=()=>{if(i.f){const y=h?s[a]:a.value;t?lt(y)&&ca(y,n):lt(y)?y.includes(n)||y.push(n):h?(s[a]=[n],Et(u,a)&&(u[a]=s[a])):(a.value=[n],i.k&&(s[i.k]=a.value))}else h?(s[a]=c,Et(u,a)&&(u[a]=c)):v&&(a.value=c,i.k&&(s[i.k]=c))};c?(b.id=-1,tr(b,o)):b()}}}const tr=Fh;function gd(i){return bd(i)}function bd(i,r){const o=Vl();o.__VUE__=!0;const{insert:e,remove:t,patchProp:n,createElement:c,createText:p,createComment:a,setText:f,setElementText:s,parentNode:u,nextSibling:h,setScopeId:v=Ir,cloneNode:b,insertStaticContent:y}=i,_=(G,W,Y,ee=null,te=null,oe=null,fe=!1,ne=null,ce=!!W.dynamicChildren)=>{if(G===W)return;G&&!In(G,W)&&(ee=j(G),q(G,te,oe,!0),G=null),W.patchFlag===-2&&(ce=!1,W.dynamicChildren=null);const{type:se,ref:ae,shapeFlag:he}=W;switch(se){case Sa:E(G,W,Y,ee);break;case wr:S(G,W,Y,ee);break;case ts:G==null&&k(W,Y,ee,fe);break;case rr:R(G,W,Y,ee,te,oe,fe,ne,ce);break;default:he&1?C(G,W,Y,ee,te,oe,fe,ne,ce):he&6?l(G,W,Y,ee,te,oe,fe,ne,ce):(he&64||he&128)&&se.process(G,W,Y,ee,te,oe,fe,ne,ce,B)}ae!=null&&te&&Ns(ae,G&&G.ref,oe,W||G,!W)},E=(G,W,Y,ee)=>{if(G==null)e(W.el=p(W.children),Y,ee);else{const te=W.el=G.el;W.children!==G.children&&f(te,W.children)}},S=(G,W,Y,ee)=>{G==null?e(W.el=a(W.children||""),Y,ee):W.el=G.el},k=(G,W,Y,ee)=>{[G.el,G.anchor]=y(G.children,W,Y,ee,G.el,G.anchor)},O=({el:G,anchor:W},Y,ee)=>{let te;for(;G&&G!==W;)te=h(G),e(G,Y,ee),G=te;e(W,Y,ee)},M=({el:G,anchor:W})=>{let Y;for(;G&&G!==W;)Y=h(G),t(G),G=Y;t(W)},C=(G,W,Y,ee,te,oe,fe,ne,ce)=>{fe=fe||W.type==="svg",G==null?N(W,Y,ee,te,oe,fe,ne,ce):V(G,W,te,oe,fe,ne,ce)},N=(G,W,Y,ee,te,oe,fe,ne)=>{let ce,se;const{type:ae,props:he,shapeFlag:me,transition:le,patchFlag:ye,dirs:Se}=G;if(G.el&&b!==void 0&&ye===-1)ce=G.el=b(G.el);else{if(ce=G.el=c(G.type,oe,he&&he.is,he),me&8?s(ce,G.children):me&16&&F(G.children,ce,null,ee,te,oe&&ae!=="foreignObject",fe,ne),Se&&Rn(G,null,ee,"created"),he){for(const Oe in he)Oe!=="value"&&!so(Oe)&&n(ce,Oe,null,he[Oe],oe,G.children,ee,te,K);"value"in he&&n(ce,"value",null,he.value),(se=he.onVnodeBeforeMount)&&Lr(se,ee,G)}L(ce,G,G.scopeId,fe,ee)}Se&&Rn(G,null,ee,"beforeMount");const pe=(!te||te&&!te.pendingBranch)&&le&&!le.persisted;pe&&le.beforeEnter(ce),e(ce,W,Y),((se=he&&he.onVnodeMounted)||pe||Se)&&tr(()=>{se&&Lr(se,ee,G),pe&&le.enter(ce),Se&&Rn(G,null,ee,"mounted")},te)},L=(G,W,Y,ee,te)=>{if(Y&&v(G,Y),ee)for(let oe=0;oe<ee.length;oe++)v(G,ee[oe]);if(te){let oe=te.subTree;if(W===oe){const fe=te.vnode;L(G,fe,fe.scopeId,fe.slotScopeIds,te.parent)}}},F=(G,W,Y,ee,te,oe,fe,ne,ce=0)=>{for(let se=ce;se<G.length;se++){const ae=G[se]=ne?vn(G[se]):Fr(G[se]);_(null,ae,W,Y,ee,te,oe,fe,ne)}},V=(G,W,Y,ee,te,oe,fe)=>{const ne=W.el=G.el;let{patchFlag:ce,dynamicChildren:se,dirs:ae}=W;ce|=G.patchFlag&16;const he=G.props||At,me=W.props||At;let le;Y&&Tn(Y,!1),(le=me.onVnodeBeforeUpdate)&&Lr(le,Y,W,G),ae&&Rn(W,G,Y,"beforeUpdate"),Y&&Tn(Y,!0);const ye=te&&W.type!=="foreignObject";if(se?H(G.dynamicChildren,se,ne,Y,ee,ye,oe):fe||w(G,W,ne,null,Y,ee,ye,oe,!1),ce>0){if(ce&16)z(ne,W,he,me,Y,ee,te);else if(ce&2&&he.class!==me.class&&n(ne,"class",null,me.class,te),ce&4&&n(ne,"style",he.style,me.style,te),ce&8){const Se=W.dynamicProps;for(let pe=0;pe<Se.length;pe++){const Oe=Se[pe],Le=he[Oe],_e=me[Oe];(_e!==Le||Oe==="value")&&n(ne,Oe,Le,_e,te,G.children,Y,ee,K)}}ce&1&&G.children!==W.children&&s(ne,W.children)}else!fe&&se==null&&z(ne,W,he,me,Y,ee,te);((le=me.onVnodeUpdated)||ae)&&tr(()=>{le&&Lr(le,Y,W,G),ae&&Rn(W,G,Y,"updated")},ee)},H=(G,W,Y,ee,te,oe,fe)=>{for(let ne=0;ne<W.length;ne++){const ce=G[ne],se=W[ne],ae=ce.el&&(ce.type===rr||!In(ce,se)||ce.shapeFlag&70)?u(ce.el):Y;_(ce,se,ae,null,ee,te,oe,fe,!0)}},z=(G,W,Y,ee,te,oe,fe)=>{if(Y!==ee){for(const ne in ee){if(so(ne))continue;const ce=ee[ne],se=Y[ne];ce!==se&&ne!=="value"&&n(G,ne,se,ce,fe,W.children,te,oe,K)}if(Y!==At)for(const ne in Y)!so(ne)&&!(ne in ee)&&n(G,ne,Y[ne],null,fe,W.children,te,oe,K);"value"in ee&&n(G,"value",Y.value,ee.value)}},R=(G,W,Y,ee,te,oe,fe,ne,ce)=>{const se=W.el=G?G.el:p(""),ae=W.anchor=G?G.anchor:p("");let{patchFlag:he,dynamicChildren:me,slotScopeIds:le}=W;le&&(ne=ne?ne.concat(le):le),G==null?(e(se,Y,ee),e(ae,Y,ee),F(W.children,Y,ae,te,oe,fe,ne,ce)):he>0&&he&64&&me&&G.dynamicChildren?(H(G.dynamicChildren,me,Y,te,oe,fe,ne),(W.key!=null||te&&W===te.subTree)&&Ea(G,W,!0)):w(G,W,Y,ae,te,oe,fe,ne,ce)},l=(G,W,Y,ee,te,oe,fe,ne,ce)=>{W.slotScopeIds=ne,G==null?W.shapeFlag&512?te.ctx.activate(W,Y,ee,fe,ce):x(W,Y,ee,te,oe,fe,ce):d(G,W,ce)},x=(G,W,Y,ee,te,oe,fe)=>{const ne=G.component=Td(G,ee,te);if(jo(G)&&(ne.ctx.renderer=B),Pd(ne),ne.asyncDep){if(te&&te.registerDep(ne,m),!G.el){const ce=ne.subTree=Tt(wr);S(null,ce,W,Y)}return}m(ne,G,W,Y,te,oe,fe)},d=(G,W,Y)=>{const ee=W.component=G.component;if(jh(G,W,Y))if(ee.asyncDep&&!ee.asyncResolved){g(ee,W,Y);return}else ee.next=W,Ch(ee.update),ee.update();else W.el=G.el,ee.vnode=W},m=(G,W,Y,ee,te,oe,fe)=>{const ne=()=>{if(G.isMounted){let{next:ae,bu:he,u:me,parent:le,vnode:ye}=G,Se=ae,pe;Tn(G,!1),ae?(ae.el=ye.el,g(G,ae,fe)):ae=ye,he&&Xo(he),(pe=ae.props&&ae.props.onVnodeBeforeUpdate)&&Lr(pe,le,ae,ye),Tn(G,!0);const Oe=Qo(G),Le=G.subTree;G.subTree=Oe,_(Le,Oe,u(Le.el),j(Le),G,te,oe),ae.el=Oe.el,Se===null&&Uh(G,Oe.el),me&&tr(me,te),(pe=ae.props&&ae.props.onVnodeUpdated)&&tr(()=>Lr(pe,le,ae,ye),te)}else{let ae;const{el:he,props:me}=W,{bm:le,m:ye,parent:Se}=G,pe=Ti(W);if(Tn(G,!1),le&&Xo(le),!pe&&(ae=me&&me.onVnodeBeforeMount)&&Lr(ae,Se,W),Tn(G,!0),he&&J){const Oe=()=>{G.subTree=Qo(G),J(he,G.subTree,G,te,null)};pe?W.type.__asyncLoader().then(()=>!G.isUnmounted&&Oe()):Oe()}else{const Oe=G.subTree=Qo(G);_(null,Oe,Y,ee,G,te,oe),W.el=Oe.el}if(ye&&tr(ye,te),!pe&&(ae=me&&me.onVnodeMounted)){const Oe=W;tr(()=>Lr(ae,Se,Oe),te)}(W.shapeFlag&256||Se&&Ti(Se.vnode)&&Se.vnode.shapeFlag&256)&&G.a&&tr(G.a,te),G.isMounted=!0,W=Y=ee=null}},ce=G.effect=new pa(ne,()=>Df(se),G.scope),se=G.update=()=>ce.run();se.id=G.uid,Tn(G,!0),se()},g=(G,W,Y)=>{W.component=G;const ee=G.vnode.props;G.vnode=W,G.next=null,cd(G,W.props,ee,Y),dd(G,W.children,Y),ci(),Bo(void 0,G.update),li()},w=(G,W,Y,ee,te,oe,fe,ne,ce=!1)=>{const se=G&&G.children,ae=G?G.shapeFlag:0,he=W.children,{patchFlag:me,shapeFlag:le}=W;if(me>0){if(me&128){P(se,he,Y,ee,te,oe,fe,ne,ce);return}else if(me&256){A(se,he,Y,ee,te,oe,fe,ne,ce);return}}le&8?(ae&16&&K(se,te,oe),he!==se&&s(Y,he)):ae&16?le&16?P(se,he,Y,ee,te,oe,fe,ne,ce):K(se,te,oe,!0):(ae&8&&s(Y,""),le&16&&F(he,Y,ee,te,oe,fe,ne,ce))},A=(G,W,Y,ee,te,oe,fe,ne,ce)=>{G=G||Yn,W=W||Yn;const se=G.length,ae=W.length,he=Math.min(se,ae);let me;for(me=0;me<he;me++){const le=W[me]=ce?vn(W[me]):Fr(W[me]);_(G[me],le,Y,null,te,oe,fe,ne,ce)}se>ae?K(G,te,oe,!0,!1,he):F(W,Y,ee,te,oe,fe,ne,ce,he)},P=(G,W,Y,ee,te,oe,fe,ne,ce)=>{let se=0;const ae=W.length;let he=G.length-1,me=ae-1;for(;se<=he&&se<=me;){const le=G[se],ye=W[se]=ce?vn(W[se]):Fr(W[se]);if(In(le,ye))_(le,ye,Y,null,te,oe,fe,ne,ce);else break;se++}for(;se<=he&&se<=me;){const le=G[he],ye=W[me]=ce?vn(W[me]):Fr(W[me]);if(In(le,ye))_(le,ye,Y,null,te,oe,fe,ne,ce);else break;he--,me--}if(se>he){if(se<=me){const le=me+1,ye=le<ae?W[le].el:ee;for(;se<=me;)_(null,W[se]=ce?vn(W[se]):Fr(W[se]),Y,ye,te,oe,fe,ne,ce),se++}}else if(se>me)for(;se<=he;)q(G[se],te,oe,!0),se++;else{const le=se,ye=se,Se=new Map;for(se=ye;se<=me;se++){const je=W[se]=ce?vn(W[se]):Fr(W[se]);je.key!=null&&Se.set(je.key,se)}let pe,Oe=0;const Le=me-ye+1;let _e=!1,Fe=0;const qe=new Array(Le);for(se=0;se<Le;se++)qe[se]=0;for(se=le;se<=he;se++){const je=G[se];if(Oe>=Le){q(je,te,oe,!0);continue}let ie;if(je.key!=null)ie=Se.get(je.key);else for(pe=ye;pe<=me;pe++)if(qe[pe-ye]===0&&In(je,W[pe])){ie=pe;break}ie===void 0?q(je,te,oe,!0):(qe[ie-ye]=se+1,ie>=Fe?Fe=ie:_e=!0,_(je,W[ie],Y,null,te,oe,fe,ne,ce),Oe++)}const Ee=_e?vd(qe):Yn;for(pe=Ee.length-1,se=Le-1;se>=0;se--){const je=ye+se,ie=W[je],de=je+1<ae?W[je+1].el:ee;qe[se]===0?_(null,ie,Y,de,te,oe,fe,ne,ce):_e&&(pe<0||se!==Ee[pe]?T(ie,Y,de,2):pe--)}}},T=(G,W,Y,ee,te=null)=>{const{el:oe,type:fe,transition:ne,children:ce,shapeFlag:se}=G;if(se&6){T(G.component.subTree,W,Y,ee);return}if(se&128){G.suspense.move(W,Y,ee);return}if(se&64){fe.move(G,W,Y,B);return}if(fe===rr){e(oe,W,Y);for(let he=0;he<ce.length;he++)T(ce[he],W,Y,ee);e(G.anchor,W,Y);return}if(fe===ts){O(G,W,Y);return}if(ee!==2&&se&1&&ne)if(ee===0)ne.beforeEnter(oe),e(oe,W,Y),tr(()=>ne.enter(oe),te);else{const{leave:he,delayLeave:me,afterLeave:le}=ne,ye=()=>e(oe,W,Y),Se=()=>{he(oe,()=>{ye(),le&&le()})};me?me(oe,ye,Se):Se()}else e(oe,W,Y)},q=(G,W,Y,ee=!1,te=!1)=>{const{type:oe,props:fe,ref:ne,children:ce,dynamicChildren:se,shapeFlag:ae,patchFlag:he,dirs:me}=G;if(ne!=null&&Ns(ne,null,Y,G,!0),ae&256){W.ctx.deactivate(G);return}const le=ae&1&&me,ye=!Ti(G);let Se;if(ye&&(Se=fe&&fe.onVnodeBeforeUnmount)&&Lr(Se,W,G),ae&6)$(G.component,Y,ee);else{if(ae&128){G.suspense.unmount(Y,ee);return}le&&Rn(G,null,W,"beforeUnmount"),ae&64?G.type.remove(G,W,Y,te,B,ee):se&&(oe!==rr||he>0&&he&64)?K(se,W,Y,!1,!0):(oe===rr&&he&384||!te&&ae&16)&&K(ce,W,Y),ee&&Z(G)}(ye&&(Se=fe&&fe.onVnodeUnmounted)||le)&&tr(()=>{Se&&Lr(Se,W,G),le&&Rn(G,null,W,"unmounted")},Y)},Z=G=>{const{type:W,el:Y,anchor:ee,transition:te}=G;if(W===rr){I(Y,ee);return}if(W===ts){M(G);return}const oe=()=>{t(Y),te&&!te.persisted&&te.afterLeave&&te.afterLeave()};if(G.shapeFlag&1&&te&&!te.persisted){const{leave:fe,delayLeave:ne}=te,ce=()=>fe(Y,oe);ne?ne(G.el,oe,ce):ce()}else oe()},I=(G,W)=>{let Y;for(;G!==W;)Y=h(G),t(G),G=Y;t(W)},$=(G,W,Y)=>{const{bum:ee,scope:te,update:oe,subTree:fe,um:ne}=G;ee&&Xo(ee),te.stop(),oe&&(oe.active=!1,q(fe,G,W,Y)),ne&&tr(ne,W),tr(()=>{G.isUnmounted=!0},W),W&&W.pendingBranch&&!W.isUnmounted&&G.asyncDep&&!G.asyncResolved&&G.suspenseId===W.pendingId&&(W.deps--,W.deps===0&&W.resolve())},K=(G,W,Y,ee=!1,te=!1,oe=0)=>{for(let fe=oe;fe<G.length;fe++)q(G[fe],W,Y,ee,te)},j=G=>G.shapeFlag&6?j(G.component.subTree):G.shapeFlag&128?G.suspense.next():h(G.anchor||G.el),D=(G,W,Y)=>{G==null?W._vnode&&q(W._vnode,null,null,!0):_(W._vnode||null,G,W,null,null,null,Y),Wf(),W._vnode=G},B={p:_,um:q,m:T,r:Z,mt:x,mc:F,pc:w,pbc:H,n:j,o:i};let U,J;return r&&([U,J]=r(B)),{render:D,hydrate:U,createApp:md(D,U)}}function Tn({effect:i,update:r},o){i.allowRecurse=r.allowRecurse=o}function Ea(i,r,o=!1){const e=i.children,t=r.children;if(lt(e)&<(t))for(let n=0;n<e.length;n++){const c=e[n];let p=t[n];p.shapeFlag&1&&!p.dynamicChildren&&((p.patchFlag<=0||p.patchFlag===32)&&(p=t[n]=vn(t[n]),p.el=c.el),o||Ea(c,p))}}function vd(i){const r=i.slice(),o=[0];let e,t,n,c,p;const a=i.length;for(e=0;e<a;e++){const f=i[e];if(f!==0){if(t=o[o.length-1],i[t]<f){r[e]=t,o.push(e);continue}for(n=0,c=o.length-1;n<c;)p=n+c>>1,i[o[p]]<f?n=p+1:c=p;f<i[o[n]]&&(n>0&&(r[e]=o[n-1]),o[n]=e)}}for(n=o.length,c=o[n-1];n-- >0;)o[n]=c,c=r[c];return o}const yd=i=>i.__isTeleport,Pi=i=>i&&(i.disabled||i.disabled===""),cu=i=>typeof SVGElement!="undefined"&&i instanceof SVGElement,Bs=(i,r)=>{const o=i&&i.to;return Ut(o)?r?r(o):null:o},wd={__isTeleport:!0,process(i,r,o,e,t,n,c,p,a,f){const{mc:s,pc:u,pbc:h,o:{insert:v,querySelector:b,createText:y,createComment:_}}=f,E=Pi(r.props);let{shapeFlag:S,children:k,dynamicChildren:O}=r;if(i==null){const M=r.el=y(""),C=r.anchor=y("");v(M,o,e),v(C,o,e);const N=r.target=Bs(r.props,b),L=r.targetAnchor=y("");N&&(v(L,N),c=c||cu(N));const F=(V,H)=>{S&16&&s(k,V,H,t,n,c,p,a)};E?F(o,C):N&&F(N,L)}else{r.el=i.el;const M=r.anchor=i.anchor,C=r.target=i.target,N=r.targetAnchor=i.targetAnchor,L=Pi(i.props),F=L?o:C,V=L?M:N;if(c=c||cu(C),O?(h(i.dynamicChildren,O,F,t,n,c,p),Ea(i,r,!0)):a||u(i,r,F,V,t,n,c,p,!1),E)L||eo(r,o,M,f,1);else if((r.props&&r.props.to)!==(i.props&&i.props.to)){const H=r.target=Bs(r.props,b);H&&eo(r,H,null,f,0)}else L&&eo(r,C,N,f,1)}},remove(i,r,o,e,{um:t,o:{remove:n}},c){const{shapeFlag:p,children:a,anchor:f,targetAnchor:s,target:u,props:h}=i;if(u&&n(s),(c||!Pi(h))&&(n(f),p&16))for(let v=0;v<a.length;v++){const b=a[v];t(b,r,o,!0,!!b.dynamicChildren)}},move:eo,hydrate:_d};function eo(i,r,o,{o:{insert:e},m:t},n=2){n===0&&e(i.targetAnchor,r,o);const{el:c,anchor:p,shapeFlag:a,children:f,props:s}=i,u=n===2;if(u&&e(c,r,o),(!u||Pi(s))&&a&16)for(let h=0;h<f.length;h++)t(f[h],r,o,2);u&&e(p,r,o)}function _d(i,r,o,e,t,n,{o:{nextSibling:c,parentNode:p,querySelector:a}},f){const s=r.target=Bs(r.props,a);if(s){const u=s._lpa||s.firstChild;if(r.shapeFlag&16)if(Pi(r.props))r.anchor=f(c(i),r,p(i),o,e,t,n),r.targetAnchor=u;else{r.anchor=c(i);let h=u;for(;h;)if(h=c(h),h&&h.nodeType===8&&h.data==="teleport anchor"){r.targetAnchor=h,s._lpa=r.targetAnchor&&c(r.targetAnchor);break}f(u,r,s,o,e,t,n)}}return r.anchor&&c(r.anchor)}const xd=wd,rr=Symbol(void 0),Sa=Symbol(void 0),wr=Symbol(void 0),ts=Symbol(void 0),Ci=[];let Pr=null;function Vt(i=!1){Ci.push(Pr=i?null:[])}function Md(){Ci.pop(),Pr=Ci[Ci.length-1]||null}let qi=1;function lu(i){qi+=i}function uc(i){return i.dynamicChildren=qi>0?Pr||Yn:null,Md(),qi>0&&Pr&&Pr.push(i),i}function tn(i,r,o,e,t,n){return uc(Bt(i,r,o,e,t,n,!0))}function jn(i,r,o,e,t){return uc(Tt(i,r,o,e,t,!0))}function wo(i){return i?i.__v_isVNode===!0:!1}function In(i,r){return i.type===r.type&&i.key===r.key}const qo="__vInternal",fc=({key:i})=>i!=null?i:null,ao=({ref:i,ref_key:r,ref_for:o})=>i!=null?Ut(i)||Lt(i)||gt(i)?{i:nr,r:i,k:r,f:!!o}:i:null;function Bt(i,r=null,o=null,e=0,t=null,n=i===rr?0:1,c=!1,p=!1){const a={__v_isVNode:!0,__v_skip:!0,type:i,props:r,key:r&&fc(r),ref:r&&ao(r),scopeId:Vf,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:n,patchFlag:e,dynamicProps:t,dynamicChildren:null,appContext:null};return p?(ka(a,o),n&128&&i.normalize(a)):o&&(a.shapeFlag|=Ut(o)?8:16),qi>0&&!c&&Pr&&(a.patchFlag>0||n&6)&&a.patchFlag!==32&&Pr.push(a),a}const Tt=Ed;function Ed(i,r=null,o=null,e=0,t=null,n=!1){if((!i||i===td)&&(i=wr),wo(i)){const p=nn(i,r,!0);return o&&ka(p,o),qi>0&&!n&&Pr&&(p.shapeFlag&6?Pr[Pr.indexOf(i)]=p:Pr.push(p)),p.patchFlag|=-2,p}if(Nd(i)&&(i=i.__vccOpts),r){r=Sd(r);let{class:p,style:a}=r;p&&!Ut(p)&&(r.class=To(p)),qt(a)&&(Lf(a)&&!lt(a)&&(a=Jt({},a)),r.style=ua(a))}const c=Ut(i)?1:qh(i)?128:yd(i)?64:qt(i)?4:gt(i)?2:0;return Bt(i,r,o,e,t,c,n,!0)}function Sd(i){return i?Lf(i)||qo in i?Jt({},i):i:null}function nn(i,r,o=!1){const{props:e,ref:t,patchFlag:n,children:c}=i,p=r?kd(e||{},r):e;return{__v_isVNode:!0,__v_skip:!0,type:i.type,props:p,key:p&&fc(p),ref:r&&r.ref?o&&t?lt(t)?t.concat(ao(r)):[t,ao(r)]:ao(r):t,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:c,target:i.target,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:r&&i.type!==rr?n===-1?16:n|16:n,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:i.transition,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&nn(i.ssContent),ssFallback:i.ssFallback&&nn(i.ssFallback),el:i.el,anchor:i.anchor}}function Ki(i=" ",r=0){return Tt(Sa,null,i,r)}function uo(i="",r=!1){return r?(Vt(),jn(wr,null,i)):Tt(wr,null,i)}function Fr(i){return i==null||typeof i=="boolean"?Tt(wr):lt(i)?Tt(rr,null,i.slice()):typeof i=="object"?vn(i):Tt(Sa,null,String(i))}function vn(i){return i.el===null||i.memo?i:nn(i)}function ka(i,r){let o=0;const{shapeFlag:e}=i;if(r==null)r=null;else if(lt(r))o=16;else if(typeof r=="object")if(e&65){const t=r.default;t&&(t._c&&(t._d=!1),ka(i,t()),t._c&&(t._d=!0));return}else{o=32;const t=r._;!t&&!(qo in r)?r._ctx=nr:t===3&&nr&&(nr.slots._===1?r._=1:(r._=2,i.patchFlag|=1024))}else gt(r)?(r={default:r,_ctx:nr},o=32):(r=String(r),e&64?(o=16,r=[Ki(r)]):o=8);i.children=r,i.shapeFlag|=o}function kd(...i){const r={};for(let o=0;o<i.length;o++){const e=i[o];for(const t in e)if(t==="class")r.class!==e.class&&(r.class=To([r.class,e.class]));else if(t==="style")r.style=ua([r.style,e.style]);else if(Po(t)){const n=r[t],c=e[t];c&&n!==c&&!(lt(n)&&n.includes(c))&&(r[t]=n?[].concat(n,c):c)}else t!==""&&(r[t]=e[t])}return r}function Lr(i,r,o,e=null){yr(i,r,7,[o,e])}const Ad=ac();let Rd=0;function Td(i,r,o){const e=i.type,t=(r?r.appContext:i.appContext)||Ad,n={uid:Rd++,vnode:i,type:e,parent:r,appContext:t,root:null,next:null,subTree:null,effect:null,update:null,scope:new Mf(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:r?r.provides:Object.create(t.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nc(e,t),emitsOptions:$f(e,t),emit:null,emitted:null,propsDefaults:At,inheritAttrs:e.inheritAttrs,ctx:At,data:At,props:At,attrs:At,slots:At,refs:At,setupState:At,setupContext:null,suspense:o,suspenseId:o?o.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return n.ctx={_:n},n.root=r?r.root:n,n.emit=Nh.bind(null,n),i.ce&&i.ce(n),n}let zt=null;const Aa=()=>zt||nr,ni=i=>{zt=i,i.scope.on()},Ln=()=>{zt&&zt.scope.off(),zt=null};function cc(i){return i.vnode.shapeFlag&4}let Fi=!1;function Pd(i,r=!1){Fi=r;const{props:o,children:e}=i.vnode,t=cc(i);fd(i,o,t,r),hd(i,e);const n=t?Cd(i,r):void 0;return Fi=!1,n}function Cd(i,r){const o=i.type;i.accessCache=Object.create(null),i.proxy=ri(new Proxy(i.ctx,nd));const{setup:e}=o;if(e){const t=i.setupContext=e.length>1?Od(i):null;ni(i),ci();const n=Mn(e,i,0,[i.props,t]);if(li(),Ln(),yf(n)){if(n.then(Ln,Ln),r)return n.then(c=>{hu(i,c,r)}).catch(c=>{No(c,i,0)});i.asyncDep=n}else hu(i,n,r)}else lc(i,r)}function hu(i,r,o){gt(r)?i.type.__ssrInlineRender?i.ssrRender=r:i.render=r:qt(r)&&(i.setupState=qf(r)),lc(i,o)}let du;function lc(i,r,o){const e=i.type;if(!i.render){if(!r&&du&&!e.render){const t=e.template;if(t){const{isCustomElement:n,compilerOptions:c}=i.appContext.config,{delimiters:p,compilerOptions:a}=e,f=Jt(Jt({isCustomElement:n,delimiters:p},c),a);e.render=du(t,f)}}i.render=e.render||Ir}ni(i),ci(),id(i),li(),Ln()}function Id(i){return new Proxy(i.attrs,{get(r,o){return dr(i,"get","$attrs"),r[o]}})}function Od(i){const r=e=>{i.exposed=e||{}};let o;return{get attrs(){return o||(o=Id(i))},slots:i.slots,emit:i.emit,expose:r}}function Ra(i){if(i.exposed)return i.exposeProxy||(i.exposeProxy=new Proxy(qf(ri(i.exposed)),{get(r,o){if(o in r)return r[o];if(o in vo)return vo[o](i)}}))}function Nd(i){return gt(i)&&"__vccOpts"in i}const It=(i,r)=>Rh(i,r,Fi);function Xt(i,r,o){const e=arguments.length;return e===2?qt(r)&&!lt(r)?wo(r)?Tt(i,null,[r]):Tt(i,r):Tt(i,null,r):(e>3?o=Array.prototype.slice.call(arguments,2):e===3&&wo(o)&&(o=[o]),Tt(i,r,o))}const Bd="3.2.37",Ld="http://www.w3.org/2000/svg",On=typeof document!="undefined"?document:null,pu=On&&On.createElement("template"),jd={insert:(i,r,o)=>{r.insertBefore(i,o||null)},remove:i=>{const r=i.parentNode;r&&r.removeChild(i)},createElement:(i,r,o,e)=>{const t=r?On.createElementNS(Ld,i):On.createElement(i,o?{is:o}:void 0);return i==="select"&&e&&e.multiple!=null&&t.setAttribute("multiple",e.multiple),t},createText:i=>On.createTextNode(i),createComment:i=>On.createComment(i),setText:(i,r)=>{i.nodeValue=r},setElementText:(i,r)=>{i.textContent=r},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>On.querySelector(i),setScopeId(i,r){i.setAttribute(r,"")},cloneNode(i){const r=i.cloneNode(!0);return"_value"in i&&(r._value=i._value),r},insertStaticContent(i,r,o,e,t,n){const c=o?o.previousSibling:r.lastChild;if(t&&(t===n||t.nextSibling))for(;r.insertBefore(t.cloneNode(!0),o),!(t===n||!(t=t.nextSibling)););else{pu.innerHTML=e?`<svg>${i}</svg>`:i;const p=pu.content;if(e){const a=p.firstChild;for(;a.firstChild;)p.appendChild(a.firstChild);p.removeChild(a)}r.insertBefore(p,o)}return[c?c.nextSibling:r.firstChild,o?o.previousSibling:r.lastChild]}};function Ud(i,r,o){const e=i._vtc;e&&(r=(r?[r,...e]:[...e]).join(" ")),r==null?i.removeAttribute("class"):o?i.setAttribute("class",r):i.className=r}function qd(i,r,o){const e=i.style,t=Ut(o);if(o&&!t){for(const n in o)Ls(e,n,o[n]);if(r&&!Ut(r))for(const n in r)o[n]==null&&Ls(e,n,"")}else{const n=e.display;t?r!==o&&(e.cssText=o):r&&i.removeAttribute("style"),"_vod"in i&&(e.display=n)}}const mu=/\s*!important$/;function Ls(i,r,o){if(lt(o))o.forEach(e=>Ls(i,r,e));else if(o==null&&(o=""),r.startsWith("--"))i.setProperty(r,o);else{const e=Fd(i,r);mu.test(o)?i.setProperty(fi(e),o.replace(mu,""),"important"):i[e]=o}}const gu=["Webkit","Moz","ms"],rs={};function Fd(i,r){const o=rs[r];if(o)return o;let e=ti(r);if(e!=="filter"&&e in i)return rs[r]=e;e=xf(e);for(let t=0;t<gu.length;t++){const n=gu[t]+e;if(n in i)return rs[r]=n}return r}const bu="http://www.w3.org/1999/xlink";function Dd(i,r,o,e,t){if(e&&r.startsWith("xlink:"))o==null?i.removeAttributeNS(bu,r.slice(6,r.length)):i.setAttributeNS(bu,r,o);else{const n=Ll(r);o==null||n&&!mf(o)?i.removeAttribute(r):i.setAttribute(r,n?"":o)}}function zd(i,r,o,e,t,n,c){if(r==="innerHTML"||r==="textContent"){e&&c(e,t,n),i[r]=o==null?"":o;return}if(r==="value"&&i.tagName!=="PROGRESS"&&!i.tagName.includes("-")){i._value=o;const a=o==null?"":o;(i.value!==a||i.tagName==="OPTION")&&(i.value=a),o==null&&i.removeAttribute(r);return}let p=!1;if(o===""||o==null){const a=typeof i[r];a==="boolean"?o=mf(o):o==null&&a==="string"?(o="",p=!0):a==="number"&&(o=0,p=!0)}try{i[r]=o}catch{}p&&i.removeAttribute(r)}const[hc,Hd]=(()=>{let i=Date.now,r=!1;if(typeof window!="undefined"){Date.now()>document.createEvent("Event").timeStamp&&(i=performance.now.bind(performance));const o=navigator.userAgent.match(/firefox\/(\d+)/i);r=!!(o&&Number(o[1])<=53)}return[i,r]})();let js=0;const Wd=Promise.resolve(),Kd=()=>{js=0},$d=()=>js||(Wd.then(Kd),js=hc());function Vd(i,r,o,e){i.addEventListener(r,o,e)}function Gd(i,r,o,e){i.removeEventListener(r,o,e)}function Jd(i,r,o,e,t=null){const n=i._vei||(i._vei={}),c=n[r];if(e&&c)c.value=e;else{const[p,a]=Zd(r);if(e){const f=n[r]=Yd(e,t);Vd(i,p,f,a)}else c&&(Gd(i,p,c,a),n[r]=void 0)}}const vu=/(?:Once|Passive|Capture)$/;function Zd(i){let r;if(vu.test(i)){r={};let o;for(;o=i.match(vu);)i=i.slice(0,i.length-o[0].length),r[o[0].toLowerCase()]=!0}return[fi(i.slice(2)),r]}function Yd(i,r){const o=e=>{const t=e.timeStamp||hc();(Hd||t>=o.attached-1)&&yr(Xd(e,o.value),r,5,[e])};return o.value=i,o.attached=$d(),o}function Xd(i,r){if(lt(r)){const o=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{o.call(i),i._stopped=!0},r.map(e=>t=>!t._stopped&&e&&e(t))}else return r}const yu=/^on[a-z]/,Qd=(i,r,o,e,t=!1,n,c,p,a)=>{r==="class"?Ud(i,e,t):r==="style"?qd(i,o,e):Po(r)?fa(r)||Jd(i,r,o,e,c):(r[0]==="."?(r=r.slice(1),!0):r[0]==="^"?(r=r.slice(1),!1):e0(i,r,e,t))?zd(i,r,e,n,c,p,a):(r==="true-value"?i._trueValue=e:r==="false-value"&&(i._falseValue=e),Dd(i,r,e,t))};function e0(i,r,o,e){return e?!!(r==="innerHTML"||r==="textContent"||r in i&&yu.test(r)&>(o)):r==="spellcheck"||r==="draggable"||r==="translate"||r==="form"||r==="list"&&i.tagName==="INPUT"||r==="type"&&i.tagName==="TEXTAREA"||yu.test(r)&&Ut(o)?!1:r in i}const t0={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Wh.props;const r0=Jt({patchProp:Qd},jd);let wu;function n0(){return wu||(wu=gd(r0))}const i0=(...i)=>{const r=n0().createApp(...i),{mount:o}=r;return r.mount=e=>{const t=o0(e);if(!t)return;const n=r._component;!gt(n)&&!n.render&&!n.template&&(n.template=t.innerHTML),t.innerHTML="";const c=o(t,!1,t instanceof SVGElement);return t instanceof Element&&(t.removeAttribute("v-cloak"),t.setAttribute("data-v-app","")),c},r};function o0(i){return Ut(i)?document.querySelector(i):i}var s0=!1;/*!
* pinia v2.0.16
* (c) 2022 Eduardo San Martin Morote
* @license MIT
*/let dc;const Fo=i=>dc=i,pc=Symbol();function Us(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}var Ii;(function(i){i.direct="direct",i.patchObject="patch object",i.patchFunction="patch function"})(Ii||(Ii={}));function a0(){const i=Ef(!0),r=i.run(()=>kt({}));let o=[],e=[];const t=ri({install(n){Fo(t),t._a=n,n.provide(pc,t),n.config.globalProperties.$pinia=t,e.forEach(c=>o.push(c)),e=[]},use(n){return!this._a&&!s0?e.push(n):o.push(n),this},_p:o,_a:null,_e:i,_s:new Map,state:r});return t}const mc=()=>{};function _u(i,r,o,e=mc){i.push(r);const t=()=>{const n=i.indexOf(r);n>-1&&(i.splice(n,1),e())};return!o&&Aa()&&cn(t),t}function Wn(i,...r){i.slice().forEach(o=>{o(...r)})}function qs(i,r){for(const o in r){if(!r.hasOwnProperty(o))continue;const e=r[o],t=i[o];Us(t)&&Us(e)&&i.hasOwnProperty(o)&&!Lt(e)&&!xn(e)?i[o]=qs(t,e):i[o]=e}return i}const u0=Symbol();function f0(i){return!Us(i)||!i.hasOwnProperty(u0)}const{assign:Yr}=Object;function c0(i){return!!(Lt(i)&&i.effect)}function l0(i,r,o,e){const{state:t,actions:n,getters:c}=r,p=o.state.value[i];let a;function f(){p||(o.state.value[i]=t?t():{});const s=Eh(o.state.value[i]);return Yr(s,n,Object.keys(c||{}).reduce((u,h)=>(u[h]=ri(It(()=>{Fo(o);const v=o._s.get(i);return c[h].call(v,v)})),u),{}))}return a=gc(i,f,r,o,e,!0),a.$reset=function(){const u=t?t():{};this.$patch(h=>{Yr(h,u)})},a}function gc(i,r,o={},e,t,n){let c;const p=Yr({actions:{}},o),a={deep:!0};let f,s,u=ri([]),h=ri([]),v;const b=e.state.value[i];!n&&!b&&(e.state.value[i]={}),kt({});let y;function _(N){let L;f=s=!1,typeof N=="function"?(N(e.state.value[i]),L={type:Ii.patchFunction,storeId:i,events:v}):(qs(e.state.value[i],N),L={type:Ii.patchObject,payload:N,storeId:i,events:v});const F=y=Symbol();_a().then(()=>{y===F&&(f=!0)}),s=!0,Wn(u,L,e.state.value[i])}const E=mc;function S(){c.stop(),u=[],h=[],e._s.delete(i)}function k(N,L){return function(){Fo(e);const F=Array.from(arguments),V=[],H=[];function z(x){V.push(x)}function R(x){H.push(x)}Wn(h,{args:F,name:N,store:M,after:z,onError:R});let l;try{l=L.apply(this&&this.$id===i?this:M,F)}catch(x){throw Wn(H,x),x}return l instanceof Promise?l.then(x=>(Wn(V,x),x)).catch(x=>(Wn(H,x),Promise.reject(x))):(Wn(V,l),l)}}const O={_p:e,$id:i,$onAction:_u.bind(null,h),$patch:_,$reset:E,$subscribe(N,L={}){const F=_u(u,N,L.detached,()=>V()),V=c.run(()=>En(()=>e.state.value[i],H=>{(L.flush==="sync"?s:f)&&N({storeId:i,type:Ii.direct,events:v},H)},Yr({},a,L)));return F},$dispose:S},M=Wi(Yr({},O));e._s.set(i,M);const C=e._e.run(()=>(c=Ef(),c.run(()=>r())));for(const N in C){const L=C[N];if(Lt(L)&&!c0(L)||xn(L))n||(b&&f0(L)&&(Lt(L)?L.value=b[N]:qs(L,b[N])),e.state.value[i][N]=L);else if(typeof L=="function"){const F=k(N,L);C[N]=F,p.actions[N]=L}}return Yr(M,C),Yr(St(M),C),Object.defineProperty(M,"$state",{get:()=>e.state.value[i],set:N=>{_(L=>{Yr(L,N)})}}),e._p.forEach(N=>{Yr(M,c.run(()=>N({store:M,app:e._a,pinia:e,options:p})))}),b&&n&&o.hydrate&&o.hydrate(M.$state,b),f=!0,s=!0,M}function h0(i,r,o){let e,t;const n=typeof r=="function";typeof i=="string"?(e=i,t=n?o:r):(t=i,e=i.id);function c(p,a){const f=Aa();return p=p||f&&ir(pc),p&&Fo(p),p=dc,p._s.has(e)||(n?gc(e,r,t,p):l0(e,t,p)),p._s.get(e)}return c.$id=e,c}var Ta=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function d0(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var bc={exports:{}};(function(i){(function(r,o){function e(R,l){if(!R)throw new Error(l||"Assertion failed")}function t(R,l){R.super_=l;var x=function(){};x.prototype=l.prototype,R.prototype=new x,R.prototype.constructor=R}function n(R,l,x){if(n.isBN(R))return R;this.negative=0,this.words=null,this.length=0,this.red=null,R!==null&&((l==="le"||l==="be")&&(x=l,l=10),this._init(R||0,l||10,x||"be"))}typeof r=="object"?r.exports=n:o.BN=n,n.BN=n,n.wordSize=26;var c;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?c=window.Buffer:c=require("buffer").Buffer}catch{}n.isBN=function(l){return l instanceof n?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===n.wordSize&&Array.isArray(l.words)},n.max=function(l,x){return l.cmp(x)>0?l:x},n.min=function(l,x){return l.cmp(x)<0?l:x},n.prototype._init=function(l,x,d){if(typeof l=="number")return this._initNumber(l,x,d);if(typeof l=="object")return this._initArray(l,x,d);x==="hex"&&(x=16),e(x===(x|0)&&x>=2&&x<=36),l=l.toString().replace(/\s+/g,"");var m=0;l[0]==="-"&&(m++,this.negative=1),m<l.length&&(x===16?this._parseHex(l,m,d):(this._parseBase(l,x,m),d==="le"&&this._initArray(this.toArray(),x,d)))},n.prototype._initNumber=function(l,x,d){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(e(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),x,d)},n.prototype._initArray=function(l,x,d){if(e(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var g,w,A=0;if(d==="be")for(m=l.length-1,g=0;m>=0;m-=3)w=l[m]|l[m-1]<<8|l[m-2]<<16,this.words[g]|=w<<A&67108863,this.words[g+1]=w>>>26-A&67108863,A+=24,A>=26&&(A-=26,g++);else if(d==="le")for(m=0,g=0;m<l.length;m+=3)w=l[m]|l[m+1]<<8|l[m+2]<<16,this.words[g]|=w<<A&67108863,this.words[g+1]=w>>>26-A&67108863,A+=24,A>=26&&(A-=26,g++);return this._strip()};function p(R,l){var x=R.charCodeAt(l);if(x>=48&&x<=57)return x-48;if(x>=65&&x<=70)return x-55;if(x>=97&&x<=102)return x-87;e(!1,"Invalid character in "+R)}function a(R,l,x){var d=p(R,x);return x-1>=l&&(d|=p(R,x-1)<<4),d}n.prototype._parseHex=function(l,x,d){this.length=Math.ceil((l.length-x)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var g=0,w=0,A;if(d==="be")for(m=l.length-1;m>=x;m-=2)A=a(l,x,m)<<g,this.words[w]|=A&67108863,g>=18?(g-=18,w+=1,this.words[w]|=A>>>26):g+=8;else{var P=l.length-x;for(m=P%2===0?x+1:x;m<l.length;m+=2)A=a(l,x,m)<<g,this.words[w]|=A&67108863,g>=18?(g-=18,w+=1,this.words[w]|=A>>>26):g+=8}this._strip()};function f(R,l,x,d){for(var m=0,g=0,w=Math.min(R.length,x),A=l;A<w;A++){var P=R.charCodeAt(A)-48;m*=d,P>=49?g=P-49+10:P>=17?g=P-17+10:g=P,e(P>=0&&g<d,"Invalid character"),m+=g}return m}n.prototype._parseBase=function(l,x,d){this.words=[0],this.length=1;for(var m=0,g=1;g<=67108863;g*=x)m++;m--,g=g/x|0;for(var w=l.length-d,A=w%m,P=Math.min(w,w-A)+d,T=0,q=d;q<P;q+=m)T=f(l,q,q+m,x),this.imuln(g),this.words[0]+T<67108864?this.words[0]+=T:this._iaddn(T);if(A!==0){var Z=1;for(T=f(l,q,l.length,x),q=0;q<A;q++)Z*=x;this.imuln(Z),this.words[0]+T<67108864?this.words[0]+=T:this._iaddn(T)}this._strip()},n.prototype.copy=function(l){l.words=new Array(this.length);for(var x=0;x<this.length;x++)l.words[x]=this.words[x];l.length=this.length,l.negative=this.negative,l.red=this.red};function s(R,l){R.words=l.words,R.length=l.length,R.negative=l.negative,R.red=l.red}if(n.prototype._move=function(l){s(l,this)},n.prototype.clone=function(){var l=new n(null);return this.copy(l),l},n.prototype._expand=function(l){for(;this.length<l;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{n.prototype.inspect=u}else n.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","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"],v=[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],b=[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];n.prototype.toString=function(l,x){l=l||10,x=x|0||1;var d;if(l===16||l==="hex"){d="";for(var m=0,g=0,w=0;w<this.length;w++){var A=this.words[w],P=((A<<m|g)&16777215).toString(16);g=A>>>24-m&16777215,m+=2,m>=26&&(m-=26,w--),g!==0||w!==this.length-1?d=h[6-P.length]+P+d:d=P+d}for(g!==0&&(d=g.toString(16)+d);d.length%x!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(l===(l|0)&&l>=2&&l<=36){var T=v[l],q=b[l];d="";var Z=this.clone();for(Z.negative=0;!Z.isZero();){var I=Z.modrn(q).toString(l);Z=Z.idivn(q),Z.isZero()?d=I+d:d=h[T-I.length]+I+d}for(this.isZero()&&(d="0"+d);d.length%x!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}e(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},n.prototype.toJSON=function(){return this.toString(16,2)},c&&(n.prototype.toBuffer=function(l,x){return this.toArrayLike(c,l,x)}),n.prototype.toArray=function(l,x){return this.toArrayLike(Array,l,x)};var y=function(l,x){return l.allocUnsafe?l.allocUnsafe(x):new l(x)};n.prototype.toArrayLike=function(l,x,d){this._strip();var m=this.byteLength(),g=d||Math.max(1,m);e(m<=g,"byte array longer than desired length"),e(g>0,"Requested array length <= 0");var w=y(l,g),A=x==="le"?"LE":"BE";return this["_toArrayLike"+A](w,m),w},n.prototype._toArrayLikeLE=function(l,x){for(var d=0,m=0,g=0,w=0;g<this.length;g++){var A=this.words[g]<<w|m;l[d++]=A&255,d<l.length&&(l[d++]=A>>8&255),d<l.length&&(l[d++]=A>>16&255),w===6?(d<l.length&&(l[d++]=A>>24&255),m=0,w=0):(m=A>>>24,w+=2)}if(d<l.length)for(l[d++]=m;d<l.length;)l[d++]=0},n.prototype._toArrayLikeBE=function(l,x){for(var d=l.length-1,m=0,g=0,w=0;g<this.length;g++){var A=this.words[g]<<w|m;l[d--]=A&255,d>=0&&(l[d--]=A>>8&255),d>=0&&(l[d--]=A>>16&255),w===6?(d>=0&&(l[d--]=A>>24&255),m=0,w=0):(m=A>>>24,w+=2)}if(d>=0)for(l[d--]=m;d>=0;)l[d--]=0},Math.clz32?n.prototype._countBits=function(l){return 32-Math.clz32(l)}:n.prototype._countBits=function(l){var x=l,d=0;return x>=4096&&(d+=13,x>>>=13),x>=64&&(d+=7,x>>>=7),x>=8&&(d+=4,x>>>=4),x>=2&&(d+=2,x>>>=2),d+x},n.prototype._zeroBits=function(l){if(l===0)return 26;var x=l,d=0;return(x&8191)===0&&(d+=13,x>>>=13),(x&127)===0&&(d+=7,x>>>=7),(x&15)===0&&(d+=4,x>>>=4),(x&3)===0&&(d+=2,x>>>=2),(x&1)===0&&d++,d},n.prototype.bitLength=function(){var l=this.words[this.length-1],x=this._countBits(l);return(this.length-1)*26+x};function _(R){for(var l=new Array(R.bitLength()),x=0;x<l.length;x++){var d=x/26|0,m=x%26;l[x]=R.words[d]>>>m&1}return l}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,x=0;x<this.length;x++){var d=this._zeroBits(this.words[x]);if(l+=d,d!==26)break}return l},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},n.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var x=0;x<l.length;x++)this.words[x]=this.words[x]|l.words[x];return this._strip()},n.prototype.ior=function(l){return e((this.negative|l.negative)===0),this.iuor(l)},n.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},n.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},n.prototype.iuand=function(l){var x;this.length>l.length?x=l:x=this;for(var d=0;d<x.length;d++)this.words[d]=this.words[d]&l.words[d];return this.length=x.length,this._strip()},n.prototype.iand=function(l){return e((this.negative|l.negative)===0),this.iuand(l)},n.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},n.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},n.prototype.iuxor=function(l){var x,d;this.length>l.length?(x=this,d=l):(x=l,d=this);for(var m=0;m<d.length;m++)this.words[m]=x.words[m]^d.words[m];if(this!==x)for(;m<x.length;m++)this.words[m]=x.words[m];return this.length=x.length,this._strip()},n.prototype.ixor=function(l){return e((this.negative|l.negative)===0),this.iuxor(l)},n.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},n.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},n.prototype.inotn=function(l){e(typeof l=="number"&&l>=0);var x=Math.ceil(l/26)|0,d=l%26;this._expand(x),d>0&&x--;for(var m=0;m<x;m++)this.words[m]=~this.words[m]&67108863;return d>0&&(this.words[m]=~this.words[m]&67108863>>26-d),this._strip()},n.prototype.notn=function(l){return this.clone().inotn(l)},n.prototype.setn=function(l,x){e(typeof l=="number"&&l>=0);var d=l/26|0,m=l%26;return this._expand(d+1),x?this.words[d]=this.words[d]|1<<m:this.words[d]=this.words[d]&~(1<<m),this._strip()},n.prototype.iadd=function(l){var x;if(this.negative!==0&&l.negative===0)return this.negative=0,x=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,x=this.isub(l),l.negative=1,x._normSign();var d,m;this.length>l.length?(d=this,m=l):(d=l,m=this);for(var g=0,w=0;w<m.length;w++)x=(d.words[w]|0)+(m.words[w]|0)+g,this.words[w]=x&67108863,g=x>>>26;for(;g!==0&&w<d.length;w++)x=(d.words[w]|0)+g,this.words[w]=x&67108863,g=x>>>26;if(this.length=d.length,g!==0)this.words[this.length]=g,this.length++;else if(d!==this)for(;w<d.length;w++)this.words[w]=d.words[w];return this},n.prototype.add=function(l){var x;return l.negative!==0&&this.negative===0?(l.negative=0,x=this.sub(l),l.negative^=1,x):l.negative===0&&this.negative!==0?(this.negative=0,x=l.sub(this),this.negative=1,x):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},n.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var x=this.iadd(l);return l.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var d=this.cmp(l);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,g;d>0?(m=this,g=l):(m=l,g=this);for(var w=0,A=0;A<g.length;A++)x=(m.words[A]|0)-(g.words[A]|0)+w,w=x>>26,this.words[A]=x&67108863;for(;w!==0&&A<m.length;A++)x=(m.words[A]|0)+w,w=x>>26,this.words[A]=x&67108863;if(w===0&&A<m.length&&m!==this)for(;A<m.length;A++)this.words[A]=m.words[A];return this.length=Math.max(this.length,A),m!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(l){return this.clone().isub(l)};function E(R,l,x){x.negative=l.negative^R.negative;var d=R.length+l.length|0;x.length=d,d=d-1|0;var m=R.words[0]|0,g=l.words[0]|0,w=m*g,A=w&67108863,P=w/67108864|0;x.words[0]=A;for(var T=1;T<d;T++){for(var q=P>>>26,Z=P&67108863,I=Math.min(T,l.length-1),$=Math.max(0,T-R.length+1);$<=I;$++){var K=T-$|0;m=R.words[K]|0,g=l.words[$]|0,w=m*g+Z,q+=w/67108864|0,Z=w&67108863}x.words[T]=Z|0,P=q|0}return P!==0?x.words[T]=P|0:x.length--,x._strip()}var S=function(l,x,d){var m=l.words,g=x.words,w=d.words,A=0,P,T,q,Z=m[0]|0,I=Z&8191,$=Z>>>13,K=m[1]|0,j=K&8191,D=K>>>13,B=m[2]|0,U=B&8191,J=B>>>13,G=m[3]|0,W=G&8191,Y=G>>>13,ee=m[4]|0,te=ee&8191,oe=ee>>>13,fe=m[5]|0,ne=fe&8191,ce=fe>>>13,se=m[6]|0,ae=se&8191,he=se>>>13,me=m[7]|0,le=me&8191,ye=me>>>13,Se=m[8]|0,pe=Se&8191,Oe=Se>>>13,Le=m[9]|0,_e=Le&8191,Fe=Le>>>13,qe=g[0]|0,Ee=qe&8191,je=qe>>>13,ie=g[1]|0,de=ie&8191,ke=ie>>>13,Be=g[2]|0,ge=Be&8191,Ue=Be>>>13,De=g[3]|0,we=De&8191,Ve=De>>>13,et=g[4]|0,Ie=et&8191,Ge=et>>>13,Je=g[5]|0,Re=Je&8191,He=Je>>>13,tt=g[6]|0,Te=tt&8191,We=tt>>>13,Ze=g[7]|0,Pe=Ze&8191,rt=Ze>>>13,Ye=g[8]|0,Ae=Ye&8191,Xe=Ye>>>13,Qe=g[9]|0,Ce=Qe&8191,Ke=Qe>>>13;d.negative=l.negative^x.negative,d.length=19,P=Math.imul(I,Ee),T=Math.imul(I,je),T=T+Math.imul($,Ee)|0,q=Math.imul($,je);var X=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(X>>>26)|0,X&=67108863,P=Math.imul(j,Ee),T=Math.imul(j,je),T=T+Math.imul(D,Ee)|0,q=Math.imul(D,je),P=P+Math.imul(I,de)|0,T=T+Math.imul(I,ke)|0,T=T+Math.imul($,de)|0,q=q+Math.imul($,ke)|0;var Q=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(Q>>>26)|0,Q&=67108863,P=Math.imul(U,Ee),T=Math.imul(U,je),T=T+Math.imul(J,Ee)|0,q=Math.imul(J,je),P=P+Math.imul(j,de)|0,T=T+Math.imul(j,ke)|0,T=T+Math.imul(D,de)|0,q=q+Math.imul(D,ke)|0,P=P+Math.imul(I,ge)|0,T=T+Math.imul(I,Ue)|0,T=T+Math.imul($,ge)|0,q=q+Math.imul($,Ue)|0;var re=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(re>>>26)|0,re&=67108863,P=Math.imul(W,Ee),T=Math.imul(W,je),T=T+Math.imul(Y,Ee)|0,q=Math.imul(Y,je),P=P+Math.imul(U,de)|0,T=T+Math.imul(U,ke)|0,T=T+Math.imul(J,de)|0,q=q+Math.imul(J,ke)|0,P=P+Math.imul(j,ge)|0,T=T+Math.imul(j,Ue)|0,T=T+Math.imul(D,ge)|0,q=q+Math.imul(D,Ue)|0,P=P+Math.imul(I,we)|0,T=T+Math.imul(I,Ve)|0,T=T+Math.imul($,we)|0,q=q+Math.imul($,Ve)|0;var ue=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(ue>>>26)|0,ue&=67108863,P=Math.imul(te,Ee),T=Math.imul(te,je),T=T+Math.imul(oe,Ee)|0,q=Math.imul(oe,je),P=P+Math.imul(W,de)|0,T=T+Math.imul(W,ke)|0,T=T+Math.imul(Y,de)|0,q=q+Math.imul(Y,ke)|0,P=P+Math.imul(U,ge)|0,T=T+Math.imul(U,Ue)|0,T=T+Math.imul(J,ge)|0,q=q+Math.imul(J,Ue)|0,P=P+Math.imul(j,we)|0,T=T+Math.imul(j,Ve)|0,T=T+Math.imul(D,we)|0,q=q+Math.imul(D,Ve)|0,P=P+Math.imul(I,Ie)|0,T=T+Math.imul(I,Ge)|0,T=T+Math.imul($,Ie)|0,q=q+Math.imul($,Ge)|0;var xe=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(xe>>>26)|0,xe&=67108863,P=Math.imul(ne,Ee),T=Math.imul(ne,je),T=T+Math.imul(ce,Ee)|0,q=Math.imul(ce,je),P=P+Math.imul(te,de)|0,T=T+Math.imul(te,ke)|0,T=T+Math.imul(oe,de)|0,q=q+Math.imul(oe,ke)|0,P=P+Math.imul(W,ge)|0,T=T+Math.imul(W,Ue)|0,T=T+Math.imul(Y,ge)|0,q=q+Math.imul(Y,Ue)|0,P=P+Math.imul(U,we)|0,T=T+Math.imul(U,Ve)|0,T=T+Math.imul(J,we)|0,q=q+Math.imul(J,Ve)|0,P=P+Math.imul(j,Ie)|0,T=T+Math.imul(j,Ge)|0,T=T+Math.imul(D,Ie)|0,q=q+Math.imul(D,Ge)|0,P=P+Math.imul(I,Re)|0,T=T+Math.imul(I,He)|0,T=T+Math.imul($,Re)|0,q=q+Math.imul($,He)|0;var Me=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(Me>>>26)|0,Me&=67108863,P=Math.imul(ae,Ee),T=Math.imul(ae,je),T=T+Math.imul(he,Ee)|0,q=Math.imul(he,je),P=P+Math.imul(ne,de)|0,T=T+Math.imul(ne,ke)|0,T=T+Math.imul(ce,de)|0,q=q+Math.imul(ce,ke)|0,P=P+Math.imul(te,ge)|0,T=T+Math.imul(te,Ue)|0,T=T+Math.imul(oe,ge)|0,q=q+Math.imul(oe,Ue)|0,P=P+Math.imul(W,we)|0,T=T+Math.imul(W,Ve)|0,T=T+Math.imul(Y,we)|0,q=q+Math.imul(Y,Ve)|0,P=P+Math.imul(U,Ie)|0,T=T+Math.imul(U,Ge)|0,T=T+Math.imul(J,Ie)|0,q=q+Math.imul(J,Ge)|0,P=P+Math.imul(j,Re)|0,T=T+Math.imul(j,He)|0,T=T+Math.imul(D,Re)|0,q=q+Math.imul(D,He)|0,P=P+Math.imul(I,Te)|0,T=T+Math.imul(I,We)|0,T=T+Math.imul($,Te)|0,q=q+Math.imul($,We)|0;var ze=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(ze>>>26)|0,ze&=67108863,P=Math.imul(le,Ee),T=Math.imul(le,je),T=T+Math.imul(ye,Ee)|0,q=Math.imul(ye,je),P=P+Math.imul(ae,de)|0,T=T+Math.imul(ae,ke)|0,T=T+Math.imul(he,de)|0,q=q+Math.imul(he,ke)|0,P=P+Math.imul(ne,ge)|0,T=T+Math.imul(ne,Ue)|0,T=T+Math.imul(ce,ge)|0,q=q+Math.imul(ce,Ue)|0,P=P+Math.imul(te,we)|0,T=T+Math.imul(te,Ve)|0,T=T+Math.imul(oe,we)|0,q=q+Math.imul(oe,Ve)|0,P=P+Math.imul(W,Ie)|0,T=T+Math.imul(W,Ge)|0,T=T+Math.imul(Y,Ie)|0,q=q+Math.imul(Y,Ge)|0,P=P+Math.imul(U,Re)|0,T=T+Math.imul(U,He)|0,T=T+Math.imul(J,Re)|0,q=q+Math.imul(J,He)|0,P=P+Math.imul(j,Te)|0,T=T+Math.imul(j,We)|0,T=T+Math.imul(D,Te)|0,q=q+Math.imul(D,We)|0,P=P+Math.imul(I,Pe)|0,T=T+Math.imul(I,rt)|0,T=T+Math.imul($,Pe)|0,q=q+Math.imul($,rt)|0;var $e=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+($e>>>26)|0,$e&=67108863,P=Math.imul(pe,Ee),T=Math.imul(pe,je),T=T+Math.imul(Oe,Ee)|0,q=Math.imul(Oe,je),P=P+Math.imul(le,de)|0,T=T+Math.imul(le,ke)|0,T=T+Math.imul(ye,de)|0,q=q+Math.imul(ye,ke)|0,P=P+Math.imul(ae,ge)|0,T=T+Math.imul(ae,Ue)|0,T=T+Math.imul(he,ge)|0,q=q+Math.imul(he,Ue)|0,P=P+Math.imul(ne,we)|0,T=T+Math.imul(ne,Ve)|0,T=T+Math.imul(ce,we)|0,q=q+Math.imul(ce,Ve)|0,P=P+Math.imul(te,Ie)|0,T=T+Math.imul(te,Ge)|0,T=T+Math.imul(oe,Ie)|0,q=q+Math.imul(oe,Ge)|0,P=P+Math.imul(W,Re)|0,T=T+Math.imul(W,He)|0,T=T+Math.imul(Y,Re)|0,q=q+Math.imul(Y,He)|0,P=P+Math.imul(U,Te)|0,T=T+Math.imul(U,We)|0,T=T+Math.imul(J,Te)|0,q=q+Math.imul(J,We)|0,P=P+Math.imul(j,Pe)|0,T=T+Math.imul(j,rt)|0,T=T+Math.imul(D,Pe)|0,q=q+Math.imul(D,rt)|0,P=P+Math.imul(I,Ae)|0,T=T+Math.imul(I,Xe)|0,T=T+Math.imul($,Ae)|0,q=q+Math.imul($,Xe)|0;var it=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(it>>>26)|0,it&=67108863,P=Math.imul(_e,Ee),T=Math.imul(_e,je),T=T+Math.imul(Fe,Ee)|0,q=Math.imul(Fe,je),P=P+Math.imul(pe,de)|0,T=T+Math.imul(pe,ke)|0,T=T+Math.imul(Oe,de)|0,q=q+Math.imul(Oe,ke)|0,P=P+Math.imul(le,ge)|0,T=T+Math.imul(le,Ue)|0,T=T+Math.imul(ye,ge)|0,q=q+Math.imul(ye,Ue)|0,P=P+Math.imul(ae,we)|0,T=T+Math.imul(ae,Ve)|0,T=T+Math.imul(he,we)|0,q=q+Math.imul(he,Ve)|0,P=P+Math.imul(ne,Ie)|0,T=T+Math.imul(ne,Ge)|0,T=T+Math.imul(ce,Ie)|0,q=q+Math.imul(ce,Ge)|0,P=P+Math.imul(te,Re)|0,T=T+Math.imul(te,He)|0,T=T+Math.imul(oe,Re)|0,q=q+Math.imul(oe,He)|0,P=P+Math.imul(W,Te)|0,T=T+Math.imul(W,We)|0,T=T+Math.imul(Y,Te)|0,q=q+Math.imul(Y,We)|0,P=P+Math.imul(U,Pe)|0,T=T+Math.imul(U,rt)|0,T=T+Math.imul(J,Pe)|0,q=q+Math.imul(J,rt)|0,P=P+Math.imul(j,Ae)|0,T=T+Math.imul(j,Xe)|0,T=T+Math.imul(D,Ae)|0,q=q+Math.imul(D,Xe)|0,P=P+Math.imul(I,Ce)|0,T=T+Math.imul(I,Ke)|0,T=T+Math.imul($,Ce)|0,q=q+Math.imul($,Ke)|0;var Ne=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,P=Math.imul(_e,de),T=Math.imul(_e,ke),T=T+Math.imul(Fe,de)|0,q=Math.imul(Fe,ke),P=P+Math.imul(pe,ge)|0,T=T+Math.imul(pe,Ue)|0,T=T+Math.imul(Oe,ge)|0,q=q+Math.imul(Oe,Ue)|0,P=P+Math.imul(le,we)|0,T=T+Math.imul(le,Ve)|0,T=T+Math.imul(ye,we)|0,q=q+Math.imul(ye,Ve)|0,P=P+Math.imul(ae,Ie)|0,T=T+Math.imul(ae,Ge)|0,T=T+Math.imul(he,Ie)|0,q=q+Math.imul(he,Ge)|0,P=P+Math.imul(ne,Re)|0,T=T+Math.imul(ne,He)|0,T=T+Math.imul(ce,Re)|0,q=q+Math.imul(ce,He)|0,P=P+Math.imul(te,Te)|0,T=T+Math.imul(te,We)|0,T=T+Math.imul(oe,Te)|0,q=q+Math.imul(oe,We)|0,P=P+Math.imul(W,Pe)|0,T=T+Math.imul(W,rt)|0,T=T+Math.imul(Y,Pe)|0,q=q+Math.imul(Y,rt)|0,P=P+Math.imul(U,Ae)|0,T=T+Math.imul(U,Xe)|0,T=T+Math.imul(J,Ae)|0,q=q+Math.imul(J,Xe)|0,P=P+Math.imul(j,Ce)|0,T=T+Math.imul(j,Ke)|0,T=T+Math.imul(D,Ce)|0,q=q+Math.imul(D,Ke)|0;var ve=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(ve>>>26)|0,ve&=67108863,P=Math.imul(_e,ge),T=Math.imul(_e,Ue),T=T+Math.imul(Fe,ge)|0,q=Math.imul(Fe,Ue),P=P+Math.imul(pe,we)|0,T=T+Math.imul(pe,Ve)|0,T=T+Math.imul(Oe,we)|0,q=q+Math.imul(Oe,Ve)|0,P=P+Math.imul(le,Ie)|0,T=T+Math.imul(le,Ge)|0,T=T+Math.imul(ye,Ie)|0,q=q+Math.imul(ye,Ge)|0,P=P+Math.imul(ae,Re)|0,T=T+Math.imul(ae,He)|0,T=T+Math.imul(he,Re)|0,q=q+Math.imul(he,He)|0,P=P+Math.imul(ne,Te)|0,T=T+Math.imul(ne,We)|0,T=T+Math.imul(ce,Te)|0,q=q+Math.imul(ce,We)|0,P=P+Math.imul(te,Pe)|0,T=T+Math.imul(te,rt)|0,T=T+Math.imul(oe,Pe)|0,q=q+Math.imul(oe,rt)|0,P=P+Math.imul(W,Ae)|0,T=T+Math.imul(W,Xe)|0,T=T+Math.imul(Y,Ae)|0,q=q+Math.imul(Y,Xe)|0,P=P+Math.imul(U,Ce)|0,T=T+Math.imul(U,Ke)|0,T=T+Math.imul(J,Ce)|0,q=q+Math.imul(J,Ke)|0;var st=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(st>>>26)|0,st&=67108863,P=Math.imul(_e,we),T=Math.imul(_e,Ve),T=T+Math.imul(Fe,we)|0,q=Math.imul(Fe,Ve),P=P+Math.imul(pe,Ie)|0,T=T+Math.imul(pe,Ge)|0,T=T+Math.imul(Oe,Ie)|0,q=q+Math.imul(Oe,Ge)|0,P=P+Math.imul(le,Re)|0,T=T+Math.imul(le,He)|0,T=T+Math.imul(ye,Re)|0,q=q+Math.imul(ye,He)|0,P=P+Math.imul(ae,Te)|0,T=T+Math.imul(ae,We)|0,T=T+Math.imul(he,Te)|0,q=q+Math.imul(he,We)|0,P=P+Math.imul(ne,Pe)|0,T=T+Math.imul(ne,rt)|0,T=T+Math.imul(ce,Pe)|0,q=q+Math.imul(ce,rt)|0,P=P+Math.imul(te,Ae)|0,T=T+Math.imul(te,Xe)|0,T=T+Math.imul(oe,Ae)|0,q=q+Math.imul(oe,Xe)|0,P=P+Math.imul(W,Ce)|0,T=T+Math.imul(W,Ke)|0,T=T+Math.imul(Y,Ce)|0,q=q+Math.imul(Y,Ke)|0;var dt=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(dt>>>26)|0,dt&=67108863,P=Math.imul(_e,Ie),T=Math.imul(_e,Ge),T=T+Math.imul(Fe,Ie)|0,q=Math.imul(Fe,Ge),P=P+Math.imul(pe,Re)|0,T=T+Math.imul(pe,He)|0,T=T+Math.imul(Oe,Re)|0,q=q+Math.imul(Oe,He)|0,P=P+Math.imul(le,Te)|0,T=T+Math.imul(le,We)|0,T=T+Math.imul(ye,Te)|0,q=q+Math.imul(ye,We)|0,P=P+Math.imul(ae,Pe)|0,T=T+Math.imul(ae,rt)|0,T=T+Math.imul(he,Pe)|0,q=q+Math.imul(he,rt)|0,P=P+Math.imul(ne,Ae)|0,T=T+Math.imul(ne,Xe)|0,T=T+Math.imul(ce,Ae)|0,q=q+Math.imul(ce,Xe)|0,P=P+Math.imul(te,Ce)|0,T=T+Math.imul(te,Ke)|0,T=T+Math.imul(oe,Ce)|0,q=q+Math.imul(oe,Ke)|0;var vt=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(vt>>>26)|0,vt&=67108863,P=Math.imul(_e,Re),T=Math.imul(_e,He),T=T+Math.imul(Fe,Re)|0,q=Math.imul(Fe,He),P=P+Math.imul(pe,Te)|0,T=T+Math.imul(pe,We)|0,T=T+Math.imul(Oe,Te)|0,q=q+Math.imul(Oe,We)|0,P=P+Math.imul(le,Pe)|0,T=T+Math.imul(le,rt)|0,T=T+Math.imul(ye,Pe)|0,q=q+Math.imul(ye,rt)|0,P=P+Math.imul(ae,Ae)|0,T=T+Math.imul(ae,Xe)|0,T=T+Math.imul(he,Ae)|0,q=q+Math.imul(he,Xe)|0,P=P+Math.imul(ne,Ce)|0,T=T+Math.imul(ne,Ke)|0,T=T+Math.imul(ce,Ce)|0,q=q+Math.imul(ce,Ke)|0;var mt=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(mt>>>26)|0,mt&=67108863,P=Math.imul(_e,Te),T=Math.imul(_e,We),T=T+Math.imul(Fe,Te)|0,q=Math.imul(Fe,We),P=P+Math.imul(pe,Pe)|0,T=T+Math.imul(pe,rt)|0,T=T+Math.imul(Oe,Pe)|0,q=q+Math.imul(Oe,rt)|0,P=P+Math.imul(le,Ae)|0,T=T+Math.imul(le,Xe)|0,T=T+Math.imul(ye,Ae)|0,q=q+Math.imul(ye,Xe)|0,P=P+Math.imul(ae,Ce)|0,T=T+Math.imul(ae,Ke)|0,T=T+Math.imul(he,Ce)|0,q=q+Math.imul(he,Ke)|0;var _t=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(_t>>>26)|0,_t&=67108863,P=Math.imul(_e,Pe),T=Math.imul(_e,rt),T=T+Math.imul(Fe,Pe)|0,q=Math.imul(Fe,rt),P=P+Math.imul(pe,Ae)|0,T=T+Math.imul(pe,Xe)|0,T=T+Math.imul(Oe,Ae)|0,q=q+Math.imul(Oe,Xe)|0,P=P+Math.imul(le,Ce)|0,T=T+Math.imul(le,Ke)|0,T=T+Math.imul(ye,Ce)|0,q=q+Math.imul(ye,Ke)|0;var at=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(at>>>26)|0,at&=67108863,P=Math.imul(_e,Ae),T=Math.imul(_e,Xe),T=T+Math.imul(Fe,Ae)|0,q=Math.imul(Fe,Xe),P=P+Math.imul(pe,Ce)|0,T=T+Math.imul(pe,Ke)|0,T=T+Math.imul(Oe,Ce)|0,q=q+Math.imul(Oe,Ke)|0;var xt=(A+P|0)+((T&8191)<<13)|0;A=(q+(T>>>13)|0)+(xt>>>26)|0,xt&=67108863,P=Math.imul(_e,Ce),T=Math.imul(_e,Ke),T=T+Math.imul(Fe,Ce)|0,q=Math.imul(Fe,Ke);var ut=(A+P|0)+((T&8191)<<13)|0;return A=(q+(T>>>13)|0)+(ut>>>26)|0,ut&=67108863,w[0]=X,w[1]=Q,w[2]=re,w[3]=ue,w[4]=xe,w[5]=Me,w[6]=ze,w[7]=$e,w[8]=it,w[9]=Ne,w[10]=ve,w[11]=st,w[12]=dt,w[13]=vt,w[14]=mt,w[15]=_t,w[16]=at,w[17]=xt,w[18]=ut,A!==0&&(w[19]=A,d.length++),d};Math.imul||(S=E);function k(R,l,x){x.negative=l.negative^R.negative,x.length=R.length+l.length;for(var d=0,m=0,g=0;g<x.length-1;g++){var w=m;m=0;for(var A=d&67108863,P=Math.min(g,l.length-1),T=Math.max(0,g-R.length+1);T<=P;T++){var q=g-T,Z=R.words[q]|0,I=l.words[T]|0,$=Z*I,K=$&67108863;w=w+($/67108864|0)|0,K=K+A|0,A=K&67108863,w=w+(K>>>26)|0,m+=w>>>26,w&=67108863}x.words[g]=A,d=w,w=m}return d!==0?x.words[g]=d:x.length--,x._strip()}function O(R,l,x){return k(R,l,x)}n.prototype.mulTo=function(l,x){var d,m=this.length+l.length;return this.length===10&&l.length===10?d=S(this,l,x):m<63?d=E(this,l,x):m<1024?d=k(this,l,x):d=O(this,l,x),d},n.prototype.mul=function(l){var x=new n(null);return x.words=new Array(this.length+l.length),this.mulTo(l,x)},n.prototype.mulf=function(l){var x=new n(null);return x.words=new Array(this.length+l.length),O(this,l,x)},n.prototype.imul=function(l){return this.clone().mulTo(l,this)},n.prototype.imuln=function(l){var x=l<0;x&&(l=-l),e(typeof l=="number"),e(l<67108864);for(var d=0,m=0;m<this.length;m++){var g=(this.words[m]|0)*l,w=(g&67108863)+(d&67108863);d>>=26,d+=g/67108864|0,d+=w>>>26,this.words[m]=w&67108863}return d!==0&&(this.words[m]=d,this.length++),x?this.ineg():this},n.prototype.muln=function(l){return this.clone().imuln(l)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(l){var x=_(l);if(x.length===0)return new n(1);for(var d=this,m=0;m<x.length&&x[m]===0;m++,d=d.sqr());if(++m<x.length)for(var g=d.sqr();m<x.length;m++,g=g.sqr())x[m]!==0&&(d=d.mul(g));return d},n.prototype.iushln=function(l){e(typeof l=="number"&&l>=0);var x=l%26,d=(l-x)/26,m=67108863>>>26-x<<26-x,g;if(x!==0){var w=0;for(g=0;g<this.length;g++){var A=this.words[g]&m,P=(this.words[g]|0)-A<<x;this.words[g]=P|w,w=A>>>26-x}w&&(this.words[g]=w,this.length++)}if(d!==0){for(g=this.length-1;g>=0;g--)this.words[g+d]=this.words[g];for(g=0;g<d;g++)this.words[g]=0;this.length+=d}return this._strip()},n.prototype.ishln=function(l){return e(this.negative===0),this.iushln(l)},n.prototype.iushrn=function(l,x,d){e(typeof l=="number"&&l>=0);var m;x?m=(x-x%26)/26:m=0;var g=l%26,w=Math.min((l-g)/26,this.length),A=67108863^67108863>>>g<<g,P=d;if(m-=w,m=Math.max(0,m),P){for(var T=0;T<w;T++)P.words[T]=this.words[T];P.length=w}if(w!==0)if(this.length>w)for(this.length-=w,T=0;T<this.length;T++)this.words[T]=this.words[T+w];else this.words[0]=0,this.length=1;var q=0;for(T=this.length-1;T>=0&&(q!==0||T>=m);T--){var Z=this.words[T]|0;this.words[T]=q<<26-g|Z>>>g,q=Z&A}return P&&q!==0&&(P.words[P.length++]=q),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(l,x,d){return e(this.negative===0),this.iushrn(l,x,d)},n.prototype.shln=function(l){return this.clone().ishln(l)},n.prototype.ushln=function(l){return this.clone().iushln(l)},n.prototype.shrn=function(l){return this.clone().ishrn(l)},n.prototype.ushrn=function(l){return this.clone().iushrn(l)},n.prototype.testn=function(l){e(typeof l=="number"&&l>=0);var x=l%26,d=(l-x)/26,m=1<<x;if(this.length<=d)return!1;var g=this.words[d];return!!(g&m)},n.prototype.imaskn=function(l){e(typeof l=="number"&&l>=0);var x=l%26,d=(l-x)/26;if(e(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(x!==0&&d++,this.length=Math.min(d,this.length),x!==0){var m=67108863^67108863>>>x<<x;this.words[this.length-1]&=m}return this._strip()},n.prototype.maskn=function(l){return this.clone().imaskn(l)},n.prototype.iaddn=function(l){return e(typeof l=="number"),e(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<=l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},n.prototype._iaddn=function(l){this.words[0]+=l;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},n.prototype.isubn=function(l){if(e(typeof l=="number"),e(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this._strip()},n.prototype.addn=function(l){return this.clone().iaddn(l)},n.prototype.subn=function(l){return this.clone().isubn(l)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(l,x,d){var m=l.length+d,g;this._expand(m);var w,A=0;for(g=0;g<l.length;g++){w=(this.words[g+d]|0)+A;var P=(l.words[g]|0)*x;w-=P&67108863,A=(w>>26)-(P/67108864|0),this.words[g+d]=w&67108863}for(;g<this.length-d;g++)w=(this.words[g+d]|0)+A,A=w>>26,this.words[g+d]=w&67108863;if(A===0)return this._strip();for(e(A===-1),A=0,g=0;g<this.length;g++)w=-(this.words[g]|0)+A,A=w>>26,this.words[g]=w&67108863;return this.negative=1,this._strip()},n.prototype._wordDiv=function(l,x){var d=this.length-l.length,m=this.clone(),g=l,w=g.words[g.length-1]|0,A=this._countBits(w);d=26-A,d!==0&&(g=g.ushln(d),m.iushln(d),w=g.words[g.length-1]|0);var P=m.length-g.length,T;if(x!=="mod"){T=new n(null),T.length=P+1,T.words=new Array(T.length);for(var q=0;q<T.length;q++)T.words[q]=0}var Z=m.clone()._ishlnsubmul(g,1,P);Z.negative===0&&(m=Z,T&&(T.words[P]=1));for(var I=P-1;I>=0;I--){var $=(m.words[g.length+I]|0)*67108864+(m.words[g.length+I-1]|0);for($=Math.min($/w|0,67108863),m._ishlnsubmul(g,$,I);m.negative!==0;)$--,m.negative=0,m._ishlnsubmul(g,1,I),m.isZero()||(m.negative^=1);T&&(T.words[I]=$)}return T&&T._strip(),m._strip(),x!=="div"&&d!==0&&m.iushrn(d),{div:T||null,mod:m}},n.prototype.divmod=function(l,x,d){if(e(!l.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var m,g,w;return this.negative!==0&&l.negative===0?(w=this.neg().divmod(l,x),x!=="mod"&&(m=w.div.neg()),x!=="div"&&(g=w.mod.neg(),d&&g.negative!==0&&g.iadd(l)),{div:m,mod:g}):this.negative===0&&l.negative!==0?(w=this.divmod(l.neg(),x),x!=="mod"&&(m=w.div.neg()),{div:m,mod:w.mod}):(this.negative&l.negative)!==0?(w=this.neg().divmod(l.neg(),x),x!=="div"&&(g=w.mod.neg(),d&&g.negative!==0&&g.isub(l)),{div:w.div,mod:g}):l.length>this.length||this.cmp(l)<0?{div:new n(0),mod:this}:l.length===1?x==="div"?{div:this.divn(l.words[0]),mod:null}:x==="mod"?{div:null,mod:new n(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new n(this.modrn(l.words[0]))}:this._wordDiv(l,x)},n.prototype.div=function(l){return this.divmod(l,"div",!1).div},n.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},n.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},n.prototype.divRound=function(l){var x=this.divmod(l);if(x.mod.isZero())return x.div;var d=x.div.negative!==0?x.mod.isub(l):x.mod,m=l.ushrn(1),g=l.andln(1),w=d.cmp(m);return w<0||g===1&&w===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},n.prototype.modrn=function(l){var x=l<0;x&&(l=-l),e(l<=67108863);for(var d=(1<<26)%l,m=0,g=this.length-1;g>=0;g--)m=(d*m+(this.words[g]|0))%l;return x?-m:m},n.prototype.modn=function(l){return this.modrn(l)},n.prototype.idivn=function(l){var x=l<0;x&&(l=-l),e(l<=67108863);for(var d=0,m=this.length-1;m>=0;m--){var g=(this.words[m]|0)+d*67108864;this.words[m]=g/l|0,d=g%l}return this._strip(),x?this.ineg():this},n.prototype.divn=function(l){return this.clone().idivn(l)},n.prototype.egcd=function(l){e(l.negative===0),e(!l.isZero());var x=this,d=l.clone();x.negative!==0?x=x.umod(l):x=x.clone();for(var m=new n(1),g=new n(0),w=new n(0),A=new n(1),P=0;x.isEven()&&d.isEven();)x.iushrn(1),d.iushrn(1),++P;for(var T=d.clone(),q=x.clone();!x.isZero();){for(var Z=0,I=1;(x.words[0]&I)===0&&Z<26;++Z,I<<=1);if(Z>0)for(x.iushrn(Z);Z-- >0;)(m.isOdd()||g.isOdd())&&(m.iadd(T),g.isub(q)),m.iushrn(1),g.iushrn(1);for(var $=0,K=1;(d.words[0]&K)===0&&$<26;++$,K<<=1);if($>0)for(d.iushrn($);$-- >0;)(w.isOdd()||A.isOdd())&&(w.iadd(T),A.isub(q)),w.iushrn(1),A.iushrn(1);x.cmp(d)>=0?(x.isub(d),m.isub(w),g.isub(A)):(d.isub(x),w.isub(m),A.isub(g))}return{a:w,b:A,gcd:d.iushln(P)}},n.prototype._invmp=function(l){e(l.negative===0),e(!l.isZero());var x=this,d=l.clone();x.negative!==0?x=x.umod(l):x=x.clone();for(var m=new n(1),g=new n(0),w=d.clone();x.cmpn(1)>0&&d.cmpn(1)>0;){for(var A=0,P=1;(x.words[0]&P)===0&&A<26;++A,P<<=1);if(A>0)for(x.iushrn(A);A-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);for(var T=0,q=1;(d.words[0]&q)===0&&T<26;++T,q<<=1);if(T>0)for(d.iushrn(T);T-- >0;)g.isOdd()&&g.iadd(w),g.iushrn(1);x.cmp(d)>=0?(x.isub(d),m.isub(g)):(d.isub(x),g.isub(m))}var Z;return x.cmpn(1)===0?Z=m:Z=g,Z.cmpn(0)<0&&Z.iadd(l),Z},n.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var x=this.clone(),d=l.clone();x.negative=0,d.negative=0;for(var m=0;x.isEven()&&d.isEven();m++)x.iushrn(1),d.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;d.isEven();)d.iushrn(1);var g=x.cmp(d);if(g<0){var w=x;x=d,d=w}else if(g===0||d.cmpn(1)===0)break;x.isub(d)}while(!0);return d.iushln(m)},n.prototype.invm=function(l){return this.egcd(l).a.umod(l)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(l){return this.words[0]&l},n.prototype.bincn=function(l){e(typeof l=="number");var x=l%26,d=(l-x)/26,m=1<<x;if(this.length<=d)return this._expand(d+1),this.words[d]|=m,this;for(var g=m,w=d;g!==0&&w<this.length;w++){var A=this.words[w]|0;A+=g,g=A>>>26,A&=67108863,this.words[w]=A}return g!==0&&(this.words[w]=g,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(l){var x=l<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this._strip();var d;if(this.length>1)d=1;else{x&&(l=-l),e(l<=67108863,"Number is too big");var m=this.words[0]|0;d=m===l?0:m<l?-1:1}return this.negative!==0?-d|0:d},n.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var x=this.ucmp(l);return this.negative!==0?-x|0:x},n.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var x=0,d=this.length-1;d>=0;d--){var m=this.words[d]|0,g=l.words[d]|0;if(m!==g){m<g?x=-1:m>g&&(x=1);break}}return x},n.prototype.gtn=function(l){return this.cmpn(l)===1},n.prototype.gt=function(l){return this.cmp(l)===1},n.prototype.gten=function(l){return this.cmpn(l)>=0},n.prototype.gte=function(l){return this.cmp(l)>=0},n.prototype.ltn=function(l){return this.cmpn(l)===-1},n.prototype.lt=function(l){return this.cmp(l)===-1},n.prototype.lten=function(l){return this.cmpn(l)<=0},n.prototype.lte=function(l){return this.cmp(l)<=0},n.prototype.eqn=function(l){return this.cmpn(l)===0},n.prototype.eq=function(l){return this.cmp(l)===0},n.red=function(l){return new H(l)},n.prototype.toRed=function(l){return e(!this.red,"Already a number in reduction context"),e(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},n.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(l){return this.red=l,this},n.prototype.forceRed=function(l){return e(!this.red,"Already a number in reduction context"),this._forceRed(l)},n.prototype.redAdd=function(l){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},n.prototype.redIAdd=function(l){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},n.prototype.redSub=function(l){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},n.prototype.redISub=function(l){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},n.prototype.redShl=function(l){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},n.prototype.redMul=function(l){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},n.prototype.redIMul=function(l){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},n.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(l){return e(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var M={k256:null,p224:null,p192:null,p25519:null};function C(R,l){this.name=R,this.p=new n(l,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}C.prototype._tmp=function(){var l=new n(null);return l.words=new Array(Math.ceil(this.n/13)),l},C.prototype.ireduce=function(l){var x=l,d;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),d=x.bitLength();while(d>this.n);var m=d<this.n?-1:x.ucmp(this.p);return m===0?(x.words[0]=0,x.length=1):m>0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},C.prototype.split=function(l,x){l.iushrn(this.n,0,x)},C.prototype.imulK=function(l){return l.imul(this.k)};function N(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}t(N,C),N.prototype.split=function(l,x){for(var d=4194303,m=Math.min(l.length,9),g=0;g<m;g++)x.words[g]=l.words[g];if(x.length=m,l.length<=9){l.words[0]=0,l.length=1;return}var w=l.words[9];for(x.words[x.length++]=w&d,g=10;g<l.length;g++){var A=l.words[g]|0;l.words[g-10]=(A&d)<<4|w>>>22,w=A}w>>>=22,l.words[g-10]=w,w===0&&l.length>10?l.length-=10:l.length-=9},N.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var x=0,d=0;d<l.length;d++){var m=l.words[d]|0;x+=m*977,l.words[d]=x&67108863,x=m*64+(x/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function L(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}t(L,C);function F(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}t(F,C);function V(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}t(V,C),V.prototype.imulK=function(l){for(var x=0,d=0;d<l.length;d++){var m=(l.words[d]|0)*19+x,g=m&67108863;m>>>=26,l.words[d]=g,x=m}return x!==0&&(l.words[l.length++]=x),l},n._prime=function(l){if(M[l])return M[l];var x;if(l==="k256")x=new N;else if(l==="p224")x=new L;else if(l==="p192")x=new F;else if(l==="p25519")x=new V;else throw new Error("Unknown prime "+l);return M[l]=x,x};function H(R){if(typeof R=="string"){var l=n._prime(R);this.m=l.p,this.prime=l}else e(R.gtn(1),"modulus must be greater than 1"),this.m=R,this.prime=null}H.prototype._verify1=function(l){e(l.negative===0,"red works only with positives"),e(l.red,"red works only with red numbers")},H.prototype._verify2=function(l,x){e((l.negative|x.negative)===0,"red works only with positives"),e(l.red&&l.red===x.red,"red works only with red numbers")},H.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(s(l,l.umod(this.m)._forceRed(this)),l)},H.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},H.prototype.add=function(l,x){this._verify2(l,x);var d=l.add(x);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},H.prototype.iadd=function(l,x){this._verify2(l,x);var d=l.iadd(x);return d.cmp(this.m)>=0&&d.isub(this.m),d},H.prototype.sub=function(l,x){this._verify2(l,x);var d=l.sub(x);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},H.prototype.isub=function(l,x){this._verify2(l,x);var d=l.isub(x);return d.cmpn(0)<0&&d.iadd(this.m),d},H.prototype.shl=function(l,x){return this._verify1(l),this.imod(l.ushln(x))},H.prototype.imul=function(l,x){return this._verify2(l,x),this.imod(l.imul(x))},H.prototype.mul=function(l,x){return this._verify2(l,x),this.imod(l.mul(x))},H.prototype.isqr=function(l){return this.imul(l,l.clone())},H.prototype.sqr=function(l){return this.mul(l,l)},H.prototype.sqrt=function(l){if(l.isZero())return l.clone();var x=this.m.andln(3);if(e(x%2===1),x===3){var d=this.m.add(new n(1)).iushrn(2);return this.pow(l,d)}for(var m=this.m.subn(1),g=0;!m.isZero()&&m.andln(1)===0;)g++,m.iushrn(1);e(!m.isZero());var w=new n(1).toRed(this),A=w.redNeg(),P=this.m.subn(1).iushrn(1),T=this.m.bitLength();for(T=new n(2*T*T).toRed(this);this.pow(T,P).cmp(A)!==0;)T.redIAdd(A);for(var q=this.pow(T,m),Z=this.pow(l,m.addn(1).iushrn(1)),I=this.pow(l,m),$=g;I.cmp(w)!==0;){for(var K=I,j=0;K.cmp(w)!==0;j++)K=K.redSqr();e(j<$);var D=this.pow(q,new n(1).iushln($-j-1));Z=Z.redMul(D),q=D.redSqr(),I=I.redMul(q),$=j}return Z},H.prototype.invm=function(l){var x=l._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},H.prototype.pow=function(l,x){if(x.isZero())return new n(1).toRed(this);if(x.cmpn(1)===0)return l.clone();var d=4,m=new Array(1<<d);m[0]=new n(1).toRed(this),m[1]=l;for(var g=2;g<m.length;g++)m[g]=this.mul(m[g-1],l);var w=m[0],A=0,P=0,T=x.bitLength()%26;for(T===0&&(T=26),g=x.length-1;g>=0;g--){for(var q=x.words[g],Z=T-1;Z>=0;Z--){var I=q>>Z&1;if(w!==m[0]&&(w=this.sqr(w)),I===0&&A===0){P=0;continue}A<<=1,A|=I,P++,!(P!==d&&(g!==0||Z!==0))&&(w=this.mul(w,m[A]),P=0,A=0)}T=26}return w},H.prototype.convertTo=function(l){var x=l.umod(this.m);return x===l?x.clone():x},H.prototype.convertFrom=function(l){var x=l.clone();return x.red=null,x},n.mont=function(l){return new z(l)};function z(R){H.call(this,R),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}t(z,H),z.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},z.prototype.convertFrom=function(l){var x=this.imod(l.mul(this.rinv));return x.red=null,x},z.prototype.imul=function(l,x){if(l.isZero()||x.isZero())return l.words[0]=0,l.length=1,l;var d=l.imul(x),m=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=d.isub(m).iushrn(this.shift),w=g;return g.cmp(this.m)>=0?w=g.isub(this.m):g.cmpn(0)<0&&(w=g.iadd(this.m)),w._forceRed(this)},z.prototype.mul=function(l,x){if(l.isZero()||x.isZero())return new n(0)._forceRed(this);var d=l.mul(x),m=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=d.isub(m).iushrn(this.shift),w=g;return g.cmp(this.m)>=0?w=g.isub(this.m):g.cmpn(0)<0&&(w=g.iadd(this.m)),w._forceRed(this)},z.prototype.invm=function(l){var x=this.imod(l._invmp(this.m).mul(this.r2));return x._forceRed(this)}})(i,Ta)})(bc);var ct=bc.exports;const p0="logger/5.6.0";let xu=!1,Mu=!1;const fo={debug:1,default:2,info:2,warning:3,error:4,off:5};let Eu=fo.default,ns=null;function m0(){try{const i=[];if(["NFD","NFC","NFKD","NFKC"].forEach(r=>{try{if("test".normalize(r)!=="test")throw new Error("bad normalize")}catch{i.push(r)}}),i.length)throw new Error("missing "+i.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(i){return i.message}return null}const Su=m0();var Fs;(function(i){i.DEBUG="DEBUG",i.INFO="INFO",i.WARNING="WARNING",i.ERROR="ERROR",i.OFF="OFF"})(Fs||(Fs={}));var Rr;(function(i){i.UNKNOWN_ERROR="UNKNOWN_ERROR",i.NOT_IMPLEMENTED="NOT_IMPLEMENTED",i.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",i.NETWORK_ERROR="NETWORK_ERROR",i.SERVER_ERROR="SERVER_ERROR",i.TIMEOUT="TIMEOUT",i.BUFFER_OVERRUN="BUFFER_OVERRUN",i.NUMERIC_FAULT="NUMERIC_FAULT",i.MISSING_NEW="MISSING_NEW",i.INVALID_ARGUMENT="INVALID_ARGUMENT",i.MISSING_ARGUMENT="MISSING_ARGUMENT",i.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",i.CALL_EXCEPTION="CALL_EXCEPTION",i.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",i.NONCE_EXPIRED="NONCE_EXPIRED",i.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",i.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",i.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(Rr||(Rr={}));const ku="0123456789abcdef";class be{constructor(r){Object.defineProperty(this,"version",{enumerable:!0,value:r,writable:!1})}_log(r,o){const e=r.toLowerCase();fo[e]==null&&this.throwArgumentError("invalid log level name","logLevel",r),!(Eu>fo[e])&&console.log.apply(console,o)}debug(...r){this._log(be.levels.DEBUG,r)}info(...r){this._log(be.levels.INFO,r)}warn(...r){this._log(be.levels.WARNING,r)}makeError(r,o,e){if(Mu)return this.makeError("censored error",o,{});o||(o=be.errors.UNKNOWN_ERROR),e||(e={});const t=[];Object.keys(e).forEach(a=>{const f=e[a];try{if(f instanceof Uint8Array){let s="";for(let u=0;u<f.length;u++)s+=ku[f[u]>>4],s+=ku[f[u]&15];t.push(a+"=Uint8Array(0x"+s+")")}else t.push(a+"="+JSON.stringify(f))}catch{t.push(a+"="+JSON.stringify(e[a].toString()))}}),t.push(`code=${o}`),t.push(`version=${this.version}`);const n=r;let c="";switch(o){case Rr.NUMERIC_FAULT:{c="NUMERIC_FAULT";const a=r;switch(a){case"overflow":case"underflow":case"division-by-zero":c+="-"+a;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Rr.CALL_EXCEPTION:case Rr.INSUFFICIENT_FUNDS:case Rr.MISSING_NEW:case Rr.NONCE_EXPIRED:case Rr.REPLACEMENT_UNDERPRICED:case Rr.TRANSACTION_REPLACED:case Rr.UNPREDICTABLE_GAS_LIMIT:c=o;break}c&&(r+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),t.length&&(r+=" ("+t.join(", ")+")");const p=new Error(r);return p.reason=n,p.code=o,Object.keys(e).forEach(function(a){p[a]=e[a]}),p}throwError(r,o,e){throw this.makeError(r,o,e)}throwArgumentError(r,o,e){return this.throwError(r,be.errors.INVALID_ARGUMENT,{argument:o,value:e})}assert(r,o,e,t){r||this.throwError(o,e,t)}assertArgument(r,o,e,t){r||this.throwArgumentError(o,e,t)}checkNormalize(r){Su&&this.throwError("platform missing String.prototype.normalize",be.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Su})}checkSafeUint53(r,o){typeof r=="number"&&(o==null&&(o="value not safe"),(r<0||r>=9007199254740991)&&this.throwError(o,be.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:r}),r%1&&this.throwError(o,be.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:r}))}checkArgumentCount(r,o,e){e?e=": "+e:e="",r<o&&this.throwError("missing argument"+e,be.errors.MISSING_ARGUMENT,{count:r,expectedCount:o}),r>o&&this.throwError("too many arguments"+e,be.errors.UNEXPECTED_ARGUMENT,{count:r,expectedCount:o})}checkNew(r,o){(r===Object||r==null)&&this.throwError("missing new",be.errors.MISSING_NEW,{name:o.name})}checkAbstract(r,o){r===o?this.throwError("cannot instantiate abstract class "+JSON.stringify(o.name)+" directly; use a sub-class",be.errors.UNSUPPORTED_OPERATION,{name:r.name,operation:"new"}):(r===Object||r==null)&&this.throwError("missing new",be.errors.MISSING_NEW,{name:o.name})}static globalLogger(){return ns||(ns=new be(p0)),ns}static setCensorship(r,o){if(!r&&o&&this.globalLogger().throwError("cannot permanently disable censorship",be.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),xu){if(!r)return;this.globalLogger().throwError("error censorship permanent",be.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Mu=!!r,xu=!!o}static setLogLevel(r){const o=fo[r.toLowerCase()];if(o==null){be.globalLogger().warn("invalid log level - "+r);return}Eu=o}static from(r){return new be(r)}}be.errors=Rr;be.levels=Fs;const g0="bytes/5.6.1",Nt=new be(g0);function vc(i){return!!i.toHexString}function Qn(i){return i.slice||(i.slice=function(){const r=Array.prototype.slice.call(arguments);return Qn(new Uint8Array(Array.prototype.slice.apply(i,r)))}),i}function Pa(i){return Rt(i)&&!(i.length%2)||Do(i)}function Au(i){return typeof i=="number"&&i==i&&i%1===0}function Do(i){if(i==null)return!1;if(i.constructor===Uint8Array)return!0;if(typeof i=="string"||!Au(i.length)||i.length<0)return!1;for(let r=0;r<i.length;r++){const o=i[r];if(!Au(o)||o<0||o>=256)return!1}return!0}function pt(i,r){if(r||(r={}),typeof i=="number"){Nt.checkSafeUint53(i,"invalid arrayify value");const o=[];for(;i;)o.unshift(i&255),i=parseInt(String(i/256));return o.length===0&&o.push(0),Qn(new Uint8Array(o))}if(r.allowMissingPrefix&&typeof i=="string"&&i.substring(0,2)!=="0x"&&(i="0x"+i),vc(i)&&(i=i.toHexString()),Rt(i)){let o=i.substring(2);o.length%2&&(r.hexPad==="left"?o="0"+o:r.hexPad==="right"?o+="0":Nt.throwArgumentError("hex data is odd-length","value",i));const e=[];for(let t=0;t<o.length;t+=2)e.push(parseInt(o.substring(t,t+2),16));return Qn(new Uint8Array(e))}return Do(i)?Qn(new Uint8Array(i)):Nt.throwArgumentError("invalid arrayify value","value",i)}function Nn(i){const r=i.map(t=>pt(t)),o=r.reduce((t,n)=>t+n.length,0),e=new Uint8Array(o);return r.reduce((t,n)=>(e.set(n,t),t+n.length),0),Qn(e)}function ii(i){let r=pt(i);if(r.length===0)return r;let o=0;for(;o<r.length&&r[o]===0;)o++;return o&&(r=r.slice(o)),r}function b0(i,r){i=pt(i),i.length>r&&Nt.throwArgumentError("value out of range","value",arguments[0]);const o=new Uint8Array(r);return o.set(i,r-i.length),Qn(o)}function Rt(i,r){return!(typeof i!="string"||!i.match(/^0x[0-9A-Fa-f]*$/)||r&&i.length!==2+2*r)}const is="0123456789abcdef";function ht(i,r){if(r||(r={}),typeof i=="number"){Nt.checkSafeUint53(i,"invalid hexlify value");let o="";for(;i;)o=is[i&15]+o,i=Math.floor(i/16);return o.length?(o.length%2&&(o="0"+o),"0x"+o):"0x00"}if(typeof i=="bigint")return i=i.toString(16),i.length%2?"0x0"+i:"0x"+i;if(r.allowMissingPrefix&&typeof i=="string"&&i.substring(0,2)!=="0x"&&(i="0x"+i),vc(i))return i.toHexString();if(Rt(i))return i.length%2&&(r.hexPad==="left"?i="0x0"+i.substring(2):r.hexPad==="right"?i+="0":Nt.throwArgumentError("hex data is odd-length","value",i)),i.toLowerCase();if(Do(i)){let o="0x";for(let e=0;e<i.length;e++){let t=i[e];o+=is[(t&240)>>4]+is[t&15]}return o}return Nt.throwArgumentError("invalid hexlify value","value",i)}function Un(i){if(typeof i!="string")i=ht(i);else if(!Rt(i)||i.length%2)return null;return(i.length-2)/2}function Yt(i,r,o){return typeof i!="string"?i=ht(i):(!Rt(i)||i.length%2)&&Nt.throwArgumentError("invalid hexData","value",i),r=2+2*r,o!=null?"0x"+i.substring(r,2+2*o):"0x"+i.substring(r)}function lr(i){let r="0x";return i.forEach(o=>{r+=ht(o).substring(2)}),r}function Ca(i){const r=v0(ht(i,{hexPad:"left"}));return r==="0x"?"0x0":r}function v0(i){typeof i!="string"&&(i=ht(i)),Rt(i)||Nt.throwArgumentError("invalid hex string","value",i),i=i.substring(2);let r=0;for(;r<i.length&&i[r]==="0";)r++;return"0x"+i.substring(r)}function jt(i,r){for(typeof i!="string"?i=ht(i):Rt(i)||Nt.throwArgumentError("invalid hex string","value",i),i.length>2*r+2&&Nt.throwArgumentError("value out of range","value",arguments[1]);i.length<2*r+2;)i="0x0"+i.substring(2);return i}function zo(i){const r={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Pa(i)){let o=pt(i);o.length===64?(r.v=27+(o[32]>>7),o[32]&=127,r.r=ht(o.slice(0,32)),r.s=ht(o.slice(32,64))):o.length===65?(r.r=ht(o.slice(0,32)),r.s=ht(o.slice(32,64)),r.v=o[64]):Nt.throwArgumentError("invalid signature string","signature",i),r.v<27&&(r.v===0||r.v===1?r.v+=27:Nt.throwArgumentError("signature invalid v byte","signature",i)),r.recoveryParam=1-r.v%2,r.recoveryParam&&(o[32]|=128),r._vs=ht(o.slice(32,64))}else{if(r.r=i.r,r.s=i.s,r.v=i.v,r.recoveryParam=i.recoveryParam,r._vs=i._vs,r._vs!=null){const t=b0(pt(r._vs),32);r._vs=ht(t);const n=t[0]>=128?1:0;r.recoveryParam==null?r.recoveryParam=n:r.recoveryParam!==n&&Nt.throwArgumentError("signature recoveryParam mismatch _vs","signature",i),t[0]&=127;const c=ht(t);r.s==null?r.s=c:r.s!==c&&Nt.throwArgumentError("signature v mismatch _vs","signature",i)}if(r.recoveryParam==null)r.v==null?Nt.throwArgumentError("signature missing v and recoveryParam","signature",i):r.v===0||r.v===1?r.recoveryParam=r.v:r.recoveryParam=1-r.v%2;else if(r.v==null)r.v=27+r.recoveryParam;else{const t=r.v===0||r.v===1?r.v:1-r.v%2;r.recoveryParam!==t&&Nt.throwArgumentError("signature recoveryParam mismatch v","signature",i)}r.r==null||!Rt(r.r)?Nt.throwArgumentError("signature missing or invalid r","signature",i):r.r=jt(r.r,32),r.s==null||!Rt(r.s)?Nt.throwArgumentError("signature missing or invalid s","signature",i):r.s=jt(r.s,32);const o=pt(r.s);o[0]>=128&&Nt.throwArgumentError("signature s out of range","signature",i),r.recoveryParam&&(o[0]|=128);const e=ht(o);r._vs&&(Rt(r._vs)||Nt.throwArgumentError("signature invalid _vs","signature",i),r._vs=jt(r._vs,32)),r._vs==null?r._vs=e:r._vs!==e&&Nt.throwArgumentError("signature _vs mismatch v and s","signature",i)}return r.yParityAndS=r._vs,r.compact=r.r+r.yParityAndS.substring(2),r}const y0="bignumber/5.6.2";var _o=ct.BN;const Xr=new be(y0),os={},Ru=9007199254740991;let Tu=!1;class ot{constructor(r,o){r!==os&&Xr.throwError("cannot call constructor directly; use BigNumber.from",be.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=o,this._isBigNumber=!0,Object.freeze(this)}fromTwos(r){return er(yt(this).fromTwos(r))}toTwos(r){return er(yt(this).toTwos(r))}abs(){return this._hex[0]==="-"?ot.from(this._hex.substring(1)):this}add(r){return er(yt(this).add(yt(r)))}sub(r){return er(yt(this).sub(yt(r)))}div(r){return ot.from(r).isZero()&&vr("division-by-zero","div"),er(yt(this).div(yt(r)))}mul(r){return er(yt(this).mul(yt(r)))}mod(r){const o=yt(r);return o.isNeg()&&vr("division-by-zero","mod"),er(yt(this).umod(o))}pow(r){const o=yt(r);return o.isNeg()&&vr("negative-power","pow"),er(yt(this).pow(o))}and(r){const o=yt(r);return(this.isNegative()||o.isNeg())&&vr("unbound-bitwise-result","and"),er(yt(this).and(o))}or(r){const o=yt(r);return(this.isNegative()||o.isNeg())&&vr("unbound-bitwise-result","or"),er(yt(this).or(o))}xor(r){const o=yt(r);return(this.isNegative()||o.isNeg())&&vr("unbound-bitwise-result","xor"),er(yt(this).xor(o))}mask(r){return(this.isNegative()||r<0)&&vr("negative-width","mask"),er(yt(this).maskn(r))}shl(r){return(this.isNegative()||r<0)&&vr("negative-width","shl"),er(yt(this).shln(r))}shr(r){return(this.isNegative()||r<0)&&vr("negative-width","shr"),er(yt(this).shrn(r))}eq(r){return yt(this).eq(yt(r))}lt(r){return yt(this).lt(yt(r))}lte(r){return yt(this).lte(yt(r))}gt(r){return yt(this).gt(yt(r))}gte(r){return yt(this).gte(yt(r))}isNegative(){return this._hex[0]==="-"}isZero(){return yt(this).isZero()}toNumber(){try{return yt(this).toNumber()}catch{vr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Xr.throwError("this platform does not support BigInt",be.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Tu||(Tu=!0,Xr.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Xr.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",be.errors.UNEXPECTED_ARGUMENT,{}):Xr.throwError("BigNumber.toString does not accept parameters",be.errors.UNEXPECTED_ARGUMENT,{})),yt(this).toString(10)}toHexString(){return this._hex}toJSON(r){return{type:"BigNumber",hex:this.toHexString()}}static from(r){if(r instanceof ot)return r;if(typeof r=="string")return r.match(/^-?0x[0-9a-f]+$/i)?new ot(os,Di(r)):r.match(/^-?[0-9]+$/)?new ot(os,Di(new _o(r))):Xr.throwArgumentError("invalid BigNumber string","value",r);if(typeof r=="number")return r%1&&vr("underflow","BigNumber.from",r),(r>=Ru||r<=-Ru)&&vr("overflow","BigNumber.from",r),ot.from(String(r));const o=r;if(typeof o=="bigint")return ot.from(o.toString());if(Do(o))return ot.from(ht(o));if(o)if(o.toHexString){const e=o.toHexString();if(typeof e=="string")return ot.from(e)}else{let e=o._hex;if(e==null&&o.type==="BigNumber"&&(e=o.hex),typeof e=="string"&&(Rt(e)||e[0]==="-"&&Rt(e.substring(1))))return ot.from(e)}return Xr.throwArgumentError("invalid BigNumber value","value",r)}static isBigNumber(r){return!!(r&&r._isBigNumber)}}function Di(i){if(typeof i!="string")return Di(i.toString(16));if(i[0]==="-")return i=i.substring(1),i[0]==="-"&&Xr.throwArgumentError("invalid hex","value",i),i=Di(i),i==="0x00"?i:"-"+i;if(i.substring(0,2)!=="0x"&&(i="0x"+i),i==="0x")return"0x00";for(i.length%2&&(i="0x0"+i.substring(2));i.length>4&&i.substring(0,4)==="0x00";)i="0x"+i.substring(4);return i}function er(i){return ot.from(Di(i))}function yt(i){const r=ot.from(i).toHexString();return r[0]==="-"?new _o("-"+r.substring(3),16):new _o(r.substring(2),16)}function vr(i,r,o){const e={fault:i,operation:r};return o!=null&&(e.value=o),Xr.throwError(i,be.errors.NUMERIC_FAULT,e)}function w0(i){return new _o(i,36).toString(16)}const _0="properties/5.6.0";var x0=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};const xo=new be(_0);function Mt(i,r,o){Object.defineProperty(i,r,{enumerable:!0,value:o,writable:!1})}function Si(i,r){for(let o=0;o<32;o++){if(i[r])return i[r];if(!i.prototype||typeof i.prototype!="object")break;i=Object.getPrototypeOf(i.prototype).constructor}return null}function Dt(i){return x0(this,void 0,void 0,function*(){const r=Object.keys(i).map(e=>{const t=i[e];return Promise.resolve(t).then(n=>({key:e,value:n}))});return(yield Promise.all(r)).reduce((e,t)=>(e[t.key]=t.value,e),{})})}function M0(i,r){(!i||typeof i!="object")&&xo.throwArgumentError("invalid object","object",i),Object.keys(i).forEach(o=>{r[o]||xo.throwArgumentError("invalid object key - "+o,"transaction:"+o,i)})}function hr(i){const r={};for(const o in i)r[o]=i[o];return r}const E0={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function yc(i){if(i==null||E0[typeof i])return!0;if(Array.isArray(i)||typeof i=="object"){if(!Object.isFrozen(i))return!1;const r=Object.keys(i);for(let o=0;o<r.length;o++){let e=null;try{e=i[r[o]]}catch{continue}if(!yc(e))return!1}return!0}return xo.throwArgumentError(`Cannot deepCopy ${typeof i}`,"object",i)}function S0(i){if(yc(i))return i;if(Array.isArray(i))return Object.freeze(i.map(r=>qn(r)));if(typeof i=="object"){const r={};for(const o in i){const e=i[o];e!==void 0&&Mt(r,o,qn(e))}return r}return xo.throwArgumentError(`Cannot deepCopy ${typeof i}`,"object",i)}function qn(i){return S0(i)}class k0{constructor(r){for(const o in r)this[o]=qn(r[o])}}var wc={exports:{}};/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/(function(i){(function(){var r="input is invalid type",o="finalize already called",e=typeof window=="object",t=e?window:{};t.JS_SHA3_NO_WINDOW&&(e=!1);var n=!e&&typeof self=="object",c=!t.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?t=Ta:n&&(t=self);var p=!t.JS_SHA3_NO_COMMON_JS&&!0&&i.exports,a=!t.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",f="0123456789abcdef".split(""),s=[31,7936,2031616,520093696],u=[4,1024,262144,67108864],h=[1,256,65536,16777216],v=[6,1536,393216,100663296],b=[0,8,16,24],y=[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],_=[224,256,384,512],E=[128,256],S=["hex","buffer","arrayBuffer","array","digest"],k={128:168,256:136};(t.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),a&&(t.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(I){return typeof I=="object"&&I.buffer&&I.buffer.constructor===ArrayBuffer});for(var O=function(I,$,K){return function(j){return new T(I,$,I).update(j)[K]()}},M=function(I,$,K){return function(j,D){return new T(I,$,D).update(j)[K]()}},C=function(I,$,K){return function(j,D,B,U){return l["cshake"+I].update(j,D,B,U)[K]()}},N=function(I,$,K){return function(j,D,B,U){return l["kmac"+I].update(j,D,B,U)[K]()}},L=function(I,$,K,j){for(var D=0;D<S.length;++D){var B=S[D];I[B]=$(K,j,B)}return I},F=function(I,$){var K=O(I,$,"hex");return K.create=function(){return new T(I,$,I)},K.update=function(j){return K.create().update(j)},L(K,O,I,$)},V=function(I,$){var K=M(I,$,"hex");return K.create=function(j){return new T(I,$,j)},K.update=function(j,D){return K.create(D).update(j)},L(K,M,I,$)},H=function(I,$){var K=k[I],j=C(I,$,"hex");return j.create=function(D,B,U){return!B&&!U?l["shake"+I].create(D):new T(I,$,D).bytepad([B,U],K)},j.update=function(D,B,U,J){return j.create(B,U,J).update(D)},L(j,C,I,$)},z=function(I,$){var K=k[I],j=N(I,$,"hex");return j.create=function(D,B,U){return new q(I,$,B).bytepad(["KMAC",U],K).bytepad([D],K)},j.update=function(D,B,U,J){return j.create(D,U,J).update(B)},L(j,N,I,$)},R=[{name:"keccak",padding:h,bits:_,createMethod:F},{name:"sha3",padding:v,bits:_,createMethod:F},{name:"shake",padding:s,bits:E,createMethod:V},{name:"cshake",padding:u,bits:E,createMethod:H},{name:"kmac",padding:u,bits:E,createMethod:z}],l={},x=[],d=0;d<R.length;++d)for(var m=R[d],g=m.bits,w=0;w<g.length;++w){var A=m.name+"_"+g[w];if(x.push(A),l[A]=m.createMethod(g[w],m.padding),m.name!=="sha3"){var P=m.name+g[w];x.push(P),l[P]=l[A]}}function T(I,$,K){this.blocks=[],this.s=[],this.padding=$,this.outputBits=K,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(I<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=K>>5,this.extraBytes=(K&31)>>3;for(var j=0;j<50;++j)this.s[j]=0}T.prototype.update=function(I){if(this.finalized)throw new Error(o);var $,K=typeof I;if(K!=="string"){if(K==="object"){if(I===null)throw new Error(r);if(a&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!a||!ArrayBuffer.isView(I)))throw new Error(r)}else throw new Error(r);$=!0}for(var j=this.blocks,D=this.byteCount,B=I.length,U=this.blockCount,J=0,G=this.s,W,Y;J<B;){if(this.reset)for(this.reset=!1,j[0]=this.block,W=1;W<U+1;++W)j[W]=0;if($)for(W=this.start;J<B&&W<D;++J)j[W>>2]|=I[J]<<b[W++&3];else for(W=this.start;J<B&&W<D;++J)Y=I.charCodeAt(J),Y<128?j[W>>2]|=Y<<b[W++&3]:Y<2048?(j[W>>2]|=(192|Y>>6)<<b[W++&3],j[W>>2]|=(128|Y&63)<<b[W++&3]):Y<55296||Y>=57344?(j[W>>2]|=(224|Y>>12)<<b[W++&3],j[W>>2]|=(128|Y>>6&63)<<b[W++&3],j[W>>2]|=(128|Y&63)<<b[W++&3]):(Y=65536+((Y&1023)<<10|I.charCodeAt(++J)&1023),j[W>>2]|=(240|Y>>18)<<b[W++&3],j[W>>2]|=(128|Y>>12&63)<<b[W++&3],j[W>>2]|=(128|Y>>6&63)<<b[W++&3],j[W>>2]|=(128|Y&63)<<b[W++&3]);if(this.lastByteIndex=W,W>=D){for(this.start=W-D,this.block=j[U],W=0;W<U;++W)G[W]^=j[W];Z(G),this.reset=!0}else this.start=W}return this},T.prototype.encode=function(I,$){var K=I&255,j=1,D=[K];for(I=I>>8,K=I&255;K>0;)D.unshift(K),I=I>>8,K=I&255,++j;return $?D.push(j):D.unshift(j),this.update(D),D.length},T.prototype.encodeString=function(I){var $,K=typeof I;if(K!=="string"){if(K==="object"){if(I===null)throw new Error(r);if(a&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!a||!ArrayBuffer.isView(I)))throw new Error(r)}else throw new Error(r);$=!0}var j=0,D=I.length;if($)j=D;else for(var B=0;B<I.length;++B){var U=I.charCodeAt(B);U<128?j+=1:U<2048?j+=2:U<55296||U>=57344?j+=3:(U=65536+((U&1023)<<10|I.charCodeAt(++B)&1023),j+=4)}return j+=this.encode(j*8),this.update(I),j},T.prototype.bytepad=function(I,$){for(var K=this.encode($),j=0;j<I.length;++j)K+=this.encodeString(I[j]);var D=$-K%$,B=[];return B.length=D,this.update(B),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var I=this.blocks,$=this.lastByteIndex,K=this.blockCount,j=this.s;if(I[$>>2]|=this.padding[$&3],this.lastByteIndex===this.byteCount)for(I[0]=I[K],$=1;$<K+1;++$)I[$]=0;for(I[K-1]|=2147483648,$=0;$<K;++$)j[$]^=I[$];Z(j)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var I=this.blockCount,$=this.s,K=this.outputBlocks,j=this.extraBytes,D=0,B=0,U="",J;B<K;){for(D=0;D<I&&B<K;++D,++B)J=$[D],U+=f[J>>4&15]+f[J&15]+f[J>>12&15]+f[J>>8&15]+f[J>>20&15]+f[J>>16&15]+f[J>>28&15]+f[J>>24&15];B%I===0&&(Z($),D=0)}return j&&(J=$[D],U+=f[J>>4&15]+f[J&15],j>1&&(U+=f[J>>12&15]+f[J>>8&15]),j>2&&(U+=f[J>>20&15]+f[J>>16&15])),U},T.prototype.arrayBuffer=function(){this.finalize();var I=this.blockCount,$=this.s,K=this.outputBlocks,j=this.extraBytes,D=0,B=0,U=this.outputBits>>3,J;j?J=new ArrayBuffer(K+1<<2):J=new ArrayBuffer(U);for(var G=new Uint32Array(J);B<K;){for(D=0;D<I&&B<K;++D,++B)G[B]=$[D];B%I===0&&Z($)}return j&&(G[D]=$[D],J=J.slice(0,U)),J},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var I=this.blockCount,$=this.s,K=this.outputBlocks,j=this.extraBytes,D=0,B=0,U=[],J,G;B<K;){for(D=0;D<I&&B<K;++D,++B)J=B<<2,G=$[D],U[J]=G&255,U[J+1]=G>>8&255,U[J+2]=G>>16&255,U[J+3]=G>>24&255;B%I===0&&Z($)}return j&&(J=B<<2,G=$[D],U[J]=G&255,j>1&&(U[J+1]=G>>8&255),j>2&&(U[J+2]=G>>16&255)),U};function q(I,$,K){T.call(this,I,$,K)}q.prototype=new T,q.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var Z=function(I){var $,K,j,D,B,U,J,G,W,Y,ee,te,oe,fe,ne,ce,se,ae,he,me,le,ye,Se,pe,Oe,Le,_e,Fe,qe,Ee,je,ie,de,ke,Be,ge,Ue,De,we,Ve,et,Ie,Ge,Je,Re,He,tt,Te,We,Ze,Pe,rt,Ye,Ae,Xe,Qe,Ce,Ke,X,Q,re,ue,xe;for(j=0;j<48;j+=2)D=I[0]^I[10]^I[20]^I[30]^I[40],B=I[1]^I[11]^I[21]^I[31]^I[41],U=I[2]^I[12]^I[22]^I[32]^I[42],J=I[3]^I[13]^I[23]^I[33]^I[43],G=I[4]^I[14]^I[24]^I[34]^I[44],W=I[5]^I[15]^I[25]^I[35]^I[45],Y=I[6]^I[16]^I[26]^I[36]^I[46],ee=I[7]^I[17]^I[27]^I[37]^I[47],te=I[8]^I[18]^I[28]^I[38]^I[48],oe=I[9]^I[19]^I[29]^I[39]^I[49],$=te^(U<<1|J>>>31),K=oe^(J<<1|U>>>31),I[0]^=$,I[1]^=K,I[10]^=$,I[11]^=K,I[20]^=$,I[21]^=K,I[30]^=$,I[31]^=K,I[40]^=$,I[41]^=K,$=D^(G<<1|W>>>31),K=B^(W<<1|G>>>31),I[2]^=$,I[3]^=K,I[12]^=$,I[13]^=K,I[22]^=$,I[23]^=K,I[32]^=$,I[33]^=K,I[42]^=$,I[43]^=K,$=U^(Y<<1|ee>>>31),K=J^(ee<<1|Y>>>31),I[4]^=$,I[5]^=K,I[14]^=$,I[15]^=K,I[24]^=$,I[25]^=K,I[34]^=$,I[35]^=K,I[44]^=$,I[45]^=K,$=G^(te<<1|oe>>>31),K=W^(oe<<1|te>>>31),I[6]^=$,I[7]^=K,I[16]^=$,I[17]^=K,I[26]^=$,I[27]^=K,I[36]^=$,I[37]^=K,I[46]^=$,I[47]^=K,$=Y^(D<<1|B>>>31),K=ee^(B<<1|D>>>31),I[8]^=$,I[9]^=K,I[18]^=$,I[19]^=K,I[28]^=$,I[29]^=K,I[38]^=$,I[39]^=K,I[48]^=$,I[49]^=K,fe=I[0],ne=I[1],He=I[11]<<4|I[10]>>>28,tt=I[10]<<4|I[11]>>>28,Fe=I[20]<<3|I[21]>>>29,qe=I[21]<<3|I[20]>>>29,Q=I[31]<<9|I[30]>>>23,re=I[30]<<9|I[31]>>>23,Ie=I[40]<<18|I[41]>>>14,Ge=I[41]<<18|I[40]>>>14,ke=I[2]<<1|I[3]>>>31,Be=I[3]<<1|I[2]>>>31,ce=I[13]<<12|I[12]>>>20,se=I[12]<<12|I[13]>>>20,Te=I[22]<<10|I[23]>>>22,We=I[23]<<10|I[22]>>>22,Ee=I[33]<<13|I[32]>>>19,je=I[32]<<13|I[33]>>>19,ue=I[42]<<2|I[43]>>>30,xe=I[43]<<2|I[42]>>>30,Ae=I[5]<<30|I[4]>>>2,Xe=I[4]<<30|I[5]>>>2,ge=I[14]<<6|I[15]>>>26,Ue=I[15]<<6|I[14]>>>26,ae=I[25]<<11|I[24]>>>21,he=I[24]<<11|I[25]>>>21,Ze=I[34]<<15|I[35]>>>17,Pe=I[35]<<15|I[34]>>>17,ie=I[45]<<29|I[44]>>>3,de=I[44]<<29|I[45]>>>3,pe=I[6]<<28|I[7]>>>4,Oe=I[7]<<28|I[6]>>>4,Qe=I[17]<<23|I[16]>>>9,Ce=I[16]<<23|I[17]>>>9,De=I[26]<<25|I[27]>>>7,we=I[27]<<25|I[26]>>>7,me=I[36]<<21|I[37]>>>11,le=I[37]<<21|I[36]>>>11,rt=I[47]<<24|I[46]>>>8,Ye=I[46]<<24|I[47]>>>8,Je=I[8]<<27|I[9]>>>5,Re=I[9]<<27|I[8]>>>5,Le=I[18]<<20|I[19]>>>12,_e=I[19]<<20|I[18]>>>12,Ke=I[29]<<7|I[28]>>>25,X=I[28]<<7|I[29]>>>25,Ve=I[38]<<8|I[39]>>>24,et=I[39]<<8|I[38]>>>24,ye=I[48]<<14|I[49]>>>18,Se=I[49]<<14|I[48]>>>18,I[0]=fe^~ce&ae,I[1]=ne^~se&he,I[10]=pe^~Le&Fe,I[11]=Oe^~_e&qe,I[20]=ke^~ge&De,I[21]=Be^~Ue&we,I[30]=Je^~He&Te,I[31]=Re^~tt&We,I[40]=Ae^~Qe&Ke,I[41]=Xe^~Ce&X,I[2]=ce^~ae&me,I[3]=se^~he&le,I[12]=Le^~Fe&Ee,I[13]=_e^~qe&je,I[22]=ge^~De&Ve,I[23]=Ue^~we&et,I[32]=He^~Te&Ze,I[33]=tt^~We&Pe,I[42]=Qe^~Ke&Q,I[43]=Ce^~X&re,I[4]=ae^~me&ye,I[5]=he^~le&Se,I[14]=Fe^~Ee&ie,I[15]=qe^~je&de,I[24]=De^~Ve&Ie,I[25]=we^~et&Ge,I[34]=Te^~Ze&rt,I[35]=We^~Pe&Ye,I[44]=Ke^~Q&ue,I[45]=X^~re&xe,I[6]=me^~ye&fe,I[7]=le^~Se&ne,I[16]=Ee^~ie&pe,I[17]=je^~de&Oe,I[26]=Ve^~Ie&ke,I[27]=et^~Ge&Be,I[36]=Ze^~rt&Je,I[37]=Pe^~Ye&Re,I[46]=Q^~ue&Ae,I[47]=re^~xe&Xe,I[8]=ye^~fe&ce,I[9]=Se^~ne&se,I[18]=ie^~pe&Le,I[19]=de^~Oe&_e,I[28]=Ie^~ke&ge,I[29]=Ge^~Be&Ue,I[38]=rt^~Je&He,I[39]=Ye^~Re&tt,I[48]=ue^~Ae&Qe,I[49]=xe^~Xe&Ce,I[0]^=y[j],I[1]^=y[j+1]};if(p)i.exports=l;else for(d=0;d<x.length;++d)t[x[d]]=l[x[d]]})()})(wc);var A0=wc.exports;function Ht(i){return"0x"+A0.keccak_256(pt(i))}const R0="rlp/5.6.1",qr=new be(R0);function Pu(i){const r=[];for(;i;)r.unshift(i&255),i>>=8;return r}function Cu(i,r,o){let e=0;for(let t=0;t<o;t++)e=e*256+i[r+t];return e}function _c(i){if(Array.isArray(i)){let e=[];if(i.forEach(function(n){e=e.concat(_c(n))}),e.length<=55)return e.unshift(192+e.length),e;const t=Pu(e.length);return t.unshift(247+t.length),t.concat(e)}Pa(i)||qr.throwArgumentError("RLP object must be BytesLike","object",i);const r=Array.prototype.slice.call(pt(i));if(r.length===1&&r[0]<=127)return r;if(r.length<=55)return r.unshift(128+r.length),r;const o=Pu(r.length);return o.unshift(183+o.length),o.concat(r)}function Ho(i){return ht(_c(i))}function Iu(i,r,o,e){const t=[];for(;o<r+1+e;){const n=xc(i,o);t.push(n.result),o+=n.consumed,o>r+1+e&&qr.throwError("child data too short",be.errors.BUFFER_OVERRUN,{})}return{consumed:1+e,result:t}}function xc(i,r){if(i.length===0&&qr.throwError("data too short",be.errors.BUFFER_OVERRUN,{}),i[r]>=248){const o=i[r]-247;r+1+o>i.length&&qr.throwError("data short segment too short",be.errors.BUFFER_OVERRUN,{});const e=Cu(i,r+1,o);return r+1+o+e>i.length&&qr.throwError("data long segment too short",be.errors.BUFFER_OVERRUN,{}),Iu(i,r,r+1+o,o+e)}else if(i[r]>=192){const o=i[r]-192;return r+1+o>i.length&&qr.throwError("data array too short",be.errors.BUFFER_OVERRUN,{}),Iu(i,r,r+1,o)}else if(i[r]>=184){const o=i[r]-183;r+1+o>i.length&&qr.throwError("data array too short",be.errors.BUFFER_OVERRUN,{});const e=Cu(i,r+1,o);r+1+o+e>i.length&&qr.throwError("data array too short",be.errors.BUFFER_OVERRUN,{});const t=ht(i.slice(r+1+o,r+1+o+e));return{consumed:1+o+e,result:t}}else if(i[r]>=128){const o=i[r]-128;r+1+o>i.length&&qr.throwError("data too short",be.errors.BUFFER_OVERRUN,{});const e=ht(i.slice(r+1,r+1+o));return{consumed:1+o,result:e}}return{consumed:1,result:ht(i[r])}}function Ia(i){const r=pt(i),o=xc(r,0);return o.consumed!==r.length&&qr.throwArgumentError("invalid rlp data","data",i),o.result}const T0="address/5.6.1",Zn=new be(T0);function Ou(i){Rt(i,20)||Zn.throwArgumentError("invalid address","address",i),i=i.toLowerCase();const r=i.substring(2).split(""),o=new Uint8Array(40);for(let t=0;t<40;t++)o[t]=r[t].charCodeAt(0);const e=pt(Ht(o));for(let t=0;t<40;t+=2)e[t>>1]>>4>=8&&(r[t]=r[t].toUpperCase()),(e[t>>1]&15)>=8&&(r[t+1]=r[t+1].toUpperCase());return"0x"+r.join("")}const P0=9007199254740991;function C0(i){return Math.log10?Math.log10(i):Math.log(i)/Math.LN10}const Oa={};for(let i=0;i<10;i++)Oa[String(i)]=String(i);for(let i=0;i<26;i++)Oa[String.fromCharCode(65+i)]=String(10+i);const Nu=Math.floor(C0(P0));function I0(i){i=i.toUpperCase(),i=i.substring(4)+i.substring(0,2)+"00";let r=i.split("").map(e=>Oa[e]).join("");for(;r.length>=Nu;){let e=r.substring(0,Nu);r=parseInt(e,10)%97+r.substring(e.length)}let o=String(98-parseInt(r,10)%97);for(;o.length<2;)o="0"+o;return o}function Nr(i){let r=null;if(typeof i!="string"&&Zn.throwArgumentError("invalid address","address",i),i.match(/^(0x)?[0-9a-fA-F]{40}$/))i.substring(0,2)!=="0x"&&(i="0x"+i),r=Ou(i),i.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==i&&Zn.throwArgumentError("bad address checksum","address",i);else if(i.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(i.substring(2,4)!==I0(i)&&Zn.throwArgumentError("bad icap checksum","address",i),r=w0(i.substring(4));r.length<40;)r="0"+r;r=Ou("0x"+r)}else Zn.throwArgumentError("invalid address","address",i);return r}function O0(i){let r=null;try{r=Nr(i.from)}catch{Zn.throwArgumentError("missing from address","transaction",i)}const o=ii(pt(ot.from(i.nonce).toHexString()));return Nr(Yt(Ht(Ho([r,o])),12))}const N0="0x0000000000000000000000000000000000000000",B0=ot.from(0),L0="0x0000000000000000000000000000000000000000000000000000000000000000",j0="strings/5.6.1",Mc=new be(j0);var oi;(function(i){i.current="",i.NFC="NFC",i.NFD="NFD",i.NFKC="NFKC",i.NFKD="NFKD"})(oi||(oi={}));var ur;(function(i){i.UNEXPECTED_CONTINUE="unexpected continuation byte",i.BAD_PREFIX="bad codepoint prefix",i.OVERRUN="string overrun",i.MISSING_CONTINUE="missing continuation byte",i.OUT_OF_RANGE="out of UTF-8 range",i.UTF16_SURROGATE="UTF-16 surrogate",i.OVERLONG="overlong representation"})(ur||(ur={}));function U0(i,r,o,e,t){return Mc.throwArgumentError(`invalid codepoint at offset ${r}; ${i}`,"bytes",o)}function Ec(i,r,o,e,t){if(i===ur.BAD_PREFIX||i===ur.UNEXPECTED_CONTINUE){let n=0;for(let c=r+1;c<o.length&&o[c]>>6===2;c++)n++;return n}return i===ur.OVERRUN?o.length-r-1:0}function q0(i,r,o,e,t){return i===ur.OVERLONG?(e.push(t),0):(e.push(65533),Ec(i,r,o))}const F0=Object.freeze({error:U0,ignore:Ec,replace:q0});function Sc(i,r){r==null&&(r=F0.error),i=pt(i);const o=[];let e=0;for(;e<i.length;){const t=i[e++];if(t>>7===0){o.push(t);continue}let n=null,c=null;if((t&224)===192)n=1,c=127;else if((t&240)===224)n=2,c=2047;else if((t&248)===240)n=3,c=65535;else{(t&192)===128?e+=r(ur.UNEXPECTED_CONTINUE,e-1,i,o):e+=r(ur.BAD_PREFIX,e-1,i,o);continue}if(e-1+n>=i.length){e+=r(ur.OVERRUN,e-1,i,o);continue}let p=t&(1<<8-n-1)-1;for(let a=0;a<n;a++){let f=i[e];if((f&192)!=128){e+=r(ur.MISSING_CONTINUE,e,i,o),p=null;break}p=p<<6|f&63,e++}if(p!==null){if(p>1114111){e+=r(ur.OUT_OF_RANGE,e-1-n,i,o,p);continue}if(p>=55296&&p<=57343){e+=r(ur.UTF16_SURROGATE,e-1-n,i,o,p);continue}if(p<=c){e+=r(ur.OVERLONG,e-1-n,i,o,p);continue}o.push(p)}}return o}function on(i,r=oi.current){r!=oi.current&&(Mc.checkNormalize(),i=i.normalize(r));let o=[];for(let e=0;e<i.length;e++){const t=i.charCodeAt(e);if(t<128)o.push(t);else if(t<2048)o.push(t>>6|192),o.push(t&63|128);else if((t&64512)==55296){e++;const n=i.charCodeAt(e);if(e>=i.length||(n&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((t&1023)<<10)+(n&1023);o.push(c>>18|240),o.push(c>>12&63|128),o.push(c>>6&63|128),o.push(c&63|128)}else o.push(t>>12|224),o.push(t>>6&63|128),o.push(t&63|128)}return pt(o)}function Ds(i){return i.map(r=>r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode((r>>10&1023)+55296,(r&1023)+56320))).join("")}function Wo(i,r){return Ds(Sc(i,r))}function Bu(i,r=oi.current){return Sc(on(i,r))}function D0(i){if(i.length%4!==0)throw new Error("bad data");let r=[];for(let o=0;o<i.length;o+=4)r.push(parseInt(i.substring(o,o+4),16));return r}function Na(i,r){r||(r=function(t){return[parseInt(t,16)]});let o=0,e={};return i.split(",").forEach(t=>{let n=t.split(":");o+=parseInt(n[0],16),e[o]=r(n[1])}),e}function kc(i){let r=0;return i.split(",").map(o=>{let e=o.split("-");e.length===1?e[1]="0":e[1]===""&&(e[1]="1");let t=r+parseInt(e[0],16);return r=parseInt(e[1],16),{l:t,h:r}})}function Ba(i,r){let o=0;for(let e=0;e<r.length;e++){let t=r[e];if(o+=t.l,i>=o&&i<=o+t.h&&(i-o)%(t.d||1)===0){if(t.e&&t.e.indexOf(i-o)!==-1)continue;return t}}return null}const z0=kc("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),H0="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(i=>parseInt(i,16)),W0=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],K0=Na("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),$0=Na("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),V0=Na("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",D0),G0=kc("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function J0(i){return i.reduce((r,o)=>(o.forEach(e=>{r.push(e)}),r),[])}function Z0(i){return!!Ba(i,z0)}function Y0(i){let r=Ba(i,W0);if(r)return[i+r.s];let o=K0[i];if(o)return o;let e=$0[i];if(e)return[i+e[0]];let t=V0[i];return t||null}function X0(i){return!!Ba(i,G0)}function Ac(i){if(i.match(/^[a-z0-9-]*$/i)&&i.length<=59)return i.toLowerCase();let r=Bu(i);r=J0(r.map(e=>{if(H0.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=Y0(e);return t||[e]})),r=Bu(Ds(r),oi.NFKC),r.forEach(e=>{if(X0(e))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),r.forEach(e=>{if(Z0(e))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let o=Ds(r);if(o.substring(0,1)==="-"||o.substring(2,4)==="--"||o.substring(o.length-1)==="-")throw new Error("invalid hyphen");if(o.length>63)throw new Error("too long");return o}function Rc(i){return Ht(on(i))}const Tc="hash/5.6.1",Lu=new be(Tc),Pc=new Uint8Array(32);Pc.fill(0);const Q0=new RegExp("^((.*)\\.)?([^.]+)$");function co(i){typeof i!="string"&&Lu.throwArgumentError("invalid ENS name; not a string","name",i);let r=i,o=Pc;for(;r.length;){const e=r.match(Q0);(e==null||e[2]==="")&&Lu.throwArgumentError("invalid ENS address; missing component","name",i);const t=on(Ac(e[3]));o=Ht(Nn([o,Ht(t)])),r=e[2]||""}return ht(o)}function ep(i){return ht(Nn(i.split(".").map(r=>{const o=on("_"+Ac(r));return o[0]=o.length-1,o})))+"00"}var tp=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};const Ct=new be(Tc),Cc=new Uint8Array(32);Cc.fill(0);const rp=ot.from(-1),Ic=ot.from(0),Oc=ot.from(1),np=ot.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function ip(i){const r=pt(i),o=r.length%32;return o?lr([r,Cc.slice(o)]):ht(r)}const op=jt(Oc.toHexString(),32),sp=jt(Ic.toHexString(),32),ju={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ss=["name","version","chainId","verifyingContract","salt"];function Uu(i){return function(r){return typeof r!="string"&&Ct.throwArgumentError(`invalid domain value for ${JSON.stringify(i)}`,`domain.${i}`,r),r}}const ap={name:Uu("name"),version:Uu("version"),chainId:function(i){try{return ot.from(i).toString()}catch{}return Ct.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",i)},verifyingContract:function(i){try{return Nr(i).toLowerCase()}catch{}return Ct.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",i)},salt:function(i){try{const r=pt(i);if(r.length!==32)throw new Error("bad length");return ht(r)}catch{}return Ct.throwArgumentError('invalid domain value "salt"',"domain.salt",i)}};function as(i){{const r=i.match(/^(u?)int(\d*)$/);if(r){const o=r[1]==="",e=parseInt(r[2]||"256");(e%8!==0||e>256||r[2]&&r[2]!==String(e))&&Ct.throwArgumentError("invalid numeric width","type",i);const t=np.mask(o?e-1:e),n=o?t.add(Oc).mul(rp):Ic;return function(c){const p=ot.from(c);return(p.lt(n)||p.gt(t))&&Ct.throwArgumentError(`value out-of-bounds for ${i}`,"value",c),jt(p.toTwos(256).toHexString(),32)}}}{const r=i.match(/^bytes(\d+)$/);if(r){const o=parseInt(r[1]);return(o===0||o>32||r[1]!==String(o))&&Ct.throwArgumentError("invalid bytes width","type",i),function(e){return pt(e).length!==o&&Ct.throwArgumentError(`invalid length for ${i}`,"value",e),ip(e)}}}switch(i){case"address":return function(r){return jt(Nr(r),32)};case"bool":return function(r){return r?op:sp};case"bytes":return function(r){return Ht(r)};case"string":return function(r){return Rc(r)}}return null}function qu(i,r){return`${i}(${r.map(({name:o,type:e})=>e+" "+o).join(",")})`}class sr{constructor(r){Mt(this,"types",Object.freeze(qn(r))),Mt(this,"_encoderCache",{}),Mt(this,"_types",{});const o={},e={},t={};Object.keys(r).forEach(p=>{o[p]={},e[p]=[],t[p]={}});for(const p in r){const a={};r[p].forEach(f=>{a[f.name]&&Ct.throwArgumentError(`duplicate variable name ${JSON.stringify(f.name)} in ${JSON.stringify(p)}`,"types",r),a[f.name]=!0;const s=f.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===p&&Ct.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",r),!as(s)&&(e[s]||Ct.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",r),e[s].push(p),o[p][s]=!0)})}const n=Object.keys(e).filter(p=>e[p].length===0);n.length===0?Ct.throwArgumentError("missing primary type","types",r):n.length>1&&Ct.throwArgumentError(`ambiguous primary types or unused types: ${n.map(p=>JSON.stringify(p)).join(", ")}`,"types",r),Mt(this,"primaryType",n[0]);function c(p,a){a[p]&&Ct.throwArgumentError(`circular type reference to ${JSON.stringify(p)}`,"types",r),a[p]=!0,Object.keys(o[p]).forEach(f=>{!e[f]||(c(f,a),Object.keys(a).forEach(s=>{t[s][f]=!0}))}),delete a[p]}c(this.primaryType,{});for(const p in t){const a=Object.keys(t[p]);a.sort(),this._types[p]=qu(p,r[p])+a.map(f=>qu(f,r[f])).join("")}}getEncoder(r){let o=this._encoderCache[r];return o||(o=this._encoderCache[r]=this._getEncoder(r)),o}_getEncoder(r){{const t=as(r);if(t)return t}const o=r.match(/^(.*)(\x5b(\d*)\x5d)$/);if(o){const t=o[1],n=this.getEncoder(t),c=parseInt(o[3]);return p=>{c>=0&&p.length!==c&&Ct.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",p);let a=p.map(n);return this._types[t]&&(a=a.map(Ht)),Ht(lr(a))}}const e=this.types[r];if(e){const t=Rc(this._types[r]);return n=>{const c=e.map(({name:p,type:a})=>{const f=this.getEncoder(a)(n[p]);return this._types[a]?Ht(f):f});return c.unshift(t),lr(c)}}return Ct.throwArgumentError(`unknown type: ${r}`,"type",r)}encodeType(r){const o=this._types[r];return o||Ct.throwArgumentError(`unknown type: ${JSON.stringify(r)}`,"name",r),o}encodeData(r,o){return this.getEncoder(r)(o)}hashStruct(r,o){return Ht(this.encodeData(r,o))}encode(r){return this.encodeData(this.primaryType,r)}hash(r){return this.hashStruct(this.primaryType,r)}_visit(r,o,e){if(as(r))return e(r,o);const t=r.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const c=t[1],p=parseInt(t[3]);return p>=0&&o.length!==p&&Ct.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",o),o.map(a=>this._visit(c,a,e))}const n=this.types[r];return n?n.reduce((c,{name:p,type:a})=>(c[p]=this._visit(a,o[p],e),c),{}):Ct.throwArgumentError(`unknown type: ${r}`,"type",r)}visit(r,o){return this._visit(this.primaryType,r,o)}static from(r){return new sr(r)}static getPrimaryType(r){return sr.from(r).primaryType}static hashStruct(r,o,e){return sr.from(o).hashStruct(r,e)}static hashDomain(r){const o=[];for(const e in r){const t=ju[e];t||Ct.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(e)}`,"domain",r),o.push({name:e,type:t})}return o.sort((e,t)=>ss.indexOf(e.name)-ss.indexOf(t.name)),sr.hashStruct("EIP712Domain",{EIP712Domain:o},r)}static encode(r,o,e){return lr(["0x1901",sr.hashDomain(r),sr.from(o).hash(e)])}static hash(r,o,e){return Ht(sr.encode(r,o,e))}static resolveNames(r,o,e,t){return tp(this,void 0,void 0,function*(){r=hr(r);const n={};r.verifyingContract&&!Rt(r.verifyingContract,20)&&(n[r.verifyingContract]="0x");const c=sr.from(o);c.visit(e,(p,a)=>(p==="address"&&!Rt(a,20)&&(n[a]="0x"),a));for(const p in n)n[p]=yield t(p);return r.verifyingContract&&n[r.verifyingContract]&&(r.verifyingContract=n[r.verifyingContract]),e=c.visit(e,(p,a)=>p==="address"&&n[a]?n[a]:a),{domain:r,value:e}})}static getPayload(r,o,e){sr.hashDomain(r);const t={},n=[];ss.forEach(a=>{const f=r[a];f!=null&&(t[a]=ap[a](f),n.push({name:a,type:ju[a]}))});const c=sr.from(o),p=hr(o);return p.EIP712Domain?Ct.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",o):p.EIP712Domain=n,c.encode(e),{types:p,domain:t,primaryType:c.primaryType,message:c.visit(e,(a,f)=>{if(a.match(/^bytes(\d*)/))return ht(pt(f));if(a.match(/^u?int/))return ot.from(f).toString();switch(a){case"address":return f.toLowerCase();case"bool":return!!f;case"string":return typeof f!="string"&&Ct.throwArgumentError("invalid string","value",f),f}return Ct.throwArgumentError("unsupported type","type",a)})}}}const up="abstract-provider/5.6.1";var fp=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};const cp=new be(up);class lp extends k0{static isForkEvent(r){return!!(r&&r._isForkEvent)}}class La{constructor(){cp.checkAbstract(new.target,La),Mt(this,"_isProvider",!0)}getFeeData(){return fp(this,void 0,void 0,function*(){const{block:r,gasPrice:o}=yield Dt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(n=>null)});let e=null,t=null;return r&&r.baseFeePerGas&&(t=ot.from("1500000000"),e=r.baseFeePerGas.mul(2).add(t)),{maxFeePerGas:e,maxPriorityFeePerGas:t,gasPrice:o}})}addListener(r,o){return this.on(r,o)}removeListener(r,o){return this.off(r,o)}static isProvider(r){return!!(r&&r._isProvider)}}const hp="abstract-signer/5.6.2";var Er=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};const Sr=new be(hp),dp=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],pp=[be.errors.INSUFFICIENT_FUNDS,be.errors.NONCE_EXPIRED,be.errors.REPLACEMENT_UNDERPRICED];class ja{constructor(){Sr.checkAbstract(new.target,ja),Mt(this,"_isSigner",!0)}getBalance(r){return Er(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),r)})}getTransactionCount(r){return Er(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),r)})}estimateGas(r){return Er(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const o=yield Dt(this.checkTransaction(r));return yield this.provider.estimateGas(o)})}call(r,o){return Er(this,void 0,void 0,function*(){this._checkProvider("call");const e=yield Dt(this.checkTransaction(r));return yield this.provider.call(e,o)})}sendTransaction(r){return Er(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const o=yield this.populateTransaction(r),e=yield this.signTransaction(o);return yield this.provider.sendTransaction(e)})}getChainId(){return Er(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Er(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Er(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(r){return Er(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(r)})}checkTransaction(r){for(const e in r)dp.indexOf(e)===-1&&Sr.throwArgumentError("invalid transaction key: "+e,"transaction",r);const o=hr(r);return o.from==null?o.from=this.getAddress():o.from=Promise.all([Promise.resolve(o.from),this.getAddress()]).then(e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&Sr.throwArgumentError("from address mismatch","transaction",r),e[0])),o}populateTransaction(r){return Er(this,void 0,void 0,function*(){const o=yield Dt(this.checkTransaction(r));o.to!=null&&(o.to=Promise.resolve(o.to).then(t=>Er(this,void 0,void 0,function*(){if(t==null)return null;const n=yield this.resolveName(t);return n==null&&Sr.throwArgumentError("provided ENS name resolves to null","tx.to",t),n})),o.to.catch(t=>{}));const e=o.maxFeePerGas!=null||o.maxPriorityFeePerGas!=null;if(o.gasPrice!=null&&(o.type===2||e)?Sr.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",r):(o.type===0||o.type===1)&&e&&Sr.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",r),(o.type===2||o.type==null)&&o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)o.type=2;else if(o.type===0||o.type===1)o.gasPrice==null&&(o.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(o.type==null)if(t.maxFeePerGas!=null&&t.maxPriorityFeePerGas!=null)if(o.type=2,o.gasPrice!=null){const n=o.gasPrice;delete o.gasPrice,o.maxFeePerGas=n,o.maxPriorityFeePerGas=n}else o.maxFeePerGas==null&&(o.maxFeePerGas=t.maxFeePerGas),o.maxPriorityFeePerGas==null&&(o.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else t.gasPrice!=null?(e&&Sr.throwError("network does not support EIP-1559",be.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),o.gasPrice==null&&(o.gasPrice=t.gasPrice),o.type=0):Sr.throwError("failed to get consistent fee data",be.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else o.type===2&&(o.maxFeePerGas==null&&(o.maxFeePerGas=t.maxFeePerGas),o.maxPriorityFeePerGas==null&&(o.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}return o.nonce==null&&(o.nonce=this.getTransactionCount("pending")),o.gasLimit==null&&(o.gasLimit=this.estimateGas(o).catch(t=>{if(pp.indexOf(t.code)>=0)throw t;return Sr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",be.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:o})})),o.chainId==null?o.chainId=this.getChainId():o.chainId=Promise.all([Promise.resolve(o.chainId),this.getChainId()]).then(t=>(t[1]!==0&&t[0]!==t[1]&&Sr.throwArgumentError("chainId address mismatch","transaction",r),t[0])),yield Dt(o)})}_checkProvider(r){this.provider||Sr.throwError("missing provider",be.errors.UNSUPPORTED_OPERATION,{operation:r||"_checkProvider"})}static isSigner(r){return!!(r&&r._isSigner)}}var Nc={},wt={},$i=Bc;function Bc(i,r){if(!i)throw new Error(r||"Assertion failed")}Bc.equal=function(r,o,e){if(r!=o)throw new Error(e||"Assertion failed: "+r+" != "+o)};var zs={exports:{}};typeof Object.create=="function"?zs.exports=function(r,o){o&&(r.super_=o,r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:zs.exports=function(r,o){if(o){r.super_=o;var e=function(){};e.prototype=o.prototype,r.prototype=new e,r.prototype.constructor=r}};var mp=$i,gp=zs.exports;wt.inherits=gp;function bp(i,r){return(i.charCodeAt(r)&64512)!==55296||r<0||r+1>=i.length?!1:(i.charCodeAt(r+1)&64512)===56320}function vp(i,r){if(Array.isArray(i))return i.slice();if(!i)return[];var o=[];if(typeof i=="string")if(r){if(r==="hex")for(i=i.replace(/[^a-z0-9]+/ig,""),i.length%2!==0&&(i="0"+i),t=0;t<i.length;t+=2)o.push(parseInt(i[t]+i[t+1],16))}else for(var e=0,t=0;t<i.length;t++){var n=i.charCodeAt(t);n<128?o[e++]=n:n<2048?(o[e++]=n>>6|192,o[e++]=n&63|128):bp(i,t)?(n=65536+((n&1023)<<10)+(i.charCodeAt(++t)&1023),o[e++]=n>>18|240,o[e++]=n>>12&63|128,o[e++]=n>>6&63|128,o[e++]=n&63|128):(o[e++]=n>>12|224,o[e++]=n>>6&63|128,o[e++]=n&63|128)}else for(t=0;t<i.length;t++)o[t]=i[t]|0;return o}wt.toArray=vp;function yp(i){for(var r="",o=0;o<i.length;o++)r+=jc(i[o].toString(16));return r}wt.toHex=yp;function Lc(i){var r=i>>>24|i>>>8&65280|i<<8&16711680|(i&255)<<24;return r>>>0}wt.htonl=Lc;function wp(i,r){for(var o="",e=0;e<i.length;e++){var t=i[e];r==="little"&&(t=Lc(t)),o+=Uc(t.toString(16))}return o}wt.toHex32=wp;function jc(i){return i.length===1?"0"+i:i}wt.zero2=jc;function Uc(i){return i.length===7?"0"+i:i.length===6?"00"+i:i.length===5?"000"+i:i.length===4?"0000"+i:i.length===3?"00000"+i:i.length===2?"000000"+i:i.length===1?"0000000"+i:i}wt.zero8=Uc;function _p(i,r,o,e){var t=o-r;mp(t%4===0);for(var n=new Array(t/4),c=0,p=r;c<n.length;c++,p+=4){var a;e==="big"?a=i[p]<<24|i[p+1]<<16|i[p+2]<<8|i[p+3]:a=i[p+3]<<24|i[p+2]<<16|i[p+1]<<8|i[p],n[c]=a>>>0}return n}wt.join32=_p;function xp(i,r){for(var o=new Array(i.length*4),e=0,t=0;e<i.length;e++,t+=4){var n=i[e];r==="big"?(o[t]=n>>>24,o[t+1]=n>>>16&255,o[t+2]=n>>>8&255,o[t+3]=n&255):(o[t+3]=n>>>24,o[t+2]=n>>>16&255,o[t+1]=n>>>8&255,o[t]=n&255)}return o}wt.split32=xp;function Mp(i,r){return i>>>r|i<<32-r}wt.rotr32=Mp;function Ep(i,r){return i<<r|i>>>32-r}wt.rotl32=Ep;function Sp(i,r){return i+r>>>0}wt.sum32=Sp;function kp(i,r,o){return i+r+o>>>0}wt.sum32_3=kp;function Ap(i,r,o,e){return i+r+o+e>>>0}wt.sum32_4=Ap;function Rp(i,r,o,e,t){return i+r+o+e+t>>>0}wt.sum32_5=Rp;function Tp(i,r,o,e){var t=i[r],n=i[r+1],c=e+n>>>0,p=(c<e?1:0)+o+t;i[r]=p>>>0,i[r+1]=c}wt.sum64=Tp;function Pp(i,r,o,e){var t=r+e>>>0,n=(t<r?1:0)+i+o;return n>>>0}wt.sum64_hi=Pp;function Cp(i,r,o,e){var t=r+e;return t>>>0}wt.sum64_lo=Cp;function Ip(i,r,o,e,t,n,c,p){var a=0,f=r;f=f+e>>>0,a+=f<r?1:0,f=f+n>>>0,a+=f<n?1:0,f=f+p>>>0,a+=f<p?1:0;var s=i+o+t+c+a;return s>>>0}wt.sum64_4_hi=Ip;function Op(i,r,o,e,t,n,c,p){var a=r+e+n+p;return a>>>0}wt.sum64_4_lo=Op;function Np(i,r,o,e,t,n,c,p,a,f){var s=0,u=r;u=u+e>>>0,s+=u<r?1:0,u=u+n>>>0,s+=u<n?1:0,u=u+p>>>0,s+=u<p?1:0,u=u+f>>>0,s+=u<f?1:0;var h=i+o+t+c+a+s;return h>>>0}wt.sum64_5_hi=Np;function Bp(i,r,o,e,t,n,c,p,a,f){var s=r+e+n+p+f;return s>>>0}wt.sum64_5_lo=Bp;function Lp(i,r,o){var e=r<<32-o|i>>>o;return e>>>0}wt.rotr64_hi=Lp;function jp(i,r,o){var e=i<<32-o|r>>>o;return e>>>0}wt.rotr64_lo=jp;function Up(i,r,o){return i>>>o}wt.shr64_hi=Up;function qp(i,r,o){var e=i<<32-o|r>>>o;return e>>>0}wt.shr64_lo=qp;var hi={},Fu=wt,Fp=$i;function Ko(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}hi.BlockHash=Ko;Ko.prototype.update=function(r,o){if(r=Fu.toArray(r,o),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){r=this.pending;var e=r.length%this._delta8;this.pending=r.slice(r.length-e,r.length),this.pending.length===0&&(this.pending=null),r=Fu.join32(r,0,r.length-e,this.endian);for(var t=0;t<r.length;t+=this._delta32)this._update(r,t,t+this._delta32)}return this};Ko.prototype.digest=function(r){return this.update(this._pad()),Fp(this.pending===null),this._digest(r)};Ko.prototype._pad=function(){var r=this.pendingTotal,o=this._delta8,e=o-(r+this.padLength)%o,t=new Array(e+this.padLength);t[0]=128;for(var n=1;n<e;n++)t[n]=0;if(r<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)t[n++]=0;t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=r>>>24&255,t[n++]=r>>>16&255,t[n++]=r>>>8&255,t[n++]=r&255}else for(t[n++]=r&255,t[n++]=r>>>8&255,t[n++]=r>>>16&255,t[n++]=r>>>24&255,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,c=8;c<this.padLength;c++)t[n++]=0;return t};var di={},Zr={},Dp=wt,zr=Dp.rotr32;function zp(i,r,o,e){if(i===0)return qc(r,o,e);if(i===1||i===3)return Dc(r,o,e);if(i===2)return Fc(r,o,e)}Zr.ft_1=zp;function qc(i,r,o){return i&r^~i&o}Zr.ch32=qc;function Fc(i,r,o){return i&r^i&o^r&o}Zr.maj32=Fc;function Dc(i,r,o){return i^r^o}Zr.p32=Dc;function Hp(i){return zr(i,2)^zr(i,13)^zr(i,22)}Zr.s0_256=Hp;function Wp(i){return zr(i,6)^zr(i,11)^zr(i,25)}Zr.s1_256=Wp;function Kp(i){return zr(i,7)^zr(i,18)^i>>>3}Zr.g0_256=Kp;function $p(i){return zr(i,17)^zr(i,19)^i>>>10}Zr.g1_256=$p;var si=wt,Vp=hi,Gp=Zr,us=si.rotl32,bi=si.sum32,Jp=si.sum32_5,Zp=Gp.ft_1,zc=Vp.BlockHash,Yp=[1518500249,1859775393,2400959708,3395469782];function Vr(){if(!(this instanceof Vr))return new Vr;zc.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}si.inherits(Vr,zc);var Xp=Vr;Vr.blockSize=512;Vr.outSize=160;Vr.hmacStrength=80;Vr.padLength=64;Vr.prototype._update=function(r,o){for(var e=this.W,t=0;t<16;t++)e[t]=r[o+t];for(;t<e.length;t++)e[t]=us(e[t-3]^e[t-8]^e[t-14]^e[t-16],1);var n=this.h[0],c=this.h[1],p=this.h[2],a=this.h[3],f=this.h[4];for(t=0;t<e.length;t++){var s=~~(t/20),u=Jp(us(n,5),Zp(s,c,p,a),f,e[t],Yp[s]);f=a,a=p,p=us(c,30),c=n,n=u}this.h[0]=bi(this.h[0],n),this.h[1]=bi(this.h[1],c),this.h[2]=bi(this.h[2],p),this.h[3]=bi(this.h[3],a),this.h[4]=bi(this.h[4],f)};Vr.prototype._digest=function(r){return r==="hex"?si.toHex32(this.h,"big"):si.split32(this.h,"big")};var ai=wt,Qp=hi,pi=Zr,e1=$i,kr=ai.sum32,t1=ai.sum32_4,r1=ai.sum32_5,n1=pi.ch32,i1=pi.maj32,o1=pi.s0_256,s1=pi.s1_256,a1=pi.g0_256,u1=pi.g1_256,Hc=Qp.BlockHash,f1=[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];function Gr(){if(!(this instanceof Gr))return new Gr;Hc.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=f1,this.W=new Array(64)}ai.inherits(Gr,Hc);var Wc=Gr;Gr.blockSize=512;Gr.outSize=256;Gr.hmacStrength=192;Gr.padLength=64;Gr.prototype._update=function(r,o){for(var e=this.W,t=0;t<16;t++)e[t]=r[o+t];for(;t<e.length;t++)e[t]=t1(u1(e[t-2]),e[t-7],a1(e[t-15]),e[t-16]);var n=this.h[0],c=this.h[1],p=this.h[2],a=this.h[3],f=this.h[4],s=this.h[5],u=this.h[6],h=this.h[7];for(e1(this.k.length===e.length),t=0;t<e.length;t++){var v=r1(h,s1(f),n1(f,s,u),this.k[t],e[t]),b=kr(o1(n),i1(n,c,p));h=u,u=s,s=f,f=kr(a,v),a=p,p=c,c=n,n=kr(v,b)}this.h[0]=kr(this.h[0],n),this.h[1]=kr(this.h[1],c),this.h[2]=kr(this.h[2],p),this.h[3]=kr(this.h[3],a),this.h[4]=kr(this.h[4],f),this.h[5]=kr(this.h[5],s),this.h[6]=kr(this.h[6],u),this.h[7]=kr(this.h[7],h)};Gr.prototype._digest=function(r){return r==="hex"?ai.toHex32(this.h,"big"):ai.split32(this.h,"big")};var Hs=wt,Kc=Wc;function sn(){if(!(this instanceof sn))return new sn;Kc.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Hs.inherits(sn,Kc);var c1=sn;sn.blockSize=512;sn.outSize=224;sn.hmacStrength=192;sn.padLength=64;sn.prototype._digest=function(r){return r==="hex"?Hs.toHex32(this.h.slice(0,7),"big"):Hs.split32(this.h.slice(0,7),"big")};var or=wt,l1=hi,h1=$i,Hr=or.rotr64_hi,Wr=or.rotr64_lo,$c=or.shr64_hi,Vc=or.shr64_lo,dn=or.sum64,fs=or.sum64_hi,cs=or.sum64_lo,d1=or.sum64_4_hi,p1=or.sum64_4_lo,m1=or.sum64_5_hi,g1=or.sum64_5_lo,Gc=l1.BlockHash,b1=[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];function Br(){if(!(this instanceof Br))return new Br;Gc.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b1,this.W=new Array(160)}or.inherits(Br,Gc);var Jc=Br;Br.blockSize=1024;Br.outSize=512;Br.hmacStrength=192;Br.padLength=128;Br.prototype._prepareBlock=function(r,o){for(var e=this.W,t=0;t<32;t++)e[t]=r[o+t];for(;t<e.length;t+=2){var n=R1(e[t-4],e[t-3]),c=T1(e[t-4],e[t-3]),p=e[t-14],a=e[t-13],f=k1(e[t-30],e[t-29]),s=A1(e[t-30],e[t-29]),u=e[t-32],h=e[t-31];e[t]=d1(n,c,p,a,f,s,u,h),e[t+1]=p1(n,c,p,a,f,s,u,h)}};Br.prototype._update=function(r,o){this._prepareBlock(r,o);var e=this.W,t=this.h[0],n=this.h[1],c=this.h[2],p=this.h[3],a=this.h[4],f=this.h[5],s=this.h[6],u=this.h[7],h=this.h[8],v=this.h[9],b=this.h[10],y=this.h[11],_=this.h[12],E=this.h[13],S=this.h[14],k=this.h[15];h1(this.k.length===e.length);for(var O=0;O<e.length;O+=2){var M=S,C=k,N=E1(h,v),L=S1(h,v),F=v1(h,v,b,y,_),V=y1(h,v,b,y,_,E),H=this.k[O],z=this.k[O+1],R=e[O],l=e[O+1],x=m1(M,C,N,L,F,V,H,z,R,l),d=g1(M,C,N,L,F,V,H,z,R,l);M=x1(t,n),C=M1(t,n),N=w1(t,n,c,p,a),L=_1(t,n,c,p,a,f);var m=fs(M,C,N,L),g=cs(M,C,N,L);S=_,k=E,_=b,E=y,b=h,y=v,h=fs(s,u,x,d),v=cs(u,u,x,d),s=a,u=f,a=c,f=p,c=t,p=n,t=fs(x,d,m,g),n=cs(x,d,m,g)}dn(this.h,0,t,n),dn(this.h,2,c,p),dn(this.h,4,a,f),dn(this.h,6,s,u),dn(this.h,8,h,v),dn(this.h,10,b,y),dn(this.h,12,_,E),dn(this.h,14,S,k)};Br.prototype._digest=function(r){return r==="hex"?or.toHex32(this.h,"big"):or.split32(this.h,"big")};function v1(i,r,o,e,t){var n=i&o^~i&t;return n<0&&(n+=4294967296),n}function y1(i,r,o,e,t,n){var c=r&e^~r&n;return c<0&&(c+=4294967296),c}function w1(i,r,o,e,t){var n=i&o^i&t^o&t;return n<0&&(n+=4294967296),n}function _1(i,r,o,e,t,n){var c=r&e^r&n^e&n;return c<0&&(c+=4294967296),c}function x1(i,r){var o=Hr(i,r,28),e=Hr(r,i,2),t=Hr(r,i,7),n=o^e^t;return n<0&&(n+=4294967296),n}function M1(i,r){var o=Wr(i,r,28),e=Wr(r,i,2),t=Wr(r,i,7),n=o^e^t;return n<0&&(n+=4294967296),n}function E1(i,r){var o=Hr(i,r,14),e=Hr(i,r,18),t=Hr(r,i,9),n=o^e^t;return n<0&&(n+=4294967296),n}function S1(i,r){var o=Wr(i,r,14),e=Wr(i,r,18),t=Wr(r,i,9),n=o^e^t;return n<0&&(n+=4294967296),n}function k1(i,r){var o=Hr(i,r,1),e=Hr(i,r,8),t=$c(i,r,7),n=o^e^t;return n<0&&(n+=4294967296),n}function A1(i,r){var o=Wr(i,r,1),e=Wr(i,r,8),t=Vc(i,r,7),n=o^e^t;return n<0&&(n+=4294967296),n}function R1(i,r){var o=Hr(i,r,19),e=Hr(r,i,29),t=$c(i,r,6),n=o^e^t;return n<0&&(n+=4294967296),n}function T1(i,r){var o=Wr(i,r,19),e=Wr(r,i,29),t=Vc(i,r,6),n=o^e^t;return n<0&&(n+=4294967296),n}var Ws=wt,Zc=Jc;function an(){if(!(this instanceof an))return new an;Zc.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Ws.inherits(an,Zc);var P1=an;an.blockSize=1024;an.outSize=384;an.hmacStrength=192;an.padLength=128;an.prototype._digest=function(r){return r==="hex"?Ws.toHex32(this.h.slice(0,12),"big"):Ws.split32(this.h.slice(0,12),"big")};di.sha1=Xp;di.sha224=c1;di.sha256=Wc;di.sha384=P1;di.sha512=Jc;var Yc={},Fn=wt,C1=hi,to=Fn.rotl32,Du=Fn.sum32,vi=Fn.sum32_3,zu=Fn.sum32_4,Xc=C1.BlockHash;function Jr(){if(!(this instanceof Jr))return new Jr;Xc.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Fn.inherits(Jr,Xc);Yc.ripemd160=Jr;Jr.blockSize=512;Jr.outSize=160;Jr.hmacStrength=192;Jr.padLength=64;Jr.prototype._update=function(r,o){for(var e=this.h[0],t=this.h[1],n=this.h[2],c=this.h[3],p=this.h[4],a=e,f=t,s=n,u=c,h=p,v=0;v<80;v++){var b=Du(to(zu(e,Hu(v,t,n,c),r[N1[v]+o],I1(v)),L1[v]),p);e=p,p=c,c=to(n,10),n=t,t=b,b=Du(to(zu(a,Hu(79-v,f,s,u),r[B1[v]+o],O1(v)),j1[v]),h),a=h,h=u,u=to(s,10),s=f,f=b}b=vi(this.h[1],n,u),this.h[1]=vi(this.h[2],c,h),this.h[2]=vi(this.h[3],p,a),this.h[3]=vi(this.h[4],e,f),this.h[4]=vi(this.h[0],t,s),this.h[0]=b};Jr.prototype._digest=function(r){return r==="hex"?Fn.toHex32(this.h,"little"):Fn.split32(this.h,"little")};function Hu(i,r,o,e){return i<=15?r^o^e:i<=31?r&o|~r&e:i<=47?(r|~o)^e:i<=63?r&e|o&~e:r^(o|~e)}function I1(i){return i<=15?0:i<=31?1518500249:i<=47?1859775393:i<=63?2400959708:2840853838}function O1(i){return i<=15?1352829926:i<=31?1548603684:i<=47?1836072691:i<=63?2053994217:0}var N1=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],B1=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],L1=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],j1=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],U1=wt,q1=$i;function ui(i,r,o){if(!(this instanceof ui))return new ui(i,r,o);this.Hash=i,this.blockSize=i.blockSize/8,this.outSize=i.outSize/8,this.inner=null,this.outer=null,this._init(U1.toArray(r,o))}var F1=ui;ui.prototype._init=function(r){r.length>this.blockSize&&(r=new this.Hash().update(r).digest()),q1(r.length<=this.blockSize);for(var o=r.length;o<this.blockSize;o++)r.push(0);for(o=0;o<r.length;o++)r[o]^=54;for(this.inner=new this.Hash().update(r),o=0;o<r.length;o++)r[o]^=106;this.outer=new this.Hash().update(r)};ui.prototype.update=function(r,o){return this.inner.update(r,o),this};ui.prototype.digest=function(r){return this.outer.update(this.inner.digest()),this.outer.digest(r)};(function(i){var r=i;r.utils=wt,r.common=hi,r.sha=di,r.ripemd=Yc,r.hmac=F1,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})(Nc);var Ur=Nc;function mi(i,r,o){return o={path:r,exports:{},require:function(e,t){return D1(e,t==null?o.path:t)}},i(o,o.exports),o.exports}function D1(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ua=Qc;function Qc(i,r){if(!i)throw new Error(r||"Assertion failed")}Qc.equal=function(r,o,e){if(r!=o)throw new Error(e||"Assertion failed: "+r+" != "+o)};var Cr=mi(function(i,r){var o=r;function e(c,p){if(Array.isArray(c))return c.slice();if(!c)return[];var a=[];if(typeof c!="string"){for(var f=0;f<c.length;f++)a[f]=c[f]|0;return a}if(p==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var f=0;f<c.length;f+=2)a.push(parseInt(c[f]+c[f+1],16))}else for(var f=0;f<c.length;f++){var s=c.charCodeAt(f),u=s>>8,h=s&255;u?a.push(u,h):a.push(h)}return a}o.toArray=e;function t(c){return c.length===1?"0"+c:c}o.zero2=t;function n(c){for(var p="",a=0;a<c.length;a++)p+=t(c[a].toString(16));return p}o.toHex=n,o.encode=function(p,a){return a==="hex"?n(p):p}}),mr=mi(function(i,r){var o=r;o.assert=Ua,o.toArray=Cr.toArray,o.zero2=Cr.zero2,o.toHex=Cr.toHex,o.encode=Cr.encode;function e(a,f,s){var u=new Array(Math.max(a.bitLength(),s)+1);u.fill(0);for(var h=1<<f+1,v=a.clone(),b=0;b<u.length;b++){var y,_=v.andln(h-1);v.isOdd()?(_>(h>>1)-1?y=(h>>1)-_:y=_,v.isubn(y)):y=0,u[b]=y,v.iushrn(1)}return u}o.getNAF=e;function t(a,f){var s=[[],[]];a=a.clone(),f=f.clone();for(var u=0,h=0,v;a.cmpn(-u)>0||f.cmpn(-h)>0;){var b=a.andln(3)+u&3,y=f.andln(3)+h&3;b===3&&(b=-1),y===3&&(y=-1);var _;(b&1)===0?_=0:(v=a.andln(7)+u&7,(v===3||v===5)&&y===2?_=-b:_=b),s[0].push(_);var E;(y&1)===0?E=0:(v=f.andln(7)+h&7,(v===3||v===5)&&b===2?E=-y:E=y),s[1].push(E),2*u===_+1&&(u=1-u),2*h===E+1&&(h=1-h),a.iushrn(1),f.iushrn(1)}return s}o.getJSF=t;function n(a,f,s){var u="_"+f;a.prototype[f]=function(){return this[u]!==void 0?this[u]:this[u]=s.call(this)}}o.cachedProperty=n;function c(a){return typeof a=="string"?o.toArray(a,"hex"):a}o.parseBytes=c;function p(a){return new ct(a,"hex","le")}o.intFromLE=p}),Mo=mr.getNAF,z1=mr.getJSF,Eo=mr.assert;function An(i,r){this.type=i,this.p=new ct(r.p,16),this.red=r.prime?ct.red(r.prime):ct.mont(this.p),this.zero=new ct(0).toRed(this.red),this.one=new ct(1).toRed(this.red),this.two=new ct(2).toRed(this.red),this.n=r.n&&new ct(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var o=this.n&&this.p.div(this.n);!o||o.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zn=An;An.prototype.point=function(){throw new Error("Not implemented")};An.prototype.validate=function(){throw new Error("Not implemented")};An.prototype._fixedNafMul=function(r,o){Eo(r.precomputed);var e=r._getDoubles(),t=Mo(o,1,this._bitLength),n=(1<<e.step+1)-(e.step%2===0?2:1);n/=3;var c=[],p,a;for(p=0;p<t.length;p+=e.step){a=0;for(var f=p+e.step-1;f>=p;f--)a=(a<<1)+t[f];c.push(a)}for(var s=this.jpoint(null,null,null),u=this.jpoint(null,null,null),h=n;h>0;h--){for(p=0;p<c.length;p++)a=c[p],a===h?u=u.mixedAdd(e.points[p]):a===-h&&(u=u.mixedAdd(e.points[p].neg()));s=s.add(u)}return s.toP()};An.prototype._wnafMul=function(r,o){var e=4,t=r._getNAFPoints(e);e=t.wnd;for(var n=t.points,c=Mo(o,e,this._bitLength),p=this.jpoint(null,null,null),a=c.length-1;a>=0;a--){for(var f=0;a>=0&&c[a]===0;a--)f++;if(a>=0&&f++,p=p.dblp(f),a<0)break;var s=c[a];Eo(s!==0),r.type==="affine"?s>0?p=p.mixedAdd(n[s-1>>1]):p=p.mixedAdd(n[-s-1>>1].neg()):s>0?p=p.add(n[s-1>>1]):p=p.add(n[-s-1>>1].neg())}return r.type==="affine"?p.toP():p};An.prototype._wnafMulAdd=function(r,o,e,t,n){var c=this._wnafT1,p=this._wnafT2,a=this._wnafT3,f=0,s,u,h;for(s=0;s<t;s++){h=o[s];var v=h._getNAFPoints(r);c[s]=v.wnd,p[s]=v.points}for(s=t-1;s>=1;s-=2){var b=s-1,y=s;if(c[b]!==1||c[y]!==1){a[b]=Mo(e[b],c[b],this._bitLength),a[y]=Mo(e[y],c[y],this._bitLength),f=Math.max(a[b].length,f),f=Math.max(a[y].length,f);continue}var _=[o[b],null,null,o[y]];o[b].y.cmp(o[y].y)===0?(_[1]=o[b].add(o[y]),_[2]=o[b].toJ().mixedAdd(o[y].neg())):o[b].y.cmp(o[y].y.redNeg())===0?(_[1]=o[b].toJ().mixedAdd(o[y]),_[2]=o[b].add(o[y].neg())):(_[1]=o[b].toJ().mixedAdd(o[y]),_[2]=o[b].toJ().mixedAdd(o[y].neg()));var E=[-3,-1,-5,-7,0,7,5,1,3],S=z1(e[b],e[y]);for(f=Math.max(S[0].length,f),a[b]=new Array(f),a[y]=new Array(f),u=0;u<f;u++){var k=S[0][u]|0,O=S[1][u]|0;a[b][u]=E[(k+1)*3+(O+1)],a[y][u]=0,p[b]=_}}var M=this.jpoint(null,null,null),C=this._wnafT4;for(s=f;s>=0;s--){for(var N=0;s>=0;){var L=!0;for(u=0;u<t;u++)C[u]=a[u][s]|0,C[u]!==0&&(L=!1);if(!L)break;N++,s--}if(s>=0&&N++,M=M.dblp(N),s<0)break;for(u=0;u<t;u++){var F=C[u];F!==0&&(F>0?h=p[u][F-1>>1]:F<0&&(h=p[u][-F-1>>1].neg()),h.type==="affine"?M=M.mixedAdd(h):M=M.add(h))}}for(s=0;s<t;s++)p[s]=null;return n?M:M.toP()};function xr(i,r){this.curve=i,this.type=r,this.precomputed=null}An.BasePoint=xr;xr.prototype.eq=function(){throw new Error("Not implemented")};xr.prototype.validate=function(){return this.curve.validate(this)};An.prototype.decodePoint=function(r,o){r=mr.toArray(r,o);var e=this.p.byteLength();if((r[0]===4||r[0]===6||r[0]===7)&&r.length-1===2*e){r[0]===6?Eo(r[r.length-1]%2===0):r[0]===7&&Eo(r[r.length-1]%2===1);var t=this.point(r.slice(1,1+e),r.slice(1+e,1+2*e));return t}else if((r[0]===2||r[0]===3)&&r.length-1===e)return this.pointFromX(r.slice(1,1+e),r[0]===3);throw new Error("Unknown point format")};xr.prototype.encodeCompressed=function(r){return this.encode(r,!0)};xr.prototype._encode=function(r){var o=this.curve.p.byteLength(),e=this.getX().toArray("be",o);return r?[this.getY().isEven()?2:3].concat(e):[4].concat(e,this.getY().toArray("be",o))};xr.prototype.encode=function(r,o){return mr.encode(this._encode(o),r)};xr.prototype.precompute=function(r){if(this.precomputed)return this;var o={doubles:null,naf:null,beta:null};return o.naf=this._getNAFPoints(8),o.doubles=this._getDoubles(4,r),o.beta=this._getBeta(),this.precomputed=o,this};xr.prototype._hasDoubles=function(r){if(!this.precomputed)return!1;var o=this.precomputed.doubles;return o?o.points.length>=Math.ceil((r.bitLength()+1)/o.step):!1};xr.prototype._getDoubles=function(r,o){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var e=[this],t=this,n=0;n<o;n+=r){for(var c=0;c<r;c++)t=t.dbl();e.push(t)}return{step:r,points:e}};xr.prototype._getNAFPoints=function(r){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var o=[this],e=(1<<r)-1,t=e===1?null:this.dbl(),n=1;n<e;n++)o[n]=o[n-1].add(t);return{wnd:r,points:o}};xr.prototype._getBeta=function(){return null};xr.prototype.dblp=function(r){for(var o=this,e=0;e<r;e++)o=o.dbl();return o};var qa=mi(function(i){typeof Object.create=="function"?i.exports=function(o,e){e&&(o.super_=e,o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}))}:i.exports=function(o,e){if(e){o.super_=e;var t=function(){};t.prototype=e.prototype,o.prototype=new t,o.prototype.constructor=o}}}),H1=mr.assert;function Mr(i){zn.call(this,"short",i),this.a=new ct(i.a,16).toRed(this.red),this.b=new ct(i.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(i),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}qa(Mr,zn);var W1=Mr;Mr.prototype._getEndomorphism=function(r){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var o,e;if(r.beta)o=new ct(r.beta,16).toRed(this.red);else{var t=this._getEndoRoots(this.p);o=t[0].cmp(t[1])<0?t[0]:t[1],o=o.toRed(this.red)}if(r.lambda)e=new ct(r.lambda,16);else{var n=this._getEndoRoots(this.n);this.g.mul(n[0]).x.cmp(this.g.x.redMul(o))===0?e=n[0]:(e=n[1],H1(this.g.mul(e).x.cmp(this.g.x.redMul(o))===0))}var c;return r.basis?c=r.basis.map(function(p){return{a:new ct(p.a,16),b:new ct(p.b,16)}}):c=this._getEndoBasis(e),{beta:o,lambda:e,basis:c}}};Mr.prototype._getEndoRoots=function(r){var o=r===this.p?this.red:ct.mont(r),e=new ct(2).toRed(o).redInvm(),t=e.redNeg(),n=new ct(3).toRed(o).redNeg().redSqrt().redMul(e),c=t.redAdd(n).fromRed(),p=t.redSub(n).fromRed();return[c,p]};Mr.prototype._getEndoBasis=function(r){for(var o=this.n.ushrn(Math.floor(this.n.bitLength()/2)),e=r,t=this.n.clone(),n=new ct(1),c=new ct(0),p=new ct(0),a=new ct(1),f,s,u,h,v,b,y,_=0,E,S;e.cmpn(0)!==0;){var k=t.div(e);E=t.sub(k.mul(e)),S=p.sub(k.mul(n));var O=a.sub(k.mul(c));if(!u&&E.cmp(o)<0)f=y.neg(),s=n,u=E.neg(),h=S;else if(u&&++_===2)break;y=E,t=e,e=E,p=n,n=S,a=c,c=O}v=E.neg(),b=S;var M=u.sqr().add(h.sqr()),C=v.sqr().add(b.sqr());return C.cmp(M)>=0&&(v=f,b=s),u.negative&&(u=u.neg(),h=h.neg()),v.negative&&(v=v.neg(),b=b.neg()),[{a:u,b:h},{a:v,b}]};Mr.prototype._endoSplit=function(r){var o=this.endo.basis,e=o[0],t=o[1],n=t.b.mul(r).divRound(this.n),c=e.b.neg().mul(r).divRound(this.n),p=n.mul(e.a),a=c.mul(t.a),f=n.mul(e.b),s=c.mul(t.b),u=r.sub(p).sub(a),h=f.add(s).neg();return{k1:u,k2:h}};Mr.prototype.pointFromX=function(r,o){r=new ct(r,16),r.red||(r=r.toRed(this.red));var e=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),t=e.redSqrt();if(t.redSqr().redSub(e).cmp(this.zero)!==0)throw new Error("invalid point");var n=t.fromRed().isOdd();return(o&&!n||!o&&n)&&(t=t.redNeg()),this.point(r,t)};Mr.prototype.validate=function(r){if(r.inf)return!0;var o=r.x,e=r.y,t=this.a.redMul(o),n=o.redSqr().redMul(o).redIAdd(t).redIAdd(this.b);return e.redSqr().redISub(n).cmpn(0)===0};Mr.prototype._endoWnafMulAdd=function(r,o,e){for(var t=this._endoWnafT1,n=this._endoWnafT2,c=0;c<r.length;c++){var p=this._endoSplit(o[c]),a=r[c],f=a._getBeta();p.k1.negative&&(p.k1.ineg(),a=a.neg(!0)),p.k2.negative&&(p.k2.ineg(),f=f.neg(!0)),t[c*2]=a,t[c*2+1]=f,n[c*2]=p.k1,n[c*2+1]=p.k2}for(var s=this._wnafMulAdd(1,t,n,c*2,e),u=0;u<c*2;u++)t[u]=null,n[u]=null;return s};function Ft(i,r,o,e){zn.BasePoint.call(this,i,"affine"),r===null&&o===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ct(r,16),this.y=new ct(o,16),e&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}qa(Ft,zn.BasePoint);Mr.prototype.point=function(r,o,e){return new Ft(this,r,o,e)};Mr.prototype.pointFromJSON=function(r,o){return Ft.fromJSON(this,r,o)};Ft.prototype._getBeta=function(){if(!!this.curve.endo){var r=this.precomputed;if(r&&r.beta)return r.beta;var o=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(r){var e=this.curve,t=function(n){return e.point(n.x.redMul(e.endo.beta),n.y)};r.beta=o,o.precomputed={beta:null,naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(t)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(t)}}}return o}};Ft.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Ft.fromJSON=function(r,o,e){typeof o=="string"&&(o=JSON.parse(o));var t=r.point(o[0],o[1],e);if(!o[2])return t;function n(p){return r.point(p[0],p[1],e)}var c=o[2];return t.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[t].concat(c.doubles.points.map(n))},naf:c.naf&&{wnd:c.naf.wnd,points:[t].concat(c.naf.points.map(n))}},t};Ft.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Ft.prototype.isInfinity=function(){return this.inf};Ft.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(this.x.cmp(r.x)===0)return this.curve.point(null,null);var o=this.y.redSub(r.y);o.cmpn(0)!==0&&(o=o.redMul(this.x.redSub(r.x).redInvm()));var e=o.redSqr().redISub(this.x).redISub(r.x),t=o.redMul(this.x.redSub(e)).redISub(this.y);return this.curve.point(e,t)};Ft.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(r.cmpn(0)===0)return this.curve.point(null,null);var o=this.curve.a,e=this.x.redSqr(),t=r.redInvm(),n=e.redAdd(e).redIAdd(e).redIAdd(o).redMul(t),c=n.redSqr().redISub(this.x.redAdd(this.x)),p=n.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,p)};Ft.prototype.getX=function(){return this.x.fromRed()};Ft.prototype.getY=function(){return this.y.fromRed()};Ft.prototype.mul=function(r){return r=new ct(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)};Ft.prototype.mulAdd=function(r,o,e){var t=[this,o],n=[r,e];return this.curve.endo?this.curve._endoWnafMulAdd(t,n):this.curve._wnafMulAdd(1,t,n,2)};Ft.prototype.jmulAdd=function(r,o,e){var t=[this,o],n=[r,e];return this.curve.endo?this.curve._endoWnafMulAdd(t,n,!0):this.curve._wnafMulAdd(1,t,n,2,!0)};Ft.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||this.x.cmp(r.x)===0&&this.y.cmp(r.y)===0)};Ft.prototype.neg=function(r){if(this.inf)return this;var o=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var e=this.precomputed,t=function(n){return n.neg()};o.precomputed={naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(t)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(t)}}}return o};Ft.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r};function Wt(i,r,o,e){zn.BasePoint.call(this,i,"jacobian"),r===null&&o===null&&e===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ct(0)):(this.x=new ct(r,16),this.y=new ct(o,16),this.z=new ct(e,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}qa(Wt,zn.BasePoint);Mr.prototype.jpoint=function(r,o,e){return new Wt(this,r,o,e)};Wt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),o=r.redSqr(),e=this.x.redMul(o),t=this.y.redMul(o).redMul(r);return this.curve.point(e,t)};Wt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Wt.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var o=r.z.redSqr(),e=this.z.redSqr(),t=this.x.redMul(o),n=r.x.redMul(e),c=this.y.redMul(o.redMul(r.z)),p=r.y.redMul(e.redMul(this.z)),a=t.redSub(n),f=c.redSub(p);if(a.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),u=s.redMul(a),h=t.redMul(s),v=f.redSqr().redIAdd(u).redISub(h).redISub(h),b=f.redMul(h.redISub(v)).redISub(c.redMul(u)),y=this.z.redMul(r.z).redMul(a);return this.curve.jpoint(v,b,y)};Wt.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var o=this.z.redSqr(),e=this.x,t=r.x.redMul(o),n=this.y,c=r.y.redMul(o).redMul(this.z),p=e.redSub(t),a=n.redSub(c);if(p.cmpn(0)===0)return a.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=p.redSqr(),s=f.redMul(p),u=e.redMul(f),h=a.redSqr().redIAdd(s).redISub(u).redISub(u),v=a.redMul(u.redISub(h)).redISub(n.redMul(s)),b=this.z.redMul(p);return this.curve.jpoint(h,v,b)};Wt.prototype.dblp=function(r){if(r===0)return this;if(this.isInfinity())return this;if(!r)return this.dbl();var o;if(this.curve.zeroA||this.curve.threeA){var e=this;for(o=0;o<r;o++)e=e.dbl();return e}var t=this.curve.a,n=this.curve.tinv,c=this.x,p=this.y,a=this.z,f=a.redSqr().redSqr(),s=p.redAdd(p);for(o=0;o<r;o++){var u=c.redSqr(),h=s.redSqr(),v=h.redSqr(),b=u.redAdd(u).redIAdd(u).redIAdd(t.redMul(f)),y=c.redMul(h),_=b.redSqr().redISub(y.redAdd(y)),E=y.redISub(_),S=b.redMul(E);S=S.redIAdd(S).redISub(v);var k=s.redMul(a);o+1<r&&(f=f.redMul(v)),c=_,a=k,s=S}return this.curve.jpoint(c,s.redMul(n),a)};Wt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Wt.prototype._zeroDbl=function(){var r,o,e;if(this.zOne){var t=this.x.redSqr(),n=this.y.redSqr(),c=n.redSqr(),p=this.x.redAdd(n).redSqr().redISub(t).redISub(c);p=p.redIAdd(p);var a=t.redAdd(t).redIAdd(t),f=a.redSqr().redISub(p).redISub(p),s=c.redIAdd(c);s=s.redIAdd(s),s=s.redIAdd(s),r=f,o=a.redMul(p.redISub(f)).redISub(s),e=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),h=this.y.redSqr(),v=h.redSqr(),b=this.x.redAdd(h).redSqr().redISub(u).redISub(v);b=b.redIAdd(b);var y=u.redAdd(u).redIAdd(u),_=y.redSqr(),E=v.redIAdd(v);E=E.redIAdd(E),E=E.redIAdd(E),r=_.redISub(b).redISub(b),o=y.redMul(b.redISub(r)).redISub(E),e=this.y.redMul(this.z),e=e.redIAdd(e)}return this.curve.jpoint(r,o,e)};Wt.prototype._threeDbl=function(){var r,o,e;if(this.zOne){var t=this.x.redSqr(),n=this.y.redSqr(),c=n.redSqr(),p=this.x.redAdd(n).redSqr().redISub(t).redISub(c);p=p.redIAdd(p);var a=t.redAdd(t).redIAdd(t).redIAdd(this.curve.a),f=a.redSqr().redISub(p).redISub(p);r=f;var s=c.redIAdd(c);s=s.redIAdd(s),s=s.redIAdd(s),o=a.redMul(p.redISub(f)).redISub(s),e=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),h=this.y.redSqr(),v=this.x.redMul(h),b=this.x.redSub(u).redMul(this.x.redAdd(u));b=b.redAdd(b).redIAdd(b);var y=v.redIAdd(v);y=y.redIAdd(y);var _=y.redAdd(y);r=b.redSqr().redISub(_),e=this.y.redAdd(this.z).redSqr().redISub(h).redISub(u);var E=h.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E),o=b.redMul(y.redISub(r)).redISub(E)}return this.curve.jpoint(r,o,e)};Wt.prototype._dbl=function(){var r=this.curve.a,o=this.x,e=this.y,t=this.z,n=t.redSqr().redSqr(),c=o.redSqr(),p=e.redSqr(),a=c.redAdd(c).redIAdd(c).redIAdd(r.redMul(n)),f=o.redAdd(o);f=f.redIAdd(f);var s=f.redMul(p),u=a.redSqr().redISub(s.redAdd(s)),h=s.redISub(u),v=p.redSqr();v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var b=a.redMul(h).redISub(v),y=e.redAdd(e).redMul(t);return this.curve.jpoint(u,b,y)};Wt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var r=this.x.redSqr(),o=this.y.redSqr(),e=this.z.redSqr(),t=o.redSqr(),n=r.redAdd(r).redIAdd(r),c=n.redSqr(),p=this.x.redAdd(o).redSqr().redISub(r).redISub(t);p=p.redIAdd(p),p=p.redAdd(p).redIAdd(p),p=p.redISub(c);var a=p.redSqr(),f=t.redIAdd(t);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var s=n.redIAdd(p).redSqr().redISub(c).redISub(a).redISub(f),u=o.redMul(s);u=u.redIAdd(u),u=u.redIAdd(u);var h=this.x.redMul(a).redISub(u);h=h.redIAdd(h),h=h.redIAdd(h);var v=this.y.redMul(s.redMul(f.redISub(s)).redISub(p.redMul(a)));v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var b=this.z.redAdd(p).redSqr().redISub(e).redISub(a);return this.curve.jpoint(h,v,b)};Wt.prototype.mul=function(r,o){return r=new ct(r,o),this.curve._wnafMul(this,r)};Wt.prototype.eq=function(r){if(r.type==="affine")return this.eq(r.toJ());if(this===r)return!0;var o=this.z.redSqr(),e=r.z.redSqr();if(this.x.redMul(e).redISub(r.x.redMul(o)).cmpn(0)!==0)return!1;var t=o.redMul(this.z),n=e.redMul(r.z);return this.y.redMul(n).redISub(r.y.redMul(t)).cmpn(0)===0};Wt.prototype.eqXToP=function(r){var o=this.z.redSqr(),e=r.toRed(this.curve.red).redMul(o);if(this.x.cmp(e)===0)return!0;for(var t=r.clone(),n=this.curve.redN.redMul(o);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),this.x.cmp(e)===0)return!0}};Wt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};Wt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var lo=mi(function(i,r){var o=r;o.base=zn,o.short=W1,o.mont=null,o.edwards=null}),ho=mi(function(i,r){var o=r,e=mr.assert;function t(p){p.type==="short"?this.curve=new lo.short(p):p.type==="edwards"?this.curve=new lo.edwards(p):this.curve=new lo.mont(p),this.g=this.curve.g,this.n=this.curve.n,this.hash=p.hash,e(this.g.validate(),"Invalid curve"),e(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o.PresetCurve=t;function n(p,a){Object.defineProperty(o,p,{configurable:!0,enumerable:!0,get:function(){var f=new t(a);return Object.defineProperty(o,p,{configurable:!0,enumerable:!0,value:f}),f}})}n("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ur.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),n("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ur.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),n("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ur.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),n("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ur.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),n("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ur.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),n("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ur.sha256,gRed:!1,g:["9"]}),n("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ur.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}n("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ur.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function kn(i){if(!(this instanceof kn))return new kn(i);this.hash=i.hash,this.predResist=!!i.predResist,this.outLen=this.hash.outSize,this.minEntropy=i.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var r=Cr.toArray(i.entropy,i.entropyEnc||"hex"),o=Cr.toArray(i.nonce,i.nonceEnc||"hex"),e=Cr.toArray(i.pers,i.persEnc||"hex");Ua(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(r,o,e)}var el=kn;kn.prototype._init=function(r,o,e){var t=r.concat(o).concat(e);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(t),this._reseed=1,this.reseedInterval=281474976710656};kn.prototype._hmac=function(){return new Ur.hmac(this.hash,this.K)};kn.prototype._update=function(r){var o=this._hmac().update(this.V).update([0]);r&&(o=o.update(r)),this.K=o.digest(),this.V=this._hmac().update(this.V).digest(),r&&(this.K=this._hmac().update(this.V).update([1]).update(r).digest(),this.V=this._hmac().update(this.V).digest())};kn.prototype.reseed=function(r,o,e,t){typeof o!="string"&&(t=e,e=o,o=null),r=Cr.toArray(r,o),e=Cr.toArray(e,t),Ua(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(e||[])),this._reseed=1};kn.prototype.generate=function(r,o,e,t){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof o!="string"&&(t=e,e=o,o=null),e&&(e=Cr.toArray(e,t||"hex"),this._update(e));for(var n=[];n.length<r;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var c=n.slice(0,r);return this._update(e),this._reseed++,Cr.encode(c,o)};var Ks=mr.assert;function Gt(i,r){this.ec=i,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}var Fa=Gt;Gt.fromPublic=function(r,o,e){return o instanceof Gt?o:new Gt(r,{pub:o,pubEnc:e})};Gt.fromPrivate=function(r,o,e){return o instanceof Gt?o:new Gt(r,{priv:o,privEnc:e})};Gt.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Gt.prototype.getPublic=function(r,o){return typeof r=="string"&&(o=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),o?this.pub.encode(o,r):this.pub};Gt.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv};Gt.prototype._importPrivate=function(r,o){this.priv=new ct(r,o||16),this.priv=this.priv.umod(this.ec.curve.n)};Gt.prototype._importPublic=function(r,o){if(r.x||r.y){this.ec.curve.type==="mont"?Ks(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Ks(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,o)};Gt.prototype.derive=function(r){return r.validate()||Ks(r.validate(),"public point not validated"),r.mul(this.priv).getX()};Gt.prototype.sign=function(r,o,e){return this.ec.sign(r,this,o,e)};Gt.prototype.verify=function(r,o){return this.ec.verify(r,o,this)};Gt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var K1=mr.assert;function $o(i,r){if(i instanceof $o)return i;this._importDER(i,r)||(K1(i.r&&i.s,"Signature without r or s"),this.r=new ct(i.r,16),this.s=new ct(i.s,16),i.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=i.recoveryParam)}var Vo=$o;function $1(){this.place=0}function ls(i,r){var o=i[r.place++];if(!(o&128))return o;var e=o&15;if(e===0||e>4)return!1;for(var t=0,n=0,c=r.place;n<e;n++,c++)t<<=8,t|=i[c],t>>>=0;return t<=127?!1:(r.place=c,t)}function Wu(i){for(var r=0,o=i.length-1;!i[r]&&!(i[r+1]&128)&&r<o;)r++;return r===0?i:i.slice(r)}$o.prototype._importDER=function(r,o){r=mr.toArray(r,o);var e=new $1;if(r[e.place++]!==48)return!1;var t=ls(r,e);if(t===!1||t+e.place!==r.length||r[e.place++]!==2)return!1;var n=ls(r,e);if(n===!1)return!1;var c=r.slice(e.place,n+e.place);if(e.place+=n,r[e.place++]!==2)return!1;var p=ls(r,e);if(p===!1||r.length!==p+e.place)return!1;var a=r.slice(e.place,p+e.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;return this.r=new ct(c),this.s=new ct(a),this.recoveryParam=null,!0};function hs(i,r){if(r<128){i.push(r);return}var o=1+(Math.log(r)/Math.LN2>>>3);for(i.push(o|128);--o;)i.push(r>>>(o<<3)&255);i.push(r)}$o.prototype.toDER=function(r){var o=this.r.toArray(),e=this.s.toArray();for(o[0]&128&&(o=[0].concat(o)),e[0]&128&&(e=[0].concat(e)),o=Wu(o),e=Wu(e);!e[0]&&!(e[1]&128);)e=e.slice(1);var t=[2];hs(t,o.length),t=t.concat(o),t.push(2),hs(t,e.length);var n=t.concat(e),c=[48];return hs(c,n.length),c=c.concat(n),mr.encode(c,r)};var V1=function(){throw new Error("unsupported")},tl=mr.assert;function _r(i){if(!(this instanceof _r))return new _r(i);typeof i=="string"&&(tl(Object.prototype.hasOwnProperty.call(ho,i),"Unknown curve "+i),i=ho[i]),i instanceof ho.PresetCurve&&(i={curve:i}),this.curve=i.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=i.curve.g,this.g.precompute(i.curve.n.bitLength()+1),this.hash=i.hash||i.curve.hash}var G1=_r;_r.prototype.keyPair=function(r){return new Fa(this,r)};_r.prototype.keyFromPrivate=function(r,o){return Fa.fromPrivate(this,r,o)};_r.prototype.keyFromPublic=function(r,o){return Fa.fromPublic(this,r,o)};_r.prototype.genKeyPair=function(r){r||(r={});for(var o=new el({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||V1(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),e=this.n.byteLength(),t=this.n.sub(new ct(2));;){var n=new ct(o.generate(e));if(!(n.cmp(t)>0))return n.iaddn(1),this.keyFromPrivate(n)}};_r.prototype._truncateToN=function(r,o){var e=r.byteLength()*8-this.n.bitLength();return e>0&&(r=r.ushrn(e)),!o&&r.cmp(this.n)>=0?r.sub(this.n):r};_r.prototype.sign=function(r,o,e,t){typeof e=="object"&&(t=e,e=null),t||(t={}),o=this.keyFromPrivate(o,e),r=this._truncateToN(new ct(r,16));for(var n=this.n.byteLength(),c=o.getPrivate().toArray("be",n),p=r.toArray("be",n),a=new el({hash:this.hash,entropy:c,nonce:p,pers:t.pers,persEnc:t.persEnc||"utf8"}),f=this.n.sub(new ct(1)),s=0;;s++){var u=t.k?t.k(s):new ct(a.generate(this.n.byteLength()));if(u=this._truncateToN(u,!0),!(u.cmpn(1)<=0||u.cmp(f)>=0)){var h=this.g.mul(u);if(!h.isInfinity()){var v=h.getX(),b=v.umod(this.n);if(b.cmpn(0)!==0){var y=u.invm(this.n).mul(b.mul(o.getPrivate()).iadd(r));if(y=y.umod(this.n),y.cmpn(0)!==0){var _=(h.getY().isOdd()?1:0)|(v.cmp(b)!==0?2:0);return t.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),_^=1),new Vo({r:b,s:y,recoveryParam:_})}}}}}};_r.prototype.verify=function(r,o,e,t){r=this._truncateToN(new ct(r,16)),e=this.keyFromPublic(e,t),o=new Vo(o,"hex");var n=o.r,c=o.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var p=c.invm(this.n),a=p.mul(r).umod(this.n),f=p.mul(n).umod(this.n),s;return this.curve._maxwellTrick?(s=this.g.jmulAdd(a,e.getPublic(),f),s.isInfinity()?!1:s.eqXToP(n)):(s=this.g.mulAdd(a,e.getPublic(),f),s.isInfinity()?!1:s.getX().umod(this.n).cmp(n)===0)};_r.prototype.recoverPubKey=function(i,r,o,e){tl((3&o)===o,"The recovery param is more than two bits"),r=new Vo(r,e);var t=this.n,n=new ct(i),c=r.r,p=r.s,a=o&1,f=o>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");f?c=this.curve.pointFromX(c.add(this.curve.n),a):c=this.curve.pointFromX(c,a);var s=r.r.invm(t),u=t.sub(n).mul(s).umod(t),h=p.mul(s).umod(t);return this.g.mulAdd(u,c,h)};_r.prototype.getKeyRecoveryParam=function(i,r,o,e){if(r=new Vo(r,e),r.recoveryParam!==null)return r.recoveryParam;for(var t=0;t<4;t++){var n;try{n=this.recoverPubKey(i,r,t)}catch{continue}if(n.eq(o))return t}throw new Error("Unable to find valid recovery factor")};var J1=mi(function(i,r){var o=r;o.version="6.5.4",o.utils=mr,o.rand=function(){throw new Error("unsupported")},o.curve=lo,o.curves=ho,o.ec=G1,o.eddsa=null}),Z1=J1.ec;const Y1="signing-key/5.6.2",$s=new be(Y1);let ds=null;function Dr(){return ds||(ds=new Z1("secp256k1")),ds}class X1{constructor(r){Mt(this,"curve","secp256k1"),Mt(this,"privateKey",ht(r)),Un(this.privateKey)!==32&&$s.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const o=Dr().keyFromPrivate(pt(this.privateKey));Mt(this,"publicKey","0x"+o.getPublic(!1,"hex")),Mt(this,"compressedPublicKey","0x"+o.getPublic(!0,"hex")),Mt(this,"_isSigningKey",!0)}_addPoint(r){const o=Dr().keyFromPublic(pt(this.publicKey)),e=Dr().keyFromPublic(pt(r));return"0x"+o.pub.add(e.pub).encodeCompressed("hex")}signDigest(r){const o=Dr().keyFromPrivate(pt(this.privateKey)),e=pt(r);e.length!==32&&$s.throwArgumentError("bad digest length","digest",r);const t=o.sign(e,{canonical:!0});return zo({recoveryParam:t.recoveryParam,r:jt("0x"+t.r.toString(16),32),s:jt("0x"+t.s.toString(16),32)})}computeSharedSecret(r){const o=Dr().keyFromPrivate(pt(this.privateKey)),e=Dr().keyFromPublic(pt(rl(r)));return jt("0x"+o.derive(e.getPublic()).toString(16),32)}static isSigningKey(r){return!!(r&&r._isSigningKey)}}function Q1(i,r){const o=zo(r),e={r:pt(o.r),s:pt(o.s)};return"0x"+Dr().recoverPubKey(pt(i),e,o.recoveryParam).encode("hex",!1)}function rl(i,r){const o=pt(i);if(o.length===32){const e=new X1(o);return r?"0x"+Dr().keyFromPrivate(o).getPublic(!0,"hex"):e.publicKey}else{if(o.length===33)return r?ht(o):"0x"+Dr().keyFromPublic(o).getPublic(!1,"hex");if(o.length===65)return r?"0x"+Dr().keyFromPublic(o).getPublic(!0,"hex"):ht(o)}return $s.throwArgumentError("invalid public or private key","key","[REDACTED]")}const em="transactions/5.6.2",ln=new be(em);var Ku;(function(i){i[i.legacy=0]="legacy",i[i.eip2930=1]="eip2930",i[i.eip1559=2]="eip1559"})(Ku||(Ku={}));function Da(i){return i==="0x"?null:Nr(i)}function $t(i){return i==="0x"?B0:ot.from(i)}function tm(i){const r=rl(i);return Nr(Yt(Ht(Yt(r,1)),12))}function nl(i,r){return tm(Q1(pt(i),r))}function fr(i,r){const o=ii(ot.from(i).toHexString());return o.length>32&&ln.throwArgumentError("invalid length for "+r,"transaction:"+r,i),o}function ps(i,r){return{address:Nr(i),storageKeys:(r||[]).map((o,e)=>(Un(o)!==32&&ln.throwArgumentError("invalid access list storageKey",`accessList[${i}:${e}]`,o),o.toLowerCase()))}}function Vi(i){if(Array.isArray(i))return i.map((o,e)=>Array.isArray(o)?(o.length>2&&ln.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,o),ps(o[0],o[1])):ps(o.address,o.storageKeys));const r=Object.keys(i).map(o=>{const e=i[o].reduce((t,n)=>(t[n]=!0,t),{});return ps(o,Object.keys(e).sort())});return r.sort((o,e)=>o.address.localeCompare(e.address)),r}function il(i){return Vi(i).map(r=>[r.address,r.storageKeys])}function rm(i,r){if(i.gasPrice!=null){const e=ot.from(i.gasPrice),t=ot.from(i.maxFeePerGas||0);e.eq(t)||ln.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:t})}const o=[fr(i.chainId||0,"chainId"),fr(i.nonce||0,"nonce"),fr(i.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fr(i.maxFeePerGas||0,"maxFeePerGas"),fr(i.gasLimit||0,"gasLimit"),i.to!=null?Nr(i.to):"0x",fr(i.value||0,"value"),i.data||"0x",il(i.accessList||[])];if(r){const e=zo(r);o.push(fr(e.recoveryParam,"recoveryParam")),o.push(ii(e.r)),o.push(ii(e.s))}return lr(["0x02",Ho(o)])}function nm(i,r){const o=[fr(i.chainId||0,"chainId"),fr(i.nonce||0,"nonce"),fr(i.gasPrice||0,"gasPrice"),fr(i.gasLimit||0,"gasLimit"),i.to!=null?Nr(i.to):"0x",fr(i.value||0,"value"),i.data||"0x",il(i.accessList||[])];if(r){const e=zo(r);o.push(fr(e.recoveryParam,"recoveryParam")),o.push(ii(e.r)),o.push(ii(e.s))}return lr(["0x01",Ho(o)])}function ol(i,r,o){try{const e=$t(r[0]).toNumber();if(e!==0&&e!==1)throw new Error("bad recid");i.v=e}catch{ln.throwArgumentError("invalid v for transaction type: 1","v",r[0])}i.r=jt(r[1],32),i.s=jt(r[2],32);try{const e=Ht(o(i));i.from=nl(e,{r:i.r,s:i.s,recoveryParam:i.v})}catch{}}function im(i){const r=Ia(i.slice(1));r.length!==9&&r.length!==12&&ln.throwArgumentError("invalid component count for transaction type: 2","payload",ht(i));const o=$t(r[2]),e=$t(r[3]),t={type:2,chainId:$t(r[0]).toNumber(),nonce:$t(r[1]).toNumber(),maxPriorityFeePerGas:o,maxFeePerGas:e,gasPrice:null,gasLimit:$t(r[4]),to:Da(r[5]),value:$t(r[6]),data:r[7],accessList:Vi(r[8])};return r.length===9||(t.hash=Ht(i),ol(t,r.slice(9),rm)),t}function om(i){const r=Ia(i.slice(1));r.length!==8&&r.length!==11&&ln.throwArgumentError("invalid component count for transaction type: 1","payload",ht(i));const o={type:1,chainId:$t(r[0]).toNumber(),nonce:$t(r[1]).toNumber(),gasPrice:$t(r[2]),gasLimit:$t(r[3]),to:Da(r[4]),value:$t(r[5]),data:r[6],accessList:Vi(r[7])};return r.length===8||(o.hash=Ht(i),ol(o,r.slice(8),nm)),o}function sm(i){const r=Ia(i);r.length!==9&&r.length!==6&&ln.throwArgumentError("invalid raw transaction","rawTransaction",i);const o={nonce:$t(r[0]).toNumber(),gasPrice:$t(r[1]),gasLimit:$t(r[2]),to:Da(r[3]),value:$t(r[4]),data:r[5],chainId:0};if(r.length===6)return o;try{o.v=ot.from(r[6]).toNumber()}catch{return o}if(o.r=jt(r[7],32),o.s=jt(r[8],32),ot.from(o.r).isZero()&&ot.from(o.s).isZero())o.chainId=o.v,o.v=0;else{o.chainId=Math.floor((o.v-35)/2),o.chainId<0&&(o.chainId=0);let e=o.v-27;const t=r.slice(0,6);o.chainId!==0&&(t.push(ht(o.chainId)),t.push("0x"),t.push("0x"),e-=o.chainId*2+8);const n=Ht(Ho(t));try{o.from=nl(n,{r:ht(o.r),s:ht(o.s),recoveryParam:e})}catch{}o.hash=Ht(i)}return o.type=null,o}function am(i){const r=pt(i);if(r[0]>127)return sm(r);switch(r[0]){case 1:return om(r);case 2:return im(r)}return ln.throwError(`unsupported transaction type: ${r[0]}`,be.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:r[0]})}class sl{constructor(r){Mt(this,"alphabet",r),Mt(this,"base",r.length),Mt(this,"_alphabetMap",{}),Mt(this,"_leader",r.charAt(0));for(let o=0;o<r.length;o++)this._alphabetMap[r.charAt(o)]=o}encode(r){let o=pt(r);if(o.length===0)return"";let e=[0];for(let n=0;n<o.length;++n){let c=o[n];for(let p=0;p<e.length;++p)c+=e[p]<<8,e[p]=c%this.base,c=c/this.base|0;for(;c>0;)e.push(c%this.base),c=c/this.base|0}let t="";for(let n=0;o[n]===0&&n<o.length-1;++n)t+=this._leader;for(let n=e.length-1;n>=0;--n)t+=this.alphabet[e[n]];return t}decode(r){if(typeof r!="string")throw new TypeError("Expected String");let o=[];if(r.length===0)return new Uint8Array(o);o.push(0);for(let e=0;e<r.length;e++){let t=this._alphabetMap[r[e]];if(t===void 0)throw new Error("Non-base"+this.base+" character");let n=t;for(let c=0;c<o.length;++c)n+=o[c]*this.base,o[c]=n&255,n>>=8;for(;n>0;)o.push(n&255),n>>=8}for(let e=0;r[e]===this._leader&&e<r.length-1;++e)o.push(0);return pt(new Uint8Array(o.reverse()))}}new sl("abcdefghijklmnopqrstuvwxyz234567");const Vs=new sl("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),um="sha2/5.6.1";new be(um);function $u(i){return"0x"+Ur.sha256().update(pt(i)).digest("hex")}const fm="networks/5.6.4",Vu=new be(fm);function cm(i){return i&&typeof i.renetwork=="function"}function yn(i){const r=function(o,e){e==null&&(e={});const t=[];if(o.InfuraProvider&&e.infura!=="-")try{t.push(new o.InfuraProvider(i,e.infura))}catch{}if(o.EtherscanProvider&&e.etherscan!=="-")try{t.push(new o.EtherscanProvider(i,e.etherscan))}catch{}if(o.AlchemyProvider&&e.alchemy!=="-")try{t.push(new o.AlchemyProvider(i,e.alchemy))}catch{}if(o.PocketProvider&&e.pocket!=="-"){const n=["goerli","ropsten","rinkeby"];try{const c=new o.PocketProvider(i,e.pocket);c.network&&n.indexOf(c.network.name)===-1&&t.push(c)}catch{}}if(o.CloudflareProvider&&e.cloudflare!=="-")try{t.push(new o.CloudflareProvider(i))}catch{}if(o.AnkrProvider&&e.ankr!=="-")try{const n=["ropsten"],c=new o.AnkrProvider(i,e.ankr);c.network&&n.indexOf(c.network.name)===-1&&t.push(c)}catch{}if(t.length===0)return null;if(o.FallbackProvider){let n=1;return e.quorum!=null?n=e.quorum:i==="homestead"&&(n=2),new o.FallbackProvider(t,n)}return t[0]};return r.renetwork=function(o){return yn(o)},r}function So(i,r){const o=function(e,t){return e.JsonRpcProvider?new e.JsonRpcProvider(i,r):null};return o.renetwork=function(e){return So(i,e)},o}const Gu={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:yn("homestead")},Ju={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:yn("ropsten")},Zu={chainId:63,name:"classicMordor",_defaultProvider:So("https://www.ethercluster.com/mordor","classicMordor")},ro={unspecified:{chainId:0,name:"unspecified"},homestead:Gu,mainnet:Gu,morden:{chainId:2,name:"morden"},ropsten:Ju,testnet:Ju,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:yn("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:yn("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:yn("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:So("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Zu,classicTestnet:Zu,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:So("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:yn("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:yn("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function lm(i){if(i==null)return null;if(typeof i=="number"){for(const e in ro){const t=ro[e];if(t.chainId===i)return{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress||null,_defaultProvider:t._defaultProvider||null}}return{chainId:i,name:"unknown"}}if(typeof i=="string"){const e=ro[i];return e==null?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const r=ro[i.name];if(!r)return typeof i.chainId!="number"&&Vu.throwArgumentError("invalid network chainId","network",i),i;i.chainId!==0&&i.chainId!==r.chainId&&Vu.throwArgumentError("network chainId mismatch","network",i);let o=i._defaultProvider||null;return o==null&&r._defaultProvider&&(cm(r._defaultProvider)?o=r._defaultProvider.renetwork(i):o=r._defaultProvider),{name:i.name,chainId:r.chainId,ensAddress:i.ensAddress||r.ensAddress||null,_defaultProvider:o}}function hm(i){i=atob(i);const r=[];for(let o=0;o<i.length;o++)r.push(i.charCodeAt(o));return pt(r)}function al(i){i=pt(i);let r="";for(let o=0;o<i.length;o++)r+=String.fromCharCode(i[o]);return btoa(r)}const dm="web/5.6.1";var pm=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};function mm(i,r){return pm(this,void 0,void 0,function*(){r==null&&(r={});const o={method:r.method||"GET",headers:r.headers||{},body:r.body||void 0};r.skipFetchSetup!==!0&&(o.mode="cors",o.cache="no-cache",o.credentials="same-origin",o.redirect="follow",o.referrer="client");const e=yield fetch(i,o),t=yield e.arrayBuffer(),n={};return e.headers.forEach?e.headers.forEach((c,p)=>{n[p.toLowerCase()]=c}):e.headers.keys().forEach(c=>{n[c.toLowerCase()]=e.headers.get(c)}),{headers:n,statusCode:e.status,statusMessage:e.statusText,body:pt(new Uint8Array(t))}})}var gm=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};const Ar=new be(dm);function Yu(i){return new Promise(r=>{setTimeout(r,i)})}function pn(i,r){if(i==null)return null;if(typeof i=="string")return i;if(Pa(i)){if(r&&(r.split("/")[0]==="text"||r.split(";")[0].trim()==="application/json"))try{return Wo(i)}catch{}return ht(i)}return i}function bm(i,r,o){const e=typeof i=="object"&&i.throttleLimit!=null?i.throttleLimit:12;Ar.assertArgument(e>0&&e%1===0,"invalid connection throttle limit","connection.throttleLimit",e);const t=typeof i=="object"?i.throttleCallback:null,n=typeof i=="object"&&typeof i.throttleSlotInterval=="number"?i.throttleSlotInterval:100;Ar.assertArgument(n>0&&n%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",n);const c=typeof i=="object"?!!i.errorPassThrough:!1,p={};let a=null;const f={method:"GET"};let s=!1,u=2*60*1e3;if(typeof i=="string")a=i;else if(typeof i=="object"){if((i==null||i.url==null)&&Ar.throwArgumentError("missing URL","connection.url",i),a=i.url,typeof i.timeout=="number"&&i.timeout>0&&(u=i.timeout),i.headers)for(const E in i.headers)p[E.toLowerCase()]={key:E,value:String(i.headers[E])},["if-none-match","if-modified-since"].indexOf(E.toLowerCase())>=0&&(s=!0);if(f.allowGzip=!!i.allowGzip,i.user!=null&&i.password!=null){a.substring(0,6)!=="https:"&&i.allowInsecureAuthentication!==!0&&Ar.throwError("basic authentication requires a secure https url",be.errors.INVALID_ARGUMENT,{argument:"url",url:a,user:i.user,password:"[REDACTED]"});const E=i.user+":"+i.password;p.authorization={key:"Authorization",value:"Basic "+al(on(E))}}i.skipFetchSetup!=null&&(f.skipFetchSetup=!!i.skipFetchSetup)}const h=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),v=a?a.match(h):null;if(v)try{const E={statusCode:200,statusMessage:"OK",headers:{"content-type":v[1]},body:hm(v[2])};let S=E.body;return o&&(S=o(E.body,E)),Promise.resolve(S)}catch(E){Ar.throwError("processing response error",be.errors.SERVER_ERROR,{body:pn(v[1],v[2]),error:E,requestBody:null,requestMethod:"GET",url:a})}r&&(f.method="POST",f.body=r,p["content-type"]==null&&(p["content-type"]={key:"Content-Type",value:"application/octet-stream"}),p["content-length"]==null&&(p["content-length"]={key:"Content-Length",value:String(r.length)}));const b={};Object.keys(p).forEach(E=>{const S=p[E];b[S.key]=S.value}),f.headers=b;const y=function(){let E=null;return{promise:new Promise(function(O,M){u&&(E=setTimeout(()=>{E!=null&&(E=null,M(Ar.makeError("timeout",be.errors.TIMEOUT,{requestBody:pn(f.body,b["content-type"]),requestMethod:f.method,timeout:u,url:a})))},u))}),cancel:function(){E!=null&&(clearTimeout(E),E=null)}}}(),_=function(){return gm(this,void 0,void 0,function*(){for(let E=0;E<e;E++){let S=null;try{if(S=yield mm(a,f),E<e){if(S.statusCode===301||S.statusCode===302){const O=S.headers.location||"";if(f.method==="GET"&&O.match(/^https:/)){a=S.headers.location;continue}}else if(S.statusCode===429){let O=!0;if(t&&(O=yield t(E,a)),O){let M=0;const C=S.headers["retry-after"];typeof C=="string"&&C.match(/^[1-9][0-9]*$/)?M=parseInt(C)*1e3:M=n*parseInt(String(Math.random()*Math.pow(2,E))),yield Yu(M);continue}}}}catch(O){S=O.response,S==null&&(y.cancel(),Ar.throwError("missing response",be.errors.SERVER_ERROR,{requestBody:pn(f.body,b["content-type"]),requestMethod:f.method,serverError:O,url:a}))}let k=S.body;if(s&&S.statusCode===304?k=null:!c&&(S.statusCode<200||S.statusCode>=300)&&(y.cancel(),Ar.throwError("bad response",be.errors.SERVER_ERROR,{status:S.statusCode,headers:S.headers,body:pn(k,S.headers?S.headers["content-type"]:null),requestBody:pn(f.body,b["content-type"]),requestMethod:f.method,url:a})),o)try{const O=yield o(k,S);return y.cancel(),O}catch(O){if(O.throttleRetry&&E<e){let M=!0;if(t&&(M=yield t(E,a)),M){const C=n*parseInt(String(Math.random()*Math.pow(2,E)));yield Yu(C);continue}}y.cancel(),Ar.throwError("processing response error",be.errors.SERVER_ERROR,{body:pn(k,S.headers?S.headers["content-type"]:null),error:O,requestBody:pn(f.body,b["content-type"]),requestMethod:f.method,url:a})}return y.cancel(),k}return Ar.throwError("failed response",be.errors.SERVER_ERROR,{requestBody:pn(f.body,b["content-type"]),requestMethod:f.method,url:a})})}();return Promise.race([y.promise,_])}function za(i,r,o){let e=(n,c)=>{let p=null;if(n!=null)try{p=JSON.parse(Wo(n))}catch(a){Ar.throwError("invalid JSON",be.errors.SERVER_ERROR,{body:n,error:a})}return o&&(p=o(p,c)),p},t=null;if(r!=null){t=on(r);const n=typeof i=="string"?{url:i}:hr(i);n.headers?Object.keys(n.headers).filter(p=>p.toLowerCase()==="content-type").length!==0||(n.headers=hr(n.headers),n.headers["content-type"]="application/json"):n.headers={"content-type":"application/json"},i=n}return bm(i,t,e)}function ki(i,r){return r||(r={}),r=hr(r),r.floor==null&&(r.floor=0),r.ceiling==null&&(r.ceiling=1e4),r.interval==null&&(r.interval=250),new Promise(function(o,e){let t=null,n=!1;const c=()=>n?!1:(n=!0,t&&clearTimeout(t),!0);r.timeout&&(t=setTimeout(()=>{c()&&e(new Error("timeout"))},r.timeout));const p=r.retryLimit;let a=0;function f(){return i().then(function(s){if(s!==void 0)c()&&o(s);else if(r.oncePoll)r.oncePoll.once("poll",f);else if(r.onceBlock)r.onceBlock.once("block",f);else if(!n){if(a++,a>p){c()&&e(new Error("retry limit reached"));return}let u=r.interval*parseInt(String(Math.random()*Math.pow(2,a)));u<r.floor&&(u=r.floor),u>r.ceiling&&(u=r.ceiling),setTimeout(f,u)}return null},function(s){c()&&e(s)})}f()})}var ko="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Gs={};for(var no=0;no<ko.length;no++){var ms=ko.charAt(no);if(Gs[ms]!==void 0)throw new TypeError(ms+" is ambiguous");Gs[ms]=no}function ei(i){var r=i>>25;return(i&33554431)<<5^-(r>>0&1)&996825010^-(r>>1&1)&642813549^-(r>>2&1)&513874426^-(r>>3&1)&1027748829^-(r>>4&1)&705979059}function ul(i){for(var r=1,o=0;o<i.length;++o){var e=i.charCodeAt(o);if(e<33||e>126)return"Invalid prefix ("+i+")";r=ei(r)^e>>5}for(r=ei(r),o=0;o<i.length;++o){var t=i.charCodeAt(o);r=ei(r)^t&31}return r}function vm(i,r,o){if(o=o||90,i.length+7+r.length>o)throw new TypeError("Exceeds length limit");i=i.toLowerCase();var e=ul(i);if(typeof e=="string")throw new Error(e);for(var t=i+"1",n=0;n<r.length;++n){var c=r[n];if(c>>5!==0)throw new Error("Non 5-bit word");e=ei(e)^c,t+=ko.charAt(c)}for(n=0;n<6;++n)e=ei(e);for(e^=1,n=0;n<6;++n){var p=e>>(5-n)*5&31;t+=ko.charAt(p)}return t}function fl(i,r){if(r=r||90,i.length<8)return i+" too short";if(i.length>r)return"Exceeds length limit";var o=i.toLowerCase(),e=i.toUpperCase();if(i!==o&&i!==e)return"Mixed-case string "+i;i=o;var t=i.lastIndexOf("1");if(t===-1)return"No separator character for "+i;if(t===0)return"Missing prefix for "+i;var n=i.slice(0,t),c=i.slice(t+1);if(c.length<6)return"Data too short";var p=ul(n);if(typeof p=="string")return p;for(var a=[],f=0;f<c.length;++f){var s=c.charAt(f),u=Gs[s];if(u===void 0)return"Unknown character "+s;p=ei(p)^u,!(f+6>=c.length)&&a.push(u)}return p!==1?"Invalid checksum for "+i:{prefix:n,words:a}}function ym(){var i=fl.apply(null,arguments);if(typeof i=="object")return i}function wm(i){var r=fl.apply(null,arguments);if(typeof r=="object")return r;throw new Error(r)}function Go(i,r,o,e){for(var t=0,n=0,c=(1<<o)-1,p=[],a=0;a<i.length;++a)for(t=t<<r|i[a],n+=r;n>=o;)n-=o,p.push(t>>n&c);if(e)n>0&&p.push(t<<o-n&c);else{if(n>=r)return"Excess padding";if(t<<o-n&c)return"Non-zero padding"}return p}function _m(i){var r=Go(i,8,5,!0);if(Array.isArray(r))return r}function xm(i){var r=Go(i,8,5,!0);if(Array.isArray(r))return r;throw new Error(r)}function Mm(i){var r=Go(i,5,8,!1);if(Array.isArray(r))return r}function Em(i){var r=Go(i,5,8,!1);if(Array.isArray(r))return r;throw new Error(r)}var Xu={decodeUnsafe:ym,decode:wm,encode:vm,toWordsUnsafe:_m,toWords:xm,fromWordsUnsafe:Mm,fromWords:Em};const Jo="providers/5.6.8",yi=new be(Jo);class nt{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const r={},o=this.address.bind(this),e=this.bigNumber.bind(this),t=this.blockTag.bind(this),n=this.data.bind(this),c=this.hash.bind(this),p=this.hex.bind(this),a=this.number.bind(this),f=this.type.bind(this),s=u=>this.data(u,!0);return r.transaction={hash:c,type:f,accessList:nt.allowNull(this.accessList.bind(this),null),blockHash:nt.allowNull(c,null),blockNumber:nt.allowNull(a,null),transactionIndex:nt.allowNull(a,null),confirmations:nt.allowNull(a,null),from:o,gasPrice:nt.allowNull(e),maxPriorityFeePerGas:nt.allowNull(e),maxFeePerGas:nt.allowNull(e),gasLimit:e,to:nt.allowNull(o,null),value:e,nonce:a,data:n,r:nt.allowNull(this.uint256),s:nt.allowNull(this.uint256),v:nt.allowNull(a),creates:nt.allowNull(o,null),raw:nt.allowNull(n)},r.transactionRequest={from:nt.allowNull(o),nonce:nt.allowNull(a),gasLimit:nt.allowNull(e),gasPrice:nt.allowNull(e),maxPriorityFeePerGas:nt.allowNull(e),maxFeePerGas:nt.allowNull(e),to:nt.allowNull(o),value:nt.allowNull(e),data:nt.allowNull(s),type:nt.allowNull(a),accessList:nt.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:c,address:o,topics:nt.arrayOf(c),data:n,logIndex:a,blockHash:c},r.receipt={to:nt.allowNull(this.address,null),from:nt.allowNull(this.address,null),contractAddress:nt.allowNull(o,null),transactionIndex:a,root:nt.allowNull(p),gasUsed:e,logsBloom:nt.allowNull(n),blockHash:c,transactionHash:c,logs:nt.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:nt.allowNull(a,null),cumulativeGasUsed:e,effectiveGasPrice:nt.allowNull(e),status:nt.allowNull(a),type:f},r.block={hash:nt.allowNull(c),parentHash:c,number:a,timestamp:a,nonce:nt.allowNull(p),difficulty:this.difficulty.bind(this),gasLimit:e,gasUsed:e,miner:nt.allowNull(o),extraData:n,transactions:nt.allowNull(nt.arrayOf(c)),baseFeePerGas:nt.allowNull(e)},r.blockWithTransactions=hr(r.block),r.blockWithTransactions.transactions=nt.allowNull(nt.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:nt.allowNull(t,void 0),toBlock:nt.allowNull(t,void 0),blockHash:nt.allowNull(c,void 0),address:nt.allowNull(o,void 0),topics:nt.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:nt.allowNull(a),blockHash:nt.allowNull(c),transactionIndex:a,removed:nt.allowNull(this.boolean.bind(this)),address:o,data:nt.allowFalsish(n,"0x"),topics:nt.arrayOf(c),transactionHash:c,logIndex:a},r}accessList(r){return Vi(r||[])}number(r){return r==="0x"?0:ot.from(r).toNumber()}type(r){return r==="0x"||r==null?0:ot.from(r).toNumber()}bigNumber(r){return ot.from(r)}boolean(r){if(typeof r=="boolean")return r;if(typeof r=="string"){if(r=r.toLowerCase(),r==="true")return!0;if(r==="false")return!1}throw new Error("invalid boolean - "+r)}hex(r,o){return typeof r=="string"&&(!o&&r.substring(0,2)!=="0x"&&(r="0x"+r),Rt(r))?r.toLowerCase():yi.throwArgumentError("invalid hash","value",r)}data(r,o){const e=this.hex(r,o);if(e.length%2!==0)throw new Error("invalid data; odd-length - "+r);return e}address(r){return Nr(r)}callAddress(r){if(!Rt(r,32))return null;const o=Nr(Yt(r,12));return o===N0?null:o}contractAddress(r){return O0(r)}blockTag(r){if(r==null)return"latest";if(r==="earliest")return"0x0";if(r==="latest"||r==="pending")return r;if(typeof r=="number"||Rt(r))return Ca(r);throw new Error("invalid blockTag")}hash(r,o){const e=this.hex(r,o);return Un(e)!==32?yi.throwArgumentError("invalid hash","value",r):e}difficulty(r){if(r==null)return null;const o=ot.from(r);try{return o.toNumber()}catch{}return null}uint256(r){if(!Rt(r))throw new Error("invalid uint256");return jt(r,32)}_block(r,o){r.author!=null&&r.miner==null&&(r.miner=r.author);const e=r._difficulty!=null?r._difficulty:r.difficulty,t=nt.check(o,r);return t._difficulty=e==null?null:ot.from(e),t}block(r){return this._block(r,this.formats.block)}blockWithTransactions(r){return this._block(r,this.formats.blockWithTransactions)}transactionRequest(r){return nt.check(this.formats.transactionRequest,r)}transactionResponse(r){r.gas!=null&&r.gasLimit==null&&(r.gasLimit=r.gas),r.to&&ot.from(r.to).isZero()&&(r.to="0x0000000000000000000000000000000000000000"),r.input!=null&&r.data==null&&(r.data=r.input),r.to==null&&r.creates==null&&(r.creates=this.contractAddress(r)),(r.type===1||r.type===2)&&r.accessList==null&&(r.accessList=[]);const o=nt.check(this.formats.transaction,r);if(r.chainId!=null){let e=r.chainId;Rt(e)&&(e=ot.from(e).toNumber()),o.chainId=e}else{let e=r.networkId;e==null&&o.v==null&&(e=r.chainId),Rt(e)&&(e=ot.from(e).toNumber()),typeof e!="number"&&o.v!=null&&(e=(o.v-35)/2,e<0&&(e=0),e=parseInt(e)),typeof e!="number"&&(e=0),o.chainId=e}return o.blockHash&&o.blockHash.replace(/0/g,"")==="x"&&(o.blockHash=null),o}transaction(r){return am(r)}receiptLog(r){return nt.check(this.formats.receiptLog,r)}receipt(r){const o=nt.check(this.formats.receipt,r);if(o.root!=null)if(o.root.length<=4){const e=ot.from(o.root).toNumber();e===0||e===1?(o.status!=null&&o.status!==e&&yi.throwArgumentError("alt-root-status/status mismatch","value",{root:o.root,status:o.status}),o.status=e,delete o.root):yi.throwArgumentError("invalid alt-root-status","value.root",o.root)}else o.root.length!==66&&yi.throwArgumentError("invalid root hash","value.root",o.root);return o.status!=null&&(o.byzantium=!0),o}topics(r){return Array.isArray(r)?r.map(o=>this.topics(o)):r!=null?this.hash(r,!0):null}filter(r){return nt.check(this.formats.filter,r)}filterLog(r){return nt.check(this.formats.filterLog,r)}static check(r,o){const e={};for(const t in r)try{const n=r[t](o[t]);n!==void 0&&(e[t]=n)}catch(n){throw n.checkKey=t,n.checkValue=o[t],n}return e}static allowNull(r,o){return function(e){return e==null?o:r(e)}}static allowFalsish(r,o){return function(e){return e?r(e):o}}static arrayOf(r){return function(o){if(!Array.isArray(o))throw new Error("not an array");const e=[];return o.forEach(function(t){e.push(r(t))}),e}}}var ft=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};const bt=new be(Jo),Sm=10;function Qu(i){return i==null?"null":(Un(i)!==32&&bt.throwArgumentError("invalid topic","topic",i),i.toLowerCase())}function ef(i){for(i=i.slice();i.length>0&&i[i.length-1]==null;)i.pop();return i.map(r=>{if(Array.isArray(r)){const o={};r.forEach(t=>{o[Qu(t)]=!0});const e=Object.keys(o);return e.sort(),e.join("|")}else return Qu(r)}).join("&")}function km(i){return i===""?[]:i.split(/&/g).map(r=>{if(r==="")return[];const o=r.split("|").map(e=>e==="null"?null:e);return o.length===1?o[0]:o})}function Kn(i){if(typeof i=="string"){if(i=i.toLowerCase(),Un(i)===32)return"tx:"+i;if(i.indexOf(":")===-1)return i}else{if(Array.isArray(i))return"filter:*:"+ef(i);if(lp.isForkEvent(i))throw bt.warn("not implemented"),new Error("not implemented");if(i&&typeof i=="object")return"filter:"+(i.address||"*")+":"+ef(i.topics||[])}throw new Error("invalid event - "+i)}function wi(){return new Date().getTime()}function tf(i){return new Promise(r=>{setTimeout(r,i)})}const Am=["block","network","pending","poll"];class Rm{constructor(r,o,e){Mt(this,"tag",r),Mt(this,"listener",o),Mt(this,"once",e),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const r=this.tag.split(":");return r[0]!=="tx"?null:r[1]}get filter(){const r=this.tag.split(":");if(r[0]!=="filter")return null;const o=r[1],e=km(r[2]),t={};return e.length>0&&(t.topics=e),o&&o!=="*"&&(t.address=o),t}pollable(){return this.tag.indexOf(":")>=0||Am.indexOf(this.tag)>=0}}const Tm={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function gs(i){return jt(ot.from(i).toHexString(),32)}function rf(i){return Vs.encode(Nn([i,Yt($u($u(i)),0,4)]))}const cl=new RegExp("^(ipfs)://(.*)$","i"),nf=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),cl,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function po(i,r){try{return Wo(zi(i,r))}catch{}return null}function zi(i,r){if(i==="0x")return null;const o=ot.from(Yt(i,r,r+32)).toNumber(),e=ot.from(Yt(i,o,o+32)).toNumber();return Yt(i,o+32,o+32+e)}function bs(i){return i.match(/^ipfs:\/\/ipfs\//i)?i=i.substring(12):i.match(/^ipfs:\/\//i)?i=i.substring(7):bt.throwArgumentError("unsupported IPFS format","link",i),`https://gateway.ipfs.io/ipfs/${i}`}function of(i){const r=pt(i);if(r.length>32)throw new Error("internal; should not happen");const o=new Uint8Array(32);return o.set(r,32-r.length),o}function Pm(i){if(i.length%32===0)return i;const r=new Uint8Array(Math.ceil(i.length/32)*32);return r.set(i),r}function ll(i){const r=[];let o=0;for(let e=0;e<i.length;e++)r.push(null),o+=32;for(let e=0;e<i.length;e++){const t=pt(i[e]);r[e]=of(o),r.push(of(t.length)),r.push(Pm(t)),o+=32+Math.ceil(t.length/32)*32}return lr(r)}class sf{constructor(r,o,e,t){Mt(this,"provider",r),Mt(this,"name",e),Mt(this,"address",r.formatter.address(o)),Mt(this,"_resolvedAddress",t)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(r=>ot.from(r).eq(1)).catch(r=>{if(r.code===be.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,r})),this._supportsEip2544}_fetch(r,o){return ft(this,void 0,void 0,function*(){const e={to:this.address,ccipReadEnabled:!0,data:lr([r,co(this.name),o||"0x"])};let t=!1;(yield this.supportsWildcard())&&(t=!0,e.data=lr(["0x9061b923",ll([ep(this.name),e.data])]));try{let n=yield this.provider.call(e);return pt(n).length%32===4&&bt.throwError("resolver threw error",be.errors.CALL_EXCEPTION,{transaction:e,data:n}),t&&(n=zi(n,0)),n}catch(n){if(n.code===be.errors.CALL_EXCEPTION)return null;throw n}})}_fetchBytes(r,o){return ft(this,void 0,void 0,function*(){const e=yield this._fetch(r,o);return e!=null?zi(e,0):null})}_getAddress(r,o){const e=Tm[String(r)];if(e==null&&bt.throwError(`unsupported coin type: ${r}`,be.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${r})`}),e.ilk==="eth")return this.provider.formatter.address(o);const t=pt(o);if(e.p2pkh!=null){const n=o.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(n){const c=parseInt(n[1],16);if(n[2].length===c*2&&c>=1&&c<=75)return rf(Nn([[e.p2pkh],"0x"+n[2]]))}}if(e.p2sh!=null){const n=o.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(n){const c=parseInt(n[1],16);if(n[2].length===c*2&&c>=1&&c<=75)return rf(Nn([[e.p2sh],"0x"+n[2]]))}}if(e.prefix!=null){const n=t[1];let c=t[0];if(c===0?n!==20&&n!==32&&(c=-1):c=-1,c>=0&&t.length===2+n&&n>=1&&n<=75){const p=Xu.toWords(t.slice(2));return p.unshift(c),Xu.encode(e.prefix,p)}}return null}getAddress(r){return ft(this,void 0,void 0,function*(){if(r==null&&(r=60),r===60)try{const t=yield this._fetch("0x3b3b57de");return t==="0x"||t===L0?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===be.errors.CALL_EXCEPTION)return null;throw t}const o=yield this._fetchBytes("0xf1cb7e06",gs(r));if(o==null||o==="0x")return null;const e=this._getAddress(r,o);return e==null&&bt.throwError("invalid or unsupported coin data",be.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${r})`,coinType:r,data:o}),e})}getAvatar(){return ft(this,void 0,void 0,function*(){const r=[{type:"name",content:this.name}];try{const o=yield this.getText("avatar");if(o==null)return null;for(let e=0;e<nf.length;e++){const t=o.match(nf[e]);if(t==null)continue;const n=t[1].toLowerCase();switch(n){case"https":return r.push({type:"url",content:o}),{linkage:r,url:o};case"data":return r.push({type:"data",content:o}),{linkage:r,url:o};case"ipfs":return r.push({type:"ipfs",content:o}),{linkage:r,url:bs(o)};case"erc721":case"erc1155":{const c=n==="erc721"?"0xc87b56dd":"0x0e89341c";r.push({type:n,content:o});const p=this._resolvedAddress||(yield this.getAddress()),a=(t[2]||"").split("/");if(a.length!==2)return null;const f=yield this.provider.formatter.address(a[0]),s=jt(ot.from(a[1]).toHexString(),32);if(n==="erc721"){const y=this.provider.formatter.callAddress(yield this.provider.call({to:f,data:lr(["0x6352211e",s])}));if(p!==y)return null;r.push({type:"owner",content:y})}else if(n==="erc1155"){const y=ot.from(yield this.provider.call({to:f,data:lr(["0x00fdd58e",jt(p,32),s])}));if(y.isZero())return null;r.push({type:"balance",content:y.toString()})}const u={to:this.provider.formatter.address(a[0]),data:lr([c,s])};let h=po(yield this.provider.call(u),0);if(h==null)return null;r.push({type:"metadata-url-base",content:h}),n==="erc1155"&&(h=h.replace("{id}",s.substring(2)),r.push({type:"metadata-url-expanded",content:h})),h.match(/^ipfs:/i)&&(h=bs(h)),r.push({type:"metadata-url",content:h});const v=yield za(h);if(!v)return null;r.push({type:"metadata",content:JSON.stringify(v)});let b=v.image;if(typeof b!="string")return null;if(!b.match(/^(https:\/\/|data:)/i)){if(b.match(cl)==null)return null;r.push({type:"url-ipfs",content:b}),b=bs(b)}return r.push({type:"url",content:b}),{linkage:r,url:b}}}}}catch{}return null})}getContentHash(){return ft(this,void 0,void 0,function*(){const r=yield this._fetchBytes("0xbc1c58d1");if(r==null||r==="0x")return null;const o=r.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(o){const c=parseInt(o[3],16);if(o[4].length===c*2)return"ipfs://"+Vs.encode("0x"+o[1])}const e=r.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const c=parseInt(e[3],16);if(e[4].length===c*2)return"ipns://"+Vs.encode("0x"+e[1])}const t=r.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(t&&t[1].length===32*2)return"bzz://"+t[1];const n=r.match(/^0x90b2c605([0-9a-f]*)$/);if(n&&n[1].length===34*2){const c={"=":"","+":"-","/":"_"},p=al("0x"+n[1]).replace(/[=+\/]/g,a=>c[a]);return"sia://"+p}return bt.throwError("invalid or unsupported content hash data",be.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:r})})}getText(r){return ft(this,void 0,void 0,function*(){let o=on(r);o=Nn([gs(64),gs(o.length),o]),o.length%32!==0&&(o=Nn([o,jt("0x",32-r.length%32)]));const e=yield this._fetchBytes("0x59d1d43c",ht(o));return e==null||e==="0x"?null:Wo(e)})}}let vs=null,Cm=1;class Im extends La{constructor(r){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Mt(this,"anyNetwork",r==="any"),this.anyNetwork&&(r=this.detectNetwork()),r instanceof Promise)this._networkPromise=r,r.catch(o=>{}),this._ready().catch(o=>{});else{const o=Si(new.target,"getNetwork")(r);o?(Mt(this,"_network",o),this.emit("network",o,null)):bt.throwArgumentError("invalid network","network",r)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ft(this,void 0,void 0,function*(){if(this._network==null){let r=null;if(this._networkPromise)try{r=yield this._networkPromise}catch{}r==null&&(r=yield this.detectNetwork()),r||bt.throwError("no network detected",be.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=r:Mt(this,"_network",r),this.emit("network",r,null))}return this._network})}get ready(){return ki(()=>this._ready().then(r=>r,r=>{if(!(r.code===be.errors.NETWORK_ERROR&&r.event==="noNetwork"))throw r}))}static getFormatter(){return vs==null&&(vs=new nt),vs}static getNetwork(r){return lm(r==null?"homestead":r)}ccipReadFetch(r,o,e){return ft(this,void 0,void 0,function*(){if(this.disableCcipRead||e.length===0)return null;const t=r.to.toLowerCase(),n=o.toLowerCase(),c=[];for(let p=0;p<e.length;p++){const a=e[p],f=a.replace("{sender}",t).replace("{data}",n),s=a.indexOf("{data}")>=0?null:JSON.stringify({data:n,sender:t}),u=yield za({url:f,errorPassThrough:!0},s,(v,b)=>(v.status=b.statusCode,v));if(u.data)return u.data;const h=u.message||"unknown error";if(u.status>=400&&u.status<500)return bt.throwError(`response not found during CCIP fetch: ${h}`,be.errors.SERVER_ERROR,{url:a,errorMessage:h});c.push(h)}return bt.throwError(`error encountered during CCIP fetch: ${c.map(p=>JSON.stringify(p)).join(", ")}`,be.errors.SERVER_ERROR,{urls:e,errorMessages:c})})}_getInternalBlockNumber(r){return ft(this,void 0,void 0,function*(){if(yield this._ready(),r>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const n=yield t;if(wi()-n.respTime<=r)return n.blockNumber;break}catch{if(this._internalBlockNumber===t)break}}const o=wi(),e=Dt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(t=>null,t=>t)}).then(({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===e&&(this._internalBlockNumber=null),n;const c=wi();return t=ot.from(t).toNumber(),t<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:o,respTime:c}});return this._internalBlockNumber=e,e.catch(t=>{this._internalBlockNumber===e&&(this._internalBlockNumber=null)}),(yield e).blockNumber})}poll(){return ft(this,void 0,void 0,function*(){const r=Cm++,o=[];let e=null;try{e=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){this.emit("error",t);return}if(this._setFastBlockNumber(e),this.emit("poll",r,e),e===this._lastBlockNumber){this.emit("didPoll",r);return}if(this._emitted.block===-2&&(this._emitted.block=e-1),Math.abs(this._emitted.block-e)>1e3)bt.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${e})`),this.emit("error",bt.makeError("network block skew detected",be.errors.NETWORK_ERROR,{blockNumber:e,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",e);else for(let t=this._emitted.block+1;t<=e;t++)this.emit("block",t);this._emitted.block!==e&&(this._emitted.block=e,Object.keys(this._emitted).forEach(t=>{if(t==="block")return;const n=this._emitted[t];n!=="pending"&&e-n>12&&delete this._emitted[t]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=e-1),this._events.forEach(t=>{switch(t.type){case"tx":{const n=t.hash;let c=this.getTransactionReceipt(n).then(p=>(!p||p.blockNumber==null||(this._emitted["t:"+n]=p.blockNumber,this.emit(n,p)),null)).catch(p=>{this.emit("error",p)});o.push(c);break}case"filter":{if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=e,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const c=this.getLogs(n).then(p=>{t._inflight=!1,p.length!==0&&p.forEach(a=>{a.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=a.blockNumber),this._emitted["b:"+a.blockHash]=a.blockNumber,this._emitted["t:"+a.transactionHash]=a.blockNumber,this.emit(n,a)})}).catch(p=>{this.emit("error",p),t._inflight=!1});o.push(c)}break}}}),this._lastBlockNumber=e,Promise.all(o).then(()=>{this.emit("didPoll",r)}).catch(t=>{this.emit("error",t)})})}resetEventsBlock(r){this._lastBlockNumber=r-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ft(this,void 0,void 0,function*(){return bt.throwError("provider does not support network detection",be.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ft(this,void 0,void 0,function*(){const r=yield this._ready(),o=yield this.detectNetwork();if(r.chainId!==o.chainId){if(this.anyNetwork)return this._network=o,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",o,r),yield tf(0),this._network;const e=bt.makeError("underlying network changed",be.errors.NETWORK_ERROR,{event:"changed",network:r,detectedNetwork:o});throw this.emit("error",e),e}return r})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(r=>{this._setFastBlockNumber(r)},r=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(r){r&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!r&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(r){if(typeof r!="number"||r<=0||parseInt(String(r))!=r)throw new Error("invalid polling interval");this._pollingInterval=r,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const r=wi();return r-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=r,this._fastBlockNumberPromise=this.getBlockNumber().then(o=>((this._fastBlockNumber==null||o>this._fastBlockNumber)&&(this._fastBlockNumber=o),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(r){this._fastBlockNumber!=null&&r<this._fastBlockNumber||(this._fastQueryDate=wi(),(this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r,this._fastBlockNumberPromise=Promise.resolve(r)))}waitForTransaction(r,o,e){return ft(this,void 0,void 0,function*(){return this._waitForTransaction(r,o==null?1:o,e||0,null)})}_waitForTransaction(r,o,e,t){return ft(this,void 0,void 0,function*(){const n=yield this.getTransactionReceipt(r);return(n?n.confirmations:0)>=o?n:new Promise((c,p)=>{const a=[];let f=!1;const s=function(){return f?!0:(f=!0,a.forEach(h=>{h()}),!1)},u=h=>{h.confirmations<o||s()||c(h)};if(this.on(r,u),a.push(()=>{this.removeListener(r,u)}),t){let h=t.startBlock,v=null;const b=y=>ft(this,void 0,void 0,function*(){f||(yield tf(1e3),this.getTransactionCount(t.from).then(_=>ft(this,void 0,void 0,function*(){if(!f){if(_<=t.nonce)h=y;else{{const E=yield this.getTransaction(r);if(E&&E.blockNumber!=null)return}for(v==null&&(v=h-3,v<t.startBlock&&(v=t.startBlock));v<=y;){if(f)return;const E=yield this.getBlockWithTransactions(v);for(let S=0;S<E.transactions.length;S++){const k=E.transactions[S];if(k.hash===r)return;if(k.from===t.from&&k.nonce===t.nonce){if(f)return;const O=yield this.waitForTransaction(k.hash,o);if(s())return;let M="replaced";k.data===t.data&&k.to===t.to&&k.value.eq(t.value)?M="repriced":k.data==="0x"&&k.from===k.to&&k.value.isZero()&&(M="cancelled"),p(bt.makeError("transaction was replaced",be.errors.TRANSACTION_REPLACED,{cancelled:M==="replaced"||M==="cancelled",reason:M,replacement:this._wrapTransaction(k),hash:r,receipt:O}));return}}v++}}f||this.once("block",b)}}),_=>{f||this.once("block",b)}))});if(f)return;this.once("block",b),a.push(()=>{this.removeListener("block",b)})}if(typeof e=="number"&&e>0){const h=setTimeout(()=>{s()||p(bt.makeError("timeout exceeded",be.errors.TIMEOUT,{timeout:e}))},e);h.unref&&h.unref(),a.push(()=>{clearTimeout(h)})}})})}getBlockNumber(){return ft(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield this.perform("getGasPrice",{});try{return ot.from(r)}catch(o){return bt.throwError("bad result from backend",be.errors.SERVER_ERROR,{method:"getGasPrice",result:r,error:o})}})}getBalance(r,o){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield Dt({address:this._getAddress(r),blockTag:this._getBlockTag(o)}),t=yield this.perform("getBalance",e);try{return ot.from(t)}catch(n){return bt.throwError("bad result from backend",be.errors.SERVER_ERROR,{method:"getBalance",params:e,result:t,error:n})}})}getTransactionCount(r,o){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield Dt({address:this._getAddress(r),blockTag:this._getBlockTag(o)}),t=yield this.perform("getTransactionCount",e);try{return ot.from(t).toNumber()}catch(n){return bt.throwError("bad result from backend",be.errors.SERVER_ERROR,{method:"getTransactionCount",params:e,result:t,error:n})}})}getCode(r,o){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield Dt({address:this._getAddress(r),blockTag:this._getBlockTag(o)}),t=yield this.perform("getCode",e);try{return ht(t)}catch(n){return bt.throwError("bad result from backend",be.errors.SERVER_ERROR,{method:"getCode",params:e,result:t,error:n})}})}getStorageAt(r,o,e){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield Dt({address:this._getAddress(r),blockTag:this._getBlockTag(e),position:Promise.resolve(o).then(c=>Ca(c))}),n=yield this.perform("getStorageAt",t);try{return ht(n)}catch(c){return bt.throwError("bad result from backend",be.errors.SERVER_ERROR,{method:"getStorageAt",params:t,result:n,error:c})}})}_wrapTransaction(r,o,e){if(o!=null&&Un(o)!==32)throw new Error("invalid response - sendTransaction");const t=r;return o!=null&&r.hash!==o&&bt.throwError("Transaction hash mismatch from Provider.sendTransaction.",be.errors.UNKNOWN_ERROR,{expectedHash:r.hash,returnedHash:o}),t.wait=(n,c)=>ft(this,void 0,void 0,function*(){n==null&&(n=1),c==null&&(c=0);let p;n!==0&&e!=null&&(p={data:r.data,from:r.from,nonce:r.nonce,to:r.to,value:r.value,startBlock:e});const a=yield this._waitForTransaction(r.hash,n,c,p);return a==null&&n===0?null:(this._emitted["t:"+r.hash]=a.blockNumber,a.status===0&&bt.throwError("transaction failed",be.errors.CALL_EXCEPTION,{transactionHash:r.hash,transaction:r,receipt:a}),a)}),t}sendTransaction(r){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const o=yield Promise.resolve(r).then(n=>ht(n)),e=this.formatter.transaction(r);e.confirmations==null&&(e.confirmations=0);const t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const n=yield this.perform("sendTransaction",{signedTransaction:o});return this._wrapTransaction(e,n,t)}catch(n){throw n.transaction=e,n.transactionHash=e.hash,n}})}_getTransactionRequest(r){return ft(this,void 0,void 0,function*(){const o=yield r,e={};return["from","to"].forEach(t=>{o[t]!=null&&(e[t]=Promise.resolve(o[t]).then(n=>n?this._getAddress(n):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(t=>{o[t]!=null&&(e[t]=Promise.resolve(o[t]).then(n=>n?ot.from(n):null))}),["type"].forEach(t=>{o[t]!=null&&(e[t]=Promise.resolve(o[t]).then(n=>n!=null?n:null))}),o.accessList&&(e.accessList=this.formatter.accessList(o.accessList)),["data"].forEach(t=>{o[t]!=null&&(e[t]=Promise.resolve(o[t]).then(n=>n?ht(n):null))}),this.formatter.transactionRequest(yield Dt(e))})}_getFilter(r){return ft(this,void 0,void 0,function*(){r=yield r;const o={};return r.address!=null&&(o.address=this._getAddress(r.address)),["blockHash","topics"].forEach(e=>{r[e]!=null&&(o[e]=r[e])}),["fromBlock","toBlock"].forEach(e=>{r[e]!=null&&(o[e]=this._getBlockTag(r[e]))}),this.formatter.filter(yield Dt(o))})}_call(r,o,e){return ft(this,void 0,void 0,function*(){e>=Sm&&bt.throwError("CCIP read exceeded maximum redirections",be.errors.SERVER_ERROR,{redirects:e,transaction:r});const t=r.to,n=yield this.perform("call",{transaction:r,blockTag:o});if(e>=0&&o==="latest"&&t!=null&&n.substring(0,10)==="0x556f1830"&&Un(n)%32===4)try{const c=Yt(n,4),p=Yt(c,0,32);ot.from(p).eq(t)||bt.throwError("CCIP Read sender did not match",be.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:r,data:n});const a=[],f=ot.from(Yt(c,32,64)).toNumber(),s=ot.from(Yt(c,f,f+32)).toNumber(),u=Yt(c,f+32);for(let E=0;E<s;E++){const S=po(u,E*32);S==null&&bt.throwError("CCIP Read contained corrupt URL string",be.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:r,data:n}),a.push(S)}const h=zi(c,64);ot.from(Yt(c,100,128)).isZero()||bt.throwError("CCIP Read callback selector included junk",be.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:r,data:n});const v=Yt(c,96,100),b=zi(c,128),y=yield this.ccipReadFetch(r,h,a);y==null&&bt.throwError("CCIP Read disabled or provided no URLs",be.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:r,data:n});const _={to:t,data:lr([v,ll([y,b])])};return this._call(_,o,e+1)}catch(c){if(c.code===be.errors.SERVER_ERROR)throw c}try{return ht(n)}catch(c){return bt.throwError("bad result from backend",be.errors.SERVER_ERROR,{method:"call",params:{transaction:r,blockTag:o},result:n,error:c})}})}call(r,o){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield Dt({transaction:this._getTransactionRequest(r),blockTag:this._getBlockTag(o),ccipReadEnabled:Promise.resolve(r.ccipReadEnabled)});return this._call(e.transaction,e.blockTag,e.ccipReadEnabled?0:-1)})}estimateGas(r){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const o=yield Dt({transaction:this._getTransactionRequest(r)}),e=yield this.perform("estimateGas",o);try{return ot.from(e)}catch(t){return bt.throwError("bad result from backend",be.errors.SERVER_ERROR,{method:"estimateGas",params:o,result:e,error:t})}})}_getAddress(r){return ft(this,void 0,void 0,function*(){r=yield r,typeof r!="string"&&bt.throwArgumentError("invalid address or ENS name","name",r);const o=yield this.resolveName(r);return o==null&&bt.throwError("ENS name not configured",be.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(r)})`}),o})}_getBlock(r,o){return ft(this,void 0,void 0,function*(){yield this.getNetwork(),r=yield r;let e=-128;const t={includeTransactions:!!o};if(Rt(r,32))t.blockHash=r;else try{t.blockTag=yield this._getBlockTag(r),Rt(t.blockTag)&&(e=parseInt(t.blockTag.substring(2),16))}catch{bt.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",r)}return ki(()=>ft(this,void 0,void 0,function*(){const n=yield this.perform("getBlock",t);if(n==null)return t.blockHash!=null&&this._emitted["b:"+t.blockHash]==null||t.blockTag!=null&&e>this._emitted.block?null:void 0;if(o){let c=null;for(let a=0;a<n.transactions.length;a++){const f=n.transactions[a];if(f.blockNumber==null)f.confirmations=0;else if(f.confirmations==null){c==null&&(c=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let s=c-f.blockNumber+1;s<=0&&(s=1),f.confirmations=s}}const p=this.formatter.blockWithTransactions(n);return p.transactions=p.transactions.map(a=>this._wrapTransaction(a)),p}return this.formatter.block(n)}),{oncePoll:this})})}getBlock(r){return this._getBlock(r,!1)}getBlockWithTransactions(r){return this._getBlock(r,!0)}getTransaction(r){return ft(this,void 0,void 0,function*(){yield this.getNetwork(),r=yield r;const o={transactionHash:this.formatter.hash(r,!0)};return ki(()=>ft(this,void 0,void 0,function*(){const e=yield this.perform("getTransaction",o);if(e==null)return this._emitted["t:"+r]==null?null:void 0;const t=this.formatter.transactionResponse(e);if(t.blockNumber==null)t.confirmations=0;else if(t.confirmations==null){let c=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-t.blockNumber+1;c<=0&&(c=1),t.confirmations=c}return this._wrapTransaction(t)}),{oncePoll:this})})}getTransactionReceipt(r){return ft(this,void 0,void 0,function*(){yield this.getNetwork(),r=yield r;const o={transactionHash:this.formatter.hash(r,!0)};return ki(()=>ft(this,void 0,void 0,function*(){const e=yield this.perform("getTransactionReceipt",o);if(e==null)return this._emitted["t:"+r]==null?null:void 0;if(e.blockHash==null)return;const t=this.formatter.receipt(e);if(t.blockNumber==null)t.confirmations=0;else if(t.confirmations==null){let c=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-t.blockNumber+1;c<=0&&(c=1),t.confirmations=c}return t}),{oncePoll:this})})}getLogs(r){return ft(this,void 0,void 0,function*(){yield this.getNetwork();const o=yield Dt({filter:this._getFilter(r)}),e=yield this.perform("getLogs",o);return e.forEach(t=>{t.removed==null&&(t.removed=!1)}),nt.arrayOf(this.formatter.filterLog.bind(this.formatter))(e)})}getEtherPrice(){return ft(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(r){return ft(this,void 0,void 0,function*(){if(r=yield r,typeof r=="number"&&r<0){r%1&&bt.throwArgumentError("invalid BlockTag","blockTag",r);let o=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return o+=r,o<0&&(o=0),this.formatter.blockTag(o)}return this.formatter.blockTag(r)})}getResolver(r){return ft(this,void 0,void 0,function*(){let o=r;for(;;){if(o===""||o==="."||r!=="eth"&&o==="eth")return null;const e=yield this._getResolver(o,"getResolver");if(e!=null){const t=new sf(this,e,r);return o!==r&&!(yield t.supportsWildcard())?null:t}o=o.split(".").slice(1).join(".")}})}_getResolver(r,o){return ft(this,void 0,void 0,function*(){o==null&&(o="ENS");const e=yield this.getNetwork();e.ensAddress||bt.throwError("network does not support ENS",be.errors.UNSUPPORTED_OPERATION,{operation:o,network:e.name});try{const t=yield this.call({to:e.ensAddress,data:"0x0178b8bf"+co(r).substring(2)});return this.formatter.callAddress(t)}catch{}return null})}resolveName(r){return ft(this,void 0,void 0,function*(){r=yield r;try{return Promise.resolve(this.formatter.address(r))}catch(e){if(Rt(r))throw e}typeof r!="string"&&bt.throwArgumentError("invalid ENS name","name",r);const o=yield this.getResolver(r);return o?yield o.getAddress():null})}lookupAddress(r){return ft(this,void 0,void 0,function*(){r=yield r,r=this.formatter.address(r);const o=r.substring(2).toLowerCase()+".addr.reverse",e=yield this._getResolver(o,"lookupAddress");if(e==null)return null;const t=po(yield this.call({to:e,data:"0x691f3431"+co(o).substring(2)}),0);return(yield this.resolveName(t))!=r?null:t})}getAvatar(r){return ft(this,void 0,void 0,function*(){let o=null;if(Rt(r)){const n=this.formatter.address(r).substring(2).toLowerCase()+".addr.reverse",c=yield this._getResolver(n,"getAvatar");if(!c)return null;o=new sf(this,c,n);try{const p=yield o.getAvatar();if(p)return p.url}catch(p){if(p.code!==be.errors.CALL_EXCEPTION)throw p}try{const p=po(yield this.call({to:c,data:"0x691f3431"+co(n).substring(2)}),0);o=yield this.getResolver(p)}catch(p){if(p.code!==be.errors.CALL_EXCEPTION)throw p;return null}}else if(o=yield this.getResolver(r),!o)return null;const e=yield o.getAvatar();return e==null?null:e.url})}perform(r,o){return bt.throwError(r+" not implemented",be.errors.NOT_IMPLEMENTED,{operation:r})}_startEvent(r){this.polling=this._events.filter(o=>o.pollable()).length>0}_stopEvent(r){this.polling=this._events.filter(o=>o.pollable()).length>0}_addEventListener(r,o,e){const t=new Rm(Kn(r),o,e);return this._events.push(t),this._startEvent(t),this}on(r,o){return this._addEventListener(r,o,!1)}once(r,o){return this._addEventListener(r,o,!0)}emit(r,...o){let e=!1,t=[],n=Kn(r);return this._events=this._events.filter(c=>c.tag!==n?!0:(setTimeout(()=>{c.listener.apply(this,o)},0),e=!0,c.once?(t.push(c),!1):!0)),t.forEach(c=>{this._stopEvent(c)}),e}listenerCount(r){if(!r)return this._events.length;let o=Kn(r);return this._events.filter(e=>e.tag===o).length}listeners(r){if(r==null)return this._events.map(e=>e.listener);let o=Kn(r);return this._events.filter(e=>e.tag===o).map(e=>e.listener)}off(r,o){if(o==null)return this.removeAllListeners(r);const e=[];let t=!1,n=Kn(r);return this._events=this._events.filter(c=>c.tag!==n||c.listener!=o||t?!0:(t=!0,e.push(c),!1)),e.forEach(c=>{this._stopEvent(c)}),this}removeAllListeners(r){let o=[];if(r==null)o=this._events,this._events=[];else{const e=Kn(r);this._events=this._events.filter(t=>t.tag!==e?!0:(o.push(t),!1))}return o.forEach(e=>{this._stopEvent(e)}),this}}var Qr=globalThis&&globalThis.__awaiter||function(i,r,o,e){function t(n){return n instanceof o?n:new o(function(c){c(n)})}return new(o||(o=Promise))(function(n,c){function p(s){try{f(e.next(s))}catch(u){c(u)}}function a(s){try{f(e.throw(s))}catch(u){c(u)}}function f(s){s.done?n(s.value):t(s.value).then(p,a)}f((e=e.apply(i,r||[])).next())})};const Kt=new be(Jo),Om=["call","estimateGas"];function Oi(i,r){if(i==null)return null;if(typeof i.message=="string"&&i.message.match("reverted")){const o=Rt(i.data)?i.data:null;if(!r||o)return{message:i.message,data:o}}if(typeof i=="object"){for(const o in i){const e=Oi(i[o],r);if(e)return e}return null}if(typeof i=="string")try{return Oi(JSON.parse(i),r)}catch{}return null}function hl(i,r,o){const e=o.transaction||o.signedTransaction;if(i==="call"){const n=Oi(r,!0);if(n)return n.data;Kt.throwError("missing revert data in call exception; Transaction reverted without a reason string",be.errors.CALL_EXCEPTION,{data:"0x",transaction:e,error:r})}if(i==="estimateGas"){let n=Oi(r.body,!1);n==null&&(n=Oi(r,!1)),n&&Kt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",be.errors.UNPREDICTABLE_GAS_LIMIT,{reason:n.message,method:i,transaction:e,error:r})}let t=r.message;throw r.code===be.errors.SERVER_ERROR&&r.error&&typeof r.error.message=="string"?t=r.error.message:typeof r.body=="string"?t=r.body:typeof r.responseText=="string"&&(t=r.responseText),t=(t||"").toLowerCase(),t.match(/insufficient funds|base fee exceeds gas limit/i)&&Kt.throwError("insufficient funds for intrinsic transaction cost",be.errors.INSUFFICIENT_FUNDS,{error:r,method:i,transaction:e}),t.match(/nonce (is )?too low/i)&&Kt.throwError("nonce has already been used",be.errors.NONCE_EXPIRED,{error:r,method:i,transaction:e}),t.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Kt.throwError("replacement fee too low",be.errors.REPLACEMENT_UNDERPRICED,{error:r,method:i,transaction:e}),t.match(/only replay-protected/i)&&Kt.throwError("legacy pre-eip-155 transactions not supported",be.errors.UNSUPPORTED_OPERATION,{error:r,method:i,transaction:e}),Om.indexOf(i)>=0&&t.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Kt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",be.errors.UNPREDICTABLE_GAS_LIMIT,{error:r,method:i,transaction:e}),r}function af(i){return new Promise(function(r){setTimeout(r,i)})}function Nm(i){if(i.error){const r=new Error(i.error.message);throw r.code=i.error.code,r.data=i.error.data,r}return i.result}function _i(i){return i&&i.toLowerCase()}const Js={};class dl extends ja{constructor(r,o,e){if(super(),r!==Js)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Mt(this,"provider",o),e==null&&(e=0),typeof e=="string"?(Mt(this,"_address",this.provider.formatter.address(e)),Mt(this,"_index",null)):typeof e=="number"?(Mt(this,"_index",e),Mt(this,"_address",null)):Kt.throwArgumentError("invalid address or index","addressOrIndex",e)}connect(r){return Kt.throwError("cannot alter JSON-RPC Signer connection",be.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Bm(Js,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(r=>(r.length<=this._index&&Kt.throwError("unknown account #"+this._index,be.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(r[this._index])))}sendUncheckedTransaction(r){r=hr(r);const o=this.getAddress().then(e=>(e&&(e=e.toLowerCase()),e));if(r.gasLimit==null){const e=hr(r);e.from=o,r.gasLimit=this.provider.estimateGas(e)}return r.to!=null&&(r.to=Promise.resolve(r.to).then(e=>Qr(this,void 0,void 0,function*(){if(e==null)return null;const t=yield this.provider.resolveName(e);return t==null&&Kt.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))),Dt({tx:Dt(r),sender:o}).then(({tx:e,sender:t})=>{e.from!=null?e.from.toLowerCase()!==t&&Kt.throwArgumentError("from address mismatch","transaction",r):e.from=t;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(c=>c,c=>hl("sendTransaction",c,n))})}signTransaction(r){return Kt.throwError("signing transactions is unsupported",be.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(r){return Qr(this,void 0,void 0,function*(){const o=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),e=yield this.sendUncheckedTransaction(r);try{return yield ki(()=>Qr(this,void 0,void 0,function*(){const t=yield this.provider.getTransaction(e);if(t!==null)return this.provider._wrapTransaction(t,e,o)}),{oncePoll:this.provider})}catch(t){throw t.transactionHash=e,t}})}signMessage(r){return Qr(this,void 0,void 0,function*(){const o=typeof r=="string"?on(r):r,e=yield this.getAddress();return yield this.provider.send("personal_sign",[ht(o),e.toLowerCase()])})}_legacySignMessage(r){return Qr(this,void 0,void 0,function*(){const o=typeof r=="string"?on(r):r,e=yield this.getAddress();return yield this.provider.send("eth_sign",[e.toLowerCase(),ht(o)])})}_signTypedData(r,o,e){return Qr(this,void 0,void 0,function*(){const t=yield sr.resolveNames(r,o,e,c=>this.provider.resolveName(c)),n=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[n.toLowerCase(),JSON.stringify(sr.getPayload(t.domain,o,t.value))])})}unlock(r){return Qr(this,void 0,void 0,function*(){const o=this.provider,e=yield this.getAddress();return o.send("personal_unlockAccount",[e.toLowerCase(),r,null])})}}class Bm extends dl{sendTransaction(r){return this.sendUncheckedTransaction(r).then(o=>({hash:o,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(o,e)}))}}const Lm={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class jm extends Im{constructor(r,o){let e=o;e==null&&(e=new Promise((t,n)=>{setTimeout(()=>{this.detectNetwork().then(c=>{t(c)},c=>{n(c)})},0)})),super(e),r||(r=Si(this.constructor,"defaultUrl")()),typeof r=="string"?Mt(this,"connection",Object.freeze({url:r})):Mt(this,"connection",Object.freeze(hr(r))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Qr(this,void 0,void 0,function*(){yield af(0);let r=null;try{r=yield this.send("eth_chainId",[])}catch{try{r=yield this.send("net_version",[])}catch{}}if(r!=null){const o=Si(this.constructor,"getNetwork");try{return o(ot.from(r).toNumber())}catch(e){return Kt.throwError("could not detect network",be.errors.NETWORK_ERROR,{chainId:r,event:"invalidNetwork",serverError:e})}}return Kt.throwError("could not detect network",be.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(r){return new dl(Js,this,r)}getUncheckedSigner(r){return this.getSigner(r).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(r=>r.map(o=>this.formatter.address(o)))}send(r,o){const e={method:r,params:o,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:qn(e),provider:this});const t=["eth_chainId","eth_blockNumber"].indexOf(r)>=0;if(t&&this._cache[r])return this._cache[r];const n=za(this.connection,JSON.stringify(e),Nm).then(c=>(this.emit("debug",{action:"response",request:e,response:c,provider:this}),c),c=>{throw this.emit("debug",{action:"response",error:c,request:e,provider:this}),c});return t&&(this._cache[r]=n,setTimeout(()=>{this._cache[r]=null},0)),n}prepareRequest(r,o){switch(r){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[_i(o.address),o.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[_i(o.address),o.blockTag]];case"getCode":return["eth_getCode",[_i(o.address),o.blockTag]];case"getStorageAt":return["eth_getStorageAt",[_i(o.address),jt(o.position,32),o.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[o.signedTransaction]];case"getBlock":return o.blockTag?["eth_getBlockByNumber",[o.blockTag,!!o.includeTransactions]]:o.blockHash?["eth_getBlockByHash",[o.blockHash,!!o.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[o.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[o.transactionHash]];case"call":{const e=Si(this.constructor,"hexlifyTransaction");return["eth_call",[e(o.transaction,{from:!0}),o.blockTag]]}case"estimateGas":{const e=Si(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[e(o.transaction,{from:!0})]]}case"getLogs":return o.filter&&o.filter.address!=null&&(o.filter.address=_i(o.filter.address)),["eth_getLogs",[o.filter]]}return null}perform(r,o){return Qr(this,void 0,void 0,function*(){if(r==="call"||r==="estimateGas"){const t=o.transaction;if(t&&t.type!=null&&ot.from(t.type).isZero()&&t.maxFeePerGas==null&&t.maxPriorityFeePerGas==null){const n=yield this.getFeeData();n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null&&(o=hr(o),o.transaction=hr(t),delete o.transaction.type)}}const e=this.prepareRequest(r,o);e==null&&Kt.throwError(r+" not implemented",be.errors.NOT_IMPLEMENTED,{operation:r});try{return yield this.send(e[0],e[1])}catch(t){return hl(r,t,o)}})}_startEvent(r){r.tag==="pending"&&this._startPending(),super._startEvent(r)}_startPending(){if(this._pendingFilter!=null)return;const r=this,o=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=o,o.then(function(e){function t(){r.send("eth_getFilterChanges",[e]).then(function(n){if(r._pendingFilter!=o)return null;let c=Promise.resolve();return n.forEach(function(p){r._emitted["t:"+p.toLowerCase()]="pending",c=c.then(function(){return r.getTransaction(p).then(function(a){return r.emit("pending",a),null})})}),c.then(function(){return af(1e3)})}).then(function(){if(r._pendingFilter!=o){r.send("eth_uninstallFilter",[e]);return}return setTimeout(function(){t()},0),null}).catch(n=>{})}return t(),e}).catch(e=>{})}_stopEvent(r){r.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(r)}static hexlifyTransaction(r,o){const e=hr(Lm);if(o)for(const n in o)o[n]&&(e[n]=!0);M0(r,e);const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(n){if(r[n]==null)return;const c=Ca(ot.from(r[n]));n==="gasLimit"&&(n="gas"),t[n]=c}),["from","to","data"].forEach(function(n){r[n]!=null&&(t[n]=ht(r[n]))}),r.accessList&&(t.accessList=Vi(r.accessList)),t}}const uf=new be(Jo);let Um=1;function ff(i,r){const o="Web3LegacyFetcher";return function(e,t){const n={method:e,params:t,id:Um++,jsonrpc:"2.0"};return new Promise((c,p)=>{this.emit("debug",{action:"request",fetcher:o,request:qn(n),provider:this}),r(n,(a,f)=>{if(a)return this.emit("debug",{action:"response",fetcher:o,error:a,request:n,provider:this}),p(a);if(this.emit("debug",{action:"response",fetcher:o,request:n,response:f,provider:this}),f.error){const s=new Error(f.error.message);return s.code=f.error.code,s.data=f.error.data,p(s)}c(f.result)})})}}function qm(i){return function(r,o){o==null&&(o=[]);const e={method:r,params:o};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:qn(e),provider:this}),i.request(e).then(t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:e,response:t,provider:this}),t),t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:e,error:t,provider:this}),t})}}class cf extends jm{constructor(r,o){r==null&&uf.throwArgumentError("missing provider","provider",r);let e=null,t=null,n=null;typeof r=="function"?(e="unknown:",t=r):(e=r.host||r.path||"",!e&&r.isMetaMask&&(e="metamask"),n=r,r.request?(e===""&&(e="eip-1193:"),t=qm(r)):r.sendAsync?t=ff(r,r.sendAsync.bind(r)):r.send?t=ff(r,r.send.bind(r)):uf.throwArgumentError("unsupported provider","provider",r),e||(e="unknown:")),super(e,o),Mt(this,"jsonRpcFetchFunc",t),Mt(this,"provider",n)}send(r,o){return this.jsonRpcFetchFunc(r,o)}}var pl={exports:{}};(function(i,r){(function(o,e){i.exports=e()})(Ta,function(){return function(o){var e={};function t(n){if(e[n])return e[n].exports;var c=e[n]={i:n,l:!1,exports:{}};return o[n].call(c.exports,c,c.exports,t),c.l=!0,c.exports}return t.m=o,t.c=e,t.d=function(n,c,p){t.o(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:p})},t.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,c){if(1&c&&(n=t(n)),8&c||4&c&&typeof n=="object"&&n&&n.__esModule)return n;var p=Object.create(null);if(t.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:n}),2&c&&typeof n!="string")for(var a in n)t.d(p,a,function(f){return n[f]}.bind(null,a));return p},t.n=function(n){var c=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(c,"a",c),c},t.o=function(n,c){return Object.prototype.hasOwnProperty.call(n,c)},t.p="",t(t.s=166)}([function(o,e,t){(function(n){t.d(e,"f",function(){return s}),t.d(e,"g",function(){return u}),t.d(e,"i",function(){return h}),t.d(e,"h",function(){return v}),t.d(e,"b",function(){return b}),t.d(e,"c",function(){return y}),t.d(e,"e",function(){return _}),t.d(e,"d",function(){return E}),t.d(e,"o",function(){return S}),t.d(e,"n",function(){return k}),t.d(e,"p",function(){return O}),t.d(e,"A",function(){return M}),t.d(e,"z",function(){return C}),t.d(e,"B",function(){return N}),t.d(e,"v",function(){return L}),t.d(e,"u",function(){return F}),t.d(e,"s",function(){return z}),t.d(e,"r",function(){return R}),t.d(e,"t",function(){return l}),t.d(e,"q",function(){return x}),t.d(e,"m",function(){return d}),t.d(e,"l",function(){return m}),t.d(e,"k",function(){return g}),t.d(e,"j",function(){return w}),t.d(e,"x",function(){return T}),t.d(e,"a",function(){return q}),t.d(e,"y",function(){return Z}),t.d(e,"w",function(){return I});var c=t(77),p=t.n(c),a=t(159),f=t.n(a);function s(K){return new Uint8Array(K)}function u(K,j=!1){const D=K.toString("hex");return j?q(D):D}function h(K){return K.toString("utf8")}function v(K){return K.readUIntBE(0,K.length)}function b(K){return f()(K)}function y(K,j=!1){return u(b(K),j)}function _(K){return h(b(K))}function E(K){return v(b(K))}function S(K){return n.from(T(K),"hex")}function k(K){return s(S(K))}function O(K){return h(S(K))}function M(K){return n.from(K,"utf8")}function C(K){return s(M(K))}function N(K,j=!1){return u(M(K),j)}function L(K){return b(H(V(K)))}function F(K){return H(V(K))}function V(K){return P((K>>>0).toString(2))}function H(K){return new Uint8Array(A(K).map(j=>parseInt(j,2)))}function z(K,j){return!(typeof K!="string"||!K.match(/^0x[0-9A-Fa-f]*$/))&&(!j||K.length===2+2*j)}function R(K){return n.isBuffer(K)}function l(K){return p.a.strict(K)&&!R(K)}function x(K){return!l(K)&&!R(K)&&K.byteLength!==void 0}function d(K){return R(K)?"buffer":l(K)?"typed-array":x(K)?"array-buffer":Array.isArray(K)?"array":typeof K}function m(K){return function(j){return!(typeof j!="string"||!new RegExp(/^[01]+$/).test(j))&&j.length%8==0}(K)?"binary":z(K)?"hex":"utf8"}function g(...K){return n.concat(K)}function w(...K){let j=[];return K.forEach(D=>j=j.concat(Array.from(D))),new Uint8Array([...j])}function A(K,j=8){const D=P(K).match(new RegExp(`.{${j}}`,"gi"));return Array.from(D||[])}function P(K,j=8,D="0"){return function(B,U,J="0"){return $(B,U,!0,J)}(K,function(B,U=8){const J=B%U;return J?(B-J)/U*U+U:B}(K.length,j),D)}function T(K){return K.replace(/^0x/,"")}function q(K){return K.startsWith("0x")?K:"0x"+K}function Z(K){return(K=P(K=T(K),2))&&(K=q(K)),K}function I(K){const j=K.startsWith("0x");return K=(K=T(K)).startsWith("0")?K.substring(1):K,j?q(K):K}function $(K,j,D,B="0"){const U=j-K.length;let J=K;if(U>0){const G=B.repeat(U);J=D?G+K:K+G}return J}}).call(this,t(2).Buffer)},function(o,e,t){t.r(e);var n=t(76);const c=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],p=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],a=["eth_accounts","eth_chainId","net_version"],f={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var s=t(9),u=t.n(s),h=t(0);function v(ie){return h.b(new Uint8Array(ie))}function b(ie){return h.e(new Uint8Array(ie))}function y(ie,de){return h.c(new Uint8Array(ie),!de)}function _(ie){return h.d(new Uint8Array(ie))}function E(...ie){return h.n(ie.map(de=>h.c(new Uint8Array(de))).join("")).buffer}function S(ie){return h.f(ie).buffer}function k(ie){return h.i(ie)}function O(ie,de){return h.g(ie,!de)}function M(ie){return h.h(ie)}function C(...ie){return h.k(...ie)}function N(ie){return h.z(ie).buffer}function L(ie){return h.A(ie)}function F(ie,de){return h.B(ie,!de)}function V(ie){return new u.a(ie,10).toNumber()}function H(ie){return h.o(ie)}function z(ie){return h.n(ie).buffer}function R(ie){return h.p(ie)}function l(ie){return new u.a(h.x(ie),"hex").toNumber()}function x(ie){return h.v(ie)}function d(ie){return h.u(ie).buffer}function m(ie){return new u.a(ie).toString()}function g(ie,de){const ke=h.x(h.y(new u.a(ie).toString(16)));return de?ke:h.a(ke)}var w=t(160);function A(ie){return h.y(ie)}function P(ie){return h.a(ie)}function T(ie){return h.x(ie)}function q(ie){return h.w(h.a(ie))}const Z=t(161).payloadId;function I(){return((ie,de)=>{for(de=ie="";ie++<36;de+=51*ie&52?(15^ie?8^Math.random()*(20^ie?16:4):4).toString(16):"-");return de})()}function $(){console.warn("DEPRECATION WARNING: This WalletConnect client library will be deprecated in favor of @walletconnect/client. Please check docs.walletconnect.org to learn more about this migration!")}function K(ie,de){let ke;const Be=f[ie];return Be&&(ke=`https://${Be}.infura.io/v3/${de}`),ke}function j(ie,de){let ke;const Be=K(ie,de.infuraId);return de.custom&&de.custom[ie]?ke=de.custom[ie]:Be&&(ke=Be),ke}function D(ie){return ie===""||typeof ie=="string"&&ie.trim()===""}function B(ie){return!(ie&&ie.length)}function U(ie){return h.r(ie)}function J(ie){return h.t(ie)}function G(ie){return h.q(ie)}function W(ie){return h.m(ie)}function Y(ie){return h.l(ie)}function ee(ie,de){return h.s(ie,de)}function te(ie){return typeof ie.params=="object"}function oe(ie){return ie.method!==void 0}function fe(ie){return ie.result!==void 0}function ne(ie){return ie.error!==void 0}function ce(ie){return ie.event!==void 0}function se(ie){return c.includes(ie)||ie.startsWith("wc_")}function ae(ie){return!!ie.method.startsWith("wc_")||!p.includes(ie.method)}function he(ie){ie=Object(h.x)(ie.toLowerCase());const de=Object(h.x)(Object(w.keccak_256)(L(ie)));let ke="";for(let Be=0;Be<ie.length;Be++)parseInt(de[Be],16)>7?ke+=ie[Be].toUpperCase():ke+=ie[Be];return Object(h.a)(ke)}const me=ie=>!!ie&&ie.toLowerCase().substring(0,2)==="0x"&&!!/^(0x)?[0-9a-f]{40}$/i.test(ie)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(ie)&&!/^(0x)?[0-9A-F]{40}$/.test(ie))||ie===he(ie));function le(ie){return B(ie)||ee(ie[0])||(ie[0]=F(ie[0])),ie}function ye(ie){if(ie.type!==void 0&&ie.type!=="0")return ie;if(ie.from===void 0||!me(ie.from))throw new Error("Transaction object must include a valid 'from' value.");function de(ge){let Ue=ge;return(typeof ge=="number"||typeof ge=="string"&&!D(ge))&&(ee(ge)?typeof ge=="string"&&(Ue=A(ge)):Ue=g(ge)),typeof Ue=="string"&&(Ue=q(Ue)),Ue}const ke={from:A(ie.from),to:ie.to===void 0?void 0:A(ie.to),gasPrice:ie.gasPrice===void 0?"":de(ie.gasPrice),gas:ie.gas===void 0?ie.gasLimit===void 0?"":de(ie.gasLimit):de(ie.gas),value:ie.value===void 0?"":de(ie.value),nonce:ie.nonce===void 0?"":de(ie.nonce),data:ie.data===void 0?"":A(ie.data)||"0x"},Be=["gasPrice","gas","value","nonce"];return Object.keys(ke).forEach(ge=>{(ke[ge]===void 0||typeof ke[ge]=="string"&&!ke[ge].trim().length)&&Be.includes(ge)&&delete ke[ge]}),ke}function Se(ie,de){return async(...ke)=>new Promise((Be,ge)=>{ie.apply(de,[...ke,(Ue,De)=>{Ue==null&&ge(Ue),Be(De)}])})}function pe(ie){const de=ie.message||"Failed or Rejected Request";let ke=-32e3;if(ie&&!ie.code)switch(de){case"Parse error":ke=-32700;break;case"Invalid request":ke=-32600;break;case"Method not found":ke=-32601;break;case"Invalid params":ke=-32602;break;case"Internal error":ke=-32603;break;default:ke=-32e3}return{code:ke,message:de}}var Oe=t(78);function Le(ie){const de=ie.indexOf("?")!==-1?ie.indexOf("?"):void 0;return de!==void 0?ie.substr(de):""}function _e(ie,de){let ke=Fe(ie);return ke=Object.assign(Object.assign({},ke),de),ie=qe(ke)}function Fe(ie){return Oe.parse(ie)}function qe(ie){return Oe.stringify(ie)}function Ee(ie){return ie.bridge!==void 0}function je(ie){const de=ie.indexOf(":"),ke=ie.indexOf("?")!==-1?ie.indexOf("?"):void 0,Be=ie.substring(0,de),ge=function(De){const we=De.split("@");return{handshakeTopic:we[0],version:parseInt(we[1],10)}}(ie.substring(de+1,ke)),Ue=function(De){const we=Fe(De);return{key:we.key||"",bridge:we.bridge||""}}(ke!==void 0?ie.substr(ke):"");return Object.assign(Object.assign({protocol:Be},ge),Ue)}t.d(e,"detectEnv",function(){return n.detectEnv}),t.d(e,"detectOS",function(){return n.detectOS}),t.d(e,"isAndroid",function(){return n.isAndroid}),t.d(e,"isIOS",function(){return n.isIOS}),t.d(e,"isMobile",function(){return n.isMobile}),t.d(e,"isNode",function(){return n.isNode}),t.d(e,"isBrowser",function(){return n.isBrowser}),t.d(e,"getFromWindow",function(){return n.getFromWindow}),t.d(e,"getFromWindowOrThrow",function(){return n.getFromWindowOrThrow}),t.d(e,"getDocumentOrThrow",function(){return n.getDocumentOrThrow}),t.d(e,"getDocument",function(){return n.getDocument}),t.d(e,"getNavigatorOrThrow",function(){return n.getNavigatorOrThrow}),t.d(e,"getNavigator",function(){return n.getNavigator}),t.d(e,"getLocationOrThrow",function(){return n.getLocationOrThrow}),t.d(e,"getLocation",function(){return n.getLocation}),t.d(e,"getCryptoOrThrow",function(){return n.getCryptoOrThrow}),t.d(e,"getCrypto",function(){return n.getCrypto}),t.d(e,"getLocalStorageOrThrow",function(){return n.getLocalStorageOrThrow}),t.d(e,"getLocalStorage",function(){return n.getLocalStorage}),t.d(e,"getClientMeta",function(){return n.getClientMeta}),t.d(e,"safeJsonParse",function(){return n.safeJsonParse}),t.d(e,"safeJsonStringify",function(){return n.safeJsonStringify}),t.d(e,"setLocal",function(){return n.setLocal}),t.d(e,"getLocal",function(){return n.getLocal}),t.d(e,"removeLocal",function(){return n.removeLocal}),t.d(e,"mobileLinkChoiceKey",function(){return n.mobileLinkChoiceKey}),t.d(e,"formatIOSMobile",function(){return n.formatIOSMobile}),t.d(e,"saveMobileLinkInfo",function(){return n.saveMobileLinkInfo}),t.d(e,"getMobileRegistryEntry",function(){return n.getMobileRegistryEntry}),t.d(e,"getMobileLinkRegistry",function(){return n.getMobileLinkRegistry}),t.d(e,"getWalletRegistryUrl",function(){return n.getWalletRegistryUrl}),t.d(e,"getDappRegistryUrl",function(){return n.getDappRegistryUrl}),t.d(e,"formatMobileRegistryEntry",function(){return n.formatMobileRegistryEntry}),t.d(e,"formatMobileRegistry",function(){return n.formatMobileRegistry}),t.d(e,"reservedEvents",function(){return c}),t.d(e,"signingMethods",function(){return p}),t.d(e,"stateMethods",function(){return a}),t.d(e,"infuraNetworks",function(){return f}),t.d(e,"convertArrayBufferToBuffer",function(){return v}),t.d(e,"convertArrayBufferToUtf8",function(){return b}),t.d(e,"convertArrayBufferToHex",function(){return y}),t.d(e,"convertArrayBufferToNumber",function(){return _}),t.d(e,"concatArrayBuffers",function(){return E}),t.d(e,"convertBufferToArrayBuffer",function(){return S}),t.d(e,"convertBufferToUtf8",function(){return k}),t.d(e,"convertBufferToHex",function(){return O}),t.d(e,"convertBufferToNumber",function(){return M}),t.d(e,"concatBuffers",function(){return C}),t.d(e,"convertUtf8ToArrayBuffer",function(){return N}),t.d(e,"convertUtf8ToBuffer",function(){return L}),t.d(e,"convertUtf8ToHex",function(){return F}),t.d(e,"convertUtf8ToNumber",function(){return V}),t.d(e,"convertHexToBuffer",function(){return H}),t.d(e,"convertHexToArrayBuffer",function(){return z}),t.d(e,"convertHexToUtf8",function(){return R}),t.d(e,"convertHexToNumber",function(){return l}),t.d(e,"convertNumberToBuffer",function(){return x}),t.d(e,"convertNumberToArrayBuffer",function(){return d}),t.d(e,"convertNumberToUtf8",function(){return m}),t.d(e,"convertNumberToHex",function(){return g}),t.d(e,"toChecksumAddress",function(){return he}),t.d(e,"isValidAddress",function(){return me}),t.d(e,"parsePersonalSign",function(){return le}),t.d(e,"parseTransactionData",function(){return ye}),t.d(e,"sanitizeHex",function(){return A}),t.d(e,"addHexPrefix",function(){return P}),t.d(e,"removeHexPrefix",function(){return T}),t.d(e,"removeHexLeadingZeros",function(){return q}),t.d(e,"payloadId",function(){return Z}),t.d(e,"uuid",function(){return I}),t.d(e,"logDeprecationWarning",function(){return $}),t.d(e,"getInfuraRpcUrl",function(){return K}),t.d(e,"getRpcUrl",function(){return j}),t.d(e,"promisify",function(){return Se}),t.d(e,"formatRpcError",function(){return pe}),t.d(e,"isWalletConnectSession",function(){return Ee}),t.d(e,"parseWalletConnectUri",function(){return je}),t.d(e,"getQueryString",function(){return Le}),t.d(e,"appendToQueryString",function(){return _e}),t.d(e,"parseQueryString",function(){return Fe}),t.d(e,"formatQueryString",function(){return qe}),t.d(e,"isEmptyString",function(){return D}),t.d(e,"isEmptyArray",function(){return B}),t.d(e,"isBuffer",function(){return U}),t.d(e,"isTypedArray",function(){return J}),t.d(e,"isArrayBuffer",function(){return G}),t.d(e,"getType",function(){return W}),t.d(e,"getEncoding",function(){return Y}),t.d(e,"isHexString",function(){return ee}),t.d(e,"isJsonRpcSubscription",function(){return te}),t.d(e,"isJsonRpcRequest",function(){return oe}),t.d(e,"isJsonRpcResponseSuccess",function(){return fe}),t.d(e,"isJsonRpcResponseError",function(){return ne}),t.d(e,"isInternalEvent",function(){return ce}),t.d(e,"isReservedEvent",function(){return se}),t.d(e,"isSilentPayload",function(){return ae})},function(o,e,t){(function(n){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/var c=t(169),p=t(170),a=t(79);function f(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(B,U){if(f()<U)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(B=new Uint8Array(U)).__proto__=u.prototype:(B===null&&(B=new u(U)),B.length=U),B}function u(B,U,J){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(B,U,J);if(typeof B=="number"){if(typeof U=="string")throw new Error("If encoding is specified then the first argument must be a string");return b(this,B)}return h(this,B,U,J)}function h(B,U,J,G){if(typeof U=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&U instanceof ArrayBuffer?function(W,Y,ee,te){if(Y.byteLength,ee<0||Y.byteLength<ee)throw new RangeError("'offset' is out of bounds");if(Y.byteLength<ee+(te||0))throw new RangeError("'length' is out of bounds");return Y=ee===void 0&&te===void 0?new Uint8Array(Y):te===void 0?new Uint8Array(Y,ee):new Uint8Array(Y,ee,te),u.TYPED_ARRAY_SUPPORT?(W=Y).__proto__=u.prototype:W=y(W,Y),W}(B,U,J,G):typeof U=="string"?function(W,Y,ee){if(typeof ee=="string"&&ee!==""||(ee="utf8"),!u.isEncoding(ee))throw new TypeError('"encoding" must be a valid string encoding');var te=0|E(Y,ee),oe=(W=s(W,te)).write(Y,ee);return oe!==te&&(W=W.slice(0,oe)),W}(B,U,J):function(W,Y){if(u.isBuffer(Y)){var ee=0|_(Y.length);return(W=s(W,ee)).length===0||Y.copy(W,0,0,ee),W}if(Y){if(typeof ArrayBuffer!="undefined"&&Y.buffer instanceof ArrayBuffer||"length"in Y)return typeof Y.length!="number"||(te=Y.length)!=te?s(W,0):y(W,Y);if(Y.type==="Buffer"&&a(Y.data))return y(W,Y.data)}var te;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(B,U)}function v(B){if(typeof B!="number")throw new TypeError('"size" argument must be a number');if(B<0)throw new RangeError('"size" argument must not be negative')}function b(B,U){if(v(U),B=s(B,U<0?0:0|_(U)),!u.TYPED_ARRAY_SUPPORT)for(var J=0;J<U;++J)B[J]=0;return B}function y(B,U){var J=U.length<0?0:0|_(U.length);B=s(B,J);for(var G=0;G<J;G+=1)B[G]=255&U[G];return B}function _(B){if(B>=f())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f().toString(16)+" bytes");return 0|B}function E(B,U){if(u.isBuffer(B))return B.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(B)||B instanceof ArrayBuffer))return B.byteLength;typeof B!="string"&&(B=""+B);var J=B.length;if(J===0)return 0;for(var G=!1;;)switch(U){case"ascii":case"latin1":case"binary":return J;case"utf8":case"utf-8":case void 0:return K(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*J;case"hex":return J>>>1;case"base64":return j(B).length;default:if(G)return K(B).length;U=(""+U).toLowerCase(),G=!0}}function S(B,U,J){var G=!1;if((U===void 0||U<0)&&(U=0),U>this.length||((J===void 0||J>this.length)&&(J=this.length),J<=0)||(J>>>=0)<=(U>>>=0))return"";for(B||(B="utf8");;)switch(B){case"hex":return d(this,U,J);case"utf8":case"utf-8":return R(this,U,J);case"ascii":return l(this,U,J);case"latin1":case"binary":return x(this,U,J);case"base64":return z(this,U,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,U,J);default:if(G)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),G=!0}}function k(B,U,J){var G=B[U];B[U]=B[J],B[J]=G}function O(B,U,J,G,W){if(B.length===0)return-1;if(typeof J=="string"?(G=J,J=0):J>2147483647?J=2147483647:J<-2147483648&&(J=-2147483648),J=+J,isNaN(J)&&(J=W?0:B.length-1),J<0&&(J=B.length+J),J>=B.length){if(W)return-1;J=B.length-1}else if(J<0){if(!W)return-1;J=0}if(typeof U=="string"&&(U=u.from(U,G)),u.isBuffer(U))return U.length===0?-1:M(B,U,J,G,W);if(typeof U=="number")return U&=255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(B,U,J):Uint8Array.prototype.lastIndexOf.call(B,U,J):M(B,[U],J,G,W);throw new TypeError("val must be string, number or Buffer")}function M(B,U,J,G,W){var Y,ee=1,te=B.length,oe=U.length;if(G!==void 0&&((G=String(G).toLowerCase())==="ucs2"||G==="ucs-2"||G==="utf16le"||G==="utf-16le")){if(B.length<2||U.length<2)return-1;ee=2,te/=2,oe/=2,J/=2}function fe(ae,he){return ee===1?ae[he]:ae.readUInt16BE(he*ee)}if(W){var ne=-1;for(Y=J;Y<te;Y++)if(fe(B,Y)===fe(U,ne===-1?0:Y-ne)){if(ne===-1&&(ne=Y),Y-ne+1===oe)return ne*ee}else ne!==-1&&(Y-=Y-ne),ne=-1}else for(J+oe>te&&(J=te-oe),Y=J;Y>=0;Y--){for(var ce=!0,se=0;se<oe;se++)if(fe(B,Y+se)!==fe(U,se)){ce=!1;break}if(ce)return Y}return-1}function C(B,U,J,G){J=Number(J)||0;var W=B.length-J;G?(G=Number(G))>W&&(G=W):G=W;var Y=U.length;if(Y%2!=0)throw new TypeError("Invalid hex string");G>Y/2&&(G=Y/2);for(var ee=0;ee<G;++ee){var te=parseInt(U.substr(2*ee,2),16);if(isNaN(te))return ee;B[J+ee]=te}return ee}function N(B,U,J,G){return D(K(U,B.length-J),B,J,G)}function L(B,U,J,G){return D(function(W){for(var Y=[],ee=0;ee<W.length;++ee)Y.push(255&W.charCodeAt(ee));return Y}(U),B,J,G)}function F(B,U,J,G){return L(B,U,J,G)}function V(B,U,J,G){return D(j(U),B,J,G)}function H(B,U,J,G){return D(function(W,Y){for(var ee,te,oe,fe=[],ne=0;ne<W.length&&!((Y-=2)<0);++ne)ee=W.charCodeAt(ne),te=ee>>8,oe=ee%256,fe.push(oe),fe.push(te);return fe}(U,B.length-J),B,J,G)}function z(B,U,J){return U===0&&J===B.length?c.fromByteArray(B):c.fromByteArray(B.slice(U,J))}function R(B,U,J){J=Math.min(B.length,J);for(var G=[],W=U;W<J;){var Y,ee,te,oe,fe=B[W],ne=null,ce=fe>239?4:fe>223?3:fe>191?2:1;if(W+ce<=J)switch(ce){case 1:fe<128&&(ne=fe);break;case 2:(192&(Y=B[W+1]))==128&&(oe=(31&fe)<<6|63&Y)>127&&(ne=oe);break;case 3:Y=B[W+1],ee=B[W+2],(192&Y)==128&&(192&ee)==128&&(oe=(15&fe)<<12|(63&Y)<<6|63&ee)>2047&&(oe<55296||oe>57343)&&(ne=oe);break;case 4:Y=B[W+1],ee=B[W+2],te=B[W+3],(192&Y)==128&&(192&ee)==128&&(192&te)==128&&(oe=(15&fe)<<18|(63&Y)<<12|(63&ee)<<6|63&te)>65535&&oe<1114112&&(ne=oe)}ne===null?(ne=65533,ce=1):ne>65535&&(ne-=65536,G.push(ne>>>10&1023|55296),ne=56320|1023&ne),G.push(ne),W+=ce}return function(se){var ae=se.length;if(ae<=4096)return String.fromCharCode.apply(String,se);for(var he="",me=0;me<ae;)he+=String.fromCharCode.apply(String,se.slice(me,me+=4096));return he}(G)}e.Buffer=u,e.SlowBuffer=function(B){return+B!=B&&(B=0),u.alloc(+B)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=n.TYPED_ARRAY_SUPPORT!==void 0?n.TYPED_ARRAY_SUPPORT:function(){try{var B=new Uint8Array(1);return B.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},B.foo()===42&&typeof B.subarray=="function"&&B.subarray(1,1).byteLength===0}catch{return!1}}(),e.kMaxLength=f(),u.poolSize=8192,u._augment=function(B){return B.__proto__=u.prototype,B},u.from=function(B,U,J){return h(null,B,U,J)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(B,U,J){return function(G,W,Y,ee){return v(W),W<=0?s(G,W):Y!==void 0?typeof ee=="string"?s(G,W).fill(Y,ee):s(G,W).fill(Y):s(G,W)}(null,B,U,J)},u.allocUnsafe=function(B){return b(null,B)},u.allocUnsafeSlow=function(B){return b(null,B)},u.isBuffer=function(B){return!(B==null||!B._isBuffer)},u.compare=function(B,U){if(!u.isBuffer(B)||!u.isBuffer(U))throw new TypeError("Arguments must be Buffers");if(B===U)return 0;for(var J=B.length,G=U.length,W=0,Y=Math.min(J,G);W<Y;++W)if(B[W]!==U[W]){J=B[W],G=U[W];break}return J<G?-1:G<J?1:0},u.isEncoding=function(B){switch(String(B).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}},u.concat=function(B,U){if(!a(B))throw new TypeError('"list" argument must be an Array of Buffers');if(B.length===0)return u.alloc(0);var J;if(U===void 0)for(U=0,J=0;J<B.length;++J)U+=B[J].length;var G=u.allocUnsafe(U),W=0;for(J=0;J<B.length;++J){var Y=B[J];if(!u.isBuffer(Y))throw new TypeError('"list" argument must be an Array of Buffers');Y.copy(G,W),W+=Y.length}return G},u.byteLength=E,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var B=this.length;if(B%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var U=0;U<B;U+=2)k(this,U,U+1);return this},u.prototype.swap32=function(){var B=this.length;if(B%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var U=0;U<B;U+=4)k(this,U,U+3),k(this,U+1,U+2);return this},u.prototype.swap64=function(){var B=this.length;if(B%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var U=0;U<B;U+=8)k(this,U,U+7),k(this,U+1,U+6),k(this,U+2,U+5),k(this,U+3,U+4);return this},u.prototype.toString=function(){var B=0|this.length;return B===0?"":arguments.length===0?R(this,0,B):S.apply(this,arguments)},u.prototype.equals=function(B){if(!u.isBuffer(B))throw new TypeError("Argument must be a Buffer");return this===B||u.compare(this,B)===0},u.prototype.inspect=function(){var B="",U=e.INSPECT_MAX_BYTES;return this.length>0&&(B=this.toString("hex",0,U).match(/.{2}/g).join(" "),this.length>U&&(B+=" ... ")),"<Buffer "+B+">"},u.prototype.compare=function(B,U,J,G,W){if(!u.isBuffer(B))throw new TypeError("Argument must be a Buffer");if(U===void 0&&(U=0),J===void 0&&(J=B?B.length:0),G===void 0&&(G=0),W===void 0&&(W=this.length),U<0||J>B.length||G<0||W>this.length)throw new RangeError("out of range index");if(G>=W&&U>=J)return 0;if(G>=W)return-1;if(U>=J)return 1;if(this===B)return 0;for(var Y=(W>>>=0)-(G>>>=0),ee=(J>>>=0)-(U>>>=0),te=Math.min(Y,ee),oe=this.slice(G,W),fe=B.slice(U,J),ne=0;ne<te;++ne)if(oe[ne]!==fe[ne]){Y=oe[ne],ee=fe[ne];break}return Y<ee?-1:ee<Y?1:0},u.prototype.includes=function(B,U,J){return this.indexOf(B,U,J)!==-1},u.prototype.indexOf=function(B,U,J){return O(this,B,U,J,!0)},u.prototype.lastIndexOf=function(B,U,J){return O(this,B,U,J,!1)},u.prototype.write=function(B,U,J,G){if(U===void 0)G="utf8",J=this.length,U=0;else if(J===void 0&&typeof U=="string")G=U,J=this.length,U=0;else{if(!isFinite(U))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");U|=0,isFinite(J)?(J|=0,G===void 0&&(G="utf8")):(G=J,J=void 0)}var W=this.length-U;if((J===void 0||J>W)&&(J=W),B.length>0&&(J<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");G||(G="utf8");for(var Y=!1;;)switch(G){case"hex":return C(this,B,U,J);case"utf8":case"utf-8":return N(this,B,U,J);case"ascii":return L(this,B,U,J);case"latin1":case"binary":return F(this,B,U,J);case"base64":return V(this,B,U,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,B,U,J);default:if(Y)throw new TypeError("Unknown encoding: "+G);G=(""+G).toLowerCase(),Y=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function l(B,U,J){var G="";J=Math.min(B.length,J);for(var W=U;W<J;++W)G+=String.fromCharCode(127&B[W]);return G}function x(B,U,J){var G="";J=Math.min(B.length,J);for(var W=U;W<J;++W)G+=String.fromCharCode(B[W]);return G}function d(B,U,J){var G=B.length;(!U||U<0)&&(U=0),(!J||J<0||J>G)&&(J=G);for(var W="",Y=U;Y<J;++Y)W+=$(B[Y]);return W}function m(B,U,J){for(var G=B.slice(U,J),W="",Y=0;Y<G.length;Y+=2)W+=String.fromCharCode(G[Y]+256*G[Y+1]);return W}function g(B,U,J){if(B%1!=0||B<0)throw new RangeError("offset is not uint");if(B+U>J)throw new RangeError("Trying to access beyond buffer length")}function w(B,U,J,G,W,Y){if(!u.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>W||U<Y)throw new RangeError('"value" argument is out of bounds');if(J+G>B.length)throw new RangeError("Index out of range")}function A(B,U,J,G){U<0&&(U=65535+U+1);for(var W=0,Y=Math.min(B.length-J,2);W<Y;++W)B[J+W]=(U&255<<8*(G?W:1-W))>>>8*(G?W:1-W)}function P(B,U,J,G){U<0&&(U=4294967295+U+1);for(var W=0,Y=Math.min(B.length-J,4);W<Y;++W)B[J+W]=U>>>8*(G?W:3-W)&255}function T(B,U,J,G,W,Y){if(J+G>B.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("Index out of range")}function q(B,U,J,G,W){return W||T(B,0,J,4),p.write(B,U,J,G,23,4),J+4}function Z(B,U,J,G,W){return W||T(B,0,J,8),p.write(B,U,J,G,52,8),J+8}u.prototype.slice=function(B,U){var J,G=this.length;if((B=~~B)<0?(B+=G)<0&&(B=0):B>G&&(B=G),(U=U===void 0?G:~~U)<0?(U+=G)<0&&(U=0):U>G&&(U=G),U<B&&(U=B),u.TYPED_ARRAY_SUPPORT)(J=this.subarray(B,U)).__proto__=u.prototype;else{var W=U-B;J=new u(W,void 0);for(var Y=0;Y<W;++Y)J[Y]=this[Y+B]}return J},u.prototype.readUIntLE=function(B,U,J){B|=0,U|=0,J||g(B,U,this.length);for(var G=this[B],W=1,Y=0;++Y<U&&(W*=256);)G+=this[B+Y]*W;return G},u.prototype.readUIntBE=function(B,U,J){B|=0,U|=0,J||g(B,U,this.length);for(var G=this[B+--U],W=1;U>0&&(W*=256);)G+=this[B+--U]*W;return G},u.prototype.readUInt8=function(B,U){return U||g(B,1,this.length),this[B]},u.prototype.readUInt16LE=function(B,U){return U||g(B,2,this.length),this[B]|this[B+1]<<8},u.prototype.readUInt16BE=function(B,U){return U||g(B,2,this.length),this[B]<<8|this[B+1]},u.prototype.readUInt32LE=function(B,U){return U||g(B,4,this.length),(this[B]|this[B+1]<<8|this[B+2]<<16)+16777216*this[B+3]},u.prototype.readUInt32BE=function(B,U){return U||g(B,4,this.length),16777216*this[B]+(this[B+1]<<16|this[B+2]<<8|this[B+3])},u.prototype.readIntLE=function(B,U,J){B|=0,U|=0,J||g(B,U,this.length);for(var G=this[B],W=1,Y=0;++Y<U&&(W*=256);)G+=this[B+Y]*W;return G>=(W*=128)&&(G-=Math.pow(2,8*U)),G},u.prototype.readIntBE=function(B,U,J){B|=0,U|=0,J||g(B,U,this.length);for(var G=U,W=1,Y=this[B+--G];G>0&&(W*=256);)Y+=this[B+--G]*W;return Y>=(W*=128)&&(Y-=Math.pow(2,8*U)),Y},u.prototype.readInt8=function(B,U){return U||g(B,1,this.length),128&this[B]?-1*(255-this[B]+1):this[B]},u.prototype.readInt16LE=function(B,U){U||g(B,2,this.length);var J=this[B]|this[B+1]<<8;return 32768&J?4294901760|J:J},u.prototype.readInt16BE=function(B,U){U||g(B,2,this.length);var J=this[B+1]|this[B]<<8;return 32768&J?4294901760|J:J},u.prototype.readInt32LE=function(B,U){return U||g(B,4,this.length),this[B]|this[B+1]<<8|this[B+2]<<16|this[B+3]<<24},u.prototype.readInt32BE=function(B,U){return U||g(B,4,this.length),this[B]<<24|this[B+1]<<16|this[B+2]<<8|this[B+3]},u.prototype.readFloatLE=function(B,U){return U||g(B,4,this.length),p.read(this,B,!0,23,4)},u.prototype.readFloatBE=function(B,U){return U||g(B,4,this.length),p.read(this,B,!1,23,4)},u.prototype.readDoubleLE=function(B,U){return U||g(B,8,this.length),p.read(this,B,!0,52,8)},u.prototype.readDoubleBE=function(B,U){return U||g(B,8,this.length),p.read(this,B,!1,52,8)},u.prototype.writeUIntLE=function(B,U,J,G){B=+B,U|=0,J|=0,G||w(this,B,U,J,Math.pow(2,8*J)-1,0);var W=1,Y=0;for(this[U]=255&B;++Y<J&&(W*=256);)this[U+Y]=B/W&255;return U+J},u.prototype.writeUIntBE=function(B,U,J,G){B=+B,U|=0,J|=0,G||w(this,B,U,J,Math.pow(2,8*J)-1,0);var W=J-1,Y=1;for(this[U+W]=255&B;--W>=0&&(Y*=256);)this[U+W]=B/Y&255;return U+J},u.prototype.writeUInt8=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,1,255,0),u.TYPED_ARRAY_SUPPORT||(B=Math.floor(B)),this[U]=255&B,U+1},u.prototype.writeUInt16LE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[U]=255&B,this[U+1]=B>>>8):A(this,B,U,!0),U+2},u.prototype.writeUInt16BE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[U]=B>>>8,this[U+1]=255&B):A(this,B,U,!1),U+2},u.prototype.writeUInt32LE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[U+3]=B>>>24,this[U+2]=B>>>16,this[U+1]=B>>>8,this[U]=255&B):P(this,B,U,!0),U+4},u.prototype.writeUInt32BE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[U]=B>>>24,this[U+1]=B>>>16,this[U+2]=B>>>8,this[U+3]=255&B):P(this,B,U,!1),U+4},u.prototype.writeIntLE=function(B,U,J,G){if(B=+B,U|=0,!G){var W=Math.pow(2,8*J-1);w(this,B,U,J,W-1,-W)}var Y=0,ee=1,te=0;for(this[U]=255&B;++Y<J&&(ee*=256);)B<0&&te===0&&this[U+Y-1]!==0&&(te=1),this[U+Y]=(B/ee>>0)-te&255;return U+J},u.prototype.writeIntBE=function(B,U,J,G){if(B=+B,U|=0,!G){var W=Math.pow(2,8*J-1);w(this,B,U,J,W-1,-W)}var Y=J-1,ee=1,te=0;for(this[U+Y]=255&B;--Y>=0&&(ee*=256);)B<0&&te===0&&this[U+Y+1]!==0&&(te=1),this[U+Y]=(B/ee>>0)-te&255;return U+J},u.prototype.writeInt8=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,1,127,-128),u.TYPED_ARRAY_SUPPORT||(B=Math.floor(B)),B<0&&(B=255+B+1),this[U]=255&B,U+1},u.prototype.writeInt16LE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[U]=255&B,this[U+1]=B>>>8):A(this,B,U,!0),U+2},u.prototype.writeInt16BE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[U]=B>>>8,this[U+1]=255&B):A(this,B,U,!1),U+2},u.prototype.writeInt32LE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[U]=255&B,this[U+1]=B>>>8,this[U+2]=B>>>16,this[U+3]=B>>>24):P(this,B,U,!0),U+4},u.prototype.writeInt32BE=function(B,U,J){return B=+B,U|=0,J||w(this,B,U,4,2147483647,-2147483648),B<0&&(B=4294967295+B+1),u.TYPED_ARRAY_SUPPORT?(this[U]=B>>>24,this[U+1]=B>>>16,this[U+2]=B>>>8,this[U+3]=255&B):P(this,B,U,!1),U+4},u.prototype.writeFloatLE=function(B,U,J){return q(this,B,U,!0,J)},u.prototype.writeFloatBE=function(B,U,J){return q(this,B,U,!1,J)},u.prototype.writeDoubleLE=function(B,U,J){return Z(this,B,U,!0,J)},u.prototype.writeDoubleBE=function(B,U,J){return Z(this,B,U,!1,J)},u.prototype.copy=function(B,U,J,G){if(J||(J=0),G||G===0||(G=this.length),U>=B.length&&(U=B.length),U||(U=0),G>0&&G<J&&(G=J),G===J||B.length===0||this.length===0)return 0;if(U<0)throw new RangeError("targetStart out of bounds");if(J<0||J>=this.length)throw new RangeError("sourceStart out of bounds");if(G<0)throw new RangeError("sourceEnd out of bounds");G>this.length&&(G=this.length),B.length-U<G-J&&(G=B.length-U+J);var W,Y=G-J;if(this===B&&J<U&&U<G)for(W=Y-1;W>=0;--W)B[W+U]=this[W+J];else if(Y<1e3||!u.TYPED_ARRAY_SUPPORT)for(W=0;W<Y;++W)B[W+U]=this[W+J];else Uint8Array.prototype.set.call(B,this.subarray(J,J+Y),U);return Y},u.prototype.fill=function(B,U,J,G){if(typeof B=="string"){if(typeof U=="string"?(G=U,U=0,J=this.length):typeof J=="string"&&(G=J,J=this.length),B.length===1){var W=B.charCodeAt(0);W<256&&(B=W)}if(G!==void 0&&typeof G!="string")throw new TypeError("encoding must be a string");if(typeof G=="string"&&!u.isEncoding(G))throw new TypeError("Unknown encoding: "+G)}else typeof B=="number"&&(B&=255);if(U<0||this.length<U||this.length<J)throw new RangeError("Out of range index");if(J<=U)return this;var Y;if(U>>>=0,J=J===void 0?this.length:J>>>0,B||(B=0),typeof B=="number")for(Y=U;Y<J;++Y)this[Y]=B;else{var ee=u.isBuffer(B)?B:K(new u(B,G).toString()),te=ee.length;for(Y=0;Y<J-U;++Y)this[Y+U]=ee[Y%te]}return this};var I=/[^+\/0-9A-Za-z-_]/g;function $(B){return B<16?"0"+B.toString(16):B.toString(16)}function K(B,U){var J;U=U||1/0;for(var G=B.length,W=null,Y=[],ee=0;ee<G;++ee){if((J=B.charCodeAt(ee))>55295&&J<57344){if(!W){if(J>56319){(U-=3)>-1&&Y.push(239,191,189);continue}if(ee+1===G){(U-=3)>-1&&Y.push(239,191,189);continue}W=J;continue}if(J<56320){(U-=3)>-1&&Y.push(239,191,189),W=J;continue}J=65536+(W-55296<<10|J-56320)}else W&&(U-=3)>-1&&Y.push(239,191,189);if(W=null,J<128){if((U-=1)<0)break;Y.push(J)}else if(J<2048){if((U-=2)<0)break;Y.push(J>>6|192,63&J|128)}else if(J<65536){if((U-=3)<0)break;Y.push(J>>12|224,J>>6&63|128,63&J|128)}else{if(!(J<1114112))throw new Error("Invalid code point");if((U-=4)<0)break;Y.push(J>>18|240,J>>12&63|128,J>>6&63|128,63&J|128)}}return Y}function j(B){return c.toByteArray(function(U){if((U=function(J){return J.trim?J.trim():J.replace(/^\s+|\s+$/g,"")}(U).replace(I,"")).length<2)return"";for(;U.length%4!=0;)U+="=";return U}(B))}function D(B,U,J,G){for(var W=0;W<G&&!(W+J>=U.length||W>=B.length);++W)U[W+J]=B[W];return W}}).call(this,t(6))},function(o,e){typeof Object.create=="function"?o.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function(t,n){if(n){t.super_=n;var c=function(){};c.prototype=n.prototype,t.prototype=new c,t.prototype.constructor=t}}},function(o,e,t){t.d(e,"b",function(){return 256}),t.d(e,"g",function(){return 256}),t.d(e,"a",function(){return"AES-CBC"}),t.d(e,"f",function(){return"SHA-256"}),t.d(e,"e",function(){return"HMAC"}),t.d(e,"i",function(){return"SHA-256"}),t.d(e,"j",function(){return"SHA-512"}),t.d(e,"h",function(){return 512}),t.d(e,"d",function(){return"encrypt"}),t.d(e,"c",function(){return"decrypt"}),t.d(e,"k",function(){return"sign"}),t.d(e,"l",function(){return"verify"})},function(o,e){var t,n,c=o.exports={};function p(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function f(S){if(t===setTimeout)return setTimeout(S,0);if((t===p||!t)&&setTimeout)return t=setTimeout,setTimeout(S,0);try{return t(S,0)}catch{try{return t.call(null,S,0)}catch{return t.call(this,S,0)}}}(function(){try{t=typeof setTimeout=="function"?setTimeout:p}catch{t=p}try{n=typeof clearTimeout=="function"?clearTimeout:a}catch{n=a}})();var s,u=[],h=!1,v=-1;function b(){h&&s&&(h=!1,s.length?u=s.concat(u):v=-1,u.length&&y())}function y(){if(!h){var S=f(b);h=!0;for(var k=u.length;k;){for(s=u,u=[];++v<k;)s&&s[v].run();v=-1,k=u.length}s=null,h=!1,function(O){if(n===clearTimeout)return clearTimeout(O);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(O);try{n(O)}catch{try{return n.call(null,O)}catch{return n.call(this,O)}}}(S)}}function _(S,k){this.fun=S,this.array=k}function E(){}c.nextTick=function(S){var k=new Array(arguments.length-1);if(arguments.length>1)for(var O=1;O<arguments.length;O++)k[O-1]=arguments[O];u.push(new _(S,k)),u.length!==1||h||f(y)},_.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=E,c.addListener=E,c.once=E,c.off=E,c.removeListener=E,c.removeAllListeners=E,c.emit=E,c.prependListener=E,c.prependOnceListener=E,c.listeners=function(S){return[]},c.binding=function(S){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(S){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},function(o,e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch{typeof window=="object"&&(t=window)}o.exports=t},function(o,e,t){t.d(e,"a",function(){return n}),t.d(e,"c",function(){return c}),t.d(e,"b",function(){return p}),t.d(e,"d",function(){return a}),t.d(e,"e",function(){return f});const n="INTERNAL_ERROR",c="SERVER_ERROR",p=[-32700,-32600,-32601,-32602,-32603],a=[-32e3,-32099],f={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[n]:{code:-32603,message:"Internal error"},[c]:{code:-32e3,message:"Server error"}}},function(o,e,t){var n=this&&this.__createBinding||(Object.create?function(p,a,f,s){s===void 0&&(s=f),Object.defineProperty(p,s,{enumerable:!0,get:function(){return a[f]}})}:function(p,a,f,s){s===void 0&&(s=f),p[s]=a[f]}),c=this&&this.__exportStar||function(p,a){for(var f in p)f==="default"||a.hasOwnProperty(f)||n(a,p,f)};Object.defineProperty(e,"__esModule",{value:!0}),c(t(172),e),c(t(173),e)},function(o,e,t){(function(n){(function(c,p){function a(R,l){if(!R)throw new Error(l||"Assertion failed")}function f(R,l){R.super_=l;var x=function(){};x.prototype=l.prototype,R.prototype=new x,R.prototype.constructor=R}function s(R,l,x){if(s.isBN(R))return R;this.negative=0,this.words=null,this.length=0,this.red=null,R!==null&&(l!=="le"&&l!=="be"||(x=l,l=10),this._init(R||0,l||10,x||"be"))}var u;typeof c=="object"?c.exports=s:p.BN=s,s.BN=s,s.wordSize=26;try{u=t(168).Buffer}catch{}function h(R,l,x){for(var d=0,m=Math.min(R.length,x),g=l;g<m;g++){var w=R.charCodeAt(g)-48;d<<=4,d|=w>=49&&w<=54?w-49+10:w>=17&&w<=22?w-17+10:15&w}return d}function v(R,l,x,d){for(var m=0,g=Math.min(R.length,x),w=l;w<g;w++){var A=R.charCodeAt(w)-48;m*=d,m+=A>=49?A-49+10:A>=17?A-17+10:A}return m}s.isBN=function(R){return R instanceof s||R!==null&&typeof R=="object"&&R.constructor.wordSize===s.wordSize&&Array.isArray(R.words)},s.max=function(R,l){return R.cmp(l)>0?R:l},s.min=function(R,l){return R.cmp(l)<0?R:l},s.prototype._init=function(R,l,x){if(typeof R=="number")return this._initNumber(R,l,x);if(typeof R=="object")return this._initArray(R,l,x);l==="hex"&&(l=16),a(l===(0|l)&&l>=2&&l<=36);var d=0;(R=R.toString().replace(/\s+/g,""))[0]==="-"&&d++,l===16?this._parseHex(R,d):this._parseBase(R,l,d),R[0]==="-"&&(this.negative=1),this.strip(),x==="le"&&this._initArray(this.toArray(),l,x)},s.prototype._initNumber=function(R,l,x){R<0&&(this.negative=1,R=-R),R<67108864?(this.words=[67108863&R],this.length=1):R<4503599627370496?(this.words=[67108863&R,R/67108864&67108863],this.length=2):(a(R<9007199254740992),this.words=[67108863&R,R/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),l,x)},s.prototype._initArray=function(R,l,x){if(a(typeof R.length=="number"),R.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(R.length/3),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var m,g,w=0;if(x==="be")for(d=R.length-1,m=0;d>=0;d-=3)g=R[d]|R[d-1]<<8|R[d-2]<<16,this.words[m]|=g<<w&67108863,this.words[m+1]=g>>>26-w&67108863,(w+=24)>=26&&(w-=26,m++);else if(x==="le")for(d=0,m=0;d<R.length;d+=3)g=R[d]|R[d+1]<<8|R[d+2]<<16,this.words[m]|=g<<w&67108863,this.words[m+1]=g>>>26-w&67108863,(w+=24)>=26&&(w-=26,m++);return this.strip()},s.prototype._parseHex=function(R,l){this.length=Math.ceil((R.length-l)/6),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var d,m,g=0;for(x=R.length-6,d=0;x>=l;x-=6)m=h(R,x,x+6),this.words[d]|=m<<g&67108863,this.words[d+1]|=m>>>26-g&4194303,(g+=24)>=26&&(g-=26,d++);x+6!==l&&(m=h(R,l,x+6),this.words[d]|=m<<g&67108863,this.words[d+1]|=m>>>26-g&4194303),this.strip()},s.prototype._parseBase=function(R,l,x){this.words=[0],this.length=1;for(var d=0,m=1;m<=67108863;m*=l)d++;d--,m=m/l|0;for(var g=R.length-x,w=g%d,A=Math.min(g,g-w)+x,P=0,T=x;T<A;T+=d)P=v(R,T,T+d,l),this.imuln(m),this.words[0]+P<67108864?this.words[0]+=P:this._iaddn(P);if(w!==0){var q=1;for(P=v(R,T,R.length,l),T=0;T<w;T++)q*=l;this.imuln(q),this.words[0]+P<67108864?this.words[0]+=P:this._iaddn(P)}},s.prototype.copy=function(R){R.words=new Array(this.length);for(var l=0;l<this.length;l++)R.words[l]=this.words[l];R.length=this.length,R.negative=this.negative,R.red=this.red},s.prototype.clone=function(){var R=new s(null);return this.copy(R),R},s.prototype._expand=function(R){for(;this.length<R;)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},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[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],_=[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];function E(R,l,x){x.negative=l.negative^R.negative;var d=R.length+l.length|0;x.length=d,d=d-1|0;var m=0|R.words[0],g=0|l.words[0],w=m*g,A=67108863&w,P=w/67108864|0;x.words[0]=A;for(var T=1;T<d;T++){for(var q=P>>>26,Z=67108863&P,I=Math.min(T,l.length-1),$=Math.max(0,T-R.length+1);$<=I;$++){var K=T-$|0;q+=(w=(m=0|R.words[K])*(g=0|l.words[$])+Z)/67108864|0,Z=67108863&w}x.words[T]=0|Z,P=0|q}return P!==0?x.words[T]=0|P:x.length--,x.strip()}s.prototype.toString=function(R,l){var x;if(l=0|l||1,(R=R||10)===16||R==="hex"){x="";for(var d=0,m=0,g=0;g<this.length;g++){var w=this.words[g],A=(16777215&(w<<d|m)).toString(16);x=(m=w>>>24-d&16777215)!==0||g!==this.length-1?b[6-A.length]+A+x:A+x,(d+=2)>=26&&(d-=26,g--)}for(m!==0&&(x=m.toString(16)+x);x.length%l!=0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(R===(0|R)&&R>=2&&R<=36){var P=y[R],T=_[R];x="";var q=this.clone();for(q.negative=0;!q.isZero();){var Z=q.modn(T).toString(R);x=(q=q.idivn(T)).isZero()?Z+x:b[P-Z.length]+Z+x}for(this.isZero()&&(x="0"+x);x.length%l!=0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}a(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var R=this.words[0];return this.length===2?R+=67108864*this.words[1]:this.length===3&&this.words[2]===1?R+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-R:R},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(R,l){return a(u!==void 0),this.toArrayLike(u,R,l)},s.prototype.toArray=function(R,l){return this.toArrayLike(Array,R,l)},s.prototype.toArrayLike=function(R,l,x){var d=this.byteLength(),m=x||Math.max(1,d);a(d<=m,"byte array longer than desired length"),a(m>0,"Requested array length <= 0"),this.strip();var g,w,A=l==="le",P=new R(m),T=this.clone();if(A){for(w=0;!T.isZero();w++)g=T.andln(255),T.iushrn(8),P[w]=g;for(;w<m;w++)P[w]=0}else{for(w=0;w<m-d;w++)P[w]=0;for(w=0;!T.isZero();w++)g=T.andln(255),T.iushrn(8),P[m-w-1]=g}return P},Math.clz32?s.prototype._countBits=function(R){return 32-Math.clz32(R)}:s.prototype._countBits=function(R){var l=R,x=0;return l>=4096&&(x+=13,l>>>=13),l>=64&&(x+=7,l>>>=7),l>=8&&(x+=4,l>>>=4),l>=2&&(x+=2,l>>>=2),x+l},s.prototype._zeroBits=function(R){if(R===0)return 26;var l=R,x=0;return(8191&l)==0&&(x+=13,l>>>=13),(127&l)==0&&(x+=7,l>>>=7),(15&l)==0&&(x+=4,l>>>=4),(3&l)==0&&(x+=2,l>>>=2),(1&l)==0&&x++,x},s.prototype.bitLength=function(){var R=this.words[this.length-1],l=this._countBits(R);return 26*(this.length-1)+l},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var R=0,l=0;l<this.length;l++){var x=this._zeroBits(this.words[l]);if(R+=x,x!==26)break}return R},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(R){return this.negative!==0?this.abs().inotn(R).iaddn(1):this.clone()},s.prototype.fromTwos=function(R){return this.testn(R-1)?this.notn(R).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(R){for(;this.length<R.length;)this.words[this.length++]=0;for(var l=0;l<R.length;l++)this.words[l]=this.words[l]|R.words[l];return this.strip()},s.prototype.ior=function(R){return a((this.negative|R.negative)==0),this.iuor(R)},s.prototype.or=function(R){return this.length>R.length?this.clone().ior(R):R.clone().ior(this)},s.prototype.uor=function(R){return this.length>R.length?this.clone().iuor(R):R.clone().iuor(this)},s.prototype.iuand=function(R){var l;l=this.length>R.length?R:this;for(var x=0;x<l.length;x++)this.words[x]=this.words[x]&R.words[x];return this.length=l.length,this.strip()},s.prototype.iand=function(R){return a((this.negative|R.negative)==0),this.iuand(R)},s.prototype.and=function(R){return this.length>R.length?this.clone().iand(R):R.clone().iand(this)},s.prototype.uand=function(R){return this.length>R.length?this.clone().iuand(R):R.clone().iuand(this)},s.prototype.iuxor=function(R){var l,x;this.length>R.length?(l=this,x=R):(l=R,x=this);for(var d=0;d<x.length;d++)this.words[d]=l.words[d]^x.words[d];if(this!==l)for(;d<l.length;d++)this.words[d]=l.words[d];return this.length=l.length,this.strip()},s.prototype.ixor=function(R){return a((this.negative|R.negative)==0),this.iuxor(R)},s.prototype.xor=function(R){return this.length>R.length?this.clone().ixor(R):R.clone().ixor(this)},s.prototype.uxor=function(R){return this.length>R.length?this.clone().iuxor(R):R.clone().iuxor(this)},s.prototype.inotn=function(R){a(typeof R=="number"&&R>=0);var l=0|Math.ceil(R/26),x=R%26;this._expand(l),x>0&&l--;for(var d=0;d<l;d++)this.words[d]=67108863&~this.words[d];return x>0&&(this.words[d]=~this.words[d]&67108863>>26-x),this.strip()},s.prototype.notn=function(R){return this.clone().inotn(R)},s.prototype.setn=function(R,l){a(typeof R=="number"&&R>=0);var x=R/26|0,d=R%26;return this._expand(x+1),this.words[x]=l?this.words[x]|1<<d:this.words[x]&~(1<<d),this.strip()},s.prototype.iadd=function(R){var l,x,d;if(this.negative!==0&&R.negative===0)return this.negative=0,l=this.isub(R),this.negative^=1,this._normSign();if(this.negative===0&&R.negative!==0)return R.negative=0,l=this.isub(R),R.negative=1,l._normSign();this.length>R.length?(x=this,d=R):(x=R,d=this);for(var m=0,g=0;g<d.length;g++)l=(0|x.words[g])+(0|d.words[g])+m,this.words[g]=67108863&l,m=l>>>26;for(;m!==0&&g<x.length;g++)l=(0|x.words[g])+m,this.words[g]=67108863&l,m=l>>>26;if(this.length=x.length,m!==0)this.words[this.length]=m,this.length++;else if(x!==this)for(;g<x.length;g++)this.words[g]=x.words[g];return this},s.prototype.add=function(R){var l;return R.negative!==0&&this.negative===0?(R.negative=0,l=this.sub(R),R.negative^=1,l):R.negative===0&&this.negative!==0?(this.negative=0,l=R.sub(this),this.negative=1,l):this.length>R.length?this.clone().iadd(R):R.clone().iadd(this)},s.prototype.isub=function(R){if(R.negative!==0){R.negative=0;var l=this.iadd(R);return R.negative=1,l._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(R),this.negative=1,this._normSign();var x,d,m=this.cmp(R);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;m>0?(x=this,d=R):(x=R,d=this);for(var g=0,w=0;w<d.length;w++)g=(l=(0|x.words[w])-(0|d.words[w])+g)>>26,this.words[w]=67108863&l;for(;g!==0&&w<x.length;w++)g=(l=(0|x.words[w])+g)>>26,this.words[w]=67108863&l;if(g===0&&w<x.length&&x!==this)for(;w<x.length;w++)this.words[w]=x.words[w];return this.length=Math.max(this.length,w),x!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(R){return this.clone().isub(R)};var S=function(R,l,x){var d,m,g,w=R.words,A=l.words,P=x.words,T=0,q=0|w[0],Z=8191&q,I=q>>>13,$=0|w[1],K=8191&$,j=$>>>13,D=0|w[2],B=8191&D,U=D>>>13,J=0|w[3],G=8191&J,W=J>>>13,Y=0|w[4],ee=8191&Y,te=Y>>>13,oe=0|w[5],fe=8191&oe,ne=oe>>>13,ce=0|w[6],se=8191&ce,ae=ce>>>13,he=0|w[7],me=8191&he,le=he>>>13,ye=0|w[8],Se=8191&ye,pe=ye>>>13,Oe=0|w[9],Le=8191&Oe,_e=Oe>>>13,Fe=0|A[0],qe=8191&Fe,Ee=Fe>>>13,je=0|A[1],ie=8191&je,de=je>>>13,ke=0|A[2],Be=8191&ke,ge=ke>>>13,Ue=0|A[3],De=8191&Ue,we=Ue>>>13,Ve=0|A[4],et=8191&Ve,Ie=Ve>>>13,Ge=0|A[5],Je=8191&Ge,Re=Ge>>>13,He=0|A[6],tt=8191&He,Te=He>>>13,We=0|A[7],Ze=8191&We,Pe=We>>>13,rt=0|A[8],Ye=8191&rt,Ae=rt>>>13,Xe=0|A[9],Qe=8191&Xe,Ce=Xe>>>13;x.negative=R.negative^l.negative,x.length=19;var Ke=(T+(d=Math.imul(Z,qe))|0)+((8191&(m=(m=Math.imul(Z,Ee))+Math.imul(I,qe)|0))<<13)|0;T=((g=Math.imul(I,Ee))+(m>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,d=Math.imul(K,qe),m=(m=Math.imul(K,Ee))+Math.imul(j,qe)|0,g=Math.imul(j,Ee);var X=(T+(d=d+Math.imul(Z,ie)|0)|0)+((8191&(m=(m=m+Math.imul(Z,de)|0)+Math.imul(I,ie)|0))<<13)|0;T=((g=g+Math.imul(I,de)|0)+(m>>>13)|0)+(X>>>26)|0,X&=67108863,d=Math.imul(B,qe),m=(m=Math.imul(B,Ee))+Math.imul(U,qe)|0,g=Math.imul(U,Ee),d=d+Math.imul(K,ie)|0,m=(m=m+Math.imul(K,de)|0)+Math.imul(j,ie)|0,g=g+Math.imul(j,de)|0;var Q=(T+(d=d+Math.imul(Z,Be)|0)|0)+((8191&(m=(m=m+Math.imul(Z,ge)|0)+Math.imul(I,Be)|0))<<13)|0;T=((g=g+Math.imul(I,ge)|0)+(m>>>13)|0)+(Q>>>26)|0,Q&=67108863,d=Math.imul(G,qe),m=(m=Math.imul(G,Ee))+Math.imul(W,qe)|0,g=Math.imul(W,Ee),d=d+Math.imul(B,ie)|0,m=(m=m+Math.imul(B,de)|0)+Math.imul(U,ie)|0,g=g+Math.imul(U,de)|0,d=d+Math.imul(K,Be)|0,m=(m=m+Math.imul(K,ge)|0)+Math.imul(j,Be)|0,g=g+Math.imul(j,ge)|0;var re=(T+(d=d+Math.imul(Z,De)|0)|0)+((8191&(m=(m=m+Math.imul(Z,we)|0)+Math.imul(I,De)|0))<<13)|0;T=((g=g+Math.imul(I,we)|0)+(m>>>13)|0)+(re>>>26)|0,re&=67108863,d=Math.imul(ee,qe),m=(m=Math.imul(ee,Ee))+Math.imul(te,qe)|0,g=Math.imul(te,Ee),d=d+Math.imul(G,ie)|0,m=(m=m+Math.imul(G,de)|0)+Math.imul(W,ie)|0,g=g+Math.imul(W,de)|0,d=d+Math.imul(B,Be)|0,m=(m=m+Math.imul(B,ge)|0)+Math.imul(U,Be)|0,g=g+Math.imul(U,ge)|0,d=d+Math.imul(K,De)|0,m=(m=m+Math.imul(K,we)|0)+Math.imul(j,De)|0,g=g+Math.imul(j,we)|0;var ue=(T+(d=d+Math.imul(Z,et)|0)|0)+((8191&(m=(m=m+Math.imul(Z,Ie)|0)+Math.imul(I,et)|0))<<13)|0;T=((g=g+Math.imul(I,Ie)|0)+(m>>>13)|0)+(ue>>>26)|0,ue&=67108863,d=Math.imul(fe,qe),m=(m=Math.imul(fe,Ee))+Math.imul(ne,qe)|0,g=Math.imul(ne,Ee),d=d+Math.imul(ee,ie)|0,m=(m=m+Math.imul(ee,de)|0)+Math.imul(te,ie)|0,g=g+Math.imul(te,de)|0,d=d+Math.imul(G,Be)|0,m=(m=m+Math.imul(G,ge)|0)+Math.imul(W,Be)|0,g=g+Math.imul(W,ge)|0,d=d+Math.imul(B,De)|0,m=(m=m+Math.imul(B,we)|0)+Math.imul(U,De)|0,g=g+Math.imul(U,we)|0,d=d+Math.imul(K,et)|0,m=(m=m+Math.imul(K,Ie)|0)+Math.imul(j,et)|0,g=g+Math.imul(j,Ie)|0;var xe=(T+(d=d+Math.imul(Z,Je)|0)|0)+((8191&(m=(m=m+Math.imul(Z,Re)|0)+Math.imul(I,Je)|0))<<13)|0;T=((g=g+Math.imul(I,Re)|0)+(m>>>13)|0)+(xe>>>26)|0,xe&=67108863,d=Math.imul(se,qe),m=(m=Math.imul(se,Ee))+Math.imul(ae,qe)|0,g=Math.imul(ae,Ee),d=d+Math.imul(fe,ie)|0,m=(m=m+Math.imul(fe,de)|0)+Math.imul(ne,ie)|0,g=g+Math.imul(ne,de)|0,d=d+Math.imul(ee,Be)|0,m=(m=m+Math.imul(ee,ge)|0)+Math.imul(te,Be)|0,g=g+Math.imul(te,ge)|0,d=d+Math.imul(G,De)|0,m=(m=m+Math.imul(G,we)|0)+Math.imul(W,De)|0,g=g+Math.imul(W,we)|0,d=d+Math.imul(B,et)|0,m=(m=m+Math.imul(B,Ie)|0)+Math.imul(U,et)|0,g=g+Math.imul(U,Ie)|0,d=d+Math.imul(K,Je)|0,m=(m=m+Math.imul(K,Re)|0)+Math.imul(j,Je)|0,g=g+Math.imul(j,Re)|0;var Me=(T+(d=d+Math.imul(Z,tt)|0)|0)+((8191&(m=(m=m+Math.imul(Z,Te)|0)+Math.imul(I,tt)|0))<<13)|0;T=((g=g+Math.imul(I,Te)|0)+(m>>>13)|0)+(Me>>>26)|0,Me&=67108863,d=Math.imul(me,qe),m=(m=Math.imul(me,Ee))+Math.imul(le,qe)|0,g=Math.imul(le,Ee),d=d+Math.imul(se,ie)|0,m=(m=m+Math.imul(se,de)|0)+Math.imul(ae,ie)|0,g=g+Math.imul(ae,de)|0,d=d+Math.imul(fe,Be)|0,m=(m=m+Math.imul(fe,ge)|0)+Math.imul(ne,Be)|0,g=g+Math.imul(ne,ge)|0,d=d+Math.imul(ee,De)|0,m=(m=m+Math.imul(ee,we)|0)+Math.imul(te,De)|0,g=g+Math.imul(te,we)|0,d=d+Math.imul(G,et)|0,m=(m=m+Math.imul(G,Ie)|0)+Math.imul(W,et)|0,g=g+Math.imul(W,Ie)|0,d=d+Math.imul(B,Je)|0,m=(m=m+Math.imul(B,Re)|0)+Math.imul(U,Je)|0,g=g+Math.imul(U,Re)|0,d=d+Math.imul(K,tt)|0,m=(m=m+Math.imul(K,Te)|0)+Math.imul(j,tt)|0,g=g+Math.imul(j,Te)|0;var ze=(T+(d=d+Math.imul(Z,Ze)|0)|0)+((8191&(m=(m=m+Math.imul(Z,Pe)|0)+Math.imul(I,Ze)|0))<<13)|0;T=((g=g+Math.imul(I,Pe)|0)+(m>>>13)|0)+(ze>>>26)|0,ze&=67108863,d=Math.imul(Se,qe),m=(m=Math.imul(Se,Ee))+Math.imul(pe,qe)|0,g=Math.imul(pe,Ee),d=d+Math.imul(me,ie)|0,m=(m=m+Math.imul(me,de)|0)+Math.imul(le,ie)|0,g=g+Math.imul(le,de)|0,d=d+Math.imul(se,Be)|0,m=(m=m+Math.imul(se,ge)|0)+Math.imul(ae,Be)|0,g=g+Math.imul(ae,ge)|0,d=d+Math.imul(fe,De)|0,m=(m=m+Math.imul(fe,we)|0)+Math.imul(ne,De)|0,g=g+Math.imul(ne,we)|0,d=d+Math.imul(ee,et)|0,m=(m=m+Math.imul(ee,Ie)|0)+Math.imul(te,et)|0,g=g+Math.imul(te,Ie)|0,d=d+Math.imul(G,Je)|0,m=(m=m+Math.imul(G,Re)|0)+Math.imul(W,Je)|0,g=g+Math.imul(W,Re)|0,d=d+Math.imul(B,tt)|0,m=(m=m+Math.imul(B,Te)|0)+Math.imul(U,tt)|0,g=g+Math.imul(U,Te)|0,d=d+Math.imul(K,Ze)|0,m=(m=m+Math.imul(K,Pe)|0)+Math.imul(j,Ze)|0,g=g+Math.imul(j,Pe)|0;var $e=(T+(d=d+Math.imul(Z,Ye)|0)|0)+((8191&(m=(m=m+Math.imul(Z,Ae)|0)+Math.imul(I,Ye)|0))<<13)|0;T=((g=g+Math.imul(I,Ae)|0)+(m>>>13)|0)+($e>>>26)|0,$e&=67108863,d=Math.imul(Le,qe),m=(m=Math.imul(Le,Ee))+Math.imul(_e,qe)|0,g=Math.imul(_e,Ee),d=d+Math.imul(Se,ie)|0,m=(m=m+Math.imul(Se,de)|0)+Math.imul(pe,ie)|0,g=g+Math.imul(pe,de)|0,d=d+Math.imul(me,Be)|0,m=(m=m+Math.imul(me,ge)|0)+Math.imul(le,Be)|0,g=g+Math.imul(le,ge)|0,d=d+Math.imul(se,De)|0,m=(m=m+Math.imul(se,we)|0)+Math.imul(ae,De)|0,g=g+Math.imul(ae,we)|0,d=d+Math.imul(fe,et)|0,m=(m=m+Math.imul(fe,Ie)|0)+Math.imul(ne,et)|0,g=g+Math.imul(ne,Ie)|0,d=d+Math.imul(ee,Je)|0,m=(m=m+Math.imul(ee,Re)|0)+Math.imul(te,Je)|0,g=g+Math.imul(te,Re)|0,d=d+Math.imul(G,tt)|0,m=(m=m+Math.imul(G,Te)|0)+Math.imul(W,tt)|0,g=g+Math.imul(W,Te)|0,d=d+Math.imul(B,Ze)|0,m=(m=m+Math.imul(B,Pe)|0)+Math.imul(U,Ze)|0,g=g+Math.imul(U,Pe)|0,d=d+Math.imul(K,Ye)|0,m=(m=m+Math.imul(K,Ae)|0)+Math.imul(j,Ye)|0,g=g+Math.imul(j,Ae)|0;var it=(T+(d=d+Math.imul(Z,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(Z,Ce)|0)+Math.imul(I,Qe)|0))<<13)|0;T=((g=g+Math.imul(I,Ce)|0)+(m>>>13)|0)+(it>>>26)|0,it&=67108863,d=Math.imul(Le,ie),m=(m=Math.imul(Le,de))+Math.imul(_e,ie)|0,g=Math.imul(_e,de),d=d+Math.imul(Se,Be)|0,m=(m=m+Math.imul(Se,ge)|0)+Math.imul(pe,Be)|0,g=g+Math.imul(pe,ge)|0,d=d+Math.imul(me,De)|0,m=(m=m+Math.imul(me,we)|0)+Math.imul(le,De)|0,g=g+Math.imul(le,we)|0,d=d+Math.imul(se,et)|0,m=(m=m+Math.imul(se,Ie)|0)+Math.imul(ae,et)|0,g=g+Math.imul(ae,Ie)|0,d=d+Math.imul(fe,Je)|0,m=(m=m+Math.imul(fe,Re)|0)+Math.imul(ne,Je)|0,g=g+Math.imul(ne,Re)|0,d=d+Math.imul(ee,tt)|0,m=(m=m+Math.imul(ee,Te)|0)+Math.imul(te,tt)|0,g=g+Math.imul(te,Te)|0,d=d+Math.imul(G,Ze)|0,m=(m=m+Math.imul(G,Pe)|0)+Math.imul(W,Ze)|0,g=g+Math.imul(W,Pe)|0,d=d+Math.imul(B,Ye)|0,m=(m=m+Math.imul(B,Ae)|0)+Math.imul(U,Ye)|0,g=g+Math.imul(U,Ae)|0;var Ne=(T+(d=d+Math.imul(K,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(K,Ce)|0)+Math.imul(j,Qe)|0))<<13)|0;T=((g=g+Math.imul(j,Ce)|0)+(m>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,d=Math.imul(Le,Be),m=(m=Math.imul(Le,ge))+Math.imul(_e,Be)|0,g=Math.imul(_e,ge),d=d+Math.imul(Se,De)|0,m=(m=m+Math.imul(Se,we)|0)+Math.imul(pe,De)|0,g=g+Math.imul(pe,we)|0,d=d+Math.imul(me,et)|0,m=(m=m+Math.imul(me,Ie)|0)+Math.imul(le,et)|0,g=g+Math.imul(le,Ie)|0,d=d+Math.imul(se,Je)|0,m=(m=m+Math.imul(se,Re)|0)+Math.imul(ae,Je)|0,g=g+Math.imul(ae,Re)|0,d=d+Math.imul(fe,tt)|0,m=(m=m+Math.imul(fe,Te)|0)+Math.imul(ne,tt)|0,g=g+Math.imul(ne,Te)|0,d=d+Math.imul(ee,Ze)|0,m=(m=m+Math.imul(ee,Pe)|0)+Math.imul(te,Ze)|0,g=g+Math.imul(te,Pe)|0,d=d+Math.imul(G,Ye)|0,m=(m=m+Math.imul(G,Ae)|0)+Math.imul(W,Ye)|0,g=g+Math.imul(W,Ae)|0;var ve=(T+(d=d+Math.imul(B,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(B,Ce)|0)+Math.imul(U,Qe)|0))<<13)|0;T=((g=g+Math.imul(U,Ce)|0)+(m>>>13)|0)+(ve>>>26)|0,ve&=67108863,d=Math.imul(Le,De),m=(m=Math.imul(Le,we))+Math.imul(_e,De)|0,g=Math.imul(_e,we),d=d+Math.imul(Se,et)|0,m=(m=m+Math.imul(Se,Ie)|0)+Math.imul(pe,et)|0,g=g+Math.imul(pe,Ie)|0,d=d+Math.imul(me,Je)|0,m=(m=m+Math.imul(me,Re)|0)+Math.imul(le,Je)|0,g=g+Math.imul(le,Re)|0,d=d+Math.imul(se,tt)|0,m=(m=m+Math.imul(se,Te)|0)+Math.imul(ae,tt)|0,g=g+Math.imul(ae,Te)|0,d=d+Math.imul(fe,Ze)|0,m=(m=m+Math.imul(fe,Pe)|0)+Math.imul(ne,Ze)|0,g=g+Math.imul(ne,Pe)|0,d=d+Math.imul(ee,Ye)|0,m=(m=m+Math.imul(ee,Ae)|0)+Math.imul(te,Ye)|0,g=g+Math.imul(te,Ae)|0;var st=(T+(d=d+Math.imul(G,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(G,Ce)|0)+Math.imul(W,Qe)|0))<<13)|0;T=((g=g+Math.imul(W,Ce)|0)+(m>>>13)|0)+(st>>>26)|0,st&=67108863,d=Math.imul(Le,et),m=(m=Math.imul(Le,Ie))+Math.imul(_e,et)|0,g=Math.imul(_e,Ie),d=d+Math.imul(Se,Je)|0,m=(m=m+Math.imul(Se,Re)|0)+Math.imul(pe,Je)|0,g=g+Math.imul(pe,Re)|0,d=d+Math.imul(me,tt)|0,m=(m=m+Math.imul(me,Te)|0)+Math.imul(le,tt)|0,g=g+Math.imul(le,Te)|0,d=d+Math.imul(se,Ze)|0,m=(m=m+Math.imul(se,Pe)|0)+Math.imul(ae,Ze)|0,g=g+Math.imul(ae,Pe)|0,d=d+Math.imul(fe,Ye)|0,m=(m=m+Math.imul(fe,Ae)|0)+Math.imul(ne,Ye)|0,g=g+Math.imul(ne,Ae)|0;var dt=(T+(d=d+Math.imul(ee,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(ee,Ce)|0)+Math.imul(te,Qe)|0))<<13)|0;T=((g=g+Math.imul(te,Ce)|0)+(m>>>13)|0)+(dt>>>26)|0,dt&=67108863,d=Math.imul(Le,Je),m=(m=Math.imul(Le,Re))+Math.imul(_e,Je)|0,g=Math.imul(_e,Re),d=d+Math.imul(Se,tt)|0,m=(m=m+Math.imul(Se,Te)|0)+Math.imul(pe,tt)|0,g=g+Math.imul(pe,Te)|0,d=d+Math.imul(me,Ze)|0,m=(m=m+Math.imul(me,Pe)|0)+Math.imul(le,Ze)|0,g=g+Math.imul(le,Pe)|0,d=d+Math.imul(se,Ye)|0,m=(m=m+Math.imul(se,Ae)|0)+Math.imul(ae,Ye)|0,g=g+Math.imul(ae,Ae)|0;var vt=(T+(d=d+Math.imul(fe,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(fe,Ce)|0)+Math.imul(ne,Qe)|0))<<13)|0;T=((g=g+Math.imul(ne,Ce)|0)+(m>>>13)|0)+(vt>>>26)|0,vt&=67108863,d=Math.imul(Le,tt),m=(m=Math.imul(Le,Te))+Math.imul(_e,tt)|0,g=Math.imul(_e,Te),d=d+Math.imul(Se,Ze)|0,m=(m=m+Math.imul(Se,Pe)|0)+Math.imul(pe,Ze)|0,g=g+Math.imul(pe,Pe)|0,d=d+Math.imul(me,Ye)|0,m=(m=m+Math.imul(me,Ae)|0)+Math.imul(le,Ye)|0,g=g+Math.imul(le,Ae)|0;var mt=(T+(d=d+Math.imul(se,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(se,Ce)|0)+Math.imul(ae,Qe)|0))<<13)|0;T=((g=g+Math.imul(ae,Ce)|0)+(m>>>13)|0)+(mt>>>26)|0,mt&=67108863,d=Math.imul(Le,Ze),m=(m=Math.imul(Le,Pe))+Math.imul(_e,Ze)|0,g=Math.imul(_e,Pe),d=d+Math.imul(Se,Ye)|0,m=(m=m+Math.imul(Se,Ae)|0)+Math.imul(pe,Ye)|0,g=g+Math.imul(pe,Ae)|0;var _t=(T+(d=d+Math.imul(me,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(me,Ce)|0)+Math.imul(le,Qe)|0))<<13)|0;T=((g=g+Math.imul(le,Ce)|0)+(m>>>13)|0)+(_t>>>26)|0,_t&=67108863,d=Math.imul(Le,Ye),m=(m=Math.imul(Le,Ae))+Math.imul(_e,Ye)|0,g=Math.imul(_e,Ae);var at=(T+(d=d+Math.imul(Se,Qe)|0)|0)+((8191&(m=(m=m+Math.imul(Se,Ce)|0)+Math.imul(pe,Qe)|0))<<13)|0;T=((g=g+Math.imul(pe,Ce)|0)+(m>>>13)|0)+(at>>>26)|0,at&=67108863;var xt=(T+(d=Math.imul(Le,Qe))|0)+((8191&(m=(m=Math.imul(Le,Ce))+Math.imul(_e,Qe)|0))<<13)|0;return T=((g=Math.imul(_e,Ce))+(m>>>13)|0)+(xt>>>26)|0,xt&=67108863,P[0]=Ke,P[1]=X,P[2]=Q,P[3]=re,P[4]=ue,P[5]=xe,P[6]=Me,P[7]=ze,P[8]=$e,P[9]=it,P[10]=Ne,P[11]=ve,P[12]=st,P[13]=dt,P[14]=vt,P[15]=mt,P[16]=_t,P[17]=at,P[18]=xt,T!==0&&(P[19]=T,x.length++),x};function k(R,l,x){return new O().mulp(R,l,x)}function O(R,l){this.x=R,this.y=l}Math.imul||(S=E),s.prototype.mulTo=function(R,l){var x=this.length+R.length;return this.length===10&&R.length===10?S(this,R,l):x<63?E(this,R,l):x<1024?function(d,m,g){g.negative=m.negative^d.negative,g.length=d.length+m.length;for(var w=0,A=0,P=0;P<g.length-1;P++){var T=A;A=0;for(var q=67108863&w,Z=Math.min(P,m.length-1),I=Math.max(0,P-d.length+1);I<=Z;I++){var $=P-I,K=(0|d.words[$])*(0|m.words[I]),j=67108863&K;q=67108863&(j=j+q|0),A+=(T=(T=T+(K/67108864|0)|0)+(j>>>26)|0)>>>26,T&=67108863}g.words[P]=q,w=T,T=A}return w!==0?g.words[P]=w:g.length--,g.strip()}(this,R,l):k(this,R,l)},O.prototype.makeRBT=function(R){for(var l=new Array(R),x=s.prototype._countBits(R)-1,d=0;d<R;d++)l[d]=this.revBin(d,x,R);return l},O.prototype.revBin=function(R,l,x){if(R===0||R===x-1)return R;for(var d=0,m=0;m<l;m++)d|=(1&R)<<l-m-1,R>>=1;return d},O.prototype.permute=function(R,l,x,d,m,g){for(var w=0;w<g;w++)d[w]=l[R[w]],m[w]=x[R[w]]},O.prototype.transform=function(R,l,x,d,m,g){this.permute(g,R,l,x,d,m);for(var w=1;w<m;w<<=1)for(var A=w<<1,P=Math.cos(2*Math.PI/A),T=Math.sin(2*Math.PI/A),q=0;q<m;q+=A)for(var Z=P,I=T,$=0;$<w;$++){var K=x[q+$],j=d[q+$],D=x[q+$+w],B=d[q+$+w],U=Z*D-I*B;B=Z*B+I*D,D=U,x[q+$]=K+D,d[q+$]=j+B,x[q+$+w]=K-D,d[q+$+w]=j-B,$!==A&&(U=P*Z-T*I,I=P*I+T*Z,Z=U)}},O.prototype.guessLen13b=function(R,l){var x=1|Math.max(l,R),d=1&x,m=0;for(x=x/2|0;x;x>>>=1)m++;return 1<<m+1+d},O.prototype.conjugate=function(R,l,x){if(!(x<=1))for(var d=0;d<x/2;d++){var m=R[d];R[d]=R[x-d-1],R[x-d-1]=m,m=l[d],l[d]=-l[x-d-1],l[x-d-1]=-m}},O.prototype.normalize13b=function(R,l){for(var x=0,d=0;d<l/2;d++){var m=8192*Math.round(R[2*d+1]/l)+Math.round(R[2*d]/l)+x;R[d]=67108863&m,x=m<67108864?0:m/67108864|0}return R},O.prototype.convert13b=function(R,l,x,d){for(var m=0,g=0;g<l;g++)m+=0|R[g],x[2*g]=8191&m,m>>>=13,x[2*g+1]=8191&m,m>>>=13;for(g=2*l;g<d;++g)x[g]=0;a(m===0),a((-8192&m)==0)},O.prototype.stub=function(R){for(var l=new Array(R),x=0;x<R;x++)l[x]=0;return l},O.prototype.mulp=function(R,l,x){var d=2*this.guessLen13b(R.length,l.length),m=this.makeRBT(d),g=this.stub(d),w=new Array(d),A=new Array(d),P=new Array(d),T=new Array(d),q=new Array(d),Z=new Array(d),I=x.words;I.length=d,this.convert13b(R.words,R.length,w,d),this.convert13b(l.words,l.length,T,d),this.transform(w,g,A,P,d,m),this.transform(T,g,q,Z,d,m);for(var $=0;$<d;$++){var K=A[$]*q[$]-P[$]*Z[$];P[$]=A[$]*Z[$]+P[$]*q[$],A[$]=K}return this.conjugate(A,P,d),this.transform(A,P,I,g,d,m),this.conjugate(I,g,d),this.normalize13b(I,d),x.negative=R.negative^l.negative,x.length=R.length+l.length,x.strip()},s.prototype.mul=function(R){var l=new s(null);return l.words=new Array(this.length+R.length),this.mulTo(R,l)},s.prototype.mulf=function(R){var l=new s(null);return l.words=new Array(this.length+R.length),k(this,R,l)},s.prototype.imul=function(R){return this.clone().mulTo(R,this)},s.prototype.imuln=function(R){a(typeof R=="number"),a(R<67108864);for(var l=0,x=0;x<this.length;x++){var d=(0|this.words[x])*R,m=(67108863&d)+(67108863&l);l>>=26,l+=d/67108864|0,l+=m>>>26,this.words[x]=67108863&m}return l!==0&&(this.words[x]=l,this.length++),this},s.prototype.muln=function(R){return this.clone().imuln(R)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(R){var l=function(g){for(var w=new Array(g.bitLength()),A=0;A<w.length;A++){var P=A/26|0,T=A%26;w[A]=(g.words[P]&1<<T)>>>T}return w}(R);if(l.length===0)return new s(1);for(var x=this,d=0;d<l.length&&l[d]===0;d++,x=x.sqr());if(++d<l.length)for(var m=x.sqr();d<l.length;d++,m=m.sqr())l[d]!==0&&(x=x.mul(m));return x},s.prototype.iushln=function(R){a(typeof R=="number"&&R>=0);var l,x=R%26,d=(R-x)/26,m=67108863>>>26-x<<26-x;if(x!==0){var g=0;for(l=0;l<this.length;l++){var w=this.words[l]&m,A=(0|this.words[l])-w<<x;this.words[l]=A|g,g=w>>>26-x}g&&(this.words[l]=g,this.length++)}if(d!==0){for(l=this.length-1;l>=0;l--)this.words[l+d]=this.words[l];for(l=0;l<d;l++)this.words[l]=0;this.length+=d}return this.strip()},s.prototype.ishln=function(R){return a(this.negative===0),this.iushln(R)},s.prototype.iushrn=function(R,l,x){var d;a(typeof R=="number"&&R>=0),d=l?(l-l%26)/26:0;var m=R%26,g=Math.min((R-m)/26,this.length),w=67108863^67108863>>>m<<m,A=x;if(d-=g,d=Math.max(0,d),A){for(var P=0;P<g;P++)A.words[P]=this.words[P];A.length=g}if(g!==0)if(this.length>g)for(this.length-=g,P=0;P<this.length;P++)this.words[P]=this.words[P+g];else this.words[0]=0,this.length=1;var T=0;for(P=this.length-1;P>=0&&(T!==0||P>=d);P--){var q=0|this.words[P];this.words[P]=T<<26-m|q>>>m,T=q&w}return A&&T!==0&&(A.words[A.length++]=T),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(R,l,x){return a(this.negative===0),this.iushrn(R,l,x)},s.prototype.shln=function(R){return this.clone().ishln(R)},s.prototype.ushln=function(R){return this.clone().iushln(R)},s.prototype.shrn=function(R){return this.clone().ishrn(R)},s.prototype.ushrn=function(R){return this.clone().iushrn(R)},s.prototype.testn=function(R){a(typeof R=="number"&&R>=0);var l=R%26,x=(R-l)/26,d=1<<l;return!(this.length<=x)&&!!(this.words[x]&d)},s.prototype.imaskn=function(R){a(typeof R=="number"&&R>=0);var l=R%26,x=(R-l)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(l!==0&&x++,this.length=Math.min(x,this.length),l!==0){var d=67108863^67108863>>>l<<l;this.words[this.length-1]&=d}return this.strip()},s.prototype.maskn=function(R){return this.clone().imaskn(R)},s.prototype.iaddn=function(R){return a(typeof R=="number"),a(R<67108864),R<0?this.isubn(-R):this.negative!==0?this.length===1&&(0|this.words[0])<R?(this.words[0]=R-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(R),this.negative=1,this):this._iaddn(R)},s.prototype._iaddn=function(R){this.words[0]+=R;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},s.prototype.isubn=function(R){if(a(typeof R=="number"),a(R<67108864),R<0)return this.iaddn(-R);if(this.negative!==0)return this.negative=0,this.iaddn(R),this.negative=1,this;if(this.words[0]-=R,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},s.prototype.addn=function(R){return this.clone().iaddn(R)},s.prototype.subn=function(R){return this.clone().isubn(R)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(R,l,x){var d,m,g=R.length+x;this._expand(g);var w=0;for(d=0;d<R.length;d++){m=(0|this.words[d+x])+w;var A=(0|R.words[d])*l;w=((m-=67108863&A)>>26)-(A/67108864|0),this.words[d+x]=67108863&m}for(;d<this.length-x;d++)w=(m=(0|this.words[d+x])+w)>>26,this.words[d+x]=67108863&m;if(w===0)return this.strip();for(a(w===-1),w=0,d=0;d<this.length;d++)w=(m=-(0|this.words[d])+w)>>26,this.words[d]=67108863&m;return this.negative=1,this.strip()},s.prototype._wordDiv=function(R,l){var x=(this.length,R.length),d=this.clone(),m=R,g=0|m.words[m.length-1];(x=26-this._countBits(g))!==0&&(m=m.ushln(x),d.iushln(x),g=0|m.words[m.length-1]);var w,A=d.length-m.length;if(l!=="mod"){(w=new s(null)).length=A+1,w.words=new Array(w.length);for(var P=0;P<w.length;P++)w.words[P]=0}var T=d.clone()._ishlnsubmul(m,1,A);T.negative===0&&(d=T,w&&(w.words[A]=1));for(var q=A-1;q>=0;q--){var Z=67108864*(0|d.words[m.length+q])+(0|d.words[m.length+q-1]);for(Z=Math.min(Z/g|0,67108863),d._ishlnsubmul(m,Z,q);d.negative!==0;)Z--,d.negative=0,d._ishlnsubmul(m,1,q),d.isZero()||(d.negative^=1);w&&(w.words[q]=Z)}return w&&w.strip(),d.strip(),l!=="div"&&x!==0&&d.iushrn(x),{div:w||null,mod:d}},s.prototype.divmod=function(R,l,x){return a(!R.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&R.negative===0?(g=this.neg().divmod(R,l),l!=="mod"&&(d=g.div.neg()),l!=="div"&&(m=g.mod.neg(),x&&m.negative!==0&&m.iadd(R)),{div:d,mod:m}):this.negative===0&&R.negative!==0?(g=this.divmod(R.neg(),l),l!=="mod"&&(d=g.div.neg()),{div:d,mod:g.mod}):(this.negative&R.negative)!=0?(g=this.neg().divmod(R.neg(),l),l!=="div"&&(m=g.mod.neg(),x&&m.negative!==0&&m.isub(R)),{div:g.div,mod:m}):R.length>this.length||this.cmp(R)<0?{div:new s(0),mod:this}:R.length===1?l==="div"?{div:this.divn(R.words[0]),mod:null}:l==="mod"?{div:null,mod:new s(this.modn(R.words[0]))}:{div:this.divn(R.words[0]),mod:new s(this.modn(R.words[0]))}:this._wordDiv(R,l);var d,m,g},s.prototype.div=function(R){return this.divmod(R,"div",!1).div},s.prototype.mod=function(R){return this.divmod(R,"mod",!1).mod},s.prototype.umod=function(R){return this.divmod(R,"mod",!0).mod},s.prototype.divRound=function(R){var l=this.divmod(R);if(l.mod.isZero())return l.div;var x=l.div.negative!==0?l.mod.isub(R):l.mod,d=R.ushrn(1),m=R.andln(1),g=x.cmp(d);return g<0||m===1&&g===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},s.prototype.modn=function(R){a(R<=67108863);for(var l=(1<<26)%R,x=0,d=this.length-1;d>=0;d--)x=(l*x+(0|this.words[d]))%R;return x},s.prototype.idivn=function(R){a(R<=67108863);for(var l=0,x=this.length-1;x>=0;x--){var d=(0|this.words[x])+67108864*l;this.words[x]=d/R|0,l=d%R}return this.strip()},s.prototype.divn=function(R){return this.clone().idivn(R)},s.prototype.egcd=function(R){a(R.negative===0),a(!R.isZero());var l=this,x=R.clone();l=l.negative!==0?l.umod(R):l.clone();for(var d=new s(1),m=new s(0),g=new s(0),w=new s(1),A=0;l.isEven()&&x.isEven();)l.iushrn(1),x.iushrn(1),++A;for(var P=x.clone(),T=l.clone();!l.isZero();){for(var q=0,Z=1;(l.words[0]&Z)==0&&q<26;++q,Z<<=1);if(q>0)for(l.iushrn(q);q-- >0;)(d.isOdd()||m.isOdd())&&(d.iadd(P),m.isub(T)),d.iushrn(1),m.iushrn(1);for(var I=0,$=1;(x.words[0]&$)==0&&I<26;++I,$<<=1);if(I>0)for(x.iushrn(I);I-- >0;)(g.isOdd()||w.isOdd())&&(g.iadd(P),w.isub(T)),g.iushrn(1),w.iushrn(1);l.cmp(x)>=0?(l.isub(x),d.isub(g),m.isub(w)):(x.isub(l),g.isub(d),w.isub(m))}return{a:g,b:w,gcd:x.iushln(A)}},s.prototype._invmp=function(R){a(R.negative===0),a(!R.isZero());var l=this,x=R.clone();l=l.negative!==0?l.umod(R):l.clone();for(var d,m=new s(1),g=new s(0),w=x.clone();l.cmpn(1)>0&&x.cmpn(1)>0;){for(var A=0,P=1;(l.words[0]&P)==0&&A<26;++A,P<<=1);if(A>0)for(l.iushrn(A);A-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);for(var T=0,q=1;(x.words[0]&q)==0&&T<26;++T,q<<=1);if(T>0)for(x.iushrn(T);T-- >0;)g.isOdd()&&g.iadd(w),g.iushrn(1);l.cmp(x)>=0?(l.isub(x),m.isub(g)):(x.isub(l),g.isub(m))}return(d=l.cmpn(1)===0?m:g).cmpn(0)<0&&d.iadd(R),d},s.prototype.gcd=function(R){if(this.isZero())return R.abs();if(R.isZero())return this.abs();var l=this.clone(),x=R.clone();l.negative=0,x.negative=0;for(var d=0;l.isEven()&&x.isEven();d++)l.iushrn(1),x.iushrn(1);for(;;){for(;l.isEven();)l.iushrn(1);for(;x.isEven();)x.iushrn(1);var m=l.cmp(x);if(m<0){var g=l;l=x,x=g}else if(m===0||x.cmpn(1)===0)break;l.isub(x)}return x.iushln(d)},s.prototype.invm=function(R){return this.egcd(R).a.umod(R)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(R){return this.words[0]&R},s.prototype.bincn=function(R){a(typeof R=="number");var l=R%26,x=(R-l)/26,d=1<<l;if(this.length<=x)return this._expand(x+1),this.words[x]|=d,this;for(var m=d,g=x;m!==0&&g<this.length;g++){var w=0|this.words[g];m=(w+=m)>>>26,w&=67108863,this.words[g]=w}return m!==0&&(this.words[g]=m,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(R){var l,x=R<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;if(this.strip(),this.length>1)l=1;else{x&&(R=-R),a(R<=67108863,"Number is too big");var d=0|this.words[0];l=d===R?0:d<R?-1:1}return this.negative!==0?0|-l:l},s.prototype.cmp=function(R){if(this.negative!==0&&R.negative===0)return-1;if(this.negative===0&&R.negative!==0)return 1;var l=this.ucmp(R);return this.negative!==0?0|-l:l},s.prototype.ucmp=function(R){if(this.length>R.length)return 1;if(this.length<R.length)return-1;for(var l=0,x=this.length-1;x>=0;x--){var d=0|this.words[x],m=0|R.words[x];if(d!==m){d<m?l=-1:d>m&&(l=1);break}}return l},s.prototype.gtn=function(R){return this.cmpn(R)===1},s.prototype.gt=function(R){return this.cmp(R)===1},s.prototype.gten=function(R){return this.cmpn(R)>=0},s.prototype.gte=function(R){return this.cmp(R)>=0},s.prototype.ltn=function(R){return this.cmpn(R)===-1},s.prototype.lt=function(R){return this.cmp(R)===-1},s.prototype.lten=function(R){return this.cmpn(R)<=0},s.prototype.lte=function(R){return this.cmp(R)<=0},s.prototype.eqn=function(R){return this.cmpn(R)===0},s.prototype.eq=function(R){return this.cmp(R)===0},s.red=function(R){return new H(R)},s.prototype.toRed=function(R){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),R.convertTo(this)._forceRed(R)},s.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(R){return this.red=R,this},s.prototype.forceRed=function(R){return a(!this.red,"Already a number in reduction context"),this._forceRed(R)},s.prototype.redAdd=function(R){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,R)},s.prototype.redIAdd=function(R){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,R)},s.prototype.redSub=function(R){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,R)},s.prototype.redISub=function(R){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,R)},s.prototype.redShl=function(R){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,R)},s.prototype.redMul=function(R){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.mul(this,R)},s.prototype.redIMul=function(R){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.imul(this,R)},s.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(R){return a(this.red&&!R.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,R)};var M={k256:null,p224:null,p192:null,p25519:null};function C(R,l){this.name=R,this.p=new s(l,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function N(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function L(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function F(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function V(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function H(R){if(typeof R=="string"){var l=s._prime(R);this.m=l.p,this.prime=l}else a(R.gtn(1),"modulus must be greater than 1"),this.m=R,this.prime=null}function z(R){H.call(this,R),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}C.prototype._tmp=function(){var R=new s(null);return R.words=new Array(Math.ceil(this.n/13)),R},C.prototype.ireduce=function(R){var l,x=R;do this.split(x,this.tmp),l=(x=(x=this.imulK(x)).iadd(this.tmp)).bitLength();while(l>this.n);var d=l<this.n?-1:x.ucmp(this.p);return d===0?(x.words[0]=0,x.length=1):d>0?x.isub(this.p):x.strip(),x},C.prototype.split=function(R,l){R.iushrn(this.n,0,l)},C.prototype.imulK=function(R){return R.imul(this.k)},f(N,C),N.prototype.split=function(R,l){for(var x=Math.min(R.length,9),d=0;d<x;d++)l.words[d]=R.words[d];if(l.length=x,R.length<=9)return R.words[0]=0,void(R.length=1);var m=R.words[9];for(l.words[l.length++]=4194303&m,d=10;d<R.length;d++){var g=0|R.words[d];R.words[d-10]=(4194303&g)<<4|m>>>22,m=g}m>>>=22,R.words[d-10]=m,m===0&&R.length>10?R.length-=10:R.length-=9},N.prototype.imulK=function(R){R.words[R.length]=0,R.words[R.length+1]=0,R.length+=2;for(var l=0,x=0;x<R.length;x++){var d=0|R.words[x];l+=977*d,R.words[x]=67108863&l,l=64*d+(l/67108864|0)}return R.words[R.length-1]===0&&(R.length--,R.words[R.length-1]===0&&R.length--),R},f(L,C),f(F,C),f(V,C),V.prototype.imulK=function(R){for(var l=0,x=0;x<R.length;x++){var d=19*(0|R.words[x])+l,m=67108863&d;d>>>=26,R.words[x]=m,l=d}return l!==0&&(R.words[R.length++]=l),R},s._prime=function(R){if(M[R])return M[R];var l;if(R==="k256")l=new N;else if(R==="p224")l=new L;else if(R==="p192")l=new F;else{if(R!=="p25519")throw new Error("Unknown prime "+R);l=new V}return M[R]=l,l},H.prototype._verify1=function(R){a(R.negative===0,"red works only with positives"),a(R.red,"red works only with red numbers")},H.prototype._verify2=function(R,l){a((R.negative|l.negative)==0,"red works only with positives"),a(R.red&&R.red===l.red,"red works only with red numbers")},H.prototype.imod=function(R){return this.prime?this.prime.ireduce(R)._forceRed(this):R.umod(this.m)._forceRed(this)},H.prototype.neg=function(R){return R.isZero()?R.clone():this.m.sub(R)._forceRed(this)},H.prototype.add=function(R,l){this._verify2(R,l);var x=R.add(l);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},H.prototype.iadd=function(R,l){this._verify2(R,l);var x=R.iadd(l);return x.cmp(this.m)>=0&&x.isub(this.m),x},H.prototype.sub=function(R,l){this._verify2(R,l);var x=R.sub(l);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},H.prototype.isub=function(R,l){this._verify2(R,l);var x=R.isub(l);return x.cmpn(0)<0&&x.iadd(this.m),x},H.prototype.shl=function(R,l){return this._verify1(R),this.imod(R.ushln(l))},H.prototype.imul=function(R,l){return this._verify2(R,l),this.imod(R.imul(l))},H.prototype.mul=function(R,l){return this._verify2(R,l),this.imod(R.mul(l))},H.prototype.isqr=function(R){return this.imul(R,R.clone())},H.prototype.sqr=function(R){return this.mul(R,R)},H.prototype.sqrt=function(R){if(R.isZero())return R.clone();var l=this.m.andln(3);if(a(l%2==1),l===3){var x=this.m.add(new s(1)).iushrn(2);return this.pow(R,x)}for(var d=this.m.subn(1),m=0;!d.isZero()&&d.andln(1)===0;)m++,d.iushrn(1);a(!d.isZero());var g=new s(1).toRed(this),w=g.redNeg(),A=this.m.subn(1).iushrn(1),P=this.m.bitLength();for(P=new s(2*P*P).toRed(this);this.pow(P,A).cmp(w)!==0;)P.redIAdd(w);for(var T=this.pow(P,d),q=this.pow(R,d.addn(1).iushrn(1)),Z=this.pow(R,d),I=m;Z.cmp(g)!==0;){for(var $=Z,K=0;$.cmp(g)!==0;K++)$=$.redSqr();a(K<I);var j=this.pow(T,new s(1).iushln(I-K-1));q=q.redMul(j),T=j.redSqr(),Z=Z.redMul(T),I=K}return q},H.prototype.invm=function(R){var l=R._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},H.prototype.pow=function(R,l){if(l.isZero())return new s(1).toRed(this);if(l.cmpn(1)===0)return R.clone();var x=new Array(16);x[0]=new s(1).toRed(this),x[1]=R;for(var d=2;d<x.length;d++)x[d]=this.mul(x[d-1],R);var m=x[0],g=0,w=0,A=l.bitLength()%26;for(A===0&&(A=26),d=l.length-1;d>=0;d--){for(var P=l.words[d],T=A-1;T>=0;T--){var q=P>>T&1;m!==x[0]&&(m=this.sqr(m)),q!==0||g!==0?(g<<=1,g|=q,(++w===4||d===0&&T===0)&&(m=this.mul(m,x[g]),w=0,g=0)):w=0}A=26}return m},H.prototype.convertTo=function(R){var l=R.umod(this.m);return l===R?l.clone():l},H.prototype.convertFrom=function(R){var l=R.clone();return l.red=null,l},s.mont=function(R){return new z(R)},f(z,H),z.prototype.convertTo=function(R){return this.imod(R.ushln(this.shift))},z.prototype.convertFrom=function(R){var l=this.imod(R.mul(this.rinv));return l.red=null,l},z.prototype.imul=function(R,l){if(R.isZero()||l.isZero())return R.words[0]=0,R.length=1,R;var x=R.imul(l),d=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=x.isub(d).iushrn(this.shift),g=m;return m.cmp(this.m)>=0?g=m.isub(this.m):m.cmpn(0)<0&&(g=m.iadd(this.m)),g._forceRed(this)},z.prototype.mul=function(R,l){if(R.isZero()||l.isZero())return new s(0)._forceRed(this);var x=R.mul(l),d=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=x.isub(d).iushrn(this.shift),g=m;return m.cmp(this.m)>=0?g=m.isub(this.m):m.cmpn(0)<0&&(g=m.iadd(this.m)),g._forceRed(this)},z.prototype.invm=function(R){return this.imod(R._invmp(this.m).mul(this.r2))._forceRed(this)}})(n,this)}).call(this,t(25)(o))},function(o,e,t){function n(p){let a;return typeof window!="undefined"&&window[p]!==void 0&&(a=window[p]),a}function c(p){const a=n(p);if(!a)throw new Error(p+" is not defined in Window");return a}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=n,e.getFromWindowOrThrow=c,e.getDocumentOrThrow=function(){return c("document")},e.getDocument=function(){return n("document")},e.getNavigatorOrThrow=function(){return c("navigator")},e.getNavigator=function(){return n("navigator")},e.getLocationOrThrow=function(){return c("location")},e.getLocation=function(){return n("location")},e.getCryptoOrThrow=function(){return c("crypto")},e.getCrypto=function(){return n("crypto")},e.getLocalStorageOrThrow=function(){return c("localStorage")},e.getLocalStorage=function(){return n("localStorage")}},function(o,e,t){var n=e,c=t(16),p=t(22),a=t(120);n.assert=p,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(f,s,u){var h=new Array(Math.max(f.bitLength(),u)+1);h.fill(0);for(var v=1<<s+1,b=f.clone(),y=0;y<h.length;y++){var _,E=b.andln(v-1);b.isOdd()?(_=E>(v>>1)-1?(v>>1)-E:E,b.isubn(_)):_=0,h[y]=_,b.iushrn(1)}return h},n.getJSF=function(f,s){var u=[[],[]];f=f.clone(),s=s.clone();for(var h,v=0,b=0;f.cmpn(-v)>0||s.cmpn(-b)>0;){var y,_,E=f.andln(3)+v&3,S=s.andln(3)+b&3;E===3&&(E=-1),S===3&&(S=-1),y=(1&E)==0?0:(h=f.andln(7)+v&7)!==3&&h!==5||S!==2?E:-E,u[0].push(y),_=(1&S)==0?0:(h=s.andln(7)+b&7)!==3&&h!==5||E!==2?S:-S,u[1].push(_),2*v===y+1&&(v=1-v),2*b===_+1&&(b=1-b),f.iushrn(1),s.iushrn(1)}return u},n.cachedProperty=function(f,s,u){var h="_"+s;f.prototype[s]=function(){return this[h]!==void 0?this[h]:this[h]=u.call(this)}},n.parseBytes=function(f){return typeof f=="string"?n.toArray(f,"hex"):f},n.intFromLE=function(f){return new c(f,"hex","le")}},function(o,e,t){var n,c=typeof Reflect=="object"?Reflect:null,p=c&&typeof c.apply=="function"?c.apply:function(O,M,C){return Function.prototype.apply.call(O,M,C)};n=c&&typeof c.ownKeys=="function"?c.ownKeys:Object.getOwnPropertySymbols?function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:function(O){return Object.getOwnPropertyNames(O)};var a=Number.isNaN||function(O){return O!=O};function f(){f.init.call(this)}o.exports=f,o.exports.once=function(O,M){return new Promise(function(C,N){function L(V){O.removeListener(M,F),N(V)}function F(){typeof O.removeListener=="function"&&O.removeListener("error",L),C([].slice.call(arguments))}k(O,M,F,{once:!0}),M!=="error"&&function(V,H,z){typeof V.on=="function"&&k(V,"error",H,z)}(O,L,{once:!0})})},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var s=10;function u(O){if(typeof O!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}function h(O){return O._maxListeners===void 0?f.defaultMaxListeners:O._maxListeners}function v(O,M,C,N){var L,F,V,H;if(u(C),(F=O._events)===void 0?(F=O._events=Object.create(null),O._eventsCount=0):(F.newListener!==void 0&&(O.emit("newListener",M,C.listener?C.listener:C),F=O._events),V=F[M]),V===void 0)V=F[M]=C,++O._eventsCount;else if(typeof V=="function"?V=F[M]=N?[C,V]:[V,C]:N?V.unshift(C):V.push(C),(L=h(O))>0&&V.length>L&&!V.warned){V.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+V.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=O,z.type=M,z.count=V.length,H=z,console&&console.warn&&console.warn(H)}return O}function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(O,M,C){var N={fired:!1,wrapFn:void 0,target:O,type:M,listener:C},L=b.bind(N);return L.listener=C,N.wrapFn=L,L}function _(O,M,C){var N=O._events;if(N===void 0)return[];var L=N[M];return L===void 0?[]:typeof L=="function"?C?[L.listener||L]:[L]:C?function(F){for(var V=new Array(F.length),H=0;H<V.length;++H)V[H]=F[H].listener||F[H];return V}(L):S(L,L.length)}function E(O){var M=this._events;if(M!==void 0){var C=M[O];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}function S(O,M){for(var C=new Array(M),N=0;N<M;++N)C[N]=O[N];return C}function k(O,M,C,N){if(typeof O.on=="function")N.once?O.once(M,C):O.on(M,C);else{if(typeof O.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof O);O.addEventListener(M,function L(F){N.once&&O.removeEventListener(M,L),C(F)})}}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(O){if(typeof O!="number"||O<0||a(O))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+O+".");s=O}}),f.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||a(O))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+O+".");return this._maxListeners=O,this},f.prototype.getMaxListeners=function(){return h(this)},f.prototype.emit=function(O){for(var M=[],C=1;C<arguments.length;C++)M.push(arguments[C]);var N=O==="error",L=this._events;if(L!==void 0)N=N&&L.error===void 0;else if(!N)return!1;if(N){var F;if(M.length>0&&(F=M[0]),F instanceof Error)throw F;var V=new Error("Unhandled error."+(F?" ("+F.message+")":""));throw V.context=F,V}var H=L[O];if(H===void 0)return!1;if(typeof H=="function")p(H,this,M);else{var z=H.length,R=S(H,z);for(C=0;C<z;++C)p(R[C],this,M)}return!0},f.prototype.addListener=function(O,M){return v(this,O,M,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(O,M){return v(this,O,M,!0)},f.prototype.once=function(O,M){return u(M),this.on(O,y(this,O,M)),this},f.prototype.prependOnceListener=function(O,M){return u(M),this.prependListener(O,y(this,O,M)),this},f.prototype.removeListener=function(O,M){var C,N,L,F,V;if(u(M),(N=this._events)===void 0)return this;if((C=N[O])===void 0)return this;if(C===M||C.listener===M)--this._eventsCount==0?this._events=Object.create(null):(delete N[O],N.removeListener&&this.emit("removeListener",O,C.listener||M));else if(typeof C!="function"){for(L=-1,F=C.length-1;F>=0;F--)if(C[F]===M||C[F].listener===M){V=C[F].listener,L=F;break}if(L<0)return this;L===0?C.shift():function(H,z){for(;z+1<H.length;z++)H[z]=H[z+1];H.pop()}(C,L),C.length===1&&(N[O]=C[0]),N.removeListener!==void 0&&this.emit("removeListener",O,V||M)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(O){var M,C,N;if((C=this._events)===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[O]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete C[O]),this;if(arguments.length===0){var L,F=Object.keys(C);for(N=0;N<F.length;++N)(L=F[N])!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(M=C[O])=="function")this.removeListener(O,M);else if(M!==void 0)for(N=M.length-1;N>=0;N--)this.removeListener(O,M[N]);return this},f.prototype.listeners=function(O){return _(this,O,!0)},f.prototype.rawListeners=function(O){return _(this,O,!1)},f.listenerCount=function(O,M){return typeof O.listenerCount=="function"?O.listenerCount(M):E.call(O,M)},f.prototype.listenerCount=E,f.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(o,e,t){var n=t(2),c=n.Buffer;function p(f,s){for(var u in f)s[u]=f[u]}function a(f,s,u){return c(f,s,u)}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=n:(p(n,e),e.Buffer=a),a.prototype=Object.create(c.prototype),p(c,a),a.from=function(f,s,u){if(typeof f=="number")throw new TypeError("Argument must not be a number");return c(f,s,u)},a.alloc=function(f,s,u){if(typeof f!="number")throw new TypeError("Argument must be a number");var h=c(f);return s!==void 0?typeof u=="string"?h.fill(s,u):h.fill(s):h.fill(0),h},a.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return c(f)},a.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(f)}},function(o,e,t){t.d(e,"b",function(){return a}),t.d(e,"a",function(){return f}),t.d(e,"c",function(){return s}),t.d(e,"d",function(){return u}),t.d(e,"e",function(){return h}),t.d(e,"f",function(){return v});var n=t(8),c=t(4);async function p(b,y=c.a){return n.getSubtleCrypto().importKey("raw",b,function(_){return _===c.a?{length:c.b,name:c.a}:{hash:{name:c.f},name:c.e}}(y),!0,function(_){return _===c.a?[c.d,c.c]:[c.k,c.l]}(y))}async function a(b,y,_){const E=n.getSubtleCrypto(),S=await p(y,c.a),k=await E.encrypt({iv:b,name:c.a},S,_);return new Uint8Array(k)}async function f(b,y,_){const E=n.getSubtleCrypto(),S=await p(y,c.a),k=await E.decrypt({iv:b,name:c.a},S,_);return new Uint8Array(k)}async function s(b,y){const _=n.getSubtleCrypto(),E=await p(b,c.e),S=await _.sign({length:c.g,name:c.e},E,y);return new Uint8Array(S)}async function u(b,y){const _=n.getSubtleCrypto(),E=await p(b,c.e),S=await _.sign({length:c.h,name:c.e},E,y);return new Uint8Array(S)}async function h(b){const y=n.getSubtleCrypto(),_=await y.digest({name:c.i},b);return new Uint8Array(_)}async function v(b){const y=n.getSubtleCrypto(),_=await y.digest({name:c.j},b);return new Uint8Array(_)}},function(o,e,t){var n=t(22),c=t(3);function p(u,h){return(64512&u.charCodeAt(h))==55296&&!(h<0||h+1>=u.length)&&(64512&u.charCodeAt(h+1))==56320}function a(u){return(u>>>24|u>>>8&65280|u<<8&16711680|(255&u)<<24)>>>0}function f(u){return u.length===1?"0"+u:u}function s(u){return u.length===7?"0"+u:u.length===6?"00"+u:u.length===5?"000"+u:u.length===4?"0000"+u:u.length===3?"00000"+u:u.length===2?"000000"+u:u.length===1?"0000000"+u:u}e.inherits=c,e.toArray=function(u,h){if(Array.isArray(u))return u.slice();if(!u)return[];var v=[];if(typeof u=="string")if(h){if(h==="hex")for((u=u.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(u="0"+u),y=0;y<u.length;y+=2)v.push(parseInt(u[y]+u[y+1],16))}else for(var b=0,y=0;y<u.length;y++){var _=u.charCodeAt(y);_<128?v[b++]=_:_<2048?(v[b++]=_>>6|192,v[b++]=63&_|128):p(u,y)?(_=65536+((1023&_)<<10)+(1023&u.charCodeAt(++y)),v[b++]=_>>18|240,v[b++]=_>>12&63|128,v[b++]=_>>6&63|128,v[b++]=63&_|128):(v[b++]=_>>12|224,v[b++]=_>>6&63|128,v[b++]=63&_|128)}else for(y=0;y<u.length;y++)v[y]=0|u[y];return v},e.toHex=function(u){for(var h="",v=0;v<u.length;v++)h+=f(u[v].toString(16));return h},e.htonl=a,e.toHex32=function(u,h){for(var v="",b=0;b<u.length;b++){var y=u[b];h==="little"&&(y=a(y)),v+=s(y.toString(16))}return v},e.zero2=f,e.zero8=s,e.join32=function(u,h,v,b){var y=v-h;n(y%4==0);for(var _=new Array(y/4),E=0,S=h;E<_.length;E++,S+=4){var k;k=b==="big"?u[S]<<24|u[S+1]<<16|u[S+2]<<8|u[S+3]:u[S+3]<<24|u[S+2]<<16|u[S+1]<<8|u[S],_[E]=k>>>0}return _},e.split32=function(u,h){for(var v=new Array(4*u.length),b=0,y=0;b<u.length;b++,y+=4){var _=u[b];h==="big"?(v[y]=_>>>24,v[y+1]=_>>>16&255,v[y+2]=_>>>8&255,v[y+3]=255&_):(v[y+3]=_>>>24,v[y+2]=_>>>16&255,v[y+1]=_>>>8&255,v[y]=255&_)}return v},e.rotr32=function(u,h){return u>>>h|u<<32-h},e.rotl32=function(u,h){return u<<h|u>>>32-h},e.sum32=function(u,h){return u+h>>>0},e.sum32_3=function(u,h,v){return u+h+v>>>0},e.sum32_4=function(u,h,v,b){return u+h+v+b>>>0},e.sum32_5=function(u,h,v,b,y){return u+h+v+b+y>>>0},e.sum64=function(u,h,v,b){var y=u[h],_=b+u[h+1]>>>0,E=(_<b?1:0)+v+y;u[h]=E>>>0,u[h+1]=_},e.sum64_hi=function(u,h,v,b){return(h+b>>>0<h?1:0)+u+v>>>0},e.sum64_lo=function(u,h,v,b){return h+b>>>0},e.sum64_4_hi=function(u,h,v,b,y,_,E,S){var k=0,O=h;return k+=(O=O+b>>>0)<h?1:0,k+=(O=O+_>>>0)<_?1:0,u+v+y+E+(k+=(O=O+S>>>0)<S?1:0)>>>0},e.sum64_4_lo=function(u,h,v,b,y,_,E,S){return h+b+_+S>>>0},e.sum64_5_hi=function(u,h,v,b,y,_,E,S,k,O){var M=0,C=h;return M+=(C=C+b>>>0)<h?1:0,M+=(C=C+_>>>0)<_?1:0,M+=(C=C+S>>>0)<S?1:0,u+v+y+E+k+(M+=(C=C+O>>>0)<O?1:0)>>>0},e.sum64_5_lo=function(u,h,v,b,y,_,E,S,k,O){return h+b+_+S+O>>>0},e.rotr64_hi=function(u,h,v){return(h<<32-v|u>>>v)>>>0},e.rotr64_lo=function(u,h,v){return(u<<32-v|h>>>v)>>>0},e.shr64_hi=function(u,h,v){return u>>>v},e.shr64_lo=function(u,h,v){return(u<<32-v|h>>>v)>>>0}},function(o,e,t){(function(n){(function(c,p){function a(l,x){if(!l)throw new Error(x||"Assertion failed")}function f(l,x){l.super_=x;var d=function(){};d.prototype=x.prototype,l.prototype=new d,l.prototype.constructor=l}function s(l,x,d){if(s.isBN(l))return l;this.negative=0,this.words=null,this.length=0,this.red=null,l!==null&&(x!=="le"&&x!=="be"||(d=x,x=10),this._init(l||0,x||10,d||"be"))}var u;typeof c=="object"?c.exports=s:p.BN=s,s.BN=s,s.wordSize=26;try{u=typeof window!="undefined"&&window.Buffer!==void 0?window.Buffer:t(245).Buffer}catch{}function h(l,x){var d=l.charCodeAt(x);return d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:d-48&15}function v(l,x,d){var m=h(l,d);return d-1>=x&&(m|=h(l,d-1)<<4),m}function b(l,x,d,m){for(var g=0,w=Math.min(l.length,d),A=x;A<w;A++){var P=l.charCodeAt(A)-48;g*=m,g+=P>=49?P-49+10:P>=17?P-17+10:P}return g}s.isBN=function(l){return l instanceof s||l!==null&&typeof l=="object"&&l.constructor.wordSize===s.wordSize&&Array.isArray(l.words)},s.max=function(l,x){return l.cmp(x)>0?l:x},s.min=function(l,x){return l.cmp(x)<0?l:x},s.prototype._init=function(l,x,d){if(typeof l=="number")return this._initNumber(l,x,d);if(typeof l=="object")return this._initArray(l,x,d);x==="hex"&&(x=16),a(x===(0|x)&&x>=2&&x<=36);var m=0;(l=l.toString().replace(/\s+/g,""))[0]==="-"&&(m++,this.negative=1),m<l.length&&(x===16?this._parseHex(l,m,d):(this._parseBase(l,x,m),d==="le"&&this._initArray(this.toArray(),x,d)))},s.prototype._initNumber=function(l,x,d){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[67108863&l],this.length=1):l<4503599627370496?(this.words=[67108863&l,l/67108864&67108863],this.length=2):(a(l<9007199254740992),this.words=[67108863&l,l/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),x,d)},s.prototype._initArray=function(l,x,d){if(a(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var g,w,A=0;if(d==="be")for(m=l.length-1,g=0;m>=0;m-=3)w=l[m]|l[m-1]<<8|l[m-2]<<16,this.words[g]|=w<<A&67108863,this.words[g+1]=w>>>26-A&67108863,(A+=24)>=26&&(A-=26,g++);else if(d==="le")for(m=0,g=0;m<l.length;m+=3)w=l[m]|l[m+1]<<8|l[m+2]<<16,this.words[g]|=w<<A&67108863,this.words[g+1]=w>>>26-A&67108863,(A+=24)>=26&&(A-=26,g++);return this.strip()},s.prototype._parseHex=function(l,x,d){this.length=Math.ceil((l.length-x)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var g,w=0,A=0;if(d==="be")for(m=l.length-1;m>=x;m-=2)g=v(l,x,m)<<w,this.words[A]|=67108863&g,w>=18?(w-=18,A+=1,this.words[A]|=g>>>26):w+=8;else for(m=(l.length-x)%2==0?x+1:x;m<l.length;m+=2)g=v(l,x,m)<<w,this.words[A]|=67108863&g,w>=18?(w-=18,A+=1,this.words[A]|=g>>>26):w+=8;this.strip()},s.prototype._parseBase=function(l,x,d){this.words=[0],this.length=1;for(var m=0,g=1;g<=67108863;g*=x)m++;m--,g=g/x|0;for(var w=l.length-d,A=w%m,P=Math.min(w,w-A)+d,T=0,q=d;q<P;q+=m)T=b(l,q,q+m,x),this.imuln(g),this.words[0]+T<67108864?this.words[0]+=T:this._iaddn(T);if(A!==0){var Z=1;for(T=b(l,q,l.length,x),q=0;q<A;q++)Z*=x;this.imuln(Z),this.words[0]+T<67108864?this.words[0]+=T:this._iaddn(T)}this.strip()},s.prototype.copy=function(l){l.words=new Array(this.length);for(var x=0;x<this.length;x++)l.words[x]=this.words[x];l.length=this.length,l.negative=this.negative,l.red=this.red},s.prototype.clone=function(){var l=new s(null);return this.copy(l),l},s.prototype._expand=function(l){for(;this.length<l;)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},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","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"],_=[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],E=[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];function S(l,x,d){d.negative=x.negative^l.negative;var m=l.length+x.length|0;d.length=m,m=m-1|0;var g=0|l.words[0],w=0|x.words[0],A=g*w,P=67108863&A,T=A/67108864|0;d.words[0]=P;for(var q=1;q<m;q++){for(var Z=T>>>26,I=67108863&T,$=Math.min(q,x.length-1),K=Math.max(0,q-l.length+1);K<=$;K++){var j=q-K|0;Z+=(A=(g=0|l.words[j])*(w=0|x.words[K])+I)/67108864|0,I=67108863&A}d.words[q]=0|I,T=0|Z}return T!==0?d.words[q]=0|T:d.length--,d.strip()}s.prototype.toString=function(l,x){var d;if(x=0|x||1,(l=l||10)===16||l==="hex"){d="";for(var m=0,g=0,w=0;w<this.length;w++){var A=this.words[w],P=(16777215&(A<<m|g)).toString(16);d=(g=A>>>24-m&16777215)!==0||w!==this.length-1?y[6-P.length]+P+d:P+d,(m+=2)>=26&&(m-=26,w--)}for(g!==0&&(d=g.toString(16)+d);d.length%x!=0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(l===(0|l)&&l>=2&&l<=36){var T=_[l],q=E[l];d="";var Z=this.clone();for(Z.negative=0;!Z.isZero();){var I=Z.modn(q).toString(l);d=(Z=Z.idivn(q)).isZero()?I+d:y[T-I.length]+I+d}for(this.isZero()&&(d="0"+d);d.length%x!=0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}a(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=67108864*this.words[1]:this.length===3&&this.words[2]===1?l+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(l,x){return a(u!==void 0),this.toArrayLike(u,l,x)},s.prototype.toArray=function(l,x){return this.toArrayLike(Array,l,x)},s.prototype.toArrayLike=function(l,x,d){var m=this.byteLength(),g=d||Math.max(1,m);a(m<=g,"byte array longer than desired length"),a(g>0,"Requested array length <= 0"),this.strip();var w,A,P=x==="le",T=new l(g),q=this.clone();if(P){for(A=0;!q.isZero();A++)w=q.andln(255),q.iushrn(8),T[A]=w;for(;A<g;A++)T[A]=0}else{for(A=0;A<g-m;A++)T[A]=0;for(A=0;!q.isZero();A++)w=q.andln(255),q.iushrn(8),T[g-A-1]=w}return T},Math.clz32?s.prototype._countBits=function(l){return 32-Math.clz32(l)}:s.prototype._countBits=function(l){var x=l,d=0;return x>=4096&&(d+=13,x>>>=13),x>=64&&(d+=7,x>>>=7),x>=8&&(d+=4,x>>>=4),x>=2&&(d+=2,x>>>=2),d+x},s.prototype._zeroBits=function(l){if(l===0)return 26;var x=l,d=0;return(8191&x)==0&&(d+=13,x>>>=13),(127&x)==0&&(d+=7,x>>>=7),(15&x)==0&&(d+=4,x>>>=4),(3&x)==0&&(d+=2,x>>>=2),(1&x)==0&&d++,d},s.prototype.bitLength=function(){var l=this.words[this.length-1],x=this._countBits(l);return 26*(this.length-1)+x},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,x=0;x<this.length;x++){var d=this._zeroBits(this.words[x]);if(l+=d,d!==26)break}return l},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},s.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).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(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var x=0;x<l.length;x++)this.words[x]=this.words[x]|l.words[x];return this.strip()},s.prototype.ior=function(l){return a((this.negative|l.negative)==0),this.iuor(l)},s.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},s.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},s.prototype.iuand=function(l){var x;x=this.length>l.length?l:this;for(var d=0;d<x.length;d++)this.words[d]=this.words[d]&l.words[d];return this.length=x.length,this.strip()},s.prototype.iand=function(l){return a((this.negative|l.negative)==0),this.iuand(l)},s.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},s.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},s.prototype.iuxor=function(l){var x,d;this.length>l.length?(x=this,d=l):(x=l,d=this);for(var m=0;m<d.length;m++)this.words[m]=x.words[m]^d.words[m];if(this!==x)for(;m<x.length;m++)this.words[m]=x.words[m];return this.length=x.length,this.strip()},s.prototype.ixor=function(l){return a((this.negative|l.negative)==0),this.iuxor(l)},s.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},s.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},s.prototype.inotn=function(l){a(typeof l=="number"&&l>=0);var x=0|Math.ceil(l/26),d=l%26;this._expand(x),d>0&&x--;for(var m=0;m<x;m++)this.words[m]=67108863&~this.words[m];return d>0&&(this.words[m]=~this.words[m]&67108863>>26-d),this.strip()},s.prototype.notn=function(l){return this.clone().inotn(l)},s.prototype.setn=function(l,x){a(typeof l=="number"&&l>=0);var d=l/26|0,m=l%26;return this._expand(d+1),this.words[d]=x?this.words[d]|1<<m:this.words[d]&~(1<<m),this.strip()},s.prototype.iadd=function(l){var x,d,m;if(this.negative!==0&&l.negative===0)return this.negative=0,x=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,x=this.isub(l),l.negative=1,x._normSign();this.length>l.length?(d=this,m=l):(d=l,m=this);for(var g=0,w=0;w<m.length;w++)x=(0|d.words[w])+(0|m.words[w])+g,this.words[w]=67108863&x,g=x>>>26;for(;g!==0&&w<d.length;w++)x=(0|d.words[w])+g,this.words[w]=67108863&x,g=x>>>26;if(this.length=d.length,g!==0)this.words[this.length]=g,this.length++;else if(d!==this)for(;w<d.length;w++)this.words[w]=d.words[w];return this},s.prototype.add=function(l){var x;return l.negative!==0&&this.negative===0?(l.negative=0,x=this.sub(l),l.negative^=1,x):l.negative===0&&this.negative!==0?(this.negative=0,x=l.sub(this),this.negative=1,x):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},s.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var x=this.iadd(l);return l.negative=1,x._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var d,m,g=this.cmp(l);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;g>0?(d=this,m=l):(d=l,m=this);for(var w=0,A=0;A<m.length;A++)w=(x=(0|d.words[A])-(0|m.words[A])+w)>>26,this.words[A]=67108863&x;for(;w!==0&&A<d.length;A++)w=(x=(0|d.words[A])+w)>>26,this.words[A]=67108863&x;if(w===0&&A<d.length&&d!==this)for(;A<d.length;A++)this.words[A]=d.words[A];return this.length=Math.max(this.length,A),d!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(l){return this.clone().isub(l)};var k=function(l,x,d){var m,g,w,A=l.words,P=x.words,T=d.words,q=0,Z=0|A[0],I=8191&Z,$=Z>>>13,K=0|A[1],j=8191&K,D=K>>>13,B=0|A[2],U=8191&B,J=B>>>13,G=0|A[3],W=8191&G,Y=G>>>13,ee=0|A[4],te=8191&ee,oe=ee>>>13,fe=0|A[5],ne=8191&fe,ce=fe>>>13,se=0|A[6],ae=8191&se,he=se>>>13,me=0|A[7],le=8191&me,ye=me>>>13,Se=0|A[8],pe=8191&Se,Oe=Se>>>13,Le=0|A[9],_e=8191&Le,Fe=Le>>>13,qe=0|P[0],Ee=8191&qe,je=qe>>>13,ie=0|P[1],de=8191&ie,ke=ie>>>13,Be=0|P[2],ge=8191&Be,Ue=Be>>>13,De=0|P[3],we=8191&De,Ve=De>>>13,et=0|P[4],Ie=8191&et,Ge=et>>>13,Je=0|P[5],Re=8191&Je,He=Je>>>13,tt=0|P[6],Te=8191&tt,We=tt>>>13,Ze=0|P[7],Pe=8191&Ze,rt=Ze>>>13,Ye=0|P[8],Ae=8191&Ye,Xe=Ye>>>13,Qe=0|P[9],Ce=8191&Qe,Ke=Qe>>>13;d.negative=l.negative^x.negative,d.length=19;var X=(q+(m=Math.imul(I,Ee))|0)+((8191&(g=(g=Math.imul(I,je))+Math.imul($,Ee)|0))<<13)|0;q=((w=Math.imul($,je))+(g>>>13)|0)+(X>>>26)|0,X&=67108863,m=Math.imul(j,Ee),g=(g=Math.imul(j,je))+Math.imul(D,Ee)|0,w=Math.imul(D,je);var Q=(q+(m=m+Math.imul(I,de)|0)|0)+((8191&(g=(g=g+Math.imul(I,ke)|0)+Math.imul($,de)|0))<<13)|0;q=((w=w+Math.imul($,ke)|0)+(g>>>13)|0)+(Q>>>26)|0,Q&=67108863,m=Math.imul(U,Ee),g=(g=Math.imul(U,je))+Math.imul(J,Ee)|0,w=Math.imul(J,je),m=m+Math.imul(j,de)|0,g=(g=g+Math.imul(j,ke)|0)+Math.imul(D,de)|0,w=w+Math.imul(D,ke)|0;var re=(q+(m=m+Math.imul(I,ge)|0)|0)+((8191&(g=(g=g+Math.imul(I,Ue)|0)+Math.imul($,ge)|0))<<13)|0;q=((w=w+Math.imul($,Ue)|0)+(g>>>13)|0)+(re>>>26)|0,re&=67108863,m=Math.imul(W,Ee),g=(g=Math.imul(W,je))+Math.imul(Y,Ee)|0,w=Math.imul(Y,je),m=m+Math.imul(U,de)|0,g=(g=g+Math.imul(U,ke)|0)+Math.imul(J,de)|0,w=w+Math.imul(J,ke)|0,m=m+Math.imul(j,ge)|0,g=(g=g+Math.imul(j,Ue)|0)+Math.imul(D,ge)|0,w=w+Math.imul(D,Ue)|0;var ue=(q+(m=m+Math.imul(I,we)|0)|0)+((8191&(g=(g=g+Math.imul(I,Ve)|0)+Math.imul($,we)|0))<<13)|0;q=((w=w+Math.imul($,Ve)|0)+(g>>>13)|0)+(ue>>>26)|0,ue&=67108863,m=Math.imul(te,Ee),g=(g=Math.imul(te,je))+Math.imul(oe,Ee)|0,w=Math.imul(oe,je),m=m+Math.imul(W,de)|0,g=(g=g+Math.imul(W,ke)|0)+Math.imul(Y,de)|0,w=w+Math.imul(Y,ke)|0,m=m+Math.imul(U,ge)|0,g=(g=g+Math.imul(U,Ue)|0)+Math.imul(J,ge)|0,w=w+Math.imul(J,Ue)|0,m=m+Math.imul(j,we)|0,g=(g=g+Math.imul(j,Ve)|0)+Math.imul(D,we)|0,w=w+Math.imul(D,Ve)|0;var xe=(q+(m=m+Math.imul(I,Ie)|0)|0)+((8191&(g=(g=g+Math.imul(I,Ge)|0)+Math.imul($,Ie)|0))<<13)|0;q=((w=w+Math.imul($,Ge)|0)+(g>>>13)|0)+(xe>>>26)|0,xe&=67108863,m=Math.imul(ne,Ee),g=(g=Math.imul(ne,je))+Math.imul(ce,Ee)|0,w=Math.imul(ce,je),m=m+Math.imul(te,de)|0,g=(g=g+Math.imul(te,ke)|0)+Math.imul(oe,de)|0,w=w+Math.imul(oe,ke)|0,m=m+Math.imul(W,ge)|0,g=(g=g+Math.imul(W,Ue)|0)+Math.imul(Y,ge)|0,w=w+Math.imul(Y,Ue)|0,m=m+Math.imul(U,we)|0,g=(g=g+Math.imul(U,Ve)|0)+Math.imul(J,we)|0,w=w+Math.imul(J,Ve)|0,m=m+Math.imul(j,Ie)|0,g=(g=g+Math.imul(j,Ge)|0)+Math.imul(D,Ie)|0,w=w+Math.imul(D,Ge)|0;var Me=(q+(m=m+Math.imul(I,Re)|0)|0)+((8191&(g=(g=g+Math.imul(I,He)|0)+Math.imul($,Re)|0))<<13)|0;q=((w=w+Math.imul($,He)|0)+(g>>>13)|0)+(Me>>>26)|0,Me&=67108863,m=Math.imul(ae,Ee),g=(g=Math.imul(ae,je))+Math.imul(he,Ee)|0,w=Math.imul(he,je),m=m+Math.imul(ne,de)|0,g=(g=g+Math.imul(ne,ke)|0)+Math.imul(ce,de)|0,w=w+Math.imul(ce,ke)|0,m=m+Math.imul(te,ge)|0,g=(g=g+Math.imul(te,Ue)|0)+Math.imul(oe,ge)|0,w=w+Math.imul(oe,Ue)|0,m=m+Math.imul(W,we)|0,g=(g=g+Math.imul(W,Ve)|0)+Math.imul(Y,we)|0,w=w+Math.imul(Y,Ve)|0,m=m+Math.imul(U,Ie)|0,g=(g=g+Math.imul(U,Ge)|0)+Math.imul(J,Ie)|0,w=w+Math.imul(J,Ge)|0,m=m+Math.imul(j,Re)|0,g=(g=g+Math.imul(j,He)|0)+Math.imul(D,Re)|0,w=w+Math.imul(D,He)|0;var ze=(q+(m=m+Math.imul(I,Te)|0)|0)+((8191&(g=(g=g+Math.imul(I,We)|0)+Math.imul($,Te)|0))<<13)|0;q=((w=w+Math.imul($,We)|0)+(g>>>13)|0)+(ze>>>26)|0,ze&=67108863,m=Math.imul(le,Ee),g=(g=Math.imul(le,je))+Math.imul(ye,Ee)|0,w=Math.imul(ye,je),m=m+Math.imul(ae,de)|0,g=(g=g+Math.imul(ae,ke)|0)+Math.imul(he,de)|0,w=w+Math.imul(he,ke)|0,m=m+Math.imul(ne,ge)|0,g=(g=g+Math.imul(ne,Ue)|0)+Math.imul(ce,ge)|0,w=w+Math.imul(ce,Ue)|0,m=m+Math.imul(te,we)|0,g=(g=g+Math.imul(te,Ve)|0)+Math.imul(oe,we)|0,w=w+Math.imul(oe,Ve)|0,m=m+Math.imul(W,Ie)|0,g=(g=g+Math.imul(W,Ge)|0)+Math.imul(Y,Ie)|0,w=w+Math.imul(Y,Ge)|0,m=m+Math.imul(U,Re)|0,g=(g=g+Math.imul(U,He)|0)+Math.imul(J,Re)|0,w=w+Math.imul(J,He)|0,m=m+Math.imul(j,Te)|0,g=(g=g+Math.imul(j,We)|0)+Math.imul(D,Te)|0,w=w+Math.imul(D,We)|0;var $e=(q+(m=m+Math.imul(I,Pe)|0)|0)+((8191&(g=(g=g+Math.imul(I,rt)|0)+Math.imul($,Pe)|0))<<13)|0;q=((w=w+Math.imul($,rt)|0)+(g>>>13)|0)+($e>>>26)|0,$e&=67108863,m=Math.imul(pe,Ee),g=(g=Math.imul(pe,je))+Math.imul(Oe,Ee)|0,w=Math.imul(Oe,je),m=m+Math.imul(le,de)|0,g=(g=g+Math.imul(le,ke)|0)+Math.imul(ye,de)|0,w=w+Math.imul(ye,ke)|0,m=m+Math.imul(ae,ge)|0,g=(g=g+Math.imul(ae,Ue)|0)+Math.imul(he,ge)|0,w=w+Math.imul(he,Ue)|0,m=m+Math.imul(ne,we)|0,g=(g=g+Math.imul(ne,Ve)|0)+Math.imul(ce,we)|0,w=w+Math.imul(ce,Ve)|0,m=m+Math.imul(te,Ie)|0,g=(g=g+Math.imul(te,Ge)|0)+Math.imul(oe,Ie)|0,w=w+Math.imul(oe,Ge)|0,m=m+Math.imul(W,Re)|0,g=(g=g+Math.imul(W,He)|0)+Math.imul(Y,Re)|0,w=w+Math.imul(Y,He)|0,m=m+Math.imul(U,Te)|0,g=(g=g+Math.imul(U,We)|0)+Math.imul(J,Te)|0,w=w+Math.imul(J,We)|0,m=m+Math.imul(j,Pe)|0,g=(g=g+Math.imul(j,rt)|0)+Math.imul(D,Pe)|0,w=w+Math.imul(D,rt)|0;var it=(q+(m=m+Math.imul(I,Ae)|0)|0)+((8191&(g=(g=g+Math.imul(I,Xe)|0)+Math.imul($,Ae)|0))<<13)|0;q=((w=w+Math.imul($,Xe)|0)+(g>>>13)|0)+(it>>>26)|0,it&=67108863,m=Math.imul(_e,Ee),g=(g=Math.imul(_e,je))+Math.imul(Fe,Ee)|0,w=Math.imul(Fe,je),m=m+Math.imul(pe,de)|0,g=(g=g+Math.imul(pe,ke)|0)+Math.imul(Oe,de)|0,w=w+Math.imul(Oe,ke)|0,m=m+Math.imul(le,ge)|0,g=(g=g+Math.imul(le,Ue)|0)+Math.imul(ye,ge)|0,w=w+Math.imul(ye,Ue)|0,m=m+Math.imul(ae,we)|0,g=(g=g+Math.imul(ae,Ve)|0)+Math.imul(he,we)|0,w=w+Math.imul(he,Ve)|0,m=m+Math.imul(ne,Ie)|0,g=(g=g+Math.imul(ne,Ge)|0)+Math.imul(ce,Ie)|0,w=w+Math.imul(ce,Ge)|0,m=m+Math.imul(te,Re)|0,g=(g=g+Math.imul(te,He)|0)+Math.imul(oe,Re)|0,w=w+Math.imul(oe,He)|0,m=m+Math.imul(W,Te)|0,g=(g=g+Math.imul(W,We)|0)+Math.imul(Y,Te)|0,w=w+Math.imul(Y,We)|0,m=m+Math.imul(U,Pe)|0,g=(g=g+Math.imul(U,rt)|0)+Math.imul(J,Pe)|0,w=w+Math.imul(J,rt)|0,m=m+Math.imul(j,Ae)|0,g=(g=g+Math.imul(j,Xe)|0)+Math.imul(D,Ae)|0,w=w+Math.imul(D,Xe)|0;var Ne=(q+(m=m+Math.imul(I,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(I,Ke)|0)+Math.imul($,Ce)|0))<<13)|0;q=((w=w+Math.imul($,Ke)|0)+(g>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,m=Math.imul(_e,de),g=(g=Math.imul(_e,ke))+Math.imul(Fe,de)|0,w=Math.imul(Fe,ke),m=m+Math.imul(pe,ge)|0,g=(g=g+Math.imul(pe,Ue)|0)+Math.imul(Oe,ge)|0,w=w+Math.imul(Oe,Ue)|0,m=m+Math.imul(le,we)|0,g=(g=g+Math.imul(le,Ve)|0)+Math.imul(ye,we)|0,w=w+Math.imul(ye,Ve)|0,m=m+Math.imul(ae,Ie)|0,g=(g=g+Math.imul(ae,Ge)|0)+Math.imul(he,Ie)|0,w=w+Math.imul(he,Ge)|0,m=m+Math.imul(ne,Re)|0,g=(g=g+Math.imul(ne,He)|0)+Math.imul(ce,Re)|0,w=w+Math.imul(ce,He)|0,m=m+Math.imul(te,Te)|0,g=(g=g+Math.imul(te,We)|0)+Math.imul(oe,Te)|0,w=w+Math.imul(oe,We)|0,m=m+Math.imul(W,Pe)|0,g=(g=g+Math.imul(W,rt)|0)+Math.imul(Y,Pe)|0,w=w+Math.imul(Y,rt)|0,m=m+Math.imul(U,Ae)|0,g=(g=g+Math.imul(U,Xe)|0)+Math.imul(J,Ae)|0,w=w+Math.imul(J,Xe)|0;var ve=(q+(m=m+Math.imul(j,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(j,Ke)|0)+Math.imul(D,Ce)|0))<<13)|0;q=((w=w+Math.imul(D,Ke)|0)+(g>>>13)|0)+(ve>>>26)|0,ve&=67108863,m=Math.imul(_e,ge),g=(g=Math.imul(_e,Ue))+Math.imul(Fe,ge)|0,w=Math.imul(Fe,Ue),m=m+Math.imul(pe,we)|0,g=(g=g+Math.imul(pe,Ve)|0)+Math.imul(Oe,we)|0,w=w+Math.imul(Oe,Ve)|0,m=m+Math.imul(le,Ie)|0,g=(g=g+Math.imul(le,Ge)|0)+Math.imul(ye,Ie)|0,w=w+Math.imul(ye,Ge)|0,m=m+Math.imul(ae,Re)|0,g=(g=g+Math.imul(ae,He)|0)+Math.imul(he,Re)|0,w=w+Math.imul(he,He)|0,m=m+Math.imul(ne,Te)|0,g=(g=g+Math.imul(ne,We)|0)+Math.imul(ce,Te)|0,w=w+Math.imul(ce,We)|0,m=m+Math.imul(te,Pe)|0,g=(g=g+Math.imul(te,rt)|0)+Math.imul(oe,Pe)|0,w=w+Math.imul(oe,rt)|0,m=m+Math.imul(W,Ae)|0,g=(g=g+Math.imul(W,Xe)|0)+Math.imul(Y,Ae)|0,w=w+Math.imul(Y,Xe)|0;var st=(q+(m=m+Math.imul(U,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(U,Ke)|0)+Math.imul(J,Ce)|0))<<13)|0;q=((w=w+Math.imul(J,Ke)|0)+(g>>>13)|0)+(st>>>26)|0,st&=67108863,m=Math.imul(_e,we),g=(g=Math.imul(_e,Ve))+Math.imul(Fe,we)|0,w=Math.imul(Fe,Ve),m=m+Math.imul(pe,Ie)|0,g=(g=g+Math.imul(pe,Ge)|0)+Math.imul(Oe,Ie)|0,w=w+Math.imul(Oe,Ge)|0,m=m+Math.imul(le,Re)|0,g=(g=g+Math.imul(le,He)|0)+Math.imul(ye,Re)|0,w=w+Math.imul(ye,He)|0,m=m+Math.imul(ae,Te)|0,g=(g=g+Math.imul(ae,We)|0)+Math.imul(he,Te)|0,w=w+Math.imul(he,We)|0,m=m+Math.imul(ne,Pe)|0,g=(g=g+Math.imul(ne,rt)|0)+Math.imul(ce,Pe)|0,w=w+Math.imul(ce,rt)|0,m=m+Math.imul(te,Ae)|0,g=(g=g+Math.imul(te,Xe)|0)+Math.imul(oe,Ae)|0,w=w+Math.imul(oe,Xe)|0;var dt=(q+(m=m+Math.imul(W,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(W,Ke)|0)+Math.imul(Y,Ce)|0))<<13)|0;q=((w=w+Math.imul(Y,Ke)|0)+(g>>>13)|0)+(dt>>>26)|0,dt&=67108863,m=Math.imul(_e,Ie),g=(g=Math.imul(_e,Ge))+Math.imul(Fe,Ie)|0,w=Math.imul(Fe,Ge),m=m+Math.imul(pe,Re)|0,g=(g=g+Math.imul(pe,He)|0)+Math.imul(Oe,Re)|0,w=w+Math.imul(Oe,He)|0,m=m+Math.imul(le,Te)|0,g=(g=g+Math.imul(le,We)|0)+Math.imul(ye,Te)|0,w=w+Math.imul(ye,We)|0,m=m+Math.imul(ae,Pe)|0,g=(g=g+Math.imul(ae,rt)|0)+Math.imul(he,Pe)|0,w=w+Math.imul(he,rt)|0,m=m+Math.imul(ne,Ae)|0,g=(g=g+Math.imul(ne,Xe)|0)+Math.imul(ce,Ae)|0,w=w+Math.imul(ce,Xe)|0;var vt=(q+(m=m+Math.imul(te,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(te,Ke)|0)+Math.imul(oe,Ce)|0))<<13)|0;q=((w=w+Math.imul(oe,Ke)|0)+(g>>>13)|0)+(vt>>>26)|0,vt&=67108863,m=Math.imul(_e,Re),g=(g=Math.imul(_e,He))+Math.imul(Fe,Re)|0,w=Math.imul(Fe,He),m=m+Math.imul(pe,Te)|0,g=(g=g+Math.imul(pe,We)|0)+Math.imul(Oe,Te)|0,w=w+Math.imul(Oe,We)|0,m=m+Math.imul(le,Pe)|0,g=(g=g+Math.imul(le,rt)|0)+Math.imul(ye,Pe)|0,w=w+Math.imul(ye,rt)|0,m=m+Math.imul(ae,Ae)|0,g=(g=g+Math.imul(ae,Xe)|0)+Math.imul(he,Ae)|0,w=w+Math.imul(he,Xe)|0;var mt=(q+(m=m+Math.imul(ne,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(ne,Ke)|0)+Math.imul(ce,Ce)|0))<<13)|0;q=((w=w+Math.imul(ce,Ke)|0)+(g>>>13)|0)+(mt>>>26)|0,mt&=67108863,m=Math.imul(_e,Te),g=(g=Math.imul(_e,We))+Math.imul(Fe,Te)|0,w=Math.imul(Fe,We),m=m+Math.imul(pe,Pe)|0,g=(g=g+Math.imul(pe,rt)|0)+Math.imul(Oe,Pe)|0,w=w+Math.imul(Oe,rt)|0,m=m+Math.imul(le,Ae)|0,g=(g=g+Math.imul(le,Xe)|0)+Math.imul(ye,Ae)|0,w=w+Math.imul(ye,Xe)|0;var _t=(q+(m=m+Math.imul(ae,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(ae,Ke)|0)+Math.imul(he,Ce)|0))<<13)|0;q=((w=w+Math.imul(he,Ke)|0)+(g>>>13)|0)+(_t>>>26)|0,_t&=67108863,m=Math.imul(_e,Pe),g=(g=Math.imul(_e,rt))+Math.imul(Fe,Pe)|0,w=Math.imul(Fe,rt),m=m+Math.imul(pe,Ae)|0,g=(g=g+Math.imul(pe,Xe)|0)+Math.imul(Oe,Ae)|0,w=w+Math.imul(Oe,Xe)|0;var at=(q+(m=m+Math.imul(le,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(le,Ke)|0)+Math.imul(ye,Ce)|0))<<13)|0;q=((w=w+Math.imul(ye,Ke)|0)+(g>>>13)|0)+(at>>>26)|0,at&=67108863,m=Math.imul(_e,Ae),g=(g=Math.imul(_e,Xe))+Math.imul(Fe,Ae)|0,w=Math.imul(Fe,Xe);var xt=(q+(m=m+Math.imul(pe,Ce)|0)|0)+((8191&(g=(g=g+Math.imul(pe,Ke)|0)+Math.imul(Oe,Ce)|0))<<13)|0;q=((w=w+Math.imul(Oe,Ke)|0)+(g>>>13)|0)+(xt>>>26)|0,xt&=67108863;var ut=(q+(m=Math.imul(_e,Ce))|0)+((8191&(g=(g=Math.imul(_e,Ke))+Math.imul(Fe,Ce)|0))<<13)|0;return q=((w=Math.imul(Fe,Ke))+(g>>>13)|0)+(ut>>>26)|0,ut&=67108863,T[0]=X,T[1]=Q,T[2]=re,T[3]=ue,T[4]=xe,T[5]=Me,T[6]=ze,T[7]=$e,T[8]=it,T[9]=Ne,T[10]=ve,T[11]=st,T[12]=dt,T[13]=vt,T[14]=mt,T[15]=_t,T[16]=at,T[17]=xt,T[18]=ut,q!==0&&(T[19]=q,d.length++),d};function O(l,x,d){return new M().mulp(l,x,d)}function M(l,x){this.x=l,this.y=x}Math.imul||(k=S),s.prototype.mulTo=function(l,x){var d=this.length+l.length;return this.length===10&&l.length===10?k(this,l,x):d<63?S(this,l,x):d<1024?function(m,g,w){w.negative=g.negative^m.negative,w.length=m.length+g.length;for(var A=0,P=0,T=0;T<w.length-1;T++){var q=P;P=0;for(var Z=67108863&A,I=Math.min(T,g.length-1),$=Math.max(0,T-m.length+1);$<=I;$++){var K=T-$,j=(0|m.words[K])*(0|g.words[$]),D=67108863&j;Z=67108863&(D=D+Z|0),P+=(q=(q=q+(j/67108864|0)|0)+(D>>>26)|0)>>>26,q&=67108863}w.words[T]=Z,A=q,q=P}return A!==0?w.words[T]=A:w.length--,w.strip()}(this,l,x):O(this,l,x)},M.prototype.makeRBT=function(l){for(var x=new Array(l),d=s.prototype._countBits(l)-1,m=0;m<l;m++)x[m]=this.revBin(m,d,l);return x},M.prototype.revBin=function(l,x,d){if(l===0||l===d-1)return l;for(var m=0,g=0;g<x;g++)m|=(1&l)<<x-g-1,l>>=1;return m},M.prototype.permute=function(l,x,d,m,g,w){for(var A=0;A<w;A++)m[A]=x[l[A]],g[A]=d[l[A]]},M.prototype.transform=function(l,x,d,m,g,w){this.permute(w,l,x,d,m,g);for(var A=1;A<g;A<<=1)for(var P=A<<1,T=Math.cos(2*Math.PI/P),q=Math.sin(2*Math.PI/P),Z=0;Z<g;Z+=P)for(var I=T,$=q,K=0;K<A;K++){var j=d[Z+K],D=m[Z+K],B=d[Z+K+A],U=m[Z+K+A],J=I*B-$*U;U=I*U+$*B,B=J,d[Z+K]=j+B,m[Z+K]=D+U,d[Z+K+A]=j-B,m[Z+K+A]=D-U,K!==P&&(J=T*I-q*$,$=T*$+q*I,I=J)}},M.prototype.guessLen13b=function(l,x){var d=1|Math.max(x,l),m=1&d,g=0;for(d=d/2|0;d;d>>>=1)g++;return 1<<g+1+m},M.prototype.conjugate=function(l,x,d){if(!(d<=1))for(var m=0;m<d/2;m++){var g=l[m];l[m]=l[d-m-1],l[d-m-1]=g,g=x[m],x[m]=-x[d-m-1],x[d-m-1]=-g}},M.prototype.normalize13b=function(l,x){for(var d=0,m=0;m<x/2;m++){var g=8192*Math.round(l[2*m+1]/x)+Math.round(l[2*m]/x)+d;l[m]=67108863&g,d=g<67108864?0:g/67108864|0}return l},M.prototype.convert13b=function(l,x,d,m){for(var g=0,w=0;w<x;w++)g+=0|l[w],d[2*w]=8191&g,g>>>=13,d[2*w+1]=8191&g,g>>>=13;for(w=2*x;w<m;++w)d[w]=0;a(g===0),a((-8192&g)==0)},M.prototype.stub=function(l){for(var x=new Array(l),d=0;d<l;d++)x[d]=0;return x},M.prototype.mulp=function(l,x,d){var m=2*this.guessLen13b(l.length,x.length),g=this.makeRBT(m),w=this.stub(m),A=new Array(m),P=new Array(m),T=new Array(m),q=new Array(m),Z=new Array(m),I=new Array(m),$=d.words;$.length=m,this.convert13b(l.words,l.length,A,m),this.convert13b(x.words,x.length,q,m),this.transform(A,w,P,T,m,g),this.transform(q,w,Z,I,m,g);for(var K=0;K<m;K++){var j=P[K]*Z[K]-T[K]*I[K];T[K]=P[K]*I[K]+T[K]*Z[K],P[K]=j}return this.conjugate(P,T,m),this.transform(P,T,$,w,m,g),this.conjugate($,w,m),this.normalize13b($,m),d.negative=l.negative^x.negative,d.length=l.length+x.length,d.strip()},s.prototype.mul=function(l){var x=new s(null);return x.words=new Array(this.length+l.length),this.mulTo(l,x)},s.prototype.mulf=function(l){var x=new s(null);return x.words=new Array(this.length+l.length),O(this,l,x)},s.prototype.imul=function(l){return this.clone().mulTo(l,this)},s.prototype.imuln=function(l){a(typeof l=="number"),a(l<67108864);for(var x=0,d=0;d<this.length;d++){var m=(0|this.words[d])*l,g=(67108863&m)+(67108863&x);x>>=26,x+=m/67108864|0,x+=g>>>26,this.words[d]=67108863&g}return x!==0&&(this.words[d]=x,this.length++),this},s.prototype.muln=function(l){return this.clone().imuln(l)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(l){var x=function(w){for(var A=new Array(w.bitLength()),P=0;P<A.length;P++){var T=P/26|0,q=P%26;A[P]=(w.words[T]&1<<q)>>>q}return A}(l);if(x.length===0)return new s(1);for(var d=this,m=0;m<x.length&&x[m]===0;m++,d=d.sqr());if(++m<x.length)for(var g=d.sqr();m<x.length;m++,g=g.sqr())x[m]!==0&&(d=d.mul(g));return d},s.prototype.iushln=function(l){a(typeof l=="number"&&l>=0);var x,d=l%26,m=(l-d)/26,g=67108863>>>26-d<<26-d;if(d!==0){var w=0;for(x=0;x<this.length;x++){var A=this.words[x]&g,P=(0|this.words[x])-A<<d;this.words[x]=P|w,w=A>>>26-d}w&&(this.words[x]=w,this.length++)}if(m!==0){for(x=this.length-1;x>=0;x--)this.words[x+m]=this.words[x];for(x=0;x<m;x++)this.words[x]=0;this.length+=m}return this.strip()},s.prototype.ishln=function(l){return a(this.negative===0),this.iushln(l)},s.prototype.iushrn=function(l,x,d){var m;a(typeof l=="number"&&l>=0),m=x?(x-x%26)/26:0;var g=l%26,w=Math.min((l-g)/26,this.length),A=67108863^67108863>>>g<<g,P=d;if(m-=w,m=Math.max(0,m),P){for(var T=0;T<w;T++)P.words[T]=this.words[T];P.length=w}if(w!==0)if(this.length>w)for(this.length-=w,T=0;T<this.length;T++)this.words[T]=this.words[T+w];else this.words[0]=0,this.length=1;var q=0;for(T=this.length-1;T>=0&&(q!==0||T>=m);T--){var Z=0|this.words[T];this.words[T]=q<<26-g|Z>>>g,q=Z&A}return P&&q!==0&&(P.words[P.length++]=q),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(l,x,d){return a(this.negative===0),this.iushrn(l,x,d)},s.prototype.shln=function(l){return this.clone().ishln(l)},s.prototype.ushln=function(l){return this.clone().iushln(l)},s.prototype.shrn=function(l){return this.clone().ishrn(l)},s.prototype.ushrn=function(l){return this.clone().iushrn(l)},s.prototype.testn=function(l){a(typeof l=="number"&&l>=0);var x=l%26,d=(l-x)/26,m=1<<x;return!(this.length<=d)&&!!(this.words[d]&m)},s.prototype.imaskn=function(l){a(typeof l=="number"&&l>=0);var x=l%26,d=(l-x)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(x!==0&&d++,this.length=Math.min(d,this.length),x!==0){var m=67108863^67108863>>>x<<x;this.words[this.length-1]&=m}return this.strip()},s.prototype.maskn=function(l){return this.clone().imaskn(l)},s.prototype.iaddn=function(l){return a(typeof l=="number"),a(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(0|this.words[0])<l?(this.words[0]=l-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},s.prototype._iaddn=function(l){this.words[0]+=l;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},s.prototype.isubn=function(l){if(a(typeof l=="number"),a(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this.strip()},s.prototype.addn=function(l){return this.clone().iaddn(l)},s.prototype.subn=function(l){return this.clone().isubn(l)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(l,x,d){var m,g,w=l.length+d;this._expand(w);var A=0;for(m=0;m<l.length;m++){g=(0|this.words[m+d])+A;var P=(0|l.words[m])*x;A=((g-=67108863&P)>>26)-(P/67108864|0),this.words[m+d]=67108863&g}for(;m<this.length-d;m++)A=(g=(0|this.words[m+d])+A)>>26,this.words[m+d]=67108863&g;if(A===0)return this.strip();for(a(A===-1),A=0,m=0;m<this.length;m++)A=(g=-(0|this.words[m])+A)>>26,this.words[m]=67108863&g;return this.negative=1,this.strip()},s.prototype._wordDiv=function(l,x){var d=(this.length,l.length),m=this.clone(),g=l,w=0|g.words[g.length-1];(d=26-this._countBits(w))!==0&&(g=g.ushln(d),m.iushln(d),w=0|g.words[g.length-1]);var A,P=m.length-g.length;if(x!=="mod"){(A=new s(null)).length=P+1,A.words=new Array(A.length);for(var T=0;T<A.length;T++)A.words[T]=0}var q=m.clone()._ishlnsubmul(g,1,P);q.negative===0&&(m=q,A&&(A.words[P]=1));for(var Z=P-1;Z>=0;Z--){var I=67108864*(0|m.words[g.length+Z])+(0|m.words[g.length+Z-1]);for(I=Math.min(I/w|0,67108863),m._ishlnsubmul(g,I,Z);m.negative!==0;)I--,m.negative=0,m._ishlnsubmul(g,1,Z),m.isZero()||(m.negative^=1);A&&(A.words[Z]=I)}return A&&A.strip(),m.strip(),x!=="div"&&d!==0&&m.iushrn(d),{div:A||null,mod:m}},s.prototype.divmod=function(l,x,d){return a(!l.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&l.negative===0?(w=this.neg().divmod(l,x),x!=="mod"&&(m=w.div.neg()),x!=="div"&&(g=w.mod.neg(),d&&g.negative!==0&&g.iadd(l)),{div:m,mod:g}):this.negative===0&&l.negative!==0?(w=this.divmod(l.neg(),x),x!=="mod"&&(m=w.div.neg()),{div:m,mod:w.mod}):(this.negative&l.negative)!=0?(w=this.neg().divmod(l.neg(),x),x!=="div"&&(g=w.mod.neg(),d&&g.negative!==0&&g.isub(l)),{div:w.div,mod:g}):l.length>this.length||this.cmp(l)<0?{div:new s(0),mod:this}:l.length===1?x==="div"?{div:this.divn(l.words[0]),mod:null}:x==="mod"?{div:null,mod:new s(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new s(this.modn(l.words[0]))}:this._wordDiv(l,x);var m,g,w},s.prototype.div=function(l){return this.divmod(l,"div",!1).div},s.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},s.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},s.prototype.divRound=function(l){var x=this.divmod(l);if(x.mod.isZero())return x.div;var d=x.div.negative!==0?x.mod.isub(l):x.mod,m=l.ushrn(1),g=l.andln(1),w=d.cmp(m);return w<0||g===1&&w===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},s.prototype.modn=function(l){a(l<=67108863);for(var x=(1<<26)%l,d=0,m=this.length-1;m>=0;m--)d=(x*d+(0|this.words[m]))%l;return d},s.prototype.idivn=function(l){a(l<=67108863);for(var x=0,d=this.length-1;d>=0;d--){var m=(0|this.words[d])+67108864*x;this.words[d]=m/l|0,x=m%l}return this.strip()},s.prototype.divn=function(l){return this.clone().idivn(l)},s.prototype.egcd=function(l){a(l.negative===0),a(!l.isZero());var x=this,d=l.clone();x=x.negative!==0?x.umod(l):x.clone();for(var m=new s(1),g=new s(0),w=new s(0),A=new s(1),P=0;x.isEven()&&d.isEven();)x.iushrn(1),d.iushrn(1),++P;for(var T=d.clone(),q=x.clone();!x.isZero();){for(var Z=0,I=1;(x.words[0]&I)==0&&Z<26;++Z,I<<=1);if(Z>0)for(x.iushrn(Z);Z-- >0;)(m.isOdd()||g.isOdd())&&(m.iadd(T),g.isub(q)),m.iushrn(1),g.iushrn(1);for(var $=0,K=1;(d.words[0]&K)==0&&$<26;++$,K<<=1);if($>0)for(d.iushrn($);$-- >0;)(w.isOdd()||A.isOdd())&&(w.iadd(T),A.isub(q)),w.iushrn(1),A.iushrn(1);x.cmp(d)>=0?(x.isub(d),m.isub(w),g.isub(A)):(d.isub(x),w.isub(m),A.isub(g))}return{a:w,b:A,gcd:d.iushln(P)}},s.prototype._invmp=function(l){a(l.negative===0),a(!l.isZero());var x=this,d=l.clone();x=x.negative!==0?x.umod(l):x.clone();for(var m,g=new s(1),w=new s(0),A=d.clone();x.cmpn(1)>0&&d.cmpn(1)>0;){for(var P=0,T=1;(x.words[0]&T)==0&&P<26;++P,T<<=1);if(P>0)for(x.iushrn(P);P-- >0;)g.isOdd()&&g.iadd(A),g.iushrn(1);for(var q=0,Z=1;(d.words[0]&Z)==0&&q<26;++q,Z<<=1);if(q>0)for(d.iushrn(q);q-- >0;)w.isOdd()&&w.iadd(A),w.iushrn(1);x.cmp(d)>=0?(x.isub(d),g.isub(w)):(d.isub(x),w.isub(g))}return(m=x.cmpn(1)===0?g:w).cmpn(0)<0&&m.iadd(l),m},s.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var x=this.clone(),d=l.clone();x.negative=0,d.negative=0;for(var m=0;x.isEven()&&d.isEven();m++)x.iushrn(1),d.iushrn(1);for(;;){for(;x.isEven();)x.iushrn(1);for(;d.isEven();)d.iushrn(1);var g=x.cmp(d);if(g<0){var w=x;x=d,d=w}else if(g===0||d.cmpn(1)===0)break;x.isub(d)}return d.iushln(m)},s.prototype.invm=function(l){return this.egcd(l).a.umod(l)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(l){return this.words[0]&l},s.prototype.bincn=function(l){a(typeof l=="number");var x=l%26,d=(l-x)/26,m=1<<x;if(this.length<=d)return this._expand(d+1),this.words[d]|=m,this;for(var g=m,w=d;g!==0&&w<this.length;w++){var A=0|this.words[w];g=(A+=g)>>>26,A&=67108863,this.words[w]=A}return g!==0&&(this.words[w]=g,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(l){var x,d=l<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;if(this.strip(),this.length>1)x=1;else{d&&(l=-l),a(l<=67108863,"Number is too big");var m=0|this.words[0];x=m===l?0:m<l?-1:1}return this.negative!==0?0|-x:x},s.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var x=this.ucmp(l);return this.negative!==0?0|-x:x},s.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var x=0,d=this.length-1;d>=0;d--){var m=0|this.words[d],g=0|l.words[d];if(m!==g){m<g?x=-1:m>g&&(x=1);break}}return x},s.prototype.gtn=function(l){return this.cmpn(l)===1},s.prototype.gt=function(l){return this.cmp(l)===1},s.prototype.gten=function(l){return this.cmpn(l)>=0},s.prototype.gte=function(l){return this.cmp(l)>=0},s.prototype.ltn=function(l){return this.cmpn(l)===-1},s.prototype.lt=function(l){return this.cmp(l)===-1},s.prototype.lten=function(l){return this.cmpn(l)<=0},s.prototype.lte=function(l){return this.cmp(l)<=0},s.prototype.eqn=function(l){return this.cmpn(l)===0},s.prototype.eq=function(l){return this.cmp(l)===0},s.red=function(l){return new z(l)},s.prototype.toRed=function(l){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},s.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(l){return this.red=l,this},s.prototype.forceRed=function(l){return a(!this.red,"Already a number in reduction context"),this._forceRed(l)},s.prototype.redAdd=function(l){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},s.prototype.redIAdd=function(l){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},s.prototype.redSub=function(l){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},s.prototype.redISub=function(l){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},s.prototype.redShl=function(l){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},s.prototype.redMul=function(l){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},s.prototype.redIMul=function(l){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},s.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(l){return a(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var C={k256:null,p224:null,p192:null,p25519:null};function N(l,x){this.name=l,this.p=new s(x,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function L(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function F(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function V(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function H(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function z(l){if(typeof l=="string"){var x=s._prime(l);this.m=x.p,this.prime=x}else a(l.gtn(1),"modulus must be greater than 1"),this.m=l,this.prime=null}function R(l){z.call(this,l),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)}N.prototype._tmp=function(){var l=new s(null);return l.words=new Array(Math.ceil(this.n/13)),l},N.prototype.ireduce=function(l){var x,d=l;do this.split(d,this.tmp),x=(d=(d=this.imulK(d)).iadd(this.tmp)).bitLength();while(x>this.n);var m=x<this.n?-1:d.ucmp(this.p);return m===0?(d.words[0]=0,d.length=1):m>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},N.prototype.split=function(l,x){l.iushrn(this.n,0,x)},N.prototype.imulK=function(l){return l.imul(this.k)},f(L,N),L.prototype.split=function(l,x){for(var d=Math.min(l.length,9),m=0;m<d;m++)x.words[m]=l.words[m];if(x.length=d,l.length<=9)return l.words[0]=0,void(l.length=1);var g=l.words[9];for(x.words[x.length++]=4194303&g,m=10;m<l.length;m++){var w=0|l.words[m];l.words[m-10]=(4194303&w)<<4|g>>>22,g=w}g>>>=22,l.words[m-10]=g,g===0&&l.length>10?l.length-=10:l.length-=9},L.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var x=0,d=0;d<l.length;d++){var m=0|l.words[d];x+=977*m,l.words[d]=67108863&x,x=64*m+(x/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l},f(F,N),f(V,N),f(H,N),H.prototype.imulK=function(l){for(var x=0,d=0;d<l.length;d++){var m=19*(0|l.words[d])+x,g=67108863&m;m>>>=26,l.words[d]=g,x=m}return x!==0&&(l.words[l.length++]=x),l},s._prime=function(l){if(C[l])return C[l];var x;if(l==="k256")x=new L;else if(l==="p224")x=new F;else if(l==="p192")x=new V;else{if(l!=="p25519")throw new Error("Unknown prime "+l);x=new H}return C[l]=x,x},z.prototype._verify1=function(l){a(l.negative===0,"red works only with positives"),a(l.red,"red works only with red numbers")},z.prototype._verify2=function(l,x){a((l.negative|x.negative)==0,"red works only with positives"),a(l.red&&l.red===x.red,"red works only with red numbers")},z.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},z.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},z.prototype.add=function(l,x){this._verify2(l,x);var d=l.add(x);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},z.prototype.iadd=function(l,x){this._verify2(l,x);var d=l.iadd(x);return d.cmp(this.m)>=0&&d.isub(this.m),d},z.prototype.sub=function(l,x){this._verify2(l,x);var d=l.sub(x);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},z.prototype.isub=function(l,x){this._verify2(l,x);var d=l.isub(x);return d.cmpn(0)<0&&d.iadd(this.m),d},z.prototype.shl=function(l,x){return this._verify1(l),this.imod(l.ushln(x))},z.prototype.imul=function(l,x){return this._verify2(l,x),this.imod(l.imul(x))},z.prototype.mul=function(l,x){return this._verify2(l,x),this.imod(l.mul(x))},z.prototype.isqr=function(l){return this.imul(l,l.clone())},z.prototype.sqr=function(l){return this.mul(l,l)},z.prototype.sqrt=function(l){if(l.isZero())return l.clone();var x=this.m.andln(3);if(a(x%2==1),x===3){var d=this.m.add(new s(1)).iushrn(2);return this.pow(l,d)}for(var m=this.m.subn(1),g=0;!m.isZero()&&m.andln(1)===0;)g++,m.iushrn(1);a(!m.isZero());var w=new s(1).toRed(this),A=w.redNeg(),P=this.m.subn(1).iushrn(1),T=this.m.bitLength();for(T=new s(2*T*T).toRed(this);this.pow(T,P).cmp(A)!==0;)T.redIAdd(A);for(var q=this.pow(T,m),Z=this.pow(l,m.addn(1).iushrn(1)),I=this.pow(l,m),$=g;I.cmp(w)!==0;){for(var K=I,j=0;K.cmp(w)!==0;j++)K=K.redSqr();a(j<$);var D=this.pow(q,new s(1).iushln($-j-1));Z=Z.redMul(D),q=D.redSqr(),I=I.redMul(q),$=j}return Z},z.prototype.invm=function(l){var x=l._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},z.prototype.pow=function(l,x){if(x.isZero())return new s(1).toRed(this);if(x.cmpn(1)===0)return l.clone();var d=new Array(16);d[0]=new s(1).toRed(this),d[1]=l;for(var m=2;m<d.length;m++)d[m]=this.mul(d[m-1],l);var g=d[0],w=0,A=0,P=x.bitLength()%26;for(P===0&&(P=26),m=x.length-1;m>=0;m--){for(var T=x.words[m],q=P-1;q>=0;q--){var Z=T>>q&1;g!==d[0]&&(g=this.sqr(g)),Z!==0||w!==0?(w<<=1,w|=Z,(++A===4||m===0&&q===0)&&(g=this.mul(g,d[w]),A=0,w=0)):A=0}P=26}return g},z.prototype.convertTo=function(l){var x=l.umod(this.m);return x===l?x.clone():x},z.prototype.convertFrom=function(l){var x=l.clone();return x.red=null,x},s.mont=function(l){return new R(l)},f(R,z),R.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},R.prototype.convertFrom=function(l){var x=this.imod(l.mul(this.rinv));return x.red=null,x},R.prototype.imul=function(l,x){if(l.isZero()||x.isZero())return l.words[0]=0,l.length=1,l;var d=l.imul(x),m=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=d.isub(m).iushrn(this.shift),w=g;return g.cmp(this.m)>=0?w=g.isub(this.m):g.cmpn(0)<0&&(w=g.iadd(this.m)),w._forceRed(this)},R.prototype.mul=function(l,x){if(l.isZero()||x.isZero())return new s(0)._forceRed(this);var d=l.mul(x),m=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=d.isub(m).iushrn(this.shift),w=g;return g.cmp(this.m)>=0?w=g.isub(this.m):g.cmpn(0)<0&&(w=g.iadd(this.m)),w._forceRed(this)},R.prototype.invm=function(l){return this.imod(l._invmp(this.m).mul(this.r2))._forceRed(this)}})(n,this)}).call(this,t(25)(o))},function(o,e){var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(c){if(!c)throw new Error('"version" cannot be null or undefined');if(c<1||c>40)throw new Error('"version" should be in range from 1 to 40');return 4*c+17},e.getSymbolTotalCodewords=function(c){return n[c]},e.getBCHDigit=function(c){for(var p=0;c!==0;)p++,c>>>=1;return p},e.setToSJISFunction=function(c){if(typeof c!="function")throw new Error('"toSJISFunc" is not a valid function.');t=c},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(c){return t(c)}},function(o,e,t){var n=t(99),c=t(100);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(p,a){if(!p.ccBits)throw new Error("Invalid mode: "+p);if(!n.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?p.ccBits[0]:a<27?p.ccBits[1]:p.ccBits[2]},e.getBestModeForData=function(p){return c.testNumeric(p)?e.NUMERIC:c.testAlphanumeric(p)?e.ALPHANUMERIC:c.testKanji(p)?e.KANJI:e.BYTE},e.toString=function(p){if(p&&p.id)return p.id;throw new Error("Invalid mode")},e.isValid=function(p){return p&&p.bit&&p.ccBits},e.from=function(p,a){if(e.isValid(p))return p;try{return function(f){if(typeof f!="string")throw new Error("Param is not a string");switch(f.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+f)}}(p)}catch{return a}}},function(o,e,t){var n=t(43),c=Object.keys||function(_){var E=[];for(var S in _)E.push(S);return E};o.exports=v;var p=Object.create(t(35));p.inherits=t(3);var a=t(105),f=t(53);p.inherits(v,a);for(var s=c(f.prototype),u=0;u<s.length;u++){var h=s[u];v.prototype[h]||(v.prototype[h]=f.prototype[h])}function v(_){if(!(this instanceof v))return new v(_);a.call(this,_),f.call(this,_),_&&_.readable===!1&&(this.readable=!1),_&&_.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,_&&_.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",b)}function b(){this.allowHalfOpen||this._writableState.ended||n.nextTick(y,this)}function y(_){_.end()}Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(v.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(_){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=_,this._writableState.destroyed=_)}}),v.prototype._destroy=function(_,E){this.push(null),this.end(),n.nextTick(E,_)}},function(o,e,t){var n=t(209).Buffer,c=n.isEncoding||function(_){switch((_=""+_)&&_.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 p(_){var E;switch(this.encoding=function(S){var k=function(O){if(!O)return"utf8";for(var M;;)switch(O){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 O;default:if(M)return;O=(""+O).toLowerCase(),M=!0}}(S);if(typeof k!="string"&&(n.isEncoding===c||!c(S)))throw new Error("Unknown encoding: "+S);return k||S}(_),this.encoding){case"utf16le":this.text=s,this.end=u,E=4;break;case"utf8":this.fillLast=f,E=4;break;case"base64":this.text=h,this.end=v,E=3;break;default:return this.write=b,void(this.end=y)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(E)}function a(_){return _<=127?0:_>>5==6?2:_>>4==14?3:_>>3==30?4:_>>6==2?-1:-2}function f(_){var E=this.lastTotal-this.lastNeed,S=function(k,O,M){if((192&O[0])!=128)return k.lastNeed=0,"\uFFFD";if(k.lastNeed>1&&O.length>1){if((192&O[1])!=128)return k.lastNeed=1,"\uFFFD";if(k.lastNeed>2&&O.length>2&&(192&O[2])!=128)return k.lastNeed=2,"\uFFFD"}}(this,_);return S!==void 0?S:this.lastNeed<=_.length?(_.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(_.copy(this.lastChar,E,0,_.length),void(this.lastNeed-=_.length))}function s(_,E){if((_.length-E)%2==0){var S=_.toString("utf16le",E);if(S){var k=S.charCodeAt(S.length-1);if(k>=55296&&k<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",E,_.length-1)}function u(_){var E=_&&_.length?this.write(_):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,S)}return E}function h(_,E){var S=(_.length-E)%3;return S===0?_.toString("base64",E):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",E,_.length-S))}function v(_){var E=_&&_.length?this.write(_):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function b(_){return _.toString(this.encoding)}function y(_){return _&&_.length?this.write(_):""}e.StringDecoder=p,p.prototype.write=function(_){if(_.length===0)return"";var E,S;if(this.lastNeed){if((E=this.fillLast(_))===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<_.length?E?E+this.text(_,S):this.text(_,S):E||""},p.prototype.end=function(_){var E=_&&_.length?this.write(_):"";return this.lastNeed?E+"\uFFFD":E},p.prototype.text=function(_,E){var S=function(O,M,C){var N=M.length-1;if(N<C)return 0;var L=a(M[N]);return L>=0?(L>0&&(O.lastNeed=L-1),L):--N<C||L===-2?0:(L=a(M[N]))>=0?(L>0&&(O.lastNeed=L-2),L):--N<C||L===-2?0:(L=a(M[N]))>=0?(L>0&&(L===2?L=0:O.lastNeed=L-3),L):0}(this,_,E);if(!this.lastNeed)return _.toString("utf8",E);this.lastTotal=S;var k=_.length-(S-this.lastNeed);return _.copy(this.lastChar,0,k),_.toString("utf8",E,k)},p.prototype.fillLast=function(_){if(this.lastNeed<=_.length)return _.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_.length),this.lastNeed-=_.length}},function(o,e,t){(function(n){var c=Object.getOwnPropertyDescriptors||function(g){for(var w=Object.keys(g),A={},P=0;P<w.length;P++)A[w[P]]=Object.getOwnPropertyDescriptor(g,w[P]);return A},p=/%[sdj%]/g;e.format=function(g){if(!O(g)){for(var w=[],A=0;A<arguments.length;A++)w.push(s(arguments[A]));return w.join(" ")}A=1;for(var P=arguments,T=P.length,q=String(g).replace(p,function(I){if(I==="%%")return"%";if(A>=T)return I;switch(I){case"%s":return String(P[A++]);case"%d":return Number(P[A++]);case"%j":try{return JSON.stringify(P[A++])}catch{return"[Circular]"}default:return I}}),Z=P[A];A<T;Z=P[++A])S(Z)||!N(Z)?q+=" "+Z:q+=" "+s(Z);return q},e.deprecate=function(g,w){if(n!==void 0&&n.noDeprecation===!0)return g;if(n===void 0)return function(){return e.deprecate(g,w).apply(this,arguments)};var A=!1;return function(){if(!A){if(n.throwDeprecation)throw new Error(w);n.traceDeprecation?console.trace(w):console.error(w),A=!0}return g.apply(this,arguments)}};var a,f={};function s(g,w){var A={seen:[],stylize:h};return arguments.length>=3&&(A.depth=arguments[2]),arguments.length>=4&&(A.colors=arguments[3]),E(w)?A.showHidden=w:w&&e._extend(A,w),M(A.showHidden)&&(A.showHidden=!1),M(A.depth)&&(A.depth=2),M(A.colors)&&(A.colors=!1),M(A.customInspect)&&(A.customInspect=!0),A.colors&&(A.stylize=u),v(A,g,A.depth)}function u(g,w){var A=s.styles[w];return A?"\x1B["+s.colors[A][0]+"m"+g+"\x1B["+s.colors[A][1]+"m":g}function h(g,w){return g}function v(g,w,A){if(g.customInspect&&w&&V(w.inspect)&&w.inspect!==e.inspect&&(!w.constructor||w.constructor.prototype!==w)){var P=w.inspect(A,g);return O(P)||(P=v(g,P,A)),P}var T=function(B,U){if(M(U))return B.stylize("undefined","undefined");if(O(U)){var J="'"+JSON.stringify(U).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize(J,"string")}if(k(U))return B.stylize(""+U,"number");if(E(U))return B.stylize(""+U,"boolean");if(S(U))return B.stylize("null","null")}(g,w);if(T)return T;var q=Object.keys(w),Z=function(B){var U={};return B.forEach(function(J,G){U[J]=!0}),U}(q);if(g.showHidden&&(q=Object.getOwnPropertyNames(w)),F(w)&&(q.indexOf("message")>=0||q.indexOf("description")>=0))return b(w);if(q.length===0){if(V(w)){var I=w.name?": "+w.name:"";return g.stylize("[Function"+I+"]","special")}if(C(w))return g.stylize(RegExp.prototype.toString.call(w),"regexp");if(L(w))return g.stylize(Date.prototype.toString.call(w),"date");if(F(w))return b(w)}var $,K="",j=!1,D=["{","}"];return _(w)&&(j=!0,D=["[","]"]),V(w)&&(K=" [Function"+(w.name?": "+w.name:"")+"]"),C(w)&&(K=" "+RegExp.prototype.toString.call(w)),L(w)&&(K=" "+Date.prototype.toUTCString.call(w)),F(w)&&(K=" "+b(w)),q.length!==0||j&&w.length!=0?A<0?C(w)?g.stylize(RegExp.prototype.toString.call(w),"regexp"):g.stylize("[Object]","special"):(g.seen.push(w),$=j?function(B,U,J,G,W){for(var Y=[],ee=0,te=U.length;ee<te;++ee)x(U,String(ee))?Y.push(y(B,U,J,G,String(ee),!0)):Y.push("");return W.forEach(function(oe){oe.match(/^\d+$/)||Y.push(y(B,U,J,G,oe,!0))}),Y}(g,w,A,Z,q):q.map(function(B){return y(g,w,A,Z,B,j)}),g.seen.pop(),function(B,U,J){return B.reduce(function(G,W){return W.indexOf(`
`)>=0,G+W.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?J[0]+(U===""?"":U+`
`)+" "+B.join(`,
`)+" "+J[1]:J[0]+U+" "+B.join(", ")+" "+J[1]}($,K,D)):D[0]+K+D[1]}function b(g){return"["+Error.prototype.toString.call(g)+"]"}function y(g,w,A,P,T,q){var Z,I,$;if(($=Object.getOwnPropertyDescriptor(w,T)||{value:w[T]}).get?I=$.set?g.stylize("[Getter/Setter]","special"):g.stylize("[Getter]","special"):$.set&&(I=g.stylize("[Setter]","special")),x(P,T)||(Z="["+T+"]"),I||(g.seen.indexOf($.value)<0?(I=S(A)?v(g,$.value,null):v(g,$.value,A-1)).indexOf(`
`)>-1&&(I=q?I.split(`
`).map(function(K){return" "+K}).join(`
`).substr(2):`
`+I.split(`
`).map(function(K){return" "+K}).join(`
`)):I=g.stylize("[Circular]","special")),M(Z)){if(q&&T.match(/^\d+$/))return I;(Z=JSON.stringify(""+T)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Z=Z.substr(1,Z.length-2),Z=g.stylize(Z,"name")):(Z=Z.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Z=g.stylize(Z,"string"))}return Z+": "+I}function _(g){return Array.isArray(g)}function E(g){return typeof g=="boolean"}function S(g){return g===null}function k(g){return typeof g=="number"}function O(g){return typeof g=="string"}function M(g){return g===void 0}function C(g){return N(g)&&H(g)==="[object RegExp]"}function N(g){return typeof g=="object"&&g!==null}function L(g){return N(g)&&H(g)==="[object Date]"}function F(g){return N(g)&&(H(g)==="[object Error]"||g instanceof Error)}function V(g){return typeof g=="function"}function H(g){return Object.prototype.toString.call(g)}function z(g){return g<10?"0"+g.toString(10):g.toString(10)}e.debuglog=function(g){if(M(a)&&(a=n.env.NODE_DEBUG||""),g=g.toUpperCase(),!f[g])if(new RegExp("\\b"+g+"\\b","i").test(a)){var w=n.pid;f[g]=function(){var A=e.format.apply(e,arguments);console.error("%s %d: %s",g,w,A)}}else f[g]=function(){};return f[g]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=_,e.isBoolean=E,e.isNull=S,e.isNullOrUndefined=function(g){return g==null},e.isNumber=k,e.isString=O,e.isSymbol=function(g){return typeof g=="symbol"},e.isUndefined=M,e.isRegExp=C,e.isObject=N,e.isDate=L,e.isError=F,e.isFunction=V,e.isPrimitive=function(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"||typeof g=="symbol"||g===void 0},e.isBuffer=t(225);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function l(){var g=new Date,w=[z(g.getHours()),z(g.getMinutes()),z(g.getSeconds())].join(":");return[g.getDate(),R[g.getMonth()],w].join(" ")}function x(g,w){return Object.prototype.hasOwnProperty.call(g,w)}e.log=function(){console.log("%s - %s",l(),e.format.apply(e,arguments))},e.inherits=t(226),e._extend=function(g,w){if(!w||!N(w))return g;for(var A=Object.keys(w),P=A.length;P--;)g[A[P]]=w[A[P]];return g};var d=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;function m(g,w){if(!g){var A=new Error("Promise was rejected with a falsy value");A.reason=g,g=A}return w(g)}e.promisify=function(g){if(typeof g!="function")throw new TypeError('The "original" argument must be of type Function');if(d&&g[d]){var w;if(typeof(w=g[d])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(w,d,{value:w,enumerable:!1,writable:!1,configurable:!0}),w}function w(){for(var A,P,T=new Promise(function(I,$){A=I,P=$}),q=[],Z=0;Z<arguments.length;Z++)q.push(arguments[Z]);q.push(function(I,$){I?P(I):A($)});try{g.apply(this,q)}catch(I){P(I)}return T}return Object.setPrototypeOf(w,Object.getPrototypeOf(g)),d&&Object.defineProperty(w,d,{value:w,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(w,c(g))},e.promisify.custom=d,e.callbackify=function(g){if(typeof g!="function")throw new TypeError('The "original" argument must be of type Function');function w(){for(var A=[],P=0;P<arguments.length;P++)A.push(arguments[P]);var T=A.pop();if(typeof T!="function")throw new TypeError("The last argument must be of type Function");var q=this,Z=function(){return T.apply(q,arguments)};g.apply(this,A).then(function(I){n.nextTick(Z,null,I)},function(I){n.nextTick(m,I,Z)})}return Object.setPrototypeOf(w,Object.getPrototypeOf(g)),Object.defineProperties(w,c(g)),w}}).call(this,t(5))},function(o,e){function t(n,c){if(!n)throw new Error(c||"Assertion failed")}o.exports=t,t.equal=function(n,c,p){if(n!=c)throw new Error(p||"Assertion failed: "+n+" != "+c)}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=void 0;var n,c=t(322),p=(n=c)&&n.__esModule?n:{default:n},a=typeof Symbol=="function";function f(s){return a&&s[Symbol.toStringTag]==="AsyncFunction"}e.default=function(s){return f(s)?(0,p.default)(s):s},e.isAsync=f},function(o,e,t){t.d(e,"c",function(){return c}),t.d(e,"a",function(){return p}),t.d(e,"b",function(){return a});var n=t(7);function c(f){return n.b.includes(f)}function p(f){return Object.keys(n.e).includes(f)?n.e[f]:n.e[n.a]}function a(f){return Object.values(n.e).find(u=>u.code===f)||n.e[n.a]}},function(o,e){o.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(o,e,t){var n=t(50);p.TYPED_ARRAY_SUPPORT=function(){try{var b=new Uint8Array(1);return b.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},b.foo()===42}catch{return!1}}();var c=p.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function p(b,y,_){return p.TYPED_ARRAY_SUPPORT||this instanceof p?typeof b=="number"?s(this,b):function(E,S,k,O){if(typeof S=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&S instanceof ArrayBuffer?function(M,C,N,L){if(N<0||C.byteLength<N)throw new RangeError("'offset' is out of bounds");if(C.byteLength<N+(L||0))throw new RangeError("'length' is out of bounds");var F;return F=N===void 0&&L===void 0?new Uint8Array(C):L===void 0?new Uint8Array(C,N):new Uint8Array(C,N,L),p.TYPED_ARRAY_SUPPORT?F.__proto__=p.prototype:F=u(M,F),F}(E,S,k,O):typeof S=="string"?function(M,C){var N=0|v(C),L=f(M,N),F=L.write(C);return F!==N&&(L=L.slice(0,F)),L}(E,S):function(M,C){if(p.isBuffer(C)){var N=0|a(C.length),L=f(M,N);return L.length===0||C.copy(L,0,0,N),L}if(C){if(typeof ArrayBuffer!="undefined"&&C.buffer instanceof ArrayBuffer||"length"in C)return typeof C.length!="number"||(F=C.length)!=F?f(M,0):u(M,C);if(C.type==="Buffer"&&Array.isArray(C.data))return u(M,C.data)}var F;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(E,S)}(this,b,y,_):new p(b,y,_)}function a(b){if(b>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return 0|b}function f(b,y){var _;return p.TYPED_ARRAY_SUPPORT?(_=new Uint8Array(y)).__proto__=p.prototype:((_=b)===null&&(_=new p(y)),_.length=y),_}function s(b,y){var _=f(b,y<0?0:0|a(y));if(!p.TYPED_ARRAY_SUPPORT)for(var E=0;E<y;++E)_[E]=0;return _}function u(b,y){for(var _=y.length<0?0:0|a(y.length),E=f(b,_),S=0;S<_;S+=1)E[S]=255&y[S];return E}function h(b,y){var _;y=y||1/0;for(var E=b.length,S=null,k=[],O=0;O<E;++O){if((_=b.charCodeAt(O))>55295&&_<57344){if(!S){if(_>56319){(y-=3)>-1&&k.push(239,191,189);continue}if(O+1===E){(y-=3)>-1&&k.push(239,191,189);continue}S=_;continue}if(_<56320){(y-=3)>-1&&k.push(239,191,189),S=_;continue}_=65536+(S-55296<<10|_-56320)}else S&&(y-=3)>-1&&k.push(239,191,189);if(S=null,_<128){if((y-=1)<0)break;k.push(_)}else if(_<2048){if((y-=2)<0)break;k.push(_>>6|192,63&_|128)}else if(_<65536){if((y-=3)<0)break;k.push(_>>12|224,_>>6&63|128,63&_|128)}else{if(!(_<1114112))throw new Error("Invalid code point");if((y-=4)<0)break;k.push(_>>18|240,_>>12&63|128,_>>6&63|128,63&_|128)}}return k}function v(b){return p.isBuffer(b)?b.length:typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(b)||b instanceof ArrayBuffer)?b.byteLength:(typeof b!="string"&&(b=""+b),b.length===0?0:h(b).length)}p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),p.prototype.write=function(b,y,_){y===void 0||_===void 0&&typeof y=="string"?(_=this.length,y=0):isFinite(y)&&(y|=0,isFinite(_)?_|=0:_=void 0);var E=this.length-y;if((_===void 0||_>E)&&(_=E),b.length>0&&(_<0||y<0)||y>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(S,k,O,M){return function(C,N,L,F){for(var V=0;V<F&&!(V+L>=N.length||V>=C.length);++V)N[V+L]=C[V];return V}(h(k,S.length-O),S,O,M)}(this,b,y,_)},p.prototype.slice=function(b,y){var _,E=this.length;if((b=~~b)<0?(b+=E)<0&&(b=0):b>E&&(b=E),(y=y===void 0?E:~~y)<0?(y+=E)<0&&(y=0):y>E&&(y=E),y<b&&(y=b),p.TYPED_ARRAY_SUPPORT)(_=this.subarray(b,y)).__proto__=p.prototype;else{var S=y-b;_=new p(S,void 0);for(var k=0;k<S;++k)_[k]=this[k+b]}return _},p.prototype.copy=function(b,y,_,E){if(_||(_=0),E||E===0||(E=this.length),y>=b.length&&(y=b.length),y||(y=0),E>0&&E<_&&(E=_),E===_||b.length===0||this.length===0)return 0;if(y<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("sourceStart out of bounds");if(E<0)throw new RangeError("sourceEnd out of bounds");E>this.length&&(E=this.length),b.length-y<E-_&&(E=b.length-y+_);var S,k=E-_;if(this===b&&_<y&&y<E)for(S=k-1;S>=0;--S)b[S+y]=this[S+_];else if(k<1e3||!p.TYPED_ARRAY_SUPPORT)for(S=0;S<k;++S)b[S+y]=this[S+_];else Uint8Array.prototype.set.call(b,this.subarray(_,_+k),y);return k},p.prototype.fill=function(b,y,_){if(typeof b=="string"){if(typeof y=="string"?(y=0,_=this.length):typeof _=="string"&&(_=this.length),b.length===1){var E=b.charCodeAt(0);E<256&&(b=E)}}else typeof b=="number"&&(b&=255);if(y<0||this.length<y||this.length<_)throw new RangeError("Out of range index");if(_<=y)return this;var S;if(y>>>=0,_=_===void 0?this.length:_>>>0,b||(b=0),typeof b=="number")for(S=y;S<_;++S)this[S]=b;else{var k=p.isBuffer(b)?b:new p(b),O=k.length;for(S=0;S<_-y;++S)this[S+y]=k[S%O]}return this},p.concat=function(b,y){if(!n(b))throw new TypeError('"list" argument must be an Array of Buffers');if(b.length===0)return f(null,0);var _;if(y===void 0)for(y=0,_=0;_<b.length;++_)y+=b[_].length;var E=s(null,y),S=0;for(_=0;_<b.length;++_){var k=b[_];if(!p.isBuffer(k))throw new TypeError('"list" argument must be an Array of Buffers');k.copy(E,S),S+=k.length}return E},p.byteLength=v,p.prototype._isBuffer=!0,p.isBuffer=function(b){return!(b==null||!b._isBuffer)},o.exports.alloc=function(b){var y=new p(b);return y.fill(0),y},o.exports.from=function(b){return new p(b)}},function(o,e,t){var n={};function c(a,f,s){s||(s=Error);var u=function(h){var v,b;function y(_,E,S){return h.call(this,function(k,O,M){return typeof f=="string"?f:f(k,O,M)}(_,E,S))||this}return b=h,(v=y).prototype=Object.create(b.prototype),v.prototype.constructor=v,v.__proto__=b,y}(s);u.prototype.name=s.name,u.prototype.code=a,n[a]=u}function p(a,f){if(Array.isArray(a)){var s=a.length;return a=a.map(function(u){return String(u)}),s>2?"one of ".concat(f," ").concat(a.slice(0,s-1).join(", "),", or ")+a[s-1]:s===2?"one of ".concat(f," ").concat(a[0]," or ").concat(a[1]):"of ".concat(f," ").concat(a[0])}return"of ".concat(f," ").concat(String(a))}c("ERR_INVALID_OPT_VALUE",function(a,f){return'The value "'+f+'" is invalid for option "'+a+'"'},TypeError),c("ERR_INVALID_ARG_TYPE",function(a,f,s){var u,h,v;if(typeof f=="string"&&(h="not ",f.substr(0,h.length)===h)?(u="must not be",f=f.replace(/^not /,"")):u="must be",function(y,_,E){return(E===void 0||E>y.length)&&(E=y.length),y.substring(E-_.length,E)===_}(a," argument"))v="The ".concat(a," ").concat(u," ").concat(p(f,"type"));else{var b=function(y,_,E){return typeof E!="number"&&(E=0),!(E+_.length>y.length)&&y.indexOf(_,E)!==-1}(a,".")?"property":"argument";v='The "'.concat(a,'" ').concat(b," ").concat(u," ").concat(p(f,"type"))}return v+=". Received type ".concat(typeof s)},TypeError),c("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),c("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),c("ERR_STREAM_PREMATURE_CLOSE","Premature close"),c("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),c("ERR_STREAM_WRITE_AFTER_END","write after end"),c("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),c("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),c("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),o.exports.codes=n},function(o,e,t){(function(n){var c=Object.keys||function(y){var _=[];for(var E in y)_.push(E);return _};o.exports=h;var p=t(112),a=t(116);t(3)(h,p);for(var f=c(a.prototype),s=0;s<f.length;s++){var u=f[s];h.prototype[u]||(h.prototype[u]=a.prototype[u])}function h(y){if(!(this instanceof h))return new h(y);p.call(this,y),a.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",v)))}function v(){this._writableState.ended||n.nextTick(b,this)}function b(y){y.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}})}).call(this,t(5))},function(o,e,t){var n={};function c(a,f,s){s||(s=Error);var u=function(h){var v,b;function y(_,E,S){return h.call(this,function(k,O,M){return typeof f=="string"?f:f(k,O,M)}(_,E,S))||this}return b=h,(v=y).prototype=Object.create(b.prototype),v.prototype.constructor=v,v.__proto__=b,y}(s);u.prototype.name=s.name,u.prototype.code=a,n[a]=u}function p(a,f){if(Array.isArray(a)){var s=a.length;return a=a.map(function(u){return String(u)}),s>2?"one of ".concat(f," ").concat(a.slice(0,s-1).join(", "),", or ")+a[s-1]:s===2?"one of ".concat(f," ").concat(a[0]," or ").concat(a[1]):"of ".concat(f," ").concat(a[0])}return"of ".concat(f," ").concat(String(a))}c("ERR_INVALID_OPT_VALUE",function(a,f){return'The value "'+f+'" is invalid for option "'+a+'"'},TypeError),c("ERR_INVALID_ARG_TYPE",function(a,f,s){var u,h,v;if(typeof f=="string"&&(h="not ",f.substr(0,h.length)===h)?(u="must not be",f=f.replace(/^not /,"")):u="must be",function(y,_,E){return(E===void 0||E>y.length)&&(E=y.length),y.substring(E-_.length,E)===_}(a," argument"))v="The ".concat(a," ").concat(u," ").concat(p(f,"type"));else{var b=function(y,_,E){return typeof E!="number"&&(E=0),!(E+_.length>y.length)&&y.indexOf(_,E)!==-1}(a,".")?"property":"argument";v='The "'.concat(a,'" ').concat(b," ").concat(u," ").concat(p(f,"type"))}return v+=". Received type ".concat(typeof s)},TypeError),c("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),c("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),c("ERR_STREAM_PREMATURE_CLOSE","Premature close"),c("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),c("ERR_STREAM_WRITE_AFTER_END","write after end"),c("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),c("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),c("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),o.exports.codes=n},function(o,e,t){(function(n){var c=Object.keys||function(y){var _=[];for(var E in y)_.push(E);return _};o.exports=h;var p=t(128),a=t(132);t(3)(h,p);for(var f=c(a.prototype),s=0;s<f.length;s++){var u=f[s];h.prototype[u]||(h.prototype[u]=a.prototype[u])}function h(y){if(!(this instanceof h))return new h(y);p.call(this,y),a.call(this,y),this.allowHalfOpen=!0,y&&(y.readable===!1&&(this.readable=!1),y.writable===!1&&(this.writable=!1),y.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",v)))}function v(){this._writableState.ended||n.nextTick(b,this)}function b(y){y.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}})}).call(this,t(5))},function(o,e,t){var n=t(13).Buffer;function c(p,a){this._block=n.alloc(p),this._finalSize=a,this._blockSize=p,this._len=0}c.prototype.update=function(p,a){typeof p=="string"&&(a=a||"utf8",p=n.from(p,a));for(var f=this._block,s=this._blockSize,u=p.length,h=this._len,v=0;v<u;){for(var b=h%s,y=Math.min(u-v,s-b),_=0;_<y;_++)f[b+_]=p[v+_];v+=y,(h+=y)%s==0&&this._update(f)}return this._len+=u,this},c.prototype.digest=function(p){var a=this._len%this._blockSize;this._block[a]=128,this._block.fill(0,a+1),a>=this._finalSize&&(this._update(this._block),this._block.fill(0));var f=8*this._len;if(f<=4294967295)this._block.writeUInt32BE(f,this._blockSize-4);else{var s=(4294967295&f)>>>0,u=(f-s)/4294967296;this._block.writeUInt32BE(u,this._blockSize-8),this._block.writeUInt32BE(s,this._blockSize-4)}this._update(this._block);var h=this._hash();return p?h.toString(p):h},c.prototype._update=function(){throw new Error("_update must be implemented by subclass")},o.exports=c},function(o,e,t){(function(n){var c=t(136),p=t(293);function a(s){var u=s;if(typeof u!="string")throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof u+", while padToEven.");return u.length%2&&(u="0"+u),u}function f(s){return"0x"+s.toString(16)}o.exports={arrayContainsArray:function(s,u,h){if(Array.isArray(s)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof s+"'");if(Array.isArray(u)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof u+"'");return u[Boolean(h)?"some":"every"](function(v){return s.indexOf(v)>=0})},intToBuffer:function(s){var u=f(s);return new n(a(u.slice(2)),"hex")},getBinarySize:function(s){if(typeof s!="string")throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof s+"'.");return n.byteLength(s,"utf8")},isHexPrefixed:c,stripHexPrefix:p,padToEven:a,intToHex:f,fromAscii:function(s){for(var u="",h=0;h<s.length;h++){var v=s.charCodeAt(h).toString(16);u+=v.length<2?"0"+v:v}return"0x"+u},fromUtf8:function(s){return"0x"+a(new n(s,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(s){var u="",h=0,v=s.length;for(s.substring(0,2)==="0x"&&(h=2);h<v;h+=2){var b=parseInt(s.substr(h,2),16);u+=String.fromCharCode(b)}return u},toUtf8:function(s){return new n(a(p(s).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(s,u,h){if(!Array.isArray(s))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof s+"'");if(typeof u!="string")throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof u+"'.");for(var v=[],b=0;b<s.length;b++){var y=s[b][u];if(h&&!y)y="";else if(typeof y!="string")throw new Error("invalid abi");v.push(y)}return v},isHexString:function(s,u){return!(typeof s!="string"||!s.match(/^0x[0-9A-Fa-f]*$/))&&(!u||s.length===2+2*u)}}}).call(this,t(2).Buffer)},function(o,e,t){var n=t(90);t.d(e,"randomBytes",function(){return n.a});var c=t(91);t.d(e,"aesCbcDecrypt",function(){return c.a}),t.d(e,"aesCbcEncrypt",function(){return c.b});var p=t(92);t.d(e,"hmacSha256Sign",function(){return p.a}),t(97),t(42),t(4)},function(o,e,t){(e=o.exports=t(105)).Stream=e,e.Readable=e,e.Writable=t(53),e.Duplex=t(19),e.Transform=t(109),e.PassThrough=t(210)},function(o,e,t){(function(n){function c(p){return Object.prototype.toString.call(p)}e.isArray=function(p){return Array.isArray?Array.isArray(p):c(p)==="[object Array]"},e.isBoolean=function(p){return typeof p=="boolean"},e.isNull=function(p){return p===null},e.isNullOrUndefined=function(p){return p==null},e.isNumber=function(p){return typeof p=="number"},e.isString=function(p){return typeof p=="string"},e.isSymbol=function(p){return typeof p=="symbol"},e.isUndefined=function(p){return p===void 0},e.isRegExp=function(p){return c(p)==="[object RegExp]"},e.isObject=function(p){return typeof p=="object"&&p!==null},e.isDate=function(p){return c(p)==="[object Date]"},e.isError=function(p){return c(p)==="[object Error]"||p instanceof Error},e.isFunction=function(p){return typeof p=="function"},e.isPrimitive=function(p){return p===null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||typeof p=="symbol"||p===void 0},e.isBuffer=n.isBuffer}).call(this,t(2).Buffer)},function(o,e,t){var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},c=t(110),p=c.keccak224,a=c.keccak384,f=c.keccak256,s=c.keccak512,u=t(241),h=t(61),v=t(46),b=t(9),y=t(126),_=t(292).Buffer;Object.assign(e,t(32)),e.MAX_INTEGER=new b("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new b("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.SHA3_NULL_S=e.KECCAK256_NULL_S,e.KECCAK256_NULL=_.from(e.KECCAK256_NULL_S,"hex"),e.SHA3_NULL=e.KECCAK256_NULL,e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.SHA3_RLP_ARRAY_S=e.KECCAK256_RLP_ARRAY_S,e.KECCAK256_RLP_ARRAY=_.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.SHA3_RLP_ARRAY=e.KECCAK256_RLP_ARRAY,e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.SHA3_RLP_S=e.KECCAK256_RLP_S,e.KECCAK256_RLP=_.from(e.KECCAK256_RLP_S,"hex"),e.SHA3_RLP=e.KECCAK256_RLP,e.BN=b,e.rlp=v,e.secp256k1=u,e.zeros=function(S){return _.allocUnsafe(S).fill(0)},e.zeroAddress=function(){var S=e.zeros(20);return e.bufferToHex(S)},e.setLengthLeft=e.setLength=function(S,k,O){var M=e.zeros(k);return S=e.toBuffer(S),O?S.length<k?(S.copy(M),M):S.slice(0,k):S.length<k?(S.copy(M,k-S.length),M):S.slice(-k)},e.setLengthRight=function(S,k){return e.setLength(S,k,!0)},e.unpad=e.stripZeros=function(S){for(var k=(S=e.stripHexPrefix(S))[0];S.length>0&&k.toString()==="0";)k=(S=S.slice(1))[0];return S},e.toBuffer=function(S){if(!_.isBuffer(S))if(Array.isArray(S))S=_.from(S);else if(typeof S=="string")S=e.isHexString(S)?_.from(e.padToEven(e.stripHexPrefix(S)),"hex"):_.from(S);else if(typeof S=="number")S=e.intToBuffer(S);else if(S==null)S=_.allocUnsafe(0);else if(b.isBN(S))S=S.toArrayLike(_);else{if(!S.toArray)throw new Error("invalid type");S=_.from(S.toArray())}return S},e.bufferToInt=function(S){return new b(e.toBuffer(S)).toNumber()},e.bufferToHex=function(S){return"0x"+(S=e.toBuffer(S)).toString("hex")},e.fromSigned=function(S){return new b(S).fromTwos(256)},e.toUnsigned=function(S){return _.from(S.toTwos(256).toArray())},e.keccak=function(S,k){switch(S=e.toBuffer(S),k||(k=256),k){case 224:return p(S);case 256:return f(S);case 384:return a(S);case 512:return s(S);default:throw new Error("Invald algorithm: keccak"+k)}},e.keccak256=function(S){return e.keccak(S)},e.sha3=e.keccak,e.sha256=function(S){return S=e.toBuffer(S),y("sha256").update(S).digest()},e.ripemd160=function(S,k){S=e.toBuffer(S);var O=y("rmd160").update(S).digest();return k===!0?e.setLength(O,32):O},e.rlphash=function(S){return e.keccak(v.encode(S))},e.isValidPrivate=function(S){return u.privateKeyVerify(S)},e.isValidPublic=function(S,k){return S.length===64?u.publicKeyVerify(_.concat([_.from([4]),S])):!!k&&u.publicKeyVerify(S)},e.pubToAddress=e.publicToAddress=function(S,k){return S=e.toBuffer(S),k&&S.length!==64&&(S=u.publicKeyConvert(S,!1).slice(1)),h(S.length===64),e.keccak(S).slice(-20)};var E=e.privateToPublic=function(S){return S=e.toBuffer(S),u.publicKeyCreate(S,!1).slice(1)};e.importPublic=function(S){return(S=e.toBuffer(S)).length!==64&&(S=u.publicKeyConvert(S,!1).slice(1)),S},e.ecsign=function(S,k){var O=u.sign(S,k),M={};return M.r=O.signature.slice(0,32),M.s=O.signature.slice(32,64),M.v=O.recovery+27,M},e.hashPersonalMessage=function(S){var k=e.toBuffer(`Ethereum Signed Message:
`+S.length.toString());return e.keccak(_.concat([k,S]))},e.ecrecover=function(S,k,O,M){var C=_.concat([e.setLength(O,32),e.setLength(M,32)],64),N=k-27;if(N!==0&&N!==1)throw new Error("Invalid signature v value");var L=u.recover(S,C,N);return u.publicKeyConvert(L,!1).slice(1)},e.toRpcSig=function(S,k,O){if(S!==27&&S!==28)throw new Error("Invalid recovery id");return e.bufferToHex(_.concat([e.setLengthLeft(k,32),e.setLengthLeft(O,32),e.toBuffer(S-27)]))},e.fromRpcSig=function(S){if((S=e.toBuffer(S)).length!==65)throw new Error("Invalid signature length");var k=S[64];return k<27&&(k+=27),{v:k,r:S.slice(0,32),s:S.slice(32,64)}},e.privateToAddress=function(S){return e.publicToAddress(E(S))},e.isValidAddress=function(S){return/^0x[0-9a-fA-F]{40}$/.test(S)},e.isZeroAddress=function(S){return e.zeroAddress()===e.addHexPrefix(S)},e.toChecksumAddress=function(S){S=e.stripHexPrefix(S).toLowerCase();for(var k=e.keccak(S).toString("hex"),O="0x",M=0;M<S.length;M++)parseInt(k[M],16)>=8?O+=S[M].toUpperCase():O+=S[M];return O},e.isValidChecksumAddress=function(S){return e.isValidAddress(S)&&e.toChecksumAddress(S)===S},e.generateAddress=function(S,k){return S=e.toBuffer(S),k=(k=new b(k)).isZero()?null:_.from(k.toArray()),e.rlphash([S,k]).slice(-20)},e.isPrecompiled=function(S){var k=e.unpad(S);return k.length===1&&k[0]>=1&&k[0]<=8},e.addHexPrefix=function(S){return typeof S!="string"||e.isHexPrefixed(S)?S:"0x"+S},e.isValidSignature=function(S,k,O,M){var C=new b("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),N=new b("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return k.length===32&&O.length===32&&(S===27||S===28)&&(k=new b(k),O=new b(O),!(k.isZero()||k.gt(N)||O.isZero()||O.gt(N))&&(M!==!1||new b(O).cmp(C)!==1))},e.baToJSON=function(S){if(_.isBuffer(S))return"0x"+S.toString("hex");if(S instanceof Array){for(var k=[],O=0;O<S.length;O++)k.push(e.baToJSON(S[O]));return k}},e.defineProperties=function(S,k,O){if(S.raw=[],S._fields=[],S.toJSON=function(C){if(C){var N={};return S._fields.forEach(function(L){N[L]="0x"+S[L].toString("hex")}),N}return e.baToJSON(this.raw)},S.serialize=function(){return v.encode(S.raw)},k.forEach(function(C,N){function L(){return S.raw[N]}function F(V){(V=e.toBuffer(V)).toString("hex")!=="00"||C.allowZero||(V=_.allocUnsafe(0)),C.allowLess&&C.length?(V=e.stripZeros(V),h(C.length>=V.length,"The field "+C.name+" must not have more "+C.length+" bytes")):C.allowZero&&V.length===0||!C.length||h(C.length===V.length,"The field "+C.name+" must have byte length of "+C.length),S.raw[N]=V}S._fields.push(C.name),Object.defineProperty(S,C.name,{enumerable:!0,configurable:!0,get:L,set:F}),C.default&&(S[C.name]=C.default),C.alias&&Object.defineProperty(S,C.alias,{enumerable:!1,configurable:!0,set:F,get:L})}),O)if(typeof O=="string"&&(O=_.from(e.stripHexPrefix(O),"hex")),_.isBuffer(O)&&(O=v.decode(O)),Array.isArray(O)){if(O.length>S._fields.length)throw new Error("wrong number of fields in data");O.forEach(function(C,N){S[S._fields[N]]=e.toBuffer(C)})}else{if((O===void 0?"undefined":n(O))!=="object")throw new Error("invalid data");var M=Object.keys(O);k.forEach(function(C){M.indexOf(C.name)!==-1&&(S[C.name]=O[C.name]),M.indexOf(C.alias)!==-1&&(S[C.alias]=O[C.alias])})}}},function(o,e,t){var n=t(15),c=t(22);function p(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=p,p.prototype.update=function(a,f){if(a=n.toArray(a,f),this.pending?this.pending=this.pending.concat(a):this.pending=a,this.pendingTotal+=a.length,this.pending.length>=this._delta8){var s=(a=this.pending).length%this._delta8;this.pending=a.slice(a.length-s,a.length),this.pending.length===0&&(this.pending=null),a=n.join32(a,0,a.length-s,this.endian);for(var u=0;u<a.length;u+=this._delta32)this._update(a,u,u+this._delta32)}return this},p.prototype.digest=function(a){return this.update(this._pad()),c(this.pending===null),this._digest(a)},p.prototype._pad=function(){var a=this.pendingTotal,f=this._delta8,s=f-(a+this.padLength)%f,u=new Array(s+this.padLength);u[0]=128;for(var h=1;h<s;h++)u[h]=0;if(a<<=3,this.endian==="big"){for(var v=8;v<this.padLength;v++)u[h++]=0;u[h++]=0,u[h++]=0,u[h++]=0,u[h++]=0,u[h++]=a>>>24&255,u[h++]=a>>>16&255,u[h++]=a>>>8&255,u[h++]=255&a}else for(u[h++]=255&a,u[h++]=a>>>8&255,u[h++]=a>>>16&255,u[h++]=a>>>24&255,u[h++]=0,u[h++]=0,u[h++]=0,u[h++]=0,v=8;v<this.padLength;v++)u[h++]=0;return u}},function(o,e){o.exports=function(){}},function(o,e){function t(a){return a.sort((f,s)=>f==="latest"||s==="earliest"?1:s==="latest"||f==="earliest"?-1:n(f)-n(s))}function n(a){return a==null?a:Number.parseInt(a,16)}function c(a){if(a==null)return a;let f=a.toString(16);return f.length%2&&(f="0"+f),"0x"+f}function p(){return Math.floor(16*Math.random()).toString(16)}o.exports={minBlockRef:function(...a){return t(a)[0]},maxBlockRef:function(...a){const f=t(a);return f[f.length-1]},sortBlockRefs:t,bnToHex:function(a){return"0x"+a.toString(16)},blockRefIsNumber:function(a){return a&&!["earliest","latest","pending"].includes(a)},hexToInt:n,incrementHexInt:function(a){return a==null?a:c(n(a)+1)},intToHex:c,unsafeRandomBytes:function(a){let f="0x";for(let s=0;s<a;s++)f+=p(),f+=p();return f}}},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.stripZeros=e.unpad=e.setLengthRight=e.setLength=e.setLengthLeft=e.zeros=void 0;var c=t(32),p=t(9);e.zeros=function(a){return n.allocUnsafe(a).fill(0)},e.setLengthLeft=function(a,f,s){s===void 0&&(s=!1);var u=e.zeros(f);return a=e.toBuffer(a),s?a.length<f?(a.copy(u),u):a.slice(0,f):a.length<f?(a.copy(u,f-a.length),u):a.slice(-f)},e.setLength=e.setLengthLeft,e.setLengthRight=function(a,f){return e.setLength(a,f,!0)},e.unpad=function(a){for(var f=(a=c.stripHexPrefix(a))[0];a.length>0&&f.toString()==="0";)f=(a=a.slice(1))[0];return a},e.stripZeros=e.unpad,e.toBuffer=function(a){if(!n.isBuffer(a))if(Array.isArray(a))a=n.from(a);else if(typeof a=="string"){if(!c.isHexString(a))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+a);a=n.from(c.padToEven(c.stripHexPrefix(a)),"hex")}else if(typeof a=="number")a=c.intToBuffer(a);else if(a==null)a=n.allocUnsafe(0);else if(p.isBN(a))a=a.toArrayLike(n);else{if(!a.toArray)throw new Error("invalid type");a=n.from(a.toArray())}return a},e.bufferToInt=function(a){return new p(e.toBuffer(a)).toNumber()},e.bufferToHex=function(a){return"0x"+(a=e.toBuffer(a)).toString("hex")},e.fromSigned=function(a){return new p(a).fromTwos(256)},e.toUnsigned=function(a){return n.from(a.toTwos(256).toArray())},e.addHexPrefix=function(a){return typeof a!="string"||c.isHexPrefixed(a)?a:"0x"+a},e.baToJSON=function(a){if(n.isBuffer(a))return"0x"+a.toString("hex");if(a instanceof Array){for(var f=[],s=0;s<a.length;s++)f.push(e.baToJSON(a[s]));return f}}}).call(this,t(2).Buffer)},function(o,e,t){t.d(e,"a",function(){return n});class n{}},function(o,e,t){var n=t(93);t.o(n,"isConstantTime")&&t.d(e,"isConstantTime",function(){return n.isConstantTime}),t(94);var c=t(95);t.o(c,"isConstantTime")&&t.d(e,"isConstantTime",function(){return c.isConstantTime});var p=t(96);t.d(e,"isConstantTime",function(){return p.a})},function(o,e,t){(function(n){n===void 0||!n.version||n.version.indexOf("v0.")===0||n.version.indexOf("v1.")===0&&n.version.indexOf("v1.8.")!==0?o.exports={nextTick:function(c,p,a,f){if(typeof c!="function")throw new TypeError('"callback" argument must be a function');var s,u,h=arguments.length;switch(h){case 0:case 1:return n.nextTick(c);case 2:return n.nextTick(function(){c.call(null,p)});case 3:return n.nextTick(function(){c.call(null,p,a)});case 4:return n.nextTick(function(){c.call(null,p,a,f)});default:for(s=new Array(h-1),u=0;u<s.length;)s[u++]=arguments[u];return n.nextTick(function(){c.apply(null,s)})}}}:o.exports=n}).call(this,t(5))},function(o,e){o.exports=function(){for(var n={},c=0;c<arguments.length;c++){var p=arguments[c];for(var a in p)t.call(p,a)&&(n[a]=p[a])}return n};var t=Object.prototype.hasOwnProperty},function(o,e,t){var n=t(16),c=t(11),p=c.getNAF,a=c.getJSF,f=c.assert;function s(h,v){this.type=h,this.p=new n(v.p,16),this.red=v.prime?n.red(v.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=v.n&&new n(v.n,16),this.g=v.g&&this.pointFromJSON(v.g,v.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var b=this.n&&this.p.div(this.n);!b||b.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(h,v){this.curve=h,this.type=v,this.precomputed=null}o.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(h,v){f(h.precomputed);var b=h._getDoubles(),y=p(v,1,this._bitLength),_=(1<<b.step+1)-(b.step%2==0?2:1);_/=3;var E,S,k=[];for(E=0;E<y.length;E+=b.step){S=0;for(var O=E+b.step-1;O>=E;O--)S=(S<<1)+y[O];k.push(S)}for(var M=this.jpoint(null,null,null),C=this.jpoint(null,null,null),N=_;N>0;N--){for(E=0;E<k.length;E++)(S=k[E])===N?C=C.mixedAdd(b.points[E]):S===-N&&(C=C.mixedAdd(b.points[E].neg()));M=M.add(C)}return M.toP()},s.prototype._wnafMul=function(h,v){var b=4,y=h._getNAFPoints(b);b=y.wnd;for(var _=y.points,E=p(v,b,this._bitLength),S=this.jpoint(null,null,null),k=E.length-1;k>=0;k--){for(var O=0;k>=0&&E[k]===0;k--)O++;if(k>=0&&O++,S=S.dblp(O),k<0)break;var M=E[k];f(M!==0),S=h.type==="affine"?M>0?S.mixedAdd(_[M-1>>1]):S.mixedAdd(_[-M-1>>1].neg()):M>0?S.add(_[M-1>>1]):S.add(_[-M-1>>1].neg())}return h.type==="affine"?S.toP():S},s.prototype._wnafMulAdd=function(h,v,b,y,_){var E,S,k,O=this._wnafT1,M=this._wnafT2,C=this._wnafT3,N=0;for(E=0;E<y;E++){var L=(k=v[E])._getNAFPoints(h);O[E]=L.wnd,M[E]=L.points}for(E=y-1;E>=1;E-=2){var F=E-1,V=E;if(O[F]===1&&O[V]===1){var H=[v[F],null,null,v[V]];v[F].y.cmp(v[V].y)===0?(H[1]=v[F].add(v[V]),H[2]=v[F].toJ().mixedAdd(v[V].neg())):v[F].y.cmp(v[V].y.redNeg())===0?(H[1]=v[F].toJ().mixedAdd(v[V]),H[2]=v[F].add(v[V].neg())):(H[1]=v[F].toJ().mixedAdd(v[V]),H[2]=v[F].toJ().mixedAdd(v[V].neg()));var z=[-3,-1,-5,-7,0,7,5,1,3],R=a(b[F],b[V]);for(N=Math.max(R[0].length,N),C[F]=new Array(N),C[V]=new Array(N),S=0;S<N;S++){var l=0|R[0][S],x=0|R[1][S];C[F][S]=z[3*(l+1)+(x+1)],C[V][S]=0,M[F]=H}}else C[F]=p(b[F],O[F],this._bitLength),C[V]=p(b[V],O[V],this._bitLength),N=Math.max(C[F].length,N),N=Math.max(C[V].length,N)}var d=this.jpoint(null,null,null),m=this._wnafT4;for(E=N;E>=0;E--){for(var g=0;E>=0;){var w=!0;for(S=0;S<y;S++)m[S]=0|C[S][E],m[S]!==0&&(w=!1);if(!w)break;g++,E--}if(E>=0&&g++,d=d.dblp(g),E<0)break;for(S=0;S<y;S++){var A=m[S];A!==0&&(A>0?k=M[S][A-1>>1]:A<0&&(k=M[S][-A-1>>1].neg()),d=k.type==="affine"?d.mixedAdd(k):d.add(k))}}for(E=0;E<y;E++)M[E]=null;return _?d:d.toP()},s.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},s.prototype.decodePoint=function(h,v){h=c.toArray(h,v);var b=this.p.byteLength();if((h[0]===4||h[0]===6||h[0]===7)&&h.length-1==2*b)return h[0]===6?f(h[h.length-1]%2==0):h[0]===7&&f(h[h.length-1]%2==1),this.point(h.slice(1,1+b),h.slice(1+b,1+2*b));if((h[0]===2||h[0]===3)&&h.length-1===b)return this.pointFromX(h.slice(1,1+b),h[0]===3);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(h){return this.encode(h,!0)},u.prototype._encode=function(h){var v=this.curve.p.byteLength(),b=this.getX().toArray("be",v);return h?[this.getY().isEven()?2:3].concat(b):[4].concat(b,this.getY().toArray("be",v))},u.prototype.encode=function(h,v){return c.encode(this._encode(v),h)},u.prototype.precompute=function(h){if(this.precomputed)return this;var v={doubles:null,naf:null,beta:null};return v.naf=this._getNAFPoints(8),v.doubles=this._getDoubles(4,h),v.beta=this._getBeta(),this.precomputed=v,this},u.prototype._hasDoubles=function(h){if(!this.precomputed)return!1;var v=this.precomputed.doubles;return!!v&&v.points.length>=Math.ceil((h.bitLength()+1)/v.step)},u.prototype._getDoubles=function(h,v){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var b=[this],y=this,_=0;_<v;_+=h){for(var E=0;E<h;E++)y=y.dbl();b.push(y)}return{step:h,points:b}},u.prototype._getNAFPoints=function(h){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var v=[this],b=(1<<h)-1,y=b===1?null:this.dbl(),_=1;_<b;_++)v[_]=v[_-1].add(y);return{wnd:h,points:v}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(h){for(var v=this,b=0;b<h;b++)v=v.dbl();return v}},function(o,e,t){(function(n){var c=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLength=e.decode=e.encode=void 0;var p=c(t(269));function a(v,b){if(v[0]==="0"&&v[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(v,b)}function f(v,b){if(v<56)return n.from([v+b]);var y=u(v),_=u(b+55+y.length/2);return n.from(_+y,"hex")}function s(v){return v.slice(0,2)==="0x"}function u(v){if(v<0)throw new Error("Invalid integer as argument, must be unsigned!");var b=v.toString(16);return b.length%2?"0"+b:b}function h(v){if(!n.isBuffer(v)){if(typeof v=="string")return s(v)?n.from((y=typeof(_=v)!="string"?_:s(_)?_.slice(2):_).length%2?"0"+y:y,"hex"):n.from(v);if(typeof v=="number"||typeof v=="bigint")return v?(b=u(v),n.from(b,"hex")):n.from([]);if(v==null)return n.from([]);if(v instanceof Uint8Array)return n.from(v);if(p.default.isBN(v))return n.from(v.toArray());throw new Error("invalid type")}var b,y,_;return v}e.encode=function v(b){if(Array.isArray(b)){for(var y=[],_=0;_<b.length;_++)y.push(v(b[_]));var E=n.concat(y);return n.concat([f(E.length,192),E])}var S=h(b);return S.length===1&&S[0]<128?S:n.concat([f(S.length,128),S])},e.decode=function(v,b){if(b===void 0&&(b=!1),!v||v.length===0)return n.from([]);var y=function _(E){var S,k,O,M,C,N=[],L=E[0];if(L<=127)return{data:E.slice(0,1),remainder:E.slice(1)};if(L<=183){if(S=L-127,O=L===128?n.from([]):E.slice(1,S),S===2&&O[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:O,remainder:E.slice(S)}}if(L<=191){if(k=L-182,E.length-1<k)throw new Error("invalid RLP: not enough bytes for string length");if((S=a(E.slice(1,k).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((O=E.slice(k,S+k)).length<S)throw new Error("invalid RLP: not enough bytes for string");return{data:O,remainder:E.slice(S+k)}}if(L<=247){for(S=L-191,M=E.slice(1,S);M.length;)C=_(M),N.push(C.data),M=C.remainder;return{data:N,remainder:E.slice(S)}}k=L-246,S=a(E.slice(1,k).toString("hex"),16);var F=k+S;if(F>E.length)throw new Error("invalid rlp: total length is larger than the data");if((M=E.slice(k,F)).length===0)throw new Error("invalid rlp, List has a invalid length");for(;M.length;)C=_(M),N.push(C.data),M=C.remainder;return{data:N,remainder:E.slice(F)}}(h(v));if(b)return y;if(y.remainder.length!==0)throw new Error("invalid remainder");return y.data},e.getLength=function(v){if(!v||v.length===0)return n.from([]);var b=h(v),y=b[0];if(y<=127)return b.length;if(y<=183)return y-127;if(y<=191)return y-182;if(y<=247)return y-191;var _=y-246;return _+a(b.slice(1,_).toString("hex"),16)}}).call(this,t(2).Buffer)},function(o,e,t){var n=t(300),c=t(144);o.exports=function(p){return p!=null&&c(p.length)&&!n(p)}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n,c){c|=0;for(var p=Math.max(n.length-c,0),a=Array(p),f=0;f<p;f++)a[f]=n[c+f];return a},o.exports=e.default},function(o,e,t){const n=t(67);function c(){}o.exports=c,c.prototype.setEngine=function(p){const a=this;a.engine||(a.engine=p,p.on("block",function(f){a.currentBlock=f}),p.on("start",function(){a.start()}),p.on("stop",function(){a.stop()}))},c.prototype.handleRequest=function(p,a,f){throw new Error("Subproviders should override `handleRequest`.")},c.prototype.emitPayload=function(p,a){this.engine.sendAsync(n(p),a)},c.prototype.stop=function(){},c.prototype.start=function(){}},function(o,e){var t={}.toString;o.exports=Array.isArray||function(n){return t.call(n)=="[object Array]"}},function(o,e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&t.bit!==void 0&&t.bit>=0&&t.bit<4},e.from=function(t,n){if(e.isValid(t))return t;try{return function(c){if(typeof c!="string")throw new Error("Param is not a string");switch(c.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+c)}}(t)}catch{return n}}},function(o,e,t){var n=t(2),c=n.Buffer;function p(f,s){for(var u in f)s[u]=f[u]}function a(f,s,u){return c(f,s,u)}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=n:(p(n,e),e.Buffer=a),p(c,a),a.from=function(f,s,u){if(typeof f=="number")throw new TypeError("Argument must not be a number");return c(f,s,u)},a.alloc=function(f,s,u){if(typeof f!="number")throw new TypeError("Argument must be a number");var h=c(f);return s!==void 0?typeof u=="string"?h.fill(s,u):h.fill(s):h.fill(0),h},a.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return c(f)},a.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(f)}},function(o,e,t){(function(n,c,p){var a=t(43);function f(z){var R=this;this.next=null,this.entry=null,this.finish=function(){(function(l,x,d){var m=l.entry;for(l.entry=null;m;){var g=m.callback;x.pendingcb--,g(d),m=m.next}x.corkedRequestsFree?x.corkedRequestsFree.next=l:x.corkedRequestsFree=l})(R,z)}}o.exports=M;var s,u=!n.browser&&["v0.10","v0.9."].indexOf(n.version.slice(0,5))>-1?c:a.nextTick;M.WritableState=O;var h=Object.create(t(35));h.inherits=t(3);var v={deprecate:t(54)},b=t(106),y=t(52).Buffer,_=p.Uint8Array||function(){},E,S=t(107);function k(){}function O(z,R){s=s||t(19),z=z||{};var l=R instanceof s;this.objectMode=!!z.objectMode,l&&(this.objectMode=this.objectMode||!!z.writableObjectMode);var x=z.highWaterMark,d=z.writableHighWaterMark,m=this.objectMode?16:16384;this.highWaterMark=x||x===0?x:l&&(d||d===0)?d:m,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var g=z.decodeStrings===!1;this.decodeStrings=!g,this.defaultEncoding=z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(w){(function(A,P){var T=A._writableState,q=T.sync,Z=T.writecb;if(function($){$.writing=!1,$.writecb=null,$.length-=$.writelen,$.writelen=0}(T),P)(function($,K,j,D,B){--K.pendingcb,j?(a.nextTick(B,D),a.nextTick(H,$,K),$._writableState.errorEmitted=!0,$.emit("error",D)):(B(D),$._writableState.errorEmitted=!0,$.emit("error",D),H($,K))})(A,T,q,P,Z);else{var I=F(T);I||T.corked||T.bufferProcessing||!T.bufferedRequest||L(A,T),q?u(N,A,T,I,Z):N(A,T,I,Z)}})(R,w)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}function M(z){if(s=s||t(19),!(E.call(M,this)||this instanceof s))return new M(z);this._writableState=new O(z,this),this.writable=!0,z&&(typeof z.write=="function"&&(this._write=z.write),typeof z.writev=="function"&&(this._writev=z.writev),typeof z.destroy=="function"&&(this._destroy=z.destroy),typeof z.final=="function"&&(this._final=z.final)),b.call(this)}function C(z,R,l,x,d,m,g){R.writelen=x,R.writecb=g,R.writing=!0,R.sync=!0,l?z._writev(d,R.onwrite):z._write(d,m,R.onwrite),R.sync=!1}function N(z,R,l,x){l||function(d,m){m.length===0&&m.needDrain&&(m.needDrain=!1,d.emit("drain"))}(z,R),R.pendingcb--,x(),H(z,R)}function L(z,R){R.bufferProcessing=!0;var l=R.bufferedRequest;if(z._writev&&l&&l.next){var x=R.bufferedRequestCount,d=new Array(x),m=R.corkedRequestsFree;m.entry=l;for(var g=0,w=!0;l;)d[g]=l,l.isBuf||(w=!1),l=l.next,g+=1;d.allBuffers=w,C(z,R,!0,R.length,d,"",m.finish),R.pendingcb++,R.lastBufferedRequest=null,m.next?(R.corkedRequestsFree=m.next,m.next=null):R.corkedRequestsFree=new f(R),R.bufferedRequestCount=0}else{for(;l;){var A=l.chunk,P=l.encoding,T=l.callback;if(C(z,R,!1,R.objectMode?1:A.length,A,P,T),l=l.next,R.bufferedRequestCount--,R.writing)break}l===null&&(R.lastBufferedRequest=null)}R.bufferedRequest=l,R.bufferProcessing=!1}function F(z){return z.ending&&z.length===0&&z.bufferedRequest===null&&!z.finished&&!z.writing}function V(z,R){z._final(function(l){R.pendingcb--,l&&z.emit("error",l),R.prefinished=!0,z.emit("prefinish"),H(z,R)})}function H(z,R){var l=F(R);return l&&(function(x,d){d.prefinished||d.finalCalled||(typeof x._final=="function"?(d.pendingcb++,d.finalCalled=!0,a.nextTick(V,x,d)):(d.prefinished=!0,x.emit("prefinish")))}(z,R),R.pendingcb===0&&(R.finished=!0,z.emit("finish"))),l}h.inherits(M,b),O.prototype.getBuffer=function(){for(var z=this.bufferedRequest,R=[];z;)R.push(z),z=z.next;return R},function(){try{Object.defineProperty(O.prototype,"buffer",{get:v.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(E=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(z){return!!E.call(this,z)||this===M&&z&&z._writableState instanceof O}})):E=function(z){return z instanceof this},M.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},M.prototype.write=function(z,R,l){var x,d=this._writableState,m=!1,g=!d.objectMode&&(x=z,y.isBuffer(x)||x instanceof _);return g&&!y.isBuffer(z)&&(z=function(w){return y.from(w)}(z)),typeof R=="function"&&(l=R,R=null),g?R="buffer":R||(R=d.defaultEncoding),typeof l!="function"&&(l=k),d.ended?function(w,A){var P=new Error("write after end");w.emit("error",P),a.nextTick(A,P)}(this,l):(g||function(w,A,P,T){var q=!0,Z=!1;return P===null?Z=new TypeError("May not write null values to stream"):typeof P=="string"||P===void 0||A.objectMode||(Z=new TypeError("Invalid non-string/buffer chunk")),Z&&(w.emit("error",Z),a.nextTick(T,Z),q=!1),q}(this,d,z,l))&&(d.pendingcb++,m=function(w,A,P,T,q,Z){if(!P){var I=function(D,B,U){return D.objectMode||D.decodeStrings===!1||typeof B!="string"||(B=y.from(B,U)),B}(A,T,q);T!==I&&(P=!0,q="buffer",T=I)}var $=A.objectMode?1:T.length;A.length+=$;var K=A.length<A.highWaterMark;if(K||(A.needDrain=!0),A.writing||A.corked){var j=A.lastBufferedRequest;A.lastBufferedRequest={chunk:T,encoding:q,isBuf:P,callback:Z,next:null},j?j.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else C(w,A,!1,$,T,q,Z);return K}(this,d,g,z,R,l)),m},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var z=this._writableState;z.corked&&(z.corked--,z.writing||z.corked||z.finished||z.bufferProcessing||!z.bufferedRequest||L(this,z))},M.prototype.setDefaultEncoding=function(z){if(typeof z=="string"&&(z=z.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((z+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+z);return this._writableState.defaultEncoding=z,this},Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(z,R,l){l(new Error("_write() is not implemented"))},M.prototype._writev=null,M.prototype.end=function(z,R,l){var x=this._writableState;typeof z=="function"?(l=z,z=null,R=null):typeof R=="function"&&(l=R,R=null),z!=null&&this.write(z,R),x.corked&&(x.corked=1,this.uncork()),x.ending||x.finished||function(d,m,g){m.ending=!0,H(d,m),g&&(m.finished?a.nextTick(g):d.once("finish",g)),m.ended=!0,d.writable=!1}(this,x,l)},Object.defineProperty(M.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(z){this._writableState&&(this._writableState.destroyed=z)}}),M.prototype.destroy=S.destroy,M.prototype._undestroy=S.undestroy,M.prototype._destroy=function(z,R){this.end(),R(z)}}).call(this,t(5),t(108).setImmediate,t(6))},function(o,e,t){(function(n){function c(p){try{if(!n.localStorage)return!1}catch{return!1}var a=n.localStorage[p];return a!=null&&String(a).toLowerCase()==="true"}o.exports=function(p,a){if(c("noDeprecation"))return p;var f=!1;return function(){if(!f){if(c("throwDeprecation"))throw new Error(a);c("traceDeprecation")?console.trace(a):console.warn(a),f=!0}return p.apply(this,arguments)}}}).call(this,t(6))},function(o,e,t){var n=t(213),c=t(214);function p(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=M,e.resolve=function(C,N){return M(C,!1,!0).resolve(N)},e.resolveObject=function(C,N){return C?M(C,!1,!0).resolveObject(N):N},e.format=function(C){return c.isString(C)&&(C=M(C)),C instanceof p?C.format():p.prototype.format.call(C)},e.Url=p;var a=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
`," "]),h=["'"].concat(u),v=["%","/","?",";","#"].concat(h),b=["/","?","#"],y=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},k={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=t(215);function M(C,N,L){if(C&&c.isObject(C)&&C instanceof p)return C;var F=new p;return F.parse(C,N,L),F}p.prototype.parse=function(C,N,L){if(!c.isString(C))throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var F=C.indexOf("?"),V=F!==-1&&F<C.indexOf("#")?"?":"#",H=C.split(V);H[0]=H[0].replace(/\\/g,"/");var z=C=H.join(V);if(z=z.trim(),!L&&C.split("#").length===1){var R=s.exec(z);if(R)return this.path=z,this.href=z,this.pathname=R[1],R[2]?(this.search=R[2],this.query=N?O.parse(this.search.substr(1)):this.search.substr(1)):N&&(this.search="",this.query={}),this}var l=a.exec(z);if(l){var x=(l=l[0]).toLowerCase();this.protocol=x,z=z.substr(l.length)}if(L||l||z.match(/^\/\/[^@\/]+@[^@\/]+/)){var d=z.substr(0,2)==="//";!d||l&&S[l]||(z=z.substr(2),this.slashes=!0)}if(!S[l]&&(d||l&&!k[l])){for(var m,g,w=-1,A=0;A<b.length;A++)(P=z.indexOf(b[A]))!==-1&&(w===-1||P<w)&&(w=P);for((g=w===-1?z.lastIndexOf("@"):z.lastIndexOf("@",w))!==-1&&(m=z.slice(0,g),z=z.slice(g+1),this.auth=decodeURIComponent(m)),w=-1,A=0;A<v.length;A++){var P;(P=z.indexOf(v[A]))!==-1&&(w===-1||P<w)&&(w=P)}w===-1&&(w=z.length),this.host=z.slice(0,w),z=z.slice(w),this.parseHost(),this.hostname=this.hostname||"";var T=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!T)for(var q=this.hostname.split(/\./),Z=(A=0,q.length);A<Z;A++){var I=q[A];if(I&&!I.match(y)){for(var $="",K=0,j=I.length;K<j;K++)I.charCodeAt(K)>127?$+="x":$+=I[K];if(!$.match(y)){var D=q.slice(0,A),B=q.slice(A+1),U=I.match(_);U&&(D.push(U[1]),B.unshift(U[2])),B.length&&(z="/"+B.join(".")+z),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var J=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+J,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),z[0]!=="/"&&(z="/"+z))}if(!E[x])for(A=0,Z=h.length;A<Z;A++){var W=h[A];if(z.indexOf(W)!==-1){var Y=encodeURIComponent(W);Y===W&&(Y=escape(W)),z=z.split(W).join(Y)}}var ee=z.indexOf("#");ee!==-1&&(this.hash=z.substr(ee),z=z.slice(0,ee));var te=z.indexOf("?");if(te!==-1?(this.search=z.substr(te),this.query=z.substr(te+1),N&&(this.query=O.parse(this.query)),z=z.slice(0,te)):N&&(this.search="",this.query={}),z&&(this.pathname=z),k[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){J=this.pathname||"";var oe=this.search||"";this.path=J+oe}return this.href=this.format(),this},p.prototype.format=function(){var C=this.auth||"";C&&(C=(C=encodeURIComponent(C)).replace(/%3A/i,":"),C+="@");var N=this.protocol||"",L=this.pathname||"",F=this.hash||"",V=!1,H="";this.host?V=C+this.host:this.hostname&&(V=C+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(V+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(H=O.stringify(this.query));var z=this.search||H&&"?"+H||"";return N&&N.substr(-1)!==":"&&(N+=":"),this.slashes||(!N||k[N])&&V!==!1?(V="//"+(V||""),L&&L.charAt(0)!=="/"&&(L="/"+L)):V||(V=""),F&&F.charAt(0)!=="#"&&(F="#"+F),z&&z.charAt(0)!=="?"&&(z="?"+z),N+V+(L=L.replace(/[?#]/g,function(R){return encodeURIComponent(R)}))+(z=z.replace("#","%23"))+F},p.prototype.resolve=function(C){return this.resolveObject(M(C,!1,!0)).format()},p.prototype.resolveObject=function(C){if(c.isString(C)){var N=new p;N.parse(C,!1,!0),C=N}for(var L=new p,F=Object.keys(this),V=0;V<F.length;V++){var H=F[V];L[H]=this[H]}if(L.hash=C.hash,C.href==="")return L.href=L.format(),L;if(C.slashes&&!C.protocol){for(var z=Object.keys(C),R=0;R<z.length;R++){var l=z[R];l!=="protocol"&&(L[l]=C[l])}return k[L.protocol]&&L.hostname&&!L.pathname&&(L.path=L.pathname="/"),L.href=L.format(),L}if(C.protocol&&C.protocol!==L.protocol){if(!k[C.protocol]){for(var x=Object.keys(C),d=0;d<x.length;d++){var m=x[d];L[m]=C[m]}return L.href=L.format(),L}if(L.protocol=C.protocol,C.host||S[C.protocol])L.pathname=C.pathname;else{for(var g=(C.pathname||"").split("/");g.length&&!(C.host=g.shift()););C.host||(C.host=""),C.hostname||(C.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),L.pathname=g.join("/")}if(L.search=C.search,L.query=C.query,L.host=C.host||"",L.auth=C.auth,L.hostname=C.hostname||C.host,L.port=C.port,L.pathname||L.search){var w=L.pathname||"",A=L.search||"";L.path=w+A}return L.slashes=L.slashes||C.slashes,L.href=L.format(),L}var P=L.pathname&&L.pathname.charAt(0)==="/",T=C.host||C.pathname&&C.pathname.charAt(0)==="/",q=T||P||L.host&&C.pathname,Z=q,I=L.pathname&&L.pathname.split("/")||[],$=(g=C.pathname&&C.pathname.split("/")||[],L.protocol&&!k[L.protocol]);if($&&(L.hostname="",L.port=null,L.host&&(I[0]===""?I[0]=L.host:I.unshift(L.host)),L.host="",C.protocol&&(C.hostname=null,C.port=null,C.host&&(g[0]===""?g[0]=C.host:g.unshift(C.host)),C.host=null),q=q&&(g[0]===""||I[0]==="")),T)L.host=C.host||C.host===""?C.host:L.host,L.hostname=C.hostname||C.hostname===""?C.hostname:L.hostname,L.search=C.search,L.query=C.query,I=g;else if(g.length)I||(I=[]),I.pop(),I=I.concat(g),L.search=C.search,L.query=C.query;else if(!c.isNullOrUndefined(C.search))return $&&(L.hostname=L.host=I.shift(),(U=!!(L.host&&L.host.indexOf("@")>0)&&L.host.split("@"))&&(L.auth=U.shift(),L.host=L.hostname=U.shift())),L.search=C.search,L.query=C.query,c.isNull(L.pathname)&&c.isNull(L.search)||(L.path=(L.pathname?L.pathname:"")+(L.search?L.search:"")),L.href=L.format(),L;if(!I.length)return L.pathname=null,L.search?L.path="/"+L.search:L.path=null,L.href=L.format(),L;for(var K=I.slice(-1)[0],j=(L.host||C.host||I.length>1)&&(K==="."||K==="..")||K==="",D=0,B=I.length;B>=0;B--)(K=I[B])==="."?I.splice(B,1):K===".."?(I.splice(B,1),D++):D&&(I.splice(B,1),D--);if(!q&&!Z)for(;D--;D)I.unshift("..");!q||I[0]===""||I[0]&&I[0].charAt(0)==="/"||I.unshift(""),j&&I.join("/").substr(-1)!=="/"&&I.push("");var U,J=I[0]===""||I[0]&&I[0].charAt(0)==="/";return $&&(L.hostname=L.host=J?"":I.length?I.shift():"",(U=!!(L.host&&L.host.indexOf("@")>0)&&L.host.split("@"))&&(L.auth=U.shift(),L.host=L.hostname=U.shift())),(q=q||L.host&&I.length)&&!J&&I.unshift(""),I.length?L.pathname=I.join("/"):(L.pathname=null,L.path=null),c.isNull(L.pathname)&&c.isNull(L.search)||(L.path=(L.pathname?L.pathname:"")+(L.search?L.search:"")),L.auth=C.auth||L.auth,L.slashes=L.slashes||C.slashes,L.href=L.format(),L},p.prototype.parseHost=function(){var C=this.host,N=f.exec(C);N&&((N=N[0])!==":"&&(this.port=N.substr(1)),C=C.substr(0,C.length-N.length)),C&&(this.hostname=C)}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function c(){this.listeners={}}return c.prototype.addEventListener=function(p,a){p=p.toLowerCase(),this.listeners[p]=this.listeners[p]||[],this.listeners[p].push(a.handleEvent||a)},c.prototype.removeEventListener=function(p,a){if(p=p.toLowerCase(),this.listeners[p]){var f=this.listeners[p].indexOf(a.handleEvent||a);f<0||this.listeners[p].splice(f,1)}},c.prototype.dispatchEvent=function(p){var a=p.type.toLowerCase();if(p.target=this,this.listeners[a])for(var f=0,s=this.listeners[a];f<s.length;f++)s[f].call(this,p);var u=this["on"+a];return u&&u.call(this,p),!0},c}();e.XMLHttpRequestEventTarget=n},function(o,e,t){var n=t(27).codes.ERR_STREAM_PREMATURE_CLOSE;function c(){}o.exports=function p(a,f,s){if(typeof f=="function")return p(a,null,f);f||(f={}),s=function(M){var C=!1;return function(){if(!C){C=!0;for(var N=arguments.length,L=new Array(N),F=0;F<N;F++)L[F]=arguments[F];M.apply(this,L)}}}(s||c);var u=f.readable||f.readable!==!1&&a.readable,h=f.writable||f.writable!==!1&&a.writable,v=function(){a.writable||y()},b=a._writableState&&a._writableState.finished,y=function(){h=!1,b=!0,u||s.call(a)},_=a._readableState&&a._readableState.endEmitted,E=function(){u=!1,_=!0,h||s.call(a)},S=function(M){s.call(a,M)},k=function(){var M;return u&&!_?(a._readableState&&a._readableState.ended||(M=new n),s.call(a,M)):h&&!b?(a._writableState&&a._writableState.ended||(M=new n),s.call(a,M)):void 0},O=function(){a.req.on("finish",y)};return function(M){return M.setHeader&&typeof M.abort=="function"}(a)?(a.on("complete",y),a.on("abort",k),a.req?O():a.on("request",O)):h&&!a._writableState&&(a.on("end",v),a.on("close",v)),a.on("end",E),a.on("finish",y),f.error!==!1&&a.on("error",S),a.on("close",k),function(){a.removeListener("complete",y),a.removeListener("abort",k),a.removeListener("request",O),a.req&&a.req.removeListener("finish",y),a.removeListener("end",v),a.removeListener("close",v),a.removeListener("finish",y),a.removeListener("end",E),a.removeListener("error",S),a.removeListener("close",k)}}},function(o,e,t){var n=e;n.version=t(244).version,n.utils=t(11),n.rand=t(121),n.curve=t(122),n.curves=t(59),n.ec=t(257),n.eddsa=t(261)},function(o,e,t){var n,c=e,p=t(60),a=t(122),f=t(11).assert;function s(h){h.type==="short"?this.curve=new a.short(h):h.type==="edwards"?this.curve=new a.edwards(h):this.curve=new a.mont(h),this.g=this.curve.g,this.n=this.curve.n,this.hash=h.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(h,v){Object.defineProperty(c,h,{configurable:!0,enumerable:!0,get:function(){var b=new s(v);return Object.defineProperty(c,h,{configurable:!0,enumerable:!0,value:b}),b}})}c.PresetCurve=s,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:p.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:p.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:p.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:p.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:p.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:p.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:p.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t(256)}catch{n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:p.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(o,e,t){var n=e;n.utils=t(15),n.common=t(37),n.sha=t(250),n.ripemd=t(254),n.hmac=t(255),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(o,e,t){(function(n){var c=t(268);/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/function p(H,z){if(H===z)return 0;for(var R=H.length,l=z.length,x=0,d=Math.min(R,l);x<d;++x)if(H[x]!==z[x]){R=H[x],l=z[x];break}return R<l?-1:l<R?1:0}function a(H){return n.Buffer&&typeof n.Buffer.isBuffer=="function"?n.Buffer.isBuffer(H):!(H==null||!H._isBuffer)}var f=t(21),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,h=function(){}.name==="foo";function v(H){return Object.prototype.toString.call(H)}function b(H){return!a(H)&&typeof n.ArrayBuffer=="function"&&(typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(H):!!H&&(H instanceof DataView||!!(H.buffer&&H.buffer instanceof ArrayBuffer)))}var y=o.exports=M,_=/\s*function\s+([^\(\s]*)\s*/;function E(H){if(f.isFunction(H)){if(h)return H.name;var z=H.toString().match(_);return z&&z[1]}}function S(H,z){return typeof H=="string"?H.length<z?H:H.slice(0,z):H}function k(H){if(h||!f.isFunction(H))return f.inspect(H);var z=E(H);return"[Function"+(z?": "+z:"")+"]"}function O(H,z,R,l,x){throw new y.AssertionError({message:R,actual:H,expected:z,operator:l,stackStartFunction:x})}function M(H,z){H||O(H,!0,z,"==",y.ok)}function C(H,z,R,l){if(H===z)return!0;if(a(H)&&a(z))return p(H,z)===0;if(f.isDate(H)&&f.isDate(z))return H.getTime()===z.getTime();if(f.isRegExp(H)&&f.isRegExp(z))return H.source===z.source&&H.global===z.global&&H.multiline===z.multiline&&H.lastIndex===z.lastIndex&&H.ignoreCase===z.ignoreCase;if(H!==null&&typeof H=="object"||z!==null&&typeof z=="object"){if(b(H)&&b(z)&&v(H)===v(z)&&!(H instanceof Float32Array||H instanceof Float64Array))return p(new Uint8Array(H.buffer),new Uint8Array(z.buffer))===0;if(a(H)!==a(z))return!1;var x=(l=l||{actual:[],expected:[]}).actual.indexOf(H);return x!==-1&&x===l.expected.indexOf(z)||(l.actual.push(H),l.expected.push(z),function(d,m,g,w){if(d==null||m==null)return!1;if(f.isPrimitive(d)||f.isPrimitive(m))return d===m;if(g&&Object.getPrototypeOf(d)!==Object.getPrototypeOf(m))return!1;var A=N(d),P=N(m);if(A&&!P||!A&&P)return!1;if(A)return d=u.call(d),m=u.call(m),C(d,m,g);var T,q,Z=V(d),I=V(m);if(Z.length!==I.length)return!1;for(Z.sort(),I.sort(),q=Z.length-1;q>=0;q--)if(Z[q]!==I[q])return!1;for(q=Z.length-1;q>=0;q--)if(T=Z[q],!C(d[T],m[T],g,w))return!1;return!0}(H,z,R,l))}return R?H===z:H==z}function N(H){return Object.prototype.toString.call(H)=="[object Arguments]"}function L(H,z){if(!H||!z)return!1;if(Object.prototype.toString.call(z)=="[object RegExp]")return z.test(H);try{if(H instanceof z)return!0}catch{}return!Error.isPrototypeOf(z)&&z.call({},H)===!0}function F(H,z,R,l){var x;if(typeof z!="function")throw new TypeError('"block" argument must be a function');typeof R=="string"&&(l=R,R=null),x=function(g){var w;try{g()}catch(A){w=A}return w}(z),l=(R&&R.name?" ("+R.name+").":".")+(l?" "+l:"."),H&&!x&&O(x,R,"Missing expected exception"+l);var d=typeof l=="string",m=!H&&x&&!R;if((!H&&f.isError(x)&&d&&L(x,R)||m)&&O(x,R,"Got unwanted exception"+l),H&&x&&R&&!L(x,R)||!H&&x)throw x}y.AssertionError=function(H){this.name="AssertionError",this.actual=H.actual,this.expected=H.expected,this.operator=H.operator,H.message?(this.message=H.message,this.generatedMessage=!1):(this.message=function(g){return S(k(g.actual),128)+" "+g.operator+" "+S(k(g.expected),128)}(this),this.generatedMessage=!0);var z=H.stackStartFunction||O;if(Error.captureStackTrace)Error.captureStackTrace(this,z);else{var R=new Error;if(R.stack){var l=R.stack,x=E(z),d=l.indexOf(`
`+x);if(d>=0){var m=l.indexOf(`
`,d+1);l=l.substring(m+1)}this.stack=l}}},f.inherits(y.AssertionError,Error),y.fail=O,y.ok=M,y.equal=function(H,z,R){H!=z&&O(H,z,R,"==",y.equal)},y.notEqual=function(H,z,R){H==z&&O(H,z,R,"!=",y.notEqual)},y.deepEqual=function(H,z,R){C(H,z,!1)||O(H,z,R,"deepEqual",y.deepEqual)},y.deepStrictEqual=function(H,z,R){C(H,z,!0)||O(H,z,R,"deepStrictEqual",y.deepStrictEqual)},y.notDeepEqual=function(H,z,R){C(H,z,!1)&&O(H,z,R,"notDeepEqual",y.notDeepEqual)},y.notDeepStrictEqual=function H(z,R,l){C(z,R,!0)&&O(z,R,l,"notDeepStrictEqual",H)},y.strictEqual=function(H,z,R){H!==z&&O(H,z,R,"===",y.strictEqual)},y.notStrictEqual=function(H,z,R){H===z&&O(H,z,R,"!==",y.notStrictEqual)},y.throws=function(H,z,R){F(!0,H,z,R)},y.doesNotThrow=function(H,z,R){F(!1,H,z,R)},y.ifError=function(H){if(H)throw H},y.strict=c(function H(z,R){z||O(z,!0,R,"==",H)},y,{equal:y.strictEqual,deepEqual:y.deepStrictEqual,notEqual:y.notStrictEqual,notDeepEqual:y.notDeepStrictEqual}),y.strict.strict=y.strict;var V=Object.keys||function(H){var z=[];for(var R in H)s.call(H,R)&&z.push(R);return z}}).call(this,t(6))},function(o,e,t){var n=t(29).codes.ERR_STREAM_PREMATURE_CLOSE;function c(){}o.exports=function p(a,f,s){if(typeof f=="function")return p(a,null,f);f||(f={}),s=function(M){var C=!1;return function(){if(!C){C=!0;for(var N=arguments.length,L=new Array(N),F=0;F<N;F++)L[F]=arguments[F];M.apply(this,L)}}}(s||c);var u=f.readable||f.readable!==!1&&a.readable,h=f.writable||f.writable!==!1&&a.writable,v=function(){a.writable||y()},b=a._writableState&&a._writableState.finished,y=function(){h=!1,b=!0,u||s.call(a)},_=a._readableState&&a._readableState.endEmitted,E=function(){u=!1,_=!0,h||s.call(a)},S=function(M){s.call(a,M)},k=function(){var M;return u&&!_?(a._readableState&&a._readableState.ended||(M=new n),s.call(a,M)):h&&!b?(a._writableState&&a._writableState.ended||(M=new n),s.call(a,M)):void 0},O=function(){a.req.on("finish",y)};return function(M){return M.setHeader&&typeof M.abort=="function"}(a)?(a.on("complete",y),a.on("abort",k),a.req?O():a.on("request",O)):h&&!a._writableState&&(a.on("end",v),a.on("close",v)),a.on("end",E),a.on("finish",y),f.error!==!1&&a.on("error",S),a.on("close",k),function(){a.removeListener("complete",y),a.removeListener("abort",k),a.removeListener("request",O),a.req&&a.req.removeListener("finish",y),a.removeListener("end",v),a.removeListener("close",v),a.removeListener("finish",y),a.removeListener("end",E),a.removeListener("error",S),a.removeListener("close",k)}}},function(o,e,t){var n=t(140),c=t(301),p=t(302),a=n?n.toStringTag:void 0;o.exports=function(f){return f==null?f===void 0?"[object Undefined]":"[object Null]":a&&a in Object(f)?c(f):p(f)}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return function(){if(n!==null){var c=n;n=null,c.apply(this,arguments)}}},o.exports=e.default},function(o,e){o.exports=function(t){return t!=null&&typeof t=="object"}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return function(){if(n===null)throw new Error("Callback was already called.");var c=n;n=null,c.apply(this,arguments)}},o.exports=e.default},function(o,e,t){const n=t(333),c=t(44);o.exports=function(p){return c({id:n(),jsonrpc:"2.0",params:[]},p)}},function(o,e,t){const n=t(49);o.exports=class extends n{constructor(c){if(super(),!c)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");this._constructorFn=c}setEngine(c){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");const p=c._blockTracker,a=this._constructorFn({engine:c,provider:c,blockTracker:p});if(!a)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if(typeof a!="function")throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=a}handleRequest(c,p,a){const f={id:c.id};this.middleware(c,f,function(s){p((u,h,v)=>{u?(delete f.result,f.error={message:u.message||u}):f.result=h,s?s(v):v()})},function(s){if(s)return a(s);a(null,f.result)})}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});const n=t(12);function c(a,f,s){try{Reflect.apply(a,f,s)}catch(u){setTimeout(()=>{throw u})}}class p extends n.EventEmitter{emit(f,...s){let u=f==="error";const h=this._events;if(h!==void 0)u=u&&h.error===void 0;else if(!u)return!1;if(u){let b;if(s.length>0&&([b]=s),b instanceof Error)throw b;const y=new Error("Unhandled error."+(b?` (${b.message})`:""));throw y.context=b,y}const v=h[f];if(v===void 0)return!1;if(typeof v=="function")c(v,this,s);else{const b=v.length,y=function(_){const E=_.length,S=new Array(E);for(let k=0;k<E;k+=1)S[k]=_[k];return S}(v);for(let _=0;_<b;_+=1)c(y[_],this,s)}return!0}}e.default=p},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumProviderError=e.EthereumRpcError=void 0;const n=t(344);class c extends Error{constructor(f,s,u){if(!Number.isInteger(f))throw new Error('"code" must be an integer.');if(!s||typeof s!="string")throw new Error('"message" must be a nonempty string.');super(s),this.code=f,u!==void 0&&(this.data=u)}serialize(){const f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),this.stack&&(f.stack=this.stack),f}toString(){return n.default(this.serialize(),p,2)}}e.EthereumRpcError=c;function p(a,f){if(f!=="[Circular]")return f}e.EthereumProviderError=class extends c{constructor(a,f,s){if(!function(u){return Number.isInteger(u)&&u>=1e3&&u<=4999}(a))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(a,f,s)}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.errorValues=e.errorCodes=void 0,e.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}},e.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(o,e,t){const n=t(69).default;o.exports=class extends n{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(c){this.updates=this.updates.concat(c),c.forEach(p=>this.emit("update",p))}addInitialResults(c){}getChangesAndClear(){const c=this.updates;return this.updates=[],c}}},function(o,e){function t(c){return c==null?c:Number.parseInt(c,16)}function n(c){return c==null?c:"0x"+c.toString(16)}o.exports=async function({provider:c,fromBlock:p,toBlock:a}){p||(p=a);const f=t(p),s=t(a),u=Array(s-f+1).fill().map((h,v)=>f+v).map(n);return await Promise.all(u.map(h=>function(v,b,y){return new Promise((_,E)=>{v.sendAsync({id:1,jsonrpc:"2.0",method:b,params:y},(S,k)=>{if(S)return E(S);_(k.result)})})}(c,"eth_getBlockByNumber",[h,!1])))}},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.ecdhUnsafe=e.ecdh=e.recover=e.verify=e.sign=e.signatureImportLax=e.signatureImport=e.signatureExport=e.signatureNormalize=e.publicKeyCombine=e.publicKeyTweakMul=e.publicKeyTweakAdd=e.publicKeyVerify=e.publicKeyConvert=e.publicKeyCreate=e.privateKeyTweakMul=e.privateKeyTweakAdd=e.privateKeyModInverse=e.privateKeyNegate=e.privateKeyImport=e.privateKeyExport=e.privateKeyVerify=void 0;var c=t(118),p=t(361),a=t(362);e.privateKeyVerify=function(f){return f.length===32&&c.privateKeyVerify(Uint8Array.from(f))},e.privateKeyExport=function(f,s){if(f.length!==32)throw new RangeError("private key length is invalid");var u=p.privateKeyExport(f,s);return a.privateKeyExport(f,u,s)},e.privateKeyImport=function(f){if((f=a.privateKeyImport(f))!==null&&f.length===32&&e.privateKeyVerify(f))return f;throw new Error("couldn't import from DER format")},e.privateKeyNegate=function(f){return n.from(c.privateKeyNegate(Uint8Array.from(f)))},e.privateKeyModInverse=function(f){if(f.length!==32)throw new Error("private key length is invalid");return n.from(p.privateKeyModInverse(Uint8Array.from(f)))},e.privateKeyTweakAdd=function(f,s){return n.from(c.privateKeyTweakAdd(Uint8Array.from(f),s))},e.privateKeyTweakMul=function(f,s){return n.from(c.privateKeyTweakMul(Uint8Array.from(f),Uint8Array.from(s)))},e.publicKeyCreate=function(f,s){return n.from(c.publicKeyCreate(Uint8Array.from(f),s))},e.publicKeyConvert=function(f,s){return n.from(c.publicKeyConvert(Uint8Array.from(f),s))},e.publicKeyVerify=function(f){return(f.length===33||f.length===65)&&c.publicKeyVerify(Uint8Array.from(f))},e.publicKeyTweakAdd=function(f,s,u){return n.from(c.publicKeyTweakAdd(Uint8Array.from(f),Uint8Array.from(s),u))},e.publicKeyTweakMul=function(f,s,u){return n.from(c.publicKeyTweakMul(Uint8Array.from(f),Uint8Array.from(s),u))},e.publicKeyCombine=function(f,s){var u=[];return f.forEach(function(h){u.push(Uint8Array.from(h))}),n.from(c.publicKeyCombine(u,s))},e.signatureNormalize=function(f){return n.from(c.signatureNormalize(Uint8Array.from(f)))},e.signatureExport=function(f){return n.from(c.signatureExport(Uint8Array.from(f)))},e.signatureImport=function(f){return n.from(c.signatureImport(Uint8Array.from(f)))},e.signatureImportLax=function(f){if(f.length===0)throw new RangeError("signature length is invalid");var s=a.signatureImportLax(f);if(s===null)throw new Error("couldn't parse DER signature");return p.signatureImport(s)},e.sign=function(f,s,u){if(u===null)throw new TypeError("options should be an Object");var h=void 0;if(u){if(h={},u.data===null)throw new TypeError("options.data should be a Buffer");if(u.data){if(u.data.length!=32)throw new RangeError("options.data length is invalid");h.data=new Uint8Array(u.data)}if(u.noncefn===null)throw new TypeError("options.noncefn should be a Function");u.noncefn&&(h.noncefn=function(b,y,_,E,S){var k=_!=null?n.from(_):null,O=E!=null?n.from(E):null,M=n.from("");return u.noncefn&&(M=u.noncefn(n.from(b),n.from(y),k,O,S)),new Uint8Array(M)})}var v=c.ecdsaSign(Uint8Array.from(f),Uint8Array.from(s),h);return{signature:n.from(v.signature),recovery:v.recid}},e.verify=function(f,s,u){return c.ecdsaVerify(Uint8Array.from(s),Uint8Array.from(f),u)},e.recover=function(f,s,u,h){return n.from(c.ecdsaRecover(Uint8Array.from(s),u,Uint8Array.from(f),h))},e.ecdh=function(f,s){return n.from(c.ecdh(Uint8Array.from(f),Uint8Array.from(s),{}))},e.ecdhUnsafe=function(f,s,u){if(f.length!==33&&f.length!==65)throw new RangeError("public key length is invalid");if(s.length!==32)throw new RangeError("private key length is invalid");return n.from(p.ecdhUnsafe(Uint8Array.from(f),Uint8Array.from(s),u))}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160=e.sha256=e.keccak256=e.keccak=void 0;var c=t(110),p=c.keccak224,a=c.keccak384,f=c.keccak256,s=c.keccak512,u=t(126),h=t(32),v=t(46),b=t(40);e.keccak=function(y,_){switch(_===void 0&&(_=256),y=typeof y!="string"||h.isHexString(y)?b.toBuffer(y):n.from(y,"utf8"),_||(_=256),_){case 224:return p(y);case 256:return f(y);case 384:return a(y);case 512:return s(y);default:throw new Error("Invald algorithm: keccak"+_)}},e.keccak256=function(y){return e.keccak(y)},e.sha256=function(y){return y=b.toBuffer(y),u("sha256").update(y).digest()},e.ripemd160=function(y,_){y=b.toBuffer(y);var E=u("rmd160").update(y).digest();return _===!0?b.setLength(E,32):E},e.rlphash=function(y){return e.keccak(v.encode(y))}}).call(this,t(2).Buffer)},function(o,e,t){t.r(e);var n=t(157),c=t(10),p=t(158);function a($){return Object(p.a)($)}function f(){const $=a();return $&&$.os?$.os:void 0}function s(){const $=f();return!!$&&$.toLowerCase().includes("android")}function u(){const $=f();return!!$&&($.toLowerCase().includes("ios")||$.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function h(){return!!f()&&(s()||u())}function v(){const $=a();return!(!$||!$.name)&&$.name.toLowerCase()==="node"}function b(){return!v()&&!!O()}const y=c.getFromWindow,_=c.getFromWindowOrThrow,E=c.getDocumentOrThrow,S=c.getDocument,k=c.getNavigatorOrThrow,O=c.getNavigator,M=c.getLocationOrThrow,C=c.getLocation,N=c.getCryptoOrThrow,L=c.getCrypto,F=c.getLocalStorageOrThrow,V=c.getLocalStorage;function H(){return n.getWindowMetadata()}const z=function($){if(typeof $!="string")throw new Error("Cannot safe json parse value of type "+typeof $);try{return JSON.parse($)}catch{return $}},R=function($){return typeof $=="string"?$:JSON.stringify($)};function l($,K){const j=R(K),D=V();D&&D.setItem($,j)}function x($){let K=null,j=null;const D=V();return D&&(j=D.getItem($)),K=j&&z(j),K}function d($){const K=V();K&&K.removeItem($)}function m($,K){const j=encodeURIComponent($);return K.universalLink?`${K.universalLink}/wc?uri=${j}`:K.deepLink?`${K.deepLink}${K.deepLink.endsWith(":")?"//":"/"}wc?uri=${j}`:""}function g($){const K=$.href.split("?")[0];l("WALLETCONNECT_DEEPLINK_CHOICE",Object.assign(Object.assign({},$),{href:K}))}function w($,K){return $.filter(j=>j.name.toLowerCase().includes(K.toLowerCase()))[0]}function A($,K){let j=$;return K&&(j=K.map(D=>w($,D)).filter(Boolean)),j}const P="https://registry.walletconnect.com";function T(){return P+"/api/v2/wallets"}function q(){return P+"/api/v2/dapps"}function Z($,K="mobile"){var j;return{name:$.name||"",shortName:$.metadata.shortName||"",color:$.metadata.colors.primary||"",logo:(j=$.image_url.sm)!==null&&j!==void 0?j:"",universalLink:$[K].universal||"",deepLink:$[K].native||""}}function I($,K="mobile"){return Object.values($).filter(j=>!!j[K].universal||!!j[K].native).map(j=>Z(j,K))}t.d(e,"detectEnv",function(){return a}),t.d(e,"detectOS",function(){return f}),t.d(e,"isAndroid",function(){return s}),t.d(e,"isIOS",function(){return u}),t.d(e,"isMobile",function(){return h}),t.d(e,"isNode",function(){return v}),t.d(e,"isBrowser",function(){return b}),t.d(e,"getFromWindow",function(){return y}),t.d(e,"getFromWindowOrThrow",function(){return _}),t.d(e,"getDocumentOrThrow",function(){return E}),t.d(e,"getDocument",function(){return S}),t.d(e,"getNavigatorOrThrow",function(){return k}),t.d(e,"getNavigator",function(){return O}),t.d(e,"getLocationOrThrow",function(){return M}),t.d(e,"getLocation",function(){return C}),t.d(e,"getCryptoOrThrow",function(){return N}),t.d(e,"getCrypto",function(){return L}),t.d(e,"getLocalStorageOrThrow",function(){return F}),t.d(e,"getLocalStorage",function(){return V}),t.d(e,"getClientMeta",function(){return H}),t.d(e,"safeJsonParse",function(){return z}),t.d(e,"safeJsonStringify",function(){return R}),t.d(e,"setLocal",function(){return l}),t.d(e,"getLocal",function(){return x}),t.d(e,"removeLocal",function(){return d}),t.d(e,"mobileLinkChoiceKey",function(){return"WALLETCONNECT_DEEPLINK_CHOICE"}),t.d(e,"formatIOSMobile",function(){return m}),t.d(e,"saveMobileLinkInfo",function(){return g}),t.d(e,"getMobileRegistryEntry",function(){return w}),t.d(e,"getMobileLinkRegistry",function(){return A}),t.d(e,"getWalletRegistryUrl",function(){return T}),t.d(e,"getDappRegistryUrl",function(){return q}),t.d(e,"formatMobileRegistryEntry",function(){return Z}),t.d(e,"formatMobileRegistry",function(){return I})},function(o,e){o.exports=c,c.strict=p,c.loose=a;var t=Object.prototype.toString,n={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function c(f){return p(f)||a(f)}function p(f){return f instanceof Int8Array||f instanceof Int16Array||f instanceof Int32Array||f instanceof Uint8Array||f instanceof Uint8ClampedArray||f instanceof Uint16Array||f instanceof Uint32Array||f instanceof Float32Array||f instanceof Float64Array}function a(f){return n[t.call(f)]}},function(o,e,t){const n=t(174),c=t(175),p=t(176);function a(y){if(typeof y!="string"||y.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(y,_){return _.encode?_.strict?n(y):encodeURIComponent(y):y}function s(y,_){return _.decode?c(y):y}function u(y){const _=y.indexOf("#");return _!==-1&&(y=y.slice(0,_)),y}function h(y){const _=(y=u(y)).indexOf("?");return _===-1?"":y.slice(_+1)}function v(y,_){return _.parseNumbers&&!Number.isNaN(Number(y))&&typeof y=="string"&&y.trim()!==""?y=Number(y):!_.parseBooleans||y===null||y.toLowerCase()!=="true"&&y.toLowerCase()!=="false"||(y=y.toLowerCase()==="true"),y}function b(y,_){a((_=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},_)).arrayFormatSeparator);const E=function(k){let O;switch(k.arrayFormat){case"index":return(M,C,N)=>{O=/\[(\d*)\]$/.exec(M),M=M.replace(/\[\d*\]$/,""),O?(N[M]===void 0&&(N[M]={}),N[M][O[1]]=C):N[M]=C};case"bracket":return(M,C,N)=>{O=/(\[\])$/.exec(M),M=M.replace(/\[\]$/,""),O?N[M]!==void 0?N[M]=[].concat(N[M],C):N[M]=[C]:N[M]=C};case"comma":case"separator":return(M,C,N)=>{const L=typeof C=="string"&&C.split("").indexOf(k.arrayFormatSeparator)>-1?C.split(k.arrayFormatSeparator).map(F=>s(F,k)):C===null?C:s(C,k);N[M]=L};default:return(M,C,N)=>{N[M]!==void 0?N[M]=[].concat(N[M],C):N[M]=C}}}(_),S=Object.create(null);if(typeof y!="string"||!(y=y.trim().replace(/^[?#&]/,"")))return S;for(const k of y.split("&")){let[O,M]=p(_.decode?k.replace(/\+/g," "):k,"=");M=M===void 0?null:["comma","separator"].includes(_.arrayFormat)?M:s(M,_),E(s(O,_),M,S)}for(const k of Object.keys(S)){const O=S[k];if(typeof O=="object"&&O!==null)for(const M of Object.keys(O))O[M]=v(O[M],_);else S[k]=v(O,_)}return _.sort===!1?S:(_.sort===!0?Object.keys(S).sort():Object.keys(S).sort(_.sort)).reduce((k,O)=>{const M=S[O];return Boolean(M)&&typeof M=="object"&&!Array.isArray(M)?k[O]=function C(N){return Array.isArray(N)?N.sort():typeof N=="object"?C(Object.keys(N)).sort((L,F)=>Number(L)-Number(F)).map(L=>N[L]):N}(M):k[O]=M,k},Object.create(null))}e.extract=h,e.parse=b,e.stringify=(y,_)=>{if(!y)return"";a((_=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},_)).arrayFormatSeparator);const E=M=>_.skipNull&&y[M]==null||_.skipEmptyString&&y[M]==="",S=function(M){switch(M.arrayFormat){case"index":return C=>(N,L)=>{const F=N.length;return L===void 0||M.skipNull&&L===null||M.skipEmptyString&&L===""?N:L===null?[...N,[f(C,M),"[",F,"]"].join("")]:[...N,[f(C,M),"[",f(F,M),"]=",f(L,M)].join("")]};case"bracket":return C=>(N,L)=>L===void 0||M.skipNull&&L===null||M.skipEmptyString&&L===""?N:L===null?[...N,[f(C,M),"[]"].join("")]:[...N,[f(C,M),"[]=",f(L,M)].join("")];case"comma":case"separator":return C=>(N,L)=>L==null||L.length===0?N:N.length===0?[[f(C,M),"=",f(L,M)].join("")]:[[N,f(L,M)].join(M.arrayFormatSeparator)];default:return C=>(N,L)=>L===void 0||M.skipNull&&L===null||M.skipEmptyString&&L===""?N:L===null?[...N,f(C,M)]:[...N,[f(C,M),"=",f(L,M)].join("")]}}(_),k={};for(const M of Object.keys(y))E(M)||(k[M]=y[M]);const O=Object.keys(k);return _.sort!==!1&&O.sort(_.sort),O.map(M=>{const C=y[M];return C===void 0?"":C===null?f(M,_):Array.isArray(C)?C.reduce(S(M),[]).join("&"):f(M,_)+"="+f(C,_)}).filter(M=>M.length>0).join("&")},e.parseUrl=(y,_)=>{_=Object.assign({decode:!0},_);const[E,S]=p(y,"#");return Object.assign({url:E.split("?")[0]||"",query:b(h(y),_)},_&&_.parseFragmentIdentifier&&S?{fragmentIdentifier:s(S,_)}:{})},e.stringifyUrl=(y,_)=>{_=Object.assign({encode:!0,strict:!0},_);const E=u(y.url).split("?")[0]||"",S=e.extract(y.url),k=e.parse(S,{sort:!1}),O=Object.assign(k,y.query);let M=e.stringify(O,_);M&&(M="?"+M);let C=function(N){let L="";const F=N.indexOf("#");return F!==-1&&(L=N.slice(F)),L}(y.url);return y.fragmentIdentifier&&(C="#"+f(y.fragmentIdentifier,_)),`${E}${M}${C}`}},function(o,e){var t={}.toString;o.exports=Array.isArray||function(n){return t.call(n)=="[object Array]"}},function(o,e,t){var n=t(8);t.o(n,"payloadId")&&t.d(e,"payloadId",function(){return n.payloadId}),n.isNode},function(o,e,t){t.d(e,"a",function(){return n}),t(24),t(7);function n(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))}},function(o,e,t){},function(o,e,t){t(84)},function(o,e,t){t(85),t(41),t(86),t(87)},function(o,e){},function(o,e,t){var n=t(41);n.a,n.a},function(o,e){},function(o,e,t){},function(o,e,t){},function(o,e,t){t.d(e,"a",function(){return c});var n=t(8);function c(p){return n.getBrowerCrypto().getRandomValues(new Uint8Array(p))}},function(o,e,t){t.d(e,"b",function(){return c}),t.d(e,"a",function(){return p});var n=t(14);function c(a,f,s){return Object(n.b)(a,f,s)}function p(a,f,s){return Object(n.a)(a,f,s)}},function(o,e,t){t.d(e,"a",function(){return c});var n=t(14);t(42);async function c(p,a){return await Object(n.c)(p,a)}},function(o,e,t){var n=t(8);t.o(n,"isConstantTime")&&t.d(e,"isConstantTime",function(){return n.isConstantTime})},function(o,e,t){},function(o,e){},function(o,e,t){function n(c,p){if(c.length!==p.length)return!1;let a=0;for(let f=0;f<c.length;f++)a|=c[f]^p[f];return a===0}t.d(e,"a",function(){return n})},function(o,e,t){t(14)},function(o,e,t){var n=t(51),c=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],p=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(a,f){switch(f){case n.L:return c[4*(a-1)+0];case n.M:return c[4*(a-1)+1];case n.Q:return c[4*(a-1)+2];case n.H:return c[4*(a-1)+3];default:return}},e.getTotalCodewordsCount=function(a,f){switch(f){case n.L:return p[4*(a-1)+0];case n.M:return p[4*(a-1)+1];case n.Q:return p[4*(a-1)+2];case n.H:return p[4*(a-1)+3];default:return}}},function(o,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},function(o,e){var t="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(t=t.replace(/u/g,"\\u"))+`)(?:.|[\r
]))+`;e.KANJI=new RegExp(t,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(n,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var c=new RegExp("^"+t+"$"),p=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(f){return c.test(f)},e.testNumeric=function(f){return p.test(f)},e.testAlphanumeric=function(f){return a.test(f)}},function(o,e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");var c=n.slice().replace("#","").split("");if(c.length<3||c.length===5||c.length>8)throw new Error("Invalid hex color: "+n);c.length!==3&&c.length!==4||(c=Array.prototype.concat.apply([],c.map(function(a){return[a,a]}))),c.length===6&&c.push("F","F");var p=parseInt(c.join(""),16);return{r:p>>24&255,g:p>>16&255,b:p>>8&255,a:255&p,hex:"#"+c.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});var c=n.margin===void 0||n.margin===null||n.margin<0?4:n.margin,p=n.width&&n.width>=21?n.width:void 0,a=n.scale||4;return{width:p,scale:p?4:a,margin:c,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,c){return c.width&&c.width>=n+2*c.margin?c.width/(n+2*c.margin):c.scale},e.getImageWidth=function(n,c){var p=e.getScale(n,c);return Math.floor((n+2*c.margin)*p)},e.qrToImageData=function(n,c,p){for(var a=c.modules.size,f=c.modules.data,s=e.getScale(a,p),u=Math.floor((a+2*p.margin)*s),h=p.margin*s,v=[p.color.light,p.color.dark],b=0;b<u;b++)for(var y=0;y<u;y++){var _=4*(b*u+y),E=p.color.light;b>=h&&y>=h&&b<u-h&&y<u-h&&(E=v[f[Math.floor((b-h)/s)*a+Math.floor((y-h)/s)]?1:0]),n[_++]=E.r,n[_++]=E.g,n[_++]=E.b,n[_]=E.a}}},function(o,e,t){(function(n){var c=t(204),p=t(104),a=t(44),f=t(212),s=t(55),u=e;u.request=function(h,v){h=typeof h=="string"?s.parse(h):a(h);var b=n.location.protocol.search(/^https?:$/)===-1?"http:":"",y=h.protocol||b,_=h.hostname||h.host,E=h.port,S=h.path||"/";_&&_.indexOf(":")!==-1&&(_="["+_+"]"),h.url=(_?y+"//"+_:"")+(E?":"+E:"")+S,h.method=(h.method||"GET").toUpperCase(),h.headers=h.headers||{};var k=new c(h);return v&&k.on("response",v),k},u.get=function(h,v){var b=u.request(h,v);return b.end(),b},u.ClientRequest=c,u.IncomingMessage=p.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=f,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,t(6))},function(o,e,t){(function(n){e.fetch=u(n.fetch)&&u(n.ReadableStream),e.writableStream=u(n.WritableStream),e.abortController=u(n.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch{}var c;function p(){if(c!==void 0)return c;if(n.XMLHttpRequest){c=new n.XMLHttpRequest;try{c.open("GET",n.XDomainRequest?"/":"https://example.com")}catch{c=null}}else c=null;return c}function a(h){var v=p();if(!v)return!1;try{return v.responseType=h,v.responseType===h}catch{}return!1}var f=n.ArrayBuffer!==void 0,s=f&&u(n.ArrayBuffer.prototype.slice);function u(h){return typeof h=="function"}e.arraybuffer=e.fetch||f&&a("arraybuffer"),e.msstream=!e.fetch&&s&&a("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&f&&a("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!p()&&u(p().overrideMimeType),e.vbArray=u(n.VBArray),c=null}).call(this,t(6))},function(o,e,t){(function(n,c,p){var a=t(103),f=t(3),s=t(34),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=e.IncomingMessage=function(v,b,y,_){var E=this;if(s.Readable.call(E),E._mode=y,E.headers={},E.rawHeaders=[],E.trailers={},E.rawTrailers=[],E.on("end",function(){n.nextTick(function(){E.emit("close")})}),y==="fetch"){if(E._fetchResponse=b,E.url=b.url,E.statusCode=b.status,E.statusMessage=b.statusText,b.headers.forEach(function(C,N){E.headers[N.toLowerCase()]=C,E.rawHeaders.push(N,C)}),a.writableStream){var S=new WritableStream({write:function(C){return new Promise(function(N,L){E._destroyed?L():E.push(new c(C))?N():E._resumeFetch=N})},close:function(){p.clearTimeout(_),E._destroyed||E.push(null)},abort:function(C){E._destroyed||E.emit("error",C)}});try{return void b.body.pipeTo(S).catch(function(C){p.clearTimeout(_),E._destroyed||E.emit("error",C)})}catch{}}var k=b.body.getReader();(function C(){k.read().then(function(N){if(!E._destroyed){if(N.done)return p.clearTimeout(_),void E.push(null);E.push(new c(N.value)),C()}}).catch(function(N){p.clearTimeout(_),E._destroyed||E.emit("error",N)})})()}else if(E._xhr=v,E._pos=0,E.url=v.responseURL,E.statusCode=v.status,E.statusMessage=v.statusText,v.getAllResponseHeaders().split(/\r?\n/).forEach(function(C){var N=C.match(/^([^:]+):\s*(.*)/);if(N){var L=N[1].toLowerCase();L==="set-cookie"?(E.headers[L]===void 0&&(E.headers[L]=[]),E.headers[L].push(N[2])):E.headers[L]!==void 0?E.headers[L]+=", "+N[2]:E.headers[L]=N[2],E.rawHeaders.push(N[1],N[2])}}),E._charset="x-user-defined",!a.overrideMimeType){var O=E.rawHeaders["mime-type"];if(O){var M=O.match(/;\s*charset=([^;])(;|$)/);M&&(E._charset=M[1].toLowerCase())}E._charset||(E._charset="utf-8")}};f(h,s.Readable),h.prototype._read=function(){var v=this._resumeFetch;v&&(this._resumeFetch=null,v())},h.prototype._onXHRProgress=function(){var v=this,b=v._xhr,y=null;switch(v._mode){case"text:vbarray":if(b.readyState!==u.DONE)break;try{y=new p.VBArray(b.responseBody).toArray()}catch{}if(y!==null){v.push(new c(y));break}case"text":try{y=b.responseText}catch{v._mode="text:vbarray";break}if(y.length>v._pos){var _=y.substr(v._pos);if(v._charset==="x-user-defined"){for(var E=new c(_.length),S=0;S<_.length;S++)E[S]=255&_.charCodeAt(S);v.push(E)}else v.push(_,v._charset);v._pos=y.length}break;case"arraybuffer":if(b.readyState!==u.DONE||!b.response)break;y=b.response,v.push(new c(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=b.response,b.readyState!==u.LOADING||!y)break;v.push(new c(new Uint8Array(y)));break;case"ms-stream":if(y=b.response,b.readyState!==u.LOADING)break;var k=new p.MSStreamReader;k.onprogress=function(){k.result.byteLength>v._pos&&(v.push(new c(new Uint8Array(k.result.slice(v._pos)))),v._pos=k.result.byteLength)},k.onload=function(){v.push(null)},k.readAsArrayBuffer(y)}v._xhr.readyState===u.DONE&&v._mode!=="ms-stream"&&v.push(null)}}).call(this,t(5),t(2).Buffer,t(6))},function(o,e,t){(function(n,c){var p=t(43);o.exports=C;var a,f=t(79);C.ReadableState=M,t(12).EventEmitter;var s=function(P,T){return P.listeners(T).length},u=t(106),h=t(52).Buffer,v=n.Uint8Array||function(){},b=Object.create(t(35));b.inherits=t(3);var y=t(205),_=void 0;_=y&&y.debuglog?y.debuglog("stream"):function(){};var E,S=t(206),k=t(107);b.inherits(C,u);var O=["error","close","destroy","pause","resume"];function M(P,T){P=P||{};var q=T instanceof(a=a||t(19));this.objectMode=!!P.objectMode,q&&(this.objectMode=this.objectMode||!!P.readableObjectMode);var Z=P.highWaterMark,I=P.readableHighWaterMark,$=this.objectMode?16:16384;this.highWaterMark=Z||Z===0?Z:q&&(I||I===0)?I:$,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new S,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.destroyed=!1,this.defaultEncoding=P.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,P.encoding&&(E||(E=t(20).StringDecoder),this.decoder=new E(P.encoding),this.encoding=P.encoding)}function C(P){if(a=a||t(19),!(this instanceof C))return new C(P);this._readableState=new M(P,this),this.readable=!0,P&&(typeof P.read=="function"&&(this._read=P.read),typeof P.destroy=="function"&&(this._destroy=P.destroy)),u.call(this)}function N(P,T,q,Z,I){var $,K=P._readableState;return T===null?(K.reading=!1,function(j,D){if(!D.ended){if(D.decoder){var B=D.decoder.end();B&&B.length&&(D.buffer.push(B),D.length+=D.objectMode?1:B.length)}D.ended=!0,V(j)}}(P,K)):(I||($=function(j,D){var B;U=D,h.isBuffer(U)||U instanceof v||typeof D=="string"||D===void 0||j.objectMode||(B=new TypeError("Invalid non-string/buffer chunk"));var U;return B}(K,T)),$?P.emit("error",$):K.objectMode||T&&T.length>0?(typeof T=="string"||K.objectMode||Object.getPrototypeOf(T)===h.prototype||(T=function(j){return h.from(j)}(T)),Z?K.endEmitted?P.emit("error",new Error("stream.unshift() after end event")):L(P,K,T,!0):K.ended?P.emit("error",new Error("stream.push() after EOF")):(K.reading=!1,K.decoder&&!q?(T=K.decoder.write(T),K.objectMode||T.length!==0?L(P,K,T,!1):z(P,K)):L(P,K,T,!1))):Z||(K.reading=!1)),function(j){return!j.ended&&(j.needReadable||j.length<j.highWaterMark||j.length===0)}(K)}function L(P,T,q,Z){T.flowing&&T.length===0&&!T.sync?(P.emit("data",q),P.read(0)):(T.length+=T.objectMode?1:q.length,Z?T.buffer.unshift(q):T.buffer.push(q),T.needReadable&&V(P)),z(P,T)}Object.defineProperty(C.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(P){this._readableState&&(this._readableState.destroyed=P)}}),C.prototype.destroy=k.destroy,C.prototype._undestroy=k.undestroy,C.prototype._destroy=function(P,T){this.push(null),T(P)},C.prototype.push=function(P,T){var q,Z=this._readableState;return Z.objectMode?q=!0:typeof P=="string"&&((T=T||Z.defaultEncoding)!==Z.encoding&&(P=h.from(P,T),T=""),q=!0),N(this,P,T,!1,q)},C.prototype.unshift=function(P){return N(this,P,null,!0,!1)},C.prototype.isPaused=function(){return this._readableState.flowing===!1},C.prototype.setEncoding=function(P){return E||(E=t(20).StringDecoder),this._readableState.decoder=new E(P),this._readableState.encoding=P,this};function F(P,T){return P<=0||T.length===0&&T.ended?0:T.objectMode?1:P!=P?T.flowing&&T.length?T.buffer.head.data.length:T.length:(P>T.highWaterMark&&(T.highWaterMark=function(q){return q>=8388608?q=8388608:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q}(P)),P<=T.length?P:T.ended?T.length:(T.needReadable=!0,0))}function V(P){var T=P._readableState;T.needReadable=!1,T.emittedReadable||(_("emitReadable",T.flowing),T.emittedReadable=!0,T.sync?p.nextTick(H,P):H(P))}function H(P){_("emit readable"),P.emit("readable"),d(P)}function z(P,T){T.readingMore||(T.readingMore=!0,p.nextTick(R,P,T))}function R(P,T){for(var q=T.length;!T.reading&&!T.flowing&&!T.ended&&T.length<T.highWaterMark&&(_("maybeReadMore read 0"),P.read(0),q!==T.length);)q=T.length;T.readingMore=!1}function l(P){_("readable nexttick read 0"),P.read(0)}function x(P,T){T.reading||(_("resume read 0"),P.read(0)),T.resumeScheduled=!1,T.awaitDrain=0,P.emit("resume"),d(P),T.flowing&&!T.reading&&P.read(0)}function d(P){var T=P._readableState;for(_("flow",T.flowing);T.flowing&&P.read()!==null;);}function m(P,T){return T.length===0?null:(T.objectMode?q=T.buffer.shift():!P||P>=T.length?(q=T.decoder?T.buffer.join(""):T.buffer.length===1?T.buffer.head.data:T.buffer.concat(T.length),T.buffer.clear()):q=function(Z,I,$){var K;return Z<I.head.data.length?(K=I.head.data.slice(0,Z),I.head.data=I.head.data.slice(Z)):K=Z===I.head.data.length?I.shift():$?function(j,D){var B=D.head,U=1,J=B.data;for(j-=J.length;B=B.next;){var G=B.data,W=j>G.length?G.length:j;if(W===G.length?J+=G:J+=G.slice(0,j),(j-=W)===0){W===G.length?(++U,B.next?D.head=B.next:D.head=D.tail=null):(D.head=B,B.data=G.slice(W));break}++U}return D.length-=U,J}(Z,I):function(j,D){var B=h.allocUnsafe(j),U=D.head,J=1;for(U.data.copy(B),j-=U.data.length;U=U.next;){var G=U.data,W=j>G.length?G.length:j;if(G.copy(B,B.length-j,0,W),(j-=W)===0){W===G.length?(++J,U.next?D.head=U.next:D.head=D.tail=null):(D.head=U,U.data=G.slice(W));break}++J}return D.length-=J,B}(Z,I),K}(P,T.buffer,T.decoder),q);var q}function g(P){var T=P._readableState;if(T.length>0)throw new Error('"endReadable()" called on non-empty stream');T.endEmitted||(T.ended=!0,p.nextTick(w,T,P))}function w(P,T){P.endEmitted||P.length!==0||(P.endEmitted=!0,T.readable=!1,T.emit("end"))}function A(P,T){for(var q=0,Z=P.length;q<Z;q++)if(P[q]===T)return q;return-1}C.prototype.read=function(P){_("read",P),P=parseInt(P,10);var T=this._readableState,q=P;if(P!==0&&(T.emittedReadable=!1),P===0&&T.needReadable&&(T.length>=T.highWaterMark||T.ended))return _("read: emitReadable",T.length,T.ended),T.length===0&&T.ended?g(this):V(this),null;if((P=F(P,T))===0&&T.ended)return T.length===0&&g(this),null;var Z,I=T.needReadable;return _("need readable",I),(T.length===0||T.length-P<T.highWaterMark)&&_("length less than watermark",I=!0),T.ended||T.reading?_("reading or ended",I=!1):I&&(_("do read"),T.reading=!0,T.sync=!0,T.length===0&&(T.needReadable=!0),this._read(T.highWaterMark),T.sync=!1,T.reading||(P=F(q,T))),(Z=P>0?m(P,T):null)===null?(T.needReadable=!0,P=0):T.length-=P,T.length===0&&(T.ended||(T.needReadable=!0),q!==P&&T.ended&&g(this)),Z!==null&&this.emit("data",Z),Z},C.prototype._read=function(P){this.emit("error",new Error("_read() is not implemented"))},C.prototype.pipe=function(P,T){var q=this,Z=this._readableState;switch(Z.pipesCount){case 0:Z.pipes=P;break;case 1:Z.pipes=[Z.pipes,P];break;default:Z.pipes.push(P)}Z.pipesCount+=1,_("pipe count=%d opts=%j",Z.pipesCount,T);var I=(!T||T.end!==!1)&&P!==c.stdout&&P!==c.stderr?K:Y;function $(ee,te){_("onunpipe"),ee===q&&te&&te.hasUnpiped===!1&&(te.hasUnpiped=!0,_("cleanup"),P.removeListener("close",G),P.removeListener("finish",W),P.removeListener("drain",j),P.removeListener("error",J),P.removeListener("unpipe",$),q.removeListener("end",K),q.removeListener("end",Y),q.removeListener("data",U),D=!0,!Z.awaitDrain||P._writableState&&!P._writableState.needDrain||j())}function K(){_("onend"),P.end()}Z.endEmitted?p.nextTick(I):q.once("end",I),P.on("unpipe",$);var j=function(ee){return function(){var te=ee._readableState;_("pipeOnDrain",te.awaitDrain),te.awaitDrain&&te.awaitDrain--,te.awaitDrain===0&&s(ee,"data")&&(te.flowing=!0,d(ee))}}(q);P.on("drain",j);var D=!1,B=!1;function U(ee){_("ondata"),B=!1,P.write(ee)!==!1||B||((Z.pipesCount===1&&Z.pipes===P||Z.pipesCount>1&&A(Z.pipes,P)!==-1)&&!D&&(_("false write response, pause",q._readableState.awaitDrain),q._readableState.awaitDrain++,B=!0),q.pause())}function J(ee){_("onerror",ee),Y(),P.removeListener("error",J),s(P,"error")===0&&P.emit("error",ee)}function G(){P.removeListener("finish",W),Y()}function W(){_("onfinish"),P.removeListener("close",G),Y()}function Y(){_("unpipe"),q.unpipe(P)}return q.on("data",U),function(ee,te,oe){if(typeof ee.prependListener=="function")return ee.prependListener(te,oe);ee._events&&ee._events[te]?f(ee._events[te])?ee._events[te].unshift(oe):ee._events[te]=[oe,ee._events[te]]:ee.on(te,oe)}(P,"error",J),P.once("close",G),P.once("finish",W),P.emit("pipe",q),Z.flowing||(_("pipe resume"),q.resume()),P},C.prototype.unpipe=function(P){var T=this._readableState,q={hasUnpiped:!1};if(T.pipesCount===0)return this;if(T.pipesCount===1)return P&&P!==T.pipes||(P||(P=T.pipes),T.pipes=null,T.pipesCount=0,T.flowing=!1,P&&P.emit("unpipe",this,q)),this;if(!P){var Z=T.pipes,I=T.pipesCount;T.pipes=null,T.pipesCount=0,T.flowing=!1;for(var $=0;$<I;$++)Z[$].emit("unpipe",this,q);return this}var K=A(T.pipes,P);return K===-1||(T.pipes.splice(K,1),T.pipesCount-=1,T.pipesCount===1&&(T.pipes=T.pipes[0]),P.emit("unpipe",this,q)),this},C.prototype.on=function(P,T){var q=u.prototype.on.call(this,P,T);if(P==="data")this._readableState.flowing!==!1&&this.resume();else if(P==="readable"){var Z=this._readableState;Z.endEmitted||Z.readableListening||(Z.readableListening=Z.needReadable=!0,Z.emittedReadable=!1,Z.reading?Z.length&&V(this):p.nextTick(l,this))}return q},C.prototype.addListener=C.prototype.on,C.prototype.resume=function(){var P=this._readableState;return P.flowing||(_("resume"),P.flowing=!0,function(T,q){q.resumeScheduled||(q.resumeScheduled=!0,p.nextTick(x,T,q))}(this,P)),this},C.prototype.pause=function(){return _("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_("pause"),this._readableState.flowing=!1,this.emit("pause")),this},C.prototype.wrap=function(P){var T=this,q=this._readableState,Z=!1;for(var I in P.on("end",function(){if(_("wrapped end"),q.decoder&&!q.ended){var K=q.decoder.end();K&&K.length&&T.push(K)}T.push(null)}),P.on("data",function(K){_("wrapped data"),q.decoder&&(K=q.decoder.write(K)),q.objectMode&&K==null||(q.objectMode||K&&K.length)&&(T.push(K)||(Z=!0,P.pause()))}),P)this[I]===void 0&&typeof P[I]=="function"&&(this[I]=function(K){return function(){return P[K].apply(P,arguments)}}(I));for(var $=0;$<O.length;$++)P.on(O[$],this.emit.bind(this,O[$]));return this._read=function(K){_("wrapped _read",K),Z&&(Z=!1,P.resume())},this},Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),C._fromList=m}).call(this,t(6),t(5))},function(o,e,t){o.exports=t(12).EventEmitter},function(o,e,t){var n=t(43);function c(p,a){p.emit("error",a)}o.exports={destroy:function(p,a){var f=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(a?a(p):!p||this._writableState&&this._writableState.errorEmitted||n.nextTick(c,this,p),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(h){!a&&h?(n.nextTick(c,f,h),f._writableState&&(f._writableState.errorEmitted=!0)):a&&a(h)}),this)},undestroy:function(){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.finished=!1,this._writableState.errorEmitted=!1)}}},function(o,e,t){(function(n){var c=n!==void 0&&n||typeof self!="undefined"&&self||window,p=Function.prototype.apply;function a(f,s){this._id=f,this._clearFn=s}e.setTimeout=function(){return new a(p.call(setTimeout,c,arguments),clearTimeout)},e.setInterval=function(){return new a(p.call(setInterval,c,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(f){f&&f.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(c,this._id)},e.enroll=function(f,s){clearTimeout(f._idleTimeoutId),f._idleTimeout=s},e.unenroll=function(f){clearTimeout(f._idleTimeoutId),f._idleTimeout=-1},e._unrefActive=e.active=function(f){clearTimeout(f._idleTimeoutId);var s=f._idleTimeout;s>=0&&(f._idleTimeoutId=setTimeout(function(){f._onTimeout&&f._onTimeout()},s))},t(208),e.setImmediate=typeof self!="undefined"&&self.setImmediate||n!==void 0&&n.setImmediate||this&&this.setImmediate,e.clearImmediate=typeof self!="undefined"&&self.clearImmediate||n!==void 0&&n.clearImmediate||this&&this.clearImmediate}).call(this,t(6))},function(o,e,t){o.exports=a;var n=t(19),c=Object.create(t(35));function p(u,h){var v=this._transformState;v.transforming=!1;var b=v.writecb;if(!b)return this.emit("error",new Error("write callback called multiple times"));v.writechunk=null,v.writecb=null,h!=null&&this.push(h),b(u);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}function a(u){if(!(this instanceof a))return new a(u);n.call(this,u),this._transformState={afterTransform:p.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",f)}function f(){var u=this;typeof this._flush=="function"?this._flush(function(h,v){s(u,h,v)}):s(this,null,null)}function s(u,h,v){if(h)return u.emit("error",h);if(v!=null&&u.push(v),u._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(u._transformState.transforming)throw new Error("Calling transform done when still transforming");return u.push(null)}c.inherits=t(3),c.inherits(a,n),a.prototype.push=function(u,h){return this._transformState.needTransform=!1,n.prototype.push.call(this,u,h)},a.prototype._transform=function(u,h,v){throw new Error("_transform() is not implemented")},a.prototype._write=function(u,h,v){var b=this._transformState;if(b.writecb=v,b.writechunk=u,b.writeencoding=h,!b.transforming){var y=this._readableState;(b.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.highWaterMark)}},a.prototype._read=function(u){var h=this._transformState;h.writechunk!==null&&h.writecb&&!h.transforming?(h.transforming=!0,this._transform(h.writechunk,h.writeencoding,h.afterTransform)):h.needTransform=!0},a.prototype._destroy=function(u,h){var v=this;n.prototype._destroy.call(this,u,function(b){h(b),v.emit("close")})}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=t(227),c=t(228);e.keccak224=n.createHashFunction(function(){return c("keccak224")}),e.keccak256=n.createHashFunction(function(){return c("keccak256")}),e.keccak384=n.createHashFunction(function(){return c("keccak384")}),e.keccak512=n.createHashFunction(function(){return c("keccak512")})},function(o,e,t){(e=o.exports=t(112)).Stream=e,e.Readable=e,e.Writable=t(116),e.Duplex=t(28),e.Transform=t(117),e.PassThrough=t(236),e.finished=t(57),e.pipeline=t(237)},function(o,e,t){(function(n,c){var p;o.exports=z,z.ReadableState=H,t(12).EventEmitter;var a=function(j,D){return j.listeners(D).length},f=t(113),s=t(2).Buffer,u=n.Uint8Array||function(){},h,v=t(231);h=v&&v.debuglog?v.debuglog("stream"):function(){};var b,y,_,E=t(232),S=t(114),k=t(115).getHighWaterMark,O=t(27).codes,M=O.ERR_INVALID_ARG_TYPE,C=O.ERR_STREAM_PUSH_AFTER_EOF,N=O.ERR_METHOD_NOT_IMPLEMENTED,L=O.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t(3)(z,f);var F=S.errorOrDestroy,V=["error","close","destroy","pause","resume"];function H(j,D,B){p=p||t(28),j=j||{},typeof B!="boolean"&&(B=D instanceof p),this.objectMode=!!j.objectMode,B&&(this.objectMode=this.objectMode||!!j.readableObjectMode),this.highWaterMark=k(this,j,"readableHighWaterMark",B),this.buffer=new E,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=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.destroyed=!1,this.defaultEncoding=j.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,j.encoding&&(b||(b=t(20).StringDecoder),this.decoder=new b(j.encoding),this.encoding=j.encoding)}function z(j){if(p=p||t(28),!(this instanceof z))return new z(j);var D=this instanceof p;this._readableState=new H(j,this,D),this.readable=!0,j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy)),f.call(this)}function R(j,D,B,U,J){h("readableAddChunk",D);var G,W=j._readableState;if(D===null)W.reading=!1,function(Y,ee){if(h("onEofChunk"),!ee.ended){if(ee.decoder){var te=ee.decoder.end();te&&te.length&&(ee.buffer.push(te),ee.length+=ee.objectMode?1:te.length)}ee.ended=!0,ee.sync?d(Y):(ee.needReadable=!1,ee.emittedReadable||(ee.emittedReadable=!0,m(Y)))}}(j,W);else if(J||(G=function(Y,ee){var te;oe=ee,s.isBuffer(oe)||oe instanceof u||typeof ee=="string"||ee===void 0||Y.objectMode||(te=new M("chunk",["string","Buffer","Uint8Array"],ee));var oe;return te}(W,D)),G)F(j,G);else if(W.objectMode||D&&D.length>0)if(typeof D=="string"||W.objectMode||Object.getPrototypeOf(D)===s.prototype||(D=function(Y){return s.from(Y)}(D)),U)W.endEmitted?F(j,new L):l(j,W,D,!0);else if(W.ended)F(j,new C);else{if(W.destroyed)return!1;W.reading=!1,W.decoder&&!B?(D=W.decoder.write(D),W.objectMode||D.length!==0?l(j,W,D,!1):g(j,W)):l(j,W,D,!1)}else U||(W.reading=!1,g(j,W));return!W.ended&&(W.length<W.highWaterMark||W.length===0)}function l(j,D,B,U){D.flowing&&D.length===0&&!D.sync?(D.awaitDrain=0,j.emit("data",B)):(D.length+=D.objectMode?1:B.length,U?D.buffer.unshift(B):D.buffer.push(B),D.needReadable&&d(j)),g(j,D)}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(j){this._readableState&&(this._readableState.destroyed=j)}}),z.prototype.destroy=S.destroy,z.prototype._undestroy=S.undestroy,z.prototype._destroy=function(j,D){D(j)},z.prototype.push=function(j,D){var B,U=this._readableState;return U.objectMode?B=!0:typeof j=="string"&&((D=D||U.defaultEncoding)!==U.encoding&&(j=s.from(j,D),D=""),B=!0),R(this,j,D,!1,B)},z.prototype.unshift=function(j){return R(this,j,null,!0,!1)},z.prototype.isPaused=function(){return this._readableState.flowing===!1},z.prototype.setEncoding=function(j){b||(b=t(20).StringDecoder);var D=new b(j);this._readableState.decoder=D,this._readableState.encoding=this._readableState.decoder.encoding;for(var B=this._readableState.buffer.head,U="";B!==null;)U+=D.write(B.data),B=B.next;return this._readableState.buffer.clear(),U!==""&&this._readableState.buffer.push(U),this._readableState.length=U.length,this};function x(j,D){return j<=0||D.length===0&&D.ended?0:D.objectMode?1:j!=j?D.flowing&&D.length?D.buffer.head.data.length:D.length:(j>D.highWaterMark&&(D.highWaterMark=function(B){return B>=1073741824?B=1073741824:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}(j)),j<=D.length?j:D.ended?D.length:(D.needReadable=!0,0))}function d(j){var D=j._readableState;h("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(h("emitReadable",D.flowing),D.emittedReadable=!0,c.nextTick(m,j))}function m(j){var D=j._readableState;h("emitReadable_",D.destroyed,D.length,D.ended),D.destroyed||!D.length&&!D.ended||(j.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,q(j)}function g(j,D){D.readingMore||(D.readingMore=!0,c.nextTick(w,j,D))}function w(j,D){for(;!D.reading&&!D.ended&&(D.length<D.highWaterMark||D.flowing&&D.length===0);){var B=D.length;if(h("maybeReadMore read 0"),j.read(0),B===D.length)break}D.readingMore=!1}function A(j){var D=j._readableState;D.readableListening=j.listenerCount("readable")>0,D.resumeScheduled&&!D.paused?D.flowing=!0:j.listenerCount("data")>0&&j.resume()}function P(j){h("readable nexttick read 0"),j.read(0)}function T(j,D){h("resume",D.reading),D.reading||j.read(0),D.resumeScheduled=!1,j.emit("resume"),q(j),D.flowing&&!D.reading&&j.read(0)}function q(j){var D=j._readableState;for(h("flow",D.flowing);D.flowing&&j.read()!==null;);}function Z(j,D){return D.length===0?null:(D.objectMode?B=D.buffer.shift():!j||j>=D.length?(B=D.decoder?D.buffer.join(""):D.buffer.length===1?D.buffer.first():D.buffer.concat(D.length),D.buffer.clear()):B=D.buffer.consume(j,D.decoder),B);var B}function I(j){var D=j._readableState;h("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,c.nextTick($,D,j))}function $(j,D){if(h("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,D.readable=!1,D.emit("end"),j.autoDestroy)){var B=D._writableState;(!B||B.autoDestroy&&B.finished)&&D.destroy()}}function K(j,D){for(var B=0,U=j.length;B<U;B++)if(j[B]===D)return B;return-1}z.prototype.read=function(j){h("read",j),j=parseInt(j,10);var D=this._readableState,B=j;if(j!==0&&(D.emittedReadable=!1),j===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return h("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?I(this):d(this),null;if((j=x(j,D))===0&&D.ended)return D.length===0&&I(this),null;var U,J=D.needReadable;return h("need readable",J),(D.length===0||D.length-j<D.highWaterMark)&&h("length less than watermark",J=!0),D.ended||D.reading?h("reading or ended",J=!1):J&&(h("do read"),D.reading=!0,D.sync=!0,D.length===0&&(D.needReadable=!0),this._read(D.highWaterMark),D.sync=!1,D.reading||(j=x(B,D))),(U=j>0?Z(j,D):null)===null?(D.needReadable=D.length<=D.highWaterMark,j=0):(D.length-=j,D.awaitDrain=0),D.length===0&&(D.ended||(D.needReadable=!0),B!==j&&D.ended&&I(this)),U!==null&&this.emit("data",U),U},z.prototype._read=function(j){F(this,new N("_read()"))},z.prototype.pipe=function(j,D){var B=this,U=this._readableState;switch(U.pipesCount){case 0:U.pipes=j;break;case 1:U.pipes=[U.pipes,j];break;default:U.pipes.push(j)}U.pipesCount+=1,h("pipe count=%d opts=%j",U.pipesCount,D);var J=(!D||D.end!==!1)&&j!==c.stdout&&j!==c.stderr?W:ce;function G(se,ae){h("onunpipe"),se===B&&ae&&ae.hasUnpiped===!1&&(ae.hasUnpiped=!0,h("cleanup"),j.removeListener("close",fe),j.removeListener("finish",ne),j.removeListener("drain",Y),j.removeListener("error",oe),j.removeListener("unpipe",G),B.removeListener("end",W),B.removeListener("end",ce),B.removeListener("data",te),ee=!0,!U.awaitDrain||j._writableState&&!j._writableState.needDrain||Y())}function W(){h("onend"),j.end()}U.endEmitted?c.nextTick(J):B.once("end",J),j.on("unpipe",G);var Y=function(se){return function(){var ae=se._readableState;h("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&a(se,"data")&&(ae.flowing=!0,q(se))}}(B);j.on("drain",Y);var ee=!1;function te(se){h("ondata");var ae=j.write(se);h("dest.write",ae),ae===!1&&((U.pipesCount===1&&U.pipes===j||U.pipesCount>1&&K(U.pipes,j)!==-1)&&!ee&&(h("false write response, pause",U.awaitDrain),U.awaitDrain++),B.pause())}function oe(se){h("onerror",se),ce(),j.removeListener("error",oe),a(j,"error")===0&&F(j,se)}function fe(){j.removeListener("finish",ne),ce()}function ne(){h("onfinish"),j.removeListener("close",fe),ce()}function ce(){h("unpipe"),B.unpipe(j)}return B.on("data",te),function(se,ae,he){if(typeof se.prependListener=="function")return se.prependListener(ae,he);se._events&&se._events[ae]?Array.isArray(se._events[ae])?se._events[ae].unshift(he):se._events[ae]=[he,se._events[ae]]:se.on(ae,he)}(j,"error",oe),j.once("close",fe),j.once("finish",ne),j.emit("pipe",B),U.flowing||(h("pipe resume"),B.resume()),j},z.prototype.unpipe=function(j){var D=this._readableState,B={hasUnpiped:!1};if(D.pipesCount===0)return this;if(D.pipesCount===1)return j&&j!==D.pipes||(j||(j=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,j&&j.emit("unpipe",this,B)),this;if(!j){var U=D.pipes,J=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var G=0;G<J;G++)U[G].emit("unpipe",this,{hasUnpiped:!1});return this}var W=K(D.pipes,j);return W===-1||(D.pipes.splice(W,1),D.pipesCount-=1,D.pipesCount===1&&(D.pipes=D.pipes[0]),j.emit("unpipe",this,B)),this},z.prototype.on=function(j,D){var B=f.prototype.on.call(this,j,D),U=this._readableState;return j==="data"?(U.readableListening=this.listenerCount("readable")>0,U.flowing!==!1&&this.resume()):j==="readable"&&(U.endEmitted||U.readableListening||(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,h("on readable",U.length,U.reading),U.length?d(this):U.reading||c.nextTick(P,this))),B},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(j,D){var B=f.prototype.removeListener.call(this,j,D);return j==="readable"&&c.nextTick(A,this),B},z.prototype.removeAllListeners=function(j){var D=f.prototype.removeAllListeners.apply(this,arguments);return j!=="readable"&&j!==void 0||c.nextTick(A,this),D},z.prototype.resume=function(){var j=this._readableState;return j.flowing||(h("resume"),j.flowing=!j.readableListening,function(D,B){B.resumeScheduled||(B.resumeScheduled=!0,c.nextTick(T,D,B))}(this,j)),j.paused=!1,this},z.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},z.prototype.wrap=function(j){var D=this,B=this._readableState,U=!1;for(var J in j.on("end",function(){if(h("wrapped end"),B.decoder&&!B.ended){var W=B.decoder.end();W&&W.length&&D.push(W)}D.push(null)}),j.on("data",function(W){h("wrapped data"),B.decoder&&(W=B.decoder.write(W)),B.objectMode&&W==null||(B.objectMode||W&&W.length)&&(D.push(W)||(U=!0,j.pause()))}),j)this[J]===void 0&&typeof j[J]=="function"&&(this[J]=function(W){return function(){return j[W].apply(j,arguments)}}(J));for(var G=0;G<V.length;G++)j.on(V[G],this.emit.bind(this,V[G]));return this._read=function(W){h("wrapped _read",W),U&&(U=!1,j.resume())},this},typeof Symbol=="function"&&(z.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=t(234)),y(this)}),Object.defineProperty(z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(j){this._readableState&&(this._readableState.flowing=j)}}),z._fromList=Z,Object.defineProperty(z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(z.from=function(j,D){return _===void 0&&(_=t(235)),_(z,j,D)})}).call(this,t(6),t(5))},function(o,e,t){o.exports=t(12).EventEmitter},function(o,e,t){(function(n){function c(f,s){a(f,s),p(f)}function p(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function a(f,s){f.emit("error",s)}o.exports={destroy:function(f,s){var u=this,h=this._readableState&&this._readableState.destroyed,v=this._writableState&&this._writableState.destroyed;return h||v?(s?s(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,f)):n.nextTick(a,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(b){!s&&b?u._writableState?u._writableState.errorEmitted?n.nextTick(p,u):(u._writableState.errorEmitted=!0,n.nextTick(c,u,b)):n.nextTick(c,u,b):s?(n.nextTick(p,u),s(b)):n.nextTick(p,u)}),this)},undestroy:function(){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)},errorOrDestroy:function(f,s){var u=f._readableState,h=f._writableState;u&&u.autoDestroy||h&&h.autoDestroy?f.destroy(s):f.emit("error",s)}}}).call(this,t(5))},function(o,e,t){var n=t(27).codes.ERR_INVALID_OPT_VALUE;o.exports={getHighWaterMark:function(c,p,a,f){var s=function(u,h,v){return u.highWaterMark!=null?u.highWaterMark:h?u[v]:null}(p,f,a);if(s!=null){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(f?a:"highWaterMark",s);return Math.floor(s)}return c.objectMode?16:16384}}},function(o,e,t){(function(n,c){function p(w){var A=this;this.next=null,this.entry=null,this.finish=function(){(function(P,T,q){var Z=P.entry;for(P.entry=null;Z;){var I=Z.callback;T.pendingcb--,I(q),Z=Z.next}T.corkedRequestsFree.next=P})(A,w)}}var a;o.exports=z,z.WritableState=H;var f={deprecate:t(54)},s=t(113),u=t(2).Buffer,h=n.Uint8Array||function(){},v,b=t(114),y=t(115).getHighWaterMark,_=t(27).codes,E=_.ERR_INVALID_ARG_TYPE,S=_.ERR_METHOD_NOT_IMPLEMENTED,k=_.ERR_MULTIPLE_CALLBACK,O=_.ERR_STREAM_CANNOT_PIPE,M=_.ERR_STREAM_DESTROYED,C=_.ERR_STREAM_NULL_VALUES,N=_.ERR_STREAM_WRITE_AFTER_END,L=_.ERR_UNKNOWN_ENCODING,F=b.errorOrDestroy;function V(){}function H(w,A,P){a=a||t(28),w=w||{},typeof P!="boolean"&&(P=A instanceof a),this.objectMode=!!w.objectMode,P&&(this.objectMode=this.objectMode||!!w.writableObjectMode),this.highWaterMark=y(this,w,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var T=w.decodeStrings===!1;this.decodeStrings=!T,this.defaultEncoding=w.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){(function(Z,I){var $=Z._writableState,K=$.sync,j=$.writecb;if(typeof j!="function")throw new k;if(function(B){B.writing=!1,B.writecb=null,B.length-=B.writelen,B.writelen=0}($),I)(function(B,U,J,G,W){--U.pendingcb,J?(c.nextTick(W,G),c.nextTick(g,B,U),B._writableState.errorEmitted=!0,F(B,G)):(W(G),B._writableState.errorEmitted=!0,F(B,G),g(B,U))})(Z,$,K,I,j);else{var D=d($)||Z.destroyed;D||$.corked||$.bufferProcessing||!$.bufferedRequest||x(Z,$),K?c.nextTick(l,Z,$,D,j):l(Z,$,D,j)}})(A,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=w.emitClose!==!1,this.autoDestroy=!!w.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new p(this)}function z(w){var A=this instanceof(a=a||t(28));if(!A&&!v.call(z,this))return new z(w);this._writableState=new H(w,this,A),this.writable=!0,w&&(typeof w.write=="function"&&(this._write=w.write),typeof w.writev=="function"&&(this._writev=w.writev),typeof w.destroy=="function"&&(this._destroy=w.destroy),typeof w.final=="function"&&(this._final=w.final)),s.call(this)}function R(w,A,P,T,q,Z,I){A.writelen=T,A.writecb=I,A.writing=!0,A.sync=!0,A.destroyed?A.onwrite(new M("write")):P?w._writev(q,A.onwrite):w._write(q,Z,A.onwrite),A.sync=!1}function l(w,A,P,T){P||function(q,Z){Z.length===0&&Z.needDrain&&(Z.needDrain=!1,q.emit("drain"))}(w,A),A.pendingcb--,T(),g(w,A)}function x(w,A){A.bufferProcessing=!0;var P=A.bufferedRequest;if(w._writev&&P&&P.next){var T=A.bufferedRequestCount,q=new Array(T),Z=A.corkedRequestsFree;Z.entry=P;for(var I=0,$=!0;P;)q[I]=P,P.isBuf||($=!1),P=P.next,I+=1;q.allBuffers=$,R(w,A,!0,A.length,q,"",Z.finish),A.pendingcb++,A.lastBufferedRequest=null,Z.next?(A.corkedRequestsFree=Z.next,Z.next=null):A.corkedRequestsFree=new p(A),A.bufferedRequestCount=0}else{for(;P;){var K=P.chunk,j=P.encoding,D=P.callback;if(R(w,A,!1,A.objectMode?1:K.length,K,j,D),P=P.next,A.bufferedRequestCount--,A.writing)break}P===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=P,A.bufferProcessing=!1}function d(w){return w.ending&&w.length===0&&w.bufferedRequest===null&&!w.finished&&!w.writing}function m(w,A){w._final(function(P){A.pendingcb--,P&&F(w,P),A.prefinished=!0,w.emit("prefinish"),g(w,A)})}function g(w,A){var P=d(A);if(P&&(function(q,Z){Z.prefinished||Z.finalCalled||(typeof q._final!="function"||Z.destroyed?(Z.prefinished=!0,q.emit("prefinish")):(Z.pendingcb++,Z.finalCalled=!0,c.nextTick(m,q,Z)))}(w,A),A.pendingcb===0&&(A.finished=!0,w.emit("finish"),A.autoDestroy))){var T=w._readableState;(!T||T.autoDestroy&&T.endEmitted)&&w.destroy()}return P}t(3)(z,s),H.prototype.getBuffer=function(){for(var w=this.bufferedRequest,A=[];w;)A.push(w),w=w.next;return A},function(){try{Object.defineProperty(H.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(v=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(w){return!!v.call(this,w)||this===z&&w&&w._writableState instanceof H}})):v=function(w){return w instanceof this},z.prototype.pipe=function(){F(this,new O)},z.prototype.write=function(w,A,P){var T,q=this._writableState,Z=!1,I=!q.objectMode&&(T=w,u.isBuffer(T)||T instanceof h);return I&&!u.isBuffer(w)&&(w=function($){return u.from($)}(w)),typeof A=="function"&&(P=A,A=null),I?A="buffer":A||(A=q.defaultEncoding),typeof P!="function"&&(P=V),q.ending?function($,K){var j=new N;F($,j),c.nextTick(K,j)}(this,P):(I||function($,K,j,D){var B;return j===null?B=new C:typeof j=="string"||K.objectMode||(B=new E("chunk",["string","Buffer"],j)),!B||(F($,B),c.nextTick(D,B),!1)}(this,q,w,P))&&(q.pendingcb++,Z=function($,K,j,D,B,U){if(!j){var J=function(ee,te,oe){return ee.objectMode||ee.decodeStrings===!1||typeof te!="string"||(te=u.from(te,oe)),te}(K,D,B);D!==J&&(j=!0,B="buffer",D=J)}var G=K.objectMode?1:D.length;K.length+=G;var W=K.length<K.highWaterMark;if(W||(K.needDrain=!0),K.writing||K.corked){var Y=K.lastBufferedRequest;K.lastBufferedRequest={chunk:D,encoding:B,isBuf:j,callback:U,next:null},Y?Y.next=K.lastBufferedRequest:K.bufferedRequest=K.lastBufferedRequest,K.bufferedRequestCount+=1}else R($,K,!1,G,D,B,U);return W}(this,q,I,w,A,P)),Z},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){var w=this._writableState;w.corked&&(w.corked--,w.writing||w.corked||w.bufferProcessing||!w.bufferedRequest||x(this,w))},z.prototype.setDefaultEncoding=function(w){if(typeof w=="string"&&(w=w.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((w+"").toLowerCase())>-1))throw new L(w);return this._writableState.defaultEncoding=w,this},Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),z.prototype._write=function(w,A,P){P(new S("_write()"))},z.prototype._writev=null,z.prototype.end=function(w,A,P){var T=this._writableState;return typeof w=="function"?(P=w,w=null,A=null):typeof A=="function"&&(P=A,A=null),w!=null&&this.write(w,A),T.corked&&(T.corked=1,this.uncork()),T.ending||function(q,Z,I){Z.ending=!0,g(q,Z),I&&(Z.finished?c.nextTick(I):q.once("finish",I)),Z.ended=!0,q.writable=!1}(this,T,P),this},Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(w){this._writableState&&(this._writableState.destroyed=w)}}),z.prototype.destroy=b.destroy,z.prototype._undestroy=b.undestroy,z.prototype._destroy=function(w,A){A(w)}}).call(this,t(6),t(5))},function(o,e,t){o.exports=h;var n=t(27).codes,c=n.ERR_METHOD_NOT_IMPLEMENTED,p=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,f=n.ERR_TRANSFORM_WITH_LENGTH_0,s=t(28);function u(y,_){var E=this._transformState;E.transforming=!1;var S=E.writecb;if(S===null)return this.emit("error",new p);E.writechunk=null,E.writecb=null,_!=null&&this.push(_),S(y);var k=this._readableState;k.reading=!1,(k.needReadable||k.length<k.highWaterMark)&&this._read(k.highWaterMark)}function h(y){if(!(this instanceof h))return new h(y);s.call(this,y),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,y&&(typeof y.transform=="function"&&(this._transform=y.transform),typeof y.flush=="function"&&(this._flush=y.flush)),this.on("prefinish",v)}function v(){var y=this;typeof this._flush!="function"||this._readableState.destroyed?b(this,null,null):this._flush(function(_,E){b(y,_,E)})}function b(y,_,E){if(_)return y.emit("error",_);if(E!=null&&y.push(E),y._writableState.length)throw new f;if(y._transformState.transforming)throw new a;return y.push(null)}t(3)(h,s),h.prototype.push=function(y,_){return this._transformState.needTransform=!1,s.prototype.push.call(this,y,_)},h.prototype._transform=function(y,_,E){E(new c("_transform()"))},h.prototype._write=function(y,_,E){var S=this._transformState;if(S.writecb=E,S.writechunk=y,S.writeencoding=_,!S.transforming){var k=this._readableState;(S.needTransform||k.needReadable||k.length<k.highWaterMark)&&this._read(k.highWaterMark)}},h.prototype._read=function(y){var _=this._transformState;_.writechunk===null||_.transforming?_.needTransform=!0:(_.transforming=!0,this._transform(_.writechunk,_.writeencoding,_.afterTransform))},h.prototype._destroy=function(y,_){s.prototype._destroy.call(this,y,function(E){_(E)})}},function(o,e,t){var n=this&&this.__awaiter||function(f,s,u,h){return new(u||(u=Promise))(function(v,b){function y(S){try{E(h.next(S))}catch(k){b(k)}}function _(S){try{E(h.throw(S))}catch(k){b(k)}}function E(S){var k;S.done?v(S.value):(k=S.value,k instanceof u?k:new u(function(O){O(k)})).then(y,_)}E((h=h.apply(f,s||[])).next())})},c=this&&this.__generator||function(f,s){var u,h,v,b,y={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return b={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function _(E){return function(S){return function(k){if(u)throw new TypeError("Generator is already executing.");for(;y;)try{if(u=1,h&&(v=2&k[0]?h.return:k[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,k[1])).done)return v;switch(h=0,v&&(k=[2&k[0],v.value]),k[0]){case 0:case 1:v=k;break;case 4:return y.label++,{value:k[1],done:!1};case 5:y.label++,h=k[1],k=[0];continue;case 7:k=y.ops.pop(),y.trys.pop();continue;default:if(v=y.trys,!((v=v.length>0&&v[v.length-1])||k[0]!==6&&k[0]!==2)){y=0;continue}if(k[0]===3&&(!v||k[1]>v[0]&&k[1]<v[3])){y.label=k[1];break}if(k[0]===6&&y.label<v[1]){y.label=v[1],v=k;break}if(v&&y.label<v[2]){y.label=v[2],y.ops.push(k);break}v[2]&&y.ops.pop(),y.trys.pop();continue}k=s.call(f,y)}catch(O){k=[6,O],h=0}finally{u=v=0}if(5&k[0])throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}([E,S])}}};Object.defineProperty(e,"__esModule",{value:!0});var p=t(119),a=t(264);e.createPrivateKey=function(){return n(this,void 0,void 0,function(){var f;return c(this,function(s){switch(s.label){case 0:return[4,a.getRandomBytes(32)];case 1:return f=s.sent(),p.privateKeyVerify(f)?[2,f]:[3,0];case 2:return[2]}})})},e.createPrivateKeySync=function(){for(;;){var f=a.getRandomBytesSync(32);if(p.privateKeyVerify(f))return f}},function(f){for(var s in f)e.hasOwnProperty(s)||(e[s]=f[s])}(t(119))},function(o,e,t){o.exports=t(242)(t(243))},function(o,e,t){var n=e;function c(a){return a.length===1?"0"+a:a}function p(a){for(var f="",s=0;s<a.length;s++)f+=c(a[s].toString(16));return f}n.toArray=function(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var s=[];if(typeof a!="string"){for(var u=0;u<a.length;u++)s[u]=0|a[u];return s}if(f==="hex")for((a=a.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(a="0"+a),u=0;u<a.length;u+=2)s.push(parseInt(a[u]+a[u+1],16));else for(u=0;u<a.length;u++){var h=a.charCodeAt(u),v=h>>8,b=255&h;v?s.push(v,b):s.push(b)}return s},n.zero2=c,n.toHex=p,n.encode=function(a,f){return f==="hex"?p(a):a}},function(o,e,t){var n;function c(a){this.rand=a}if(o.exports=function(a){return n||(n=new c(null)),n.generate(a)},o.exports.Rand=c,c.prototype.generate=function(a){return this._rand(a)},c.prototype._rand=function(a){if(this.rand.getBytes)return this.rand.getBytes(a);for(var f=new Uint8Array(a),s=0;s<f.length;s++)f[s]=this.rand.getByte();return f},typeof self=="object")self.crypto&&self.crypto.getRandomValues?c.prototype._rand=function(a){var f=new Uint8Array(a);return self.crypto.getRandomValues(f),f}:self.msCrypto&&self.msCrypto.getRandomValues?c.prototype._rand=function(a){var f=new Uint8Array(a);return self.msCrypto.getRandomValues(f),f}:typeof window=="object"&&(c.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var p=t(246);if(typeof p.randomBytes!="function")throw new Error("Not supported");c.prototype._rand=function(a){return p.randomBytes(a)}}catch{}},function(o,e,t){var n=e;n.base=t(45),n.short=t(247),n.mont=t(248),n.edwards=t(249)},function(o,e,t){var n=t(15).rotr32;function c(f,s,u){return f&s^~f&u}function p(f,s,u){return f&s^f&u^s&u}function a(f,s,u){return f^s^u}e.ft_1=function(f,s,u,h){return f===0?c(s,u,h):f===1||f===3?a(s,u,h):f===2?p(s,u,h):void 0},e.ch32=c,e.maj32=p,e.p32=a,e.s0_256=function(f){return n(f,2)^n(f,13)^n(f,22)},e.s1_256=function(f){return n(f,6)^n(f,11)^n(f,25)},e.g0_256=function(f){return n(f,7)^n(f,18)^f>>>3},e.g1_256=function(f){return n(f,17)^n(f,19)^f>>>10}},function(o,e,t){var n=t(15),c=t(37),p=t(123),a=t(22),f=n.sum32,s=n.sum32_4,u=n.sum32_5,h=p.ch32,v=p.maj32,b=p.s0_256,y=p.s1_256,_=p.g0_256,E=p.g1_256,S=c.BlockHash,k=[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];function O(){if(!(this instanceof O))return new O;S.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=k,this.W=new Array(64)}n.inherits(O,S),o.exports=O,O.blockSize=512,O.outSize=256,O.hmacStrength=192,O.padLength=64,O.prototype._update=function(M,C){for(var N=this.W,L=0;L<16;L++)N[L]=M[C+L];for(;L<N.length;L++)N[L]=s(E(N[L-2]),N[L-7],_(N[L-15]),N[L-16]);var F=this.h[0],V=this.h[1],H=this.h[2],z=this.h[3],R=this.h[4],l=this.h[5],x=this.h[6],d=this.h[7];for(a(this.k.length===N.length),L=0;L<N.length;L++){var m=u(d,y(R),h(R,l,x),this.k[L],N[L]),g=f(b(F),v(F,V,H));d=x,x=l,l=R,R=f(z,m),z=H,H=V,V=F,F=f(m,g)}this.h[0]=f(this.h[0],F),this.h[1]=f(this.h[1],V),this.h[2]=f(this.h[2],H),this.h[3]=f(this.h[3],z),this.h[4]=f(this.h[4],R),this.h[5]=f(this.h[5],l),this.h[6]=f(this.h[6],x),this.h[7]=f(this.h[7],d)},O.prototype._digest=function(M){return M==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(o,e,t){var n=t(15),c=t(37),p=t(22),a=n.rotr64_hi,f=n.rotr64_lo,s=n.shr64_hi,u=n.shr64_lo,h=n.sum64,v=n.sum64_hi,b=n.sum64_lo,y=n.sum64_4_hi,_=n.sum64_4_lo,E=n.sum64_5_hi,S=n.sum64_5_lo,k=c.BlockHash,O=[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];function M(){if(!(this instanceof M))return new M;k.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=O,this.W=new Array(160)}function C(g,w,A,P,T){var q=g&A^~g&T;return q<0&&(q+=4294967296),q}function N(g,w,A,P,T,q){var Z=w&P^~w&q;return Z<0&&(Z+=4294967296),Z}function L(g,w,A,P,T){var q=g&A^g&T^A&T;return q<0&&(q+=4294967296),q}function F(g,w,A,P,T,q){var Z=w&P^w&q^P&q;return Z<0&&(Z+=4294967296),Z}function V(g,w){var A=a(g,w,28)^a(w,g,2)^a(w,g,7);return A<0&&(A+=4294967296),A}function H(g,w){var A=f(g,w,28)^f(w,g,2)^f(w,g,7);return A<0&&(A+=4294967296),A}function z(g,w){var A=a(g,w,14)^a(g,w,18)^a(w,g,9);return A<0&&(A+=4294967296),A}function R(g,w){var A=f(g,w,14)^f(g,w,18)^f(w,g,9);return A<0&&(A+=4294967296),A}function l(g,w){var A=a(g,w,1)^a(g,w,8)^s(g,w,7);return A<0&&(A+=4294967296),A}function x(g,w){var A=f(g,w,1)^f(g,w,8)^u(g,w,7);return A<0&&(A+=4294967296),A}function d(g,w){var A=a(g,w,19)^a(w,g,29)^s(g,w,6);return A<0&&(A+=4294967296),A}function m(g,w){var A=f(g,w,19)^f(w,g,29)^u(g,w,6);return A<0&&(A+=4294967296),A}n.inherits(M,k),o.exports=M,M.blockSize=1024,M.outSize=512,M.hmacStrength=192,M.padLength=128,M.prototype._prepareBlock=function(g,w){for(var A=this.W,P=0;P<32;P++)A[P]=g[w+P];for(;P<A.length;P+=2){var T=d(A[P-4],A[P-3]),q=m(A[P-4],A[P-3]),Z=A[P-14],I=A[P-13],$=l(A[P-30],A[P-29]),K=x(A[P-30],A[P-29]),j=A[P-32],D=A[P-31];A[P]=y(T,q,Z,I,$,K,j,D),A[P+1]=_(T,q,Z,I,$,K,j,D)}},M.prototype._update=function(g,w){this._prepareBlock(g,w);var A=this.W,P=this.h[0],T=this.h[1],q=this.h[2],Z=this.h[3],I=this.h[4],$=this.h[5],K=this.h[6],j=this.h[7],D=this.h[8],B=this.h[9],U=this.h[10],J=this.h[11],G=this.h[12],W=this.h[13],Y=this.h[14],ee=this.h[15];p(this.k.length===A.length);for(var te=0;te<A.length;te+=2){var oe=Y,fe=ee,ne=z(D,B),ce=R(D,B),se=C(D,B,U,J,G),ae=N(D,B,U,J,G,W),he=this.k[te],me=this.k[te+1],le=A[te],ye=A[te+1],Se=E(oe,fe,ne,ce,se,ae,he,me,le,ye),pe=S(oe,fe,ne,ce,se,ae,he,me,le,ye);oe=V(P,T),fe=H(P,T),ne=L(P,T,q,Z,I),ce=F(P,T,q,Z,I,$);var Oe=v(oe,fe,ne,ce),Le=b(oe,fe,ne,ce);Y=G,ee=W,G=U,W=J,U=D,J=B,D=v(K,j,Se,pe),B=b(j,j,Se,pe),K=I,j=$,I=q,$=Z,q=P,Z=T,P=v(Se,pe,Oe,Le),T=b(Se,pe,Oe,Le)}h(this.h,0,P,T),h(this.h,2,q,Z),h(this.h,4,I,$),h(this.h,6,K,j),h(this.h,8,D,B),h(this.h,10,U,J),h(this.h,12,G,W),h(this.h,14,Y,ee)},M.prototype._digest=function(g){return g==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(o,e,t){var n=t(3),c=t(271),p=t(280),a=t(281),f=t(286);function s(u){f.call(this,"digest"),this._hash=u}n(s,f),s.prototype._update=function(u){this._hash.update(u)},s.prototype._final=function(){return this._hash.digest()},o.exports=function(u){return(u=u.toLowerCase())==="md5"?new c:u==="rmd160"||u==="ripemd160"?new p:new s(a(u))}},function(o,e,t){var n=t(13).Buffer,c=t(272).Transform;function p(a){c.call(this),this._block=n.allocUnsafe(a),this._blockSize=a,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(3)(p,c),p.prototype._transform=function(a,f,s){var u=null;try{this.update(a,f)}catch(h){u=h}s(u)},p.prototype._flush=function(a){var f=null;try{this.push(this.digest())}catch(s){f=s}a(f)},p.prototype.update=function(a,f){if(function(y,_){if(!n.isBuffer(y)&&typeof y!="string")throw new TypeError(_+" must be a string or a buffer")}(a,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(a)||(a=n.from(a,f));for(var s=this._block,u=0;this._blockOffset+a.length-u>=this._blockSize;){for(var h=this._blockOffset;h<this._blockSize;)s[h++]=a[u++];this._update(),this._blockOffset=0}for(;u<a.length;)s[this._blockOffset++]=a[u++];for(var v=0,b=8*a.length;b>0;++v)this._length[v]+=b,(b=this._length[v]/4294967296|0)>0&&(this._length[v]-=4294967296*b);return this},p.prototype._update=function(){throw new Error("_update is not implemented")},p.prototype.digest=function(a){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var f=this._digest();a!==void 0&&(f=f.toString(a)),this._block.fill(0),this._blockOffset=0;for(var s=0;s<4;++s)this._length[s]=0;return f},p.prototype._digest=function(){throw new Error("_digest is not implemented")},o.exports=p},function(o,e,t){(function(n,c){var p;o.exports=z,z.ReadableState=H,t(12).EventEmitter;var a=function(j,D){return j.listeners(D).length},f=t(129),s=t(2).Buffer,u=n.Uint8Array||function(){},h,v=t(273);h=v&&v.debuglog?v.debuglog("stream"):function(){};var b,y,_,E=t(274),S=t(130),k=t(131).getHighWaterMark,O=t(29).codes,M=O.ERR_INVALID_ARG_TYPE,C=O.ERR_STREAM_PUSH_AFTER_EOF,N=O.ERR_METHOD_NOT_IMPLEMENTED,L=O.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t(3)(z,f);var F=S.errorOrDestroy,V=["error","close","destroy","pause","resume"];function H(j,D,B){p=p||t(30),j=j||{},typeof B!="boolean"&&(B=D instanceof p),this.objectMode=!!j.objectMode,B&&(this.objectMode=this.objectMode||!!j.readableObjectMode),this.highWaterMark=k(this,j,"readableHighWaterMark",B),this.buffer=new E,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=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.destroyed=!1,this.defaultEncoding=j.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,j.encoding&&(b||(b=t(20).StringDecoder),this.decoder=new b(j.encoding),this.encoding=j.encoding)}function z(j){if(p=p||t(30),!(this instanceof z))return new z(j);var D=this instanceof p;this._readableState=new H(j,this,D),this.readable=!0,j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy)),f.call(this)}function R(j,D,B,U,J){h("readableAddChunk",D);var G,W=j._readableState;if(D===null)W.reading=!1,function(Y,ee){if(h("onEofChunk"),!ee.ended){if(ee.decoder){var te=ee.decoder.end();te&&te.length&&(ee.buffer.push(te),ee.length+=ee.objectMode?1:te.length)}ee.ended=!0,ee.sync?d(Y):(ee.needReadable=!1,ee.emittedReadable||(ee.emittedReadable=!0,m(Y)))}}(j,W);else if(J||(G=function(Y,ee){var te;oe=ee,s.isBuffer(oe)||oe instanceof u||typeof ee=="string"||ee===void 0||Y.objectMode||(te=new M("chunk",["string","Buffer","Uint8Array"],ee));var oe;return te}(W,D)),G)F(j,G);else if(W.objectMode||D&&D.length>0)if(typeof D=="string"||W.objectMode||Object.getPrototypeOf(D)===s.prototype||(D=function(Y){return s.from(Y)}(D)),U)W.endEmitted?F(j,new L):l(j,W,D,!0);else if(W.ended)F(j,new C);else{if(W.destroyed)return!1;W.reading=!1,W.decoder&&!B?(D=W.decoder.write(D),W.objectMode||D.length!==0?l(j,W,D,!1):g(j,W)):l(j,W,D,!1)}else U||(W.reading=!1,g(j,W));return!W.ended&&(W.length<W.highWaterMark||W.length===0)}function l(j,D,B,U){D.flowing&&D.length===0&&!D.sync?(D.awaitDrain=0,j.emit("data",B)):(D.length+=D.objectMode?1:B.length,U?D.buffer.unshift(B):D.buffer.push(B),D.needReadable&&d(j)),g(j,D)}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(j){this._readableState&&(this._readableState.destroyed=j)}}),z.prototype.destroy=S.destroy,z.prototype._undestroy=S.undestroy,z.prototype._destroy=function(j,D){D(j)},z.prototype.push=function(j,D){var B,U=this._readableState;return U.objectMode?B=!0:typeof j=="string"&&((D=D||U.defaultEncoding)!==U.encoding&&(j=s.from(j,D),D=""),B=!0),R(this,j,D,!1,B)},z.prototype.unshift=function(j){return R(this,j,null,!0,!1)},z.prototype.isPaused=function(){return this._readableState.flowing===!1},z.prototype.setEncoding=function(j){b||(b=t(20).StringDecoder);var D=new b(j);this._readableState.decoder=D,this._readableState.encoding=this._readableState.decoder.encoding;for(var B=this._readableState.buffer.head,U="";B!==null;)U+=D.write(B.data),B=B.next;return this._readableState.buffer.clear(),U!==""&&this._readableState.buffer.push(U),this._readableState.length=U.length,this};function x(j,D){return j<=0||D.length===0&&D.ended?0:D.objectMode?1:j!=j?D.flowing&&D.length?D.buffer.head.data.length:D.length:(j>D.highWaterMark&&(D.highWaterMark=function(B){return B>=1073741824?B=1073741824:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}(j)),j<=D.length?j:D.ended?D.length:(D.needReadable=!0,0))}function d(j){var D=j._readableState;h("emitReadable",D.needReadable,D.emittedReadable),D.needReadable=!1,D.emittedReadable||(h("emitReadable",D.flowing),D.emittedReadable=!0,c.nextTick(m,j))}function m(j){var D=j._readableState;h("emitReadable_",D.destroyed,D.length,D.ended),D.destroyed||!D.length&&!D.ended||(j.emit("readable"),D.emittedReadable=!1),D.needReadable=!D.flowing&&!D.ended&&D.length<=D.highWaterMark,q(j)}function g(j,D){D.readingMore||(D.readingMore=!0,c.nextTick(w,j,D))}function w(j,D){for(;!D.reading&&!D.ended&&(D.length<D.highWaterMark||D.flowing&&D.length===0);){var B=D.length;if(h("maybeReadMore read 0"),j.read(0),B===D.length)break}D.readingMore=!1}function A(j){var D=j._readableState;D.readableListening=j.listenerCount("readable")>0,D.resumeScheduled&&!D.paused?D.flowing=!0:j.listenerCount("data")>0&&j.resume()}function P(j){h("readable nexttick read 0"),j.read(0)}function T(j,D){h("resume",D.reading),D.reading||j.read(0),D.resumeScheduled=!1,j.emit("resume"),q(j),D.flowing&&!D.reading&&j.read(0)}function q(j){var D=j._readableState;for(h("flow",D.flowing);D.flowing&&j.read()!==null;);}function Z(j,D){return D.length===0?null:(D.objectMode?B=D.buffer.shift():!j||j>=D.length?(B=D.decoder?D.buffer.join(""):D.buffer.length===1?D.buffer.first():D.buffer.concat(D.length),D.buffer.clear()):B=D.buffer.consume(j,D.decoder),B);var B}function I(j){var D=j._readableState;h("endReadable",D.endEmitted),D.endEmitted||(D.ended=!0,c.nextTick($,D,j))}function $(j,D){if(h("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,D.readable=!1,D.emit("end"),j.autoDestroy)){var B=D._writableState;(!B||B.autoDestroy&&B.finished)&&D.destroy()}}function K(j,D){for(var B=0,U=j.length;B<U;B++)if(j[B]===D)return B;return-1}z.prototype.read=function(j){h("read",j),j=parseInt(j,10);var D=this._readableState,B=j;if(j!==0&&(D.emittedReadable=!1),j===0&&D.needReadable&&((D.highWaterMark!==0?D.length>=D.highWaterMark:D.length>0)||D.ended))return h("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?I(this):d(this),null;if((j=x(j,D))===0&&D.ended)return D.length===0&&I(this),null;var U,J=D.needReadable;return h("need readable",J),(D.length===0||D.length-j<D.highWaterMark)&&h("length less than watermark",J=!0),D.ended||D.reading?h("reading or ended",J=!1):J&&(h("do read"),D.reading=!0,D.sync=!0,D.length===0&&(D.needReadable=!0),this._read(D.highWaterMark),D.sync=!1,D.reading||(j=x(B,D))),(U=j>0?Z(j,D):null)===null?(D.needReadable=D.length<=D.highWaterMark,j=0):(D.length-=j,D.awaitDrain=0),D.length===0&&(D.ended||(D.needReadable=!0),B!==j&&D.ended&&I(this)),U!==null&&this.emit("data",U),U},z.prototype._read=function(j){F(this,new N("_read()"))},z.prototype.pipe=function(j,D){var B=this,U=this._readableState;switch(U.pipesCount){case 0:U.pipes=j;break;case 1:U.pipes=[U.pipes,j];break;default:U.pipes.push(j)}U.pipesCount+=1,h("pipe count=%d opts=%j",U.pipesCount,D);var J=(!D||D.end!==!1)&&j!==c.stdout&&j!==c.stderr?W:ce;function G(se,ae){h("onunpipe"),se===B&&ae&&ae.hasUnpiped===!1&&(ae.hasUnpiped=!0,h("cleanup"),j.removeListener("close",fe),j.removeListener("finish",ne),j.removeListener("drain",Y),j.removeListener("error",oe),j.removeListener("unpipe",G),B.removeListener("end",W),B.removeListener("end",ce),B.removeListener("data",te),ee=!0,!U.awaitDrain||j._writableState&&!j._writableState.needDrain||Y())}function W(){h("onend"),j.end()}U.endEmitted?c.nextTick(J):B.once("end",J),j.on("unpipe",G);var Y=function(se){return function(){var ae=se._readableState;h("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&a(se,"data")&&(ae.flowing=!0,q(se))}}(B);j.on("drain",Y);var ee=!1;function te(se){h("ondata");var ae=j.write(se);h("dest.write",ae),ae===!1&&((U.pipesCount===1&&U.pipes===j||U.pipesCount>1&&K(U.pipes,j)!==-1)&&!ee&&(h("false write response, pause",U.awaitDrain),U.awaitDrain++),B.pause())}function oe(se){h("onerror",se),ce(),j.removeListener("error",oe),a(j,"error")===0&&F(j,se)}function fe(){j.removeListener("finish",ne),ce()}function ne(){h("onfinish"),j.removeListener("close",fe),ce()}function ce(){h("unpipe"),B.unpipe(j)}return B.on("data",te),function(se,ae,he){if(typeof se.prependListener=="function")return se.prependListener(ae,he);se._events&&se._events[ae]?Array.isArray(se._events[ae])?se._events[ae].unshift(he):se._events[ae]=[he,se._events[ae]]:se.on(ae,he)}(j,"error",oe),j.once("close",fe),j.once("finish",ne),j.emit("pipe",B),U.flowing||(h("pipe resume"),B.resume()),j},z.prototype.unpipe=function(j){var D=this._readableState,B={hasUnpiped:!1};if(D.pipesCount===0)return this;if(D.pipesCount===1)return j&&j!==D.pipes||(j||(j=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,j&&j.emit("unpipe",this,B)),this;if(!j){var U=D.pipes,J=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var G=0;G<J;G++)U[G].emit("unpipe",this,{hasUnpiped:!1});return this}var W=K(D.pipes,j);return W===-1||(D.pipes.splice(W,1),D.pipesCount-=1,D.pipesCount===1&&(D.pipes=D.pipes[0]),j.emit("unpipe",this,B)),this},z.prototype.on=function(j,D){var B=f.prototype.on.call(this,j,D),U=this._readableState;return j==="data"?(U.readableListening=this.listenerCount("readable")>0,U.flowing!==!1&&this.resume()):j==="readable"&&(U.endEmitted||U.readableListening||(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,h("on readable",U.length,U.reading),U.length?d(this):U.reading||c.nextTick(P,this))),B},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(j,D){var B=f.prototype.removeListener.call(this,j,D);return j==="readable"&&c.nextTick(A,this),B},z.prototype.removeAllListeners=function(j){var D=f.prototype.removeAllListeners.apply(this,arguments);return j!=="readable"&&j!==void 0||c.nextTick(A,this),D},z.prototype.resume=function(){var j=this._readableState;return j.flowing||(h("resume"),j.flowing=!j.readableListening,function(D,B){B.resumeScheduled||(B.resumeScheduled=!0,c.nextTick(T,D,B))}(this,j)),j.paused=!1,this},z.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},z.prototype.wrap=function(j){var D=this,B=this._readableState,U=!1;for(var J in j.on("end",function(){if(h("wrapped end"),B.decoder&&!B.ended){var W=B.decoder.end();W&&W.length&&D.push(W)}D.push(null)}),j.on("data",function(W){h("wrapped data"),B.decoder&&(W=B.decoder.write(W)),B.objectMode&&W==null||(B.objectMode||W&&W.length)&&(D.push(W)||(U=!0,j.pause()))}),j)this[J]===void 0&&typeof j[J]=="function"&&(this[J]=function(W){return function(){return j[W].apply(j,arguments)}}(J));for(var G=0;G<V.length;G++)j.on(V[G],this.emit.bind(this,V[G]));return this._read=function(W){h("wrapped _read",W),U&&(U=!1,j.resume())},this},typeof Symbol=="function"&&(z.prototype[Symbol.asyncIterator]=function(){return y===void 0&&(y=t(276)),y(this)}),Object.defineProperty(z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(j){this._readableState&&(this._readableState.flowing=j)}}),z._fromList=Z,Object.defineProperty(z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(z.from=function(j,D){return _===void 0&&(_=t(277)),_(z,j,D)})}).call(this,t(6),t(5))},function(o,e,t){o.exports=t(12).EventEmitter},function(o,e,t){(function(n){function c(f,s){a(f,s),p(f)}function p(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function a(f,s){f.emit("error",s)}o.exports={destroy:function(f,s){var u=this,h=this._readableState&&this._readableState.destroyed,v=this._writableState&&this._writableState.destroyed;return h||v?(s?s(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,f)):n.nextTick(a,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(b){!s&&b?u._writableState?u._writableState.errorEmitted?n.nextTick(p,u):(u._writableState.errorEmitted=!0,n.nextTick(c,u,b)):n.nextTick(c,u,b):s?(n.nextTick(p,u),s(b)):n.nextTick(p,u)}),this)},undestroy:function(){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)},errorOrDestroy:function(f,s){var u=f._readableState,h=f._writableState;u&&u.autoDestroy||h&&h.autoDestroy?f.destroy(s):f.emit("error",s)}}}).call(this,t(5))},function(o,e,t){var n=t(29).codes.ERR_INVALID_OPT_VALUE;o.exports={getHighWaterMark:function(c,p,a,f){var s=function(u,h,v){return u.highWaterMark!=null?u.highWaterMark:h?u[v]:null}(p,f,a);if(s!=null){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(f?a:"highWaterMark",s);return Math.floor(s)}return c.objectMode?16:16384}}},function(o,e,t){(function(n,c){function p(w){var A=this;this.next=null,this.entry=null,this.finish=function(){(function(P,T,q){var Z=P.entry;for(P.entry=null;Z;){var I=Z.callback;T.pendingcb--,I(q),Z=Z.next}T.corkedRequestsFree.next=P})(A,w)}}var a;o.exports=z,z.WritableState=H;var f={deprecate:t(54)},s=t(129),u=t(2).Buffer,h=n.Uint8Array||function(){},v,b=t(130),y=t(131).getHighWaterMark,_=t(29).codes,E=_.ERR_INVALID_ARG_TYPE,S=_.ERR_METHOD_NOT_IMPLEMENTED,k=_.ERR_MULTIPLE_CALLBACK,O=_.ERR_STREAM_CANNOT_PIPE,M=_.ERR_STREAM_DESTROYED,C=_.ERR_STREAM_NULL_VALUES,N=_.ERR_STREAM_WRITE_AFTER_END,L=_.ERR_UNKNOWN_ENCODING,F=b.errorOrDestroy;function V(){}function H(w,A,P){a=a||t(30),w=w||{},typeof P!="boolean"&&(P=A instanceof a),this.objectMode=!!w.objectMode,P&&(this.objectMode=this.objectMode||!!w.writableObjectMode),this.highWaterMark=y(this,w,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var T=w.decodeStrings===!1;this.decodeStrings=!T,this.defaultEncoding=w.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){(function(Z,I){var $=Z._writableState,K=$.sync,j=$.writecb;if(typeof j!="function")throw new k;if(function(B){B.writing=!1,B.writecb=null,B.length-=B.writelen,B.writelen=0}($),I)(function(B,U,J,G,W){--U.pendingcb,J?(c.nextTick(W,G),c.nextTick(g,B,U),B._writableState.errorEmitted=!0,F(B,G)):(W(G),B._writableState.errorEmitted=!0,F(B,G),g(B,U))})(Z,$,K,I,j);else{var D=d($)||Z.destroyed;D||$.corked||$.bufferProcessing||!$.bufferedRequest||x(Z,$),K?c.nextTick(l,Z,$,D,j):l(Z,$,D,j)}})(A,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=w.emitClose!==!1,this.autoDestroy=!!w.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new p(this)}function z(w){var A=this instanceof(a=a||t(30));if(!A&&!v.call(z,this))return new z(w);this._writableState=new H(w,this,A),this.writable=!0,w&&(typeof w.write=="function"&&(this._write=w.write),typeof w.writev=="function"&&(this._writev=w.writev),typeof w.destroy=="function"&&(this._destroy=w.destroy),typeof w.final=="function"&&(this._final=w.final)),s.call(this)}function R(w,A,P,T,q,Z,I){A.writelen=T,A.writecb=I,A.writing=!0,A.sync=!0,A.destroyed?A.onwrite(new M("write")):P?w._writev(q,A.onwrite):w._write(q,Z,A.onwrite),A.sync=!1}function l(w,A,P,T){P||function(q,Z){Z.length===0&&Z.needDrain&&(Z.needDrain=!1,q.emit("drain"))}(w,A),A.pendingcb--,T(),g(w,A)}function x(w,A){A.bufferProcessing=!0;var P=A.bufferedRequest;if(w._writev&&P&&P.next){var T=A.bufferedRequestCount,q=new Array(T),Z=A.corkedRequestsFree;Z.entry=P;for(var I=0,$=!0;P;)q[I]=P,P.isBuf||($=!1),P=P.next,I+=1;q.allBuffers=$,R(w,A,!0,A.length,q,"",Z.finish),A.pendingcb++,A.lastBufferedRequest=null,Z.next?(A.corkedRequestsFree=Z.next,Z.next=null):A.corkedRequestsFree=new p(A),A.bufferedRequestCount=0}else{for(;P;){var K=P.chunk,j=P.encoding,D=P.callback;if(R(w,A,!1,A.objectMode?1:K.length,K,j,D),P=P.next,A.bufferedRequestCount--,A.writing)break}P===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=P,A.bufferProcessing=!1}function d(w){return w.ending&&w.length===0&&w.bufferedRequest===null&&!w.finished&&!w.writing}function m(w,A){w._final(function(P){A.pendingcb--,P&&F(w,P),A.prefinished=!0,w.emit("prefinish"),g(w,A)})}function g(w,A){var P=d(A);if(P&&(function(q,Z){Z.prefinished||Z.finalCalled||(typeof q._final!="function"||Z.destroyed?(Z.prefinished=!0,q.emit("prefinish")):(Z.pendingcb++,Z.finalCalled=!0,c.nextTick(m,q,Z)))}(w,A),A.pendingcb===0&&(A.finished=!0,w.emit("finish"),A.autoDestroy))){var T=w._readableState;(!T||T.autoDestroy&&T.endEmitted)&&w.destroy()}return P}t(3)(z,s),H.prototype.getBuffer=function(){for(var w=this.bufferedRequest,A=[];w;)A.push(w),w=w.next;return A},function(){try{Object.defineProperty(H.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(v=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(w){return!!v.call(this,w)||this===z&&w&&w._writableState instanceof H}})):v=function(w){return w instanceof this},z.prototype.pipe=function(){F(this,new O)},z.prototype.write=function(w,A,P){var T,q=this._writableState,Z=!1,I=!q.objectMode&&(T=w,u.isBuffer(T)||T instanceof h);return I&&!u.isBuffer(w)&&(w=function($){return u.from($)}(w)),typeof A=="function"&&(P=A,A=null),I?A="buffer":A||(A=q.defaultEncoding),typeof P!="function"&&(P=V),q.ending?function($,K){var j=new N;F($,j),c.nextTick(K,j)}(this,P):(I||function($,K,j,D){var B;return j===null?B=new C:typeof j=="string"||K.objectMode||(B=new E("chunk",["string","Buffer"],j)),!B||(F($,B),c.nextTick(D,B),!1)}(this,q,w,P))&&(q.pendingcb++,Z=function($,K,j,D,B,U){if(!j){var J=function(ee,te,oe){return ee.objectMode||ee.decodeStrings===!1||typeof te!="string"||(te=u.from(te,oe)),te}(K,D,B);D!==J&&(j=!0,B="buffer",D=J)}var G=K.objectMode?1:D.length;K.length+=G;var W=K.length<K.highWaterMark;if(W||(K.needDrain=!0),K.writing||K.corked){var Y=K.lastBufferedRequest;K.lastBufferedRequest={chunk:D,encoding:B,isBuf:j,callback:U,next:null},Y?Y.next=K.lastBufferedRequest:K.bufferedRequest=K.lastBufferedRequest,K.bufferedRequestCount+=1}else R($,K,!1,G,D,B,U);return W}(this,q,I,w,A,P)),Z},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){var w=this._writableState;w.corked&&(w.corked--,w.writing||w.corked||w.bufferProcessing||!w.bufferedRequest||x(this,w))},z.prototype.setDefaultEncoding=function(w){if(typeof w=="string"&&(w=w.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((w+"").toLowerCase())>-1))throw new L(w);return this._writableState.defaultEncoding=w,this},Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),z.prototype._write=function(w,A,P){P(new S("_write()"))},z.prototype._writev=null,z.prototype.end=function(w,A,P){var T=this._writableState;return typeof w=="function"?(P=w,w=null,A=null):typeof A=="function"&&(P=A,A=null),w!=null&&this.write(w,A),T.corked&&(T.corked=1,this.uncork()),T.ending||function(q,Z,I){Z.ending=!0,g(q,Z),I&&(Z.finished?c.nextTick(I):q.once("finish",I)),Z.ended=!0,q.writable=!1}(this,T,P),this},Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(w){this._writableState&&(this._writableState.destroyed=w)}}),z.prototype.destroy=b.destroy,z.prototype._undestroy=b.undestroy,z.prototype._destroy=function(w,A){A(w)}}).call(this,t(6),t(5))},function(o,e,t){o.exports=h;var n=t(29).codes,c=n.ERR_METHOD_NOT_IMPLEMENTED,p=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,f=n.ERR_TRANSFORM_WITH_LENGTH_0,s=t(30);function u(y,_){var E=this._transformState;E.transforming=!1;var S=E.writecb;if(S===null)return this.emit("error",new p);E.writechunk=null,E.writecb=null,_!=null&&this.push(_),S(y);var k=this._readableState;k.reading=!1,(k.needReadable||k.length<k.highWaterMark)&&this._read(k.highWaterMark)}function h(y){if(!(this instanceof h))return new h(y);s.call(this,y),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,y&&(typeof y.transform=="function"&&(this._transform=y.transform),typeof y.flush=="function"&&(this._flush=y.flush)),this.on("prefinish",v)}function v(){var y=this;typeof this._flush!="function"||this._readableState.destroyed?b(this,null,null):this._flush(function(_,E){b(y,_,E)})}function b(y,_,E){if(_)return y.emit("error",_);if(E!=null&&y.push(E),y._writableState.length)throw new f;if(y._transformState.transforming)throw new a;return y.push(null)}t(3)(h,s),h.prototype.push=function(y,_){return this._transformState.needTransform=!1,s.prototype.push.call(this,y,_)},h.prototype._transform=function(y,_,E){E(new c("_transform()"))},h.prototype._write=function(y,_,E){var S=this._transformState;if(S.writecb=E,S.writechunk=y,S.writeencoding=_,!S.transforming){var k=this._readableState;(S.needTransform||k.needReadable||k.length<k.highWaterMark)&&this._read(k.highWaterMark)}},h.prototype._read=function(y){var _=this._transformState;_.writechunk===null||_.transforming?_.needTransform=!0:(_.transforming=!0,this._transform(_.writechunk,_.writeencoding,_.afterTransform))},h.prototype._destroy=function(y,_){s.prototype._destroy.call(this,y,function(E){_(E)})}},function(o,e,t){var n=t(3),c=t(31),p=t(13).Buffer,a=[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],f=new Array(64);function s(){this.init(),this._w=f,c.call(this,64,56)}function u(_,E,S){return S^_&(E^S)}function h(_,E,S){return _&E|S&(_|E)}function v(_){return(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10)}function b(_){return(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7)}function y(_){return(_>>>7|_<<25)^(_>>>18|_<<14)^_>>>3}n(s,c),s.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},s.prototype._update=function(_){for(var E,S=this._w,k=0|this._a,O=0|this._b,M=0|this._c,C=0|this._d,N=0|this._e,L=0|this._f,F=0|this._g,V=0|this._h,H=0;H<16;++H)S[H]=_.readInt32BE(4*H);for(;H<64;++H)S[H]=0|(((E=S[H-2])>>>17|E<<15)^(E>>>19|E<<13)^E>>>10)+S[H-7]+y(S[H-15])+S[H-16];for(var z=0;z<64;++z){var R=V+b(N)+u(N,L,F)+a[z]+S[z]|0,l=v(k)+h(k,O,M)|0;V=F,F=L,L=N,N=C+R|0,C=M,M=O,O=k,k=R+l|0}this._a=k+this._a|0,this._b=O+this._b|0,this._c=M+this._c|0,this._d=C+this._d|0,this._e=N+this._e|0,this._f=L+this._f|0,this._g=F+this._g|0,this._h=V+this._h|0},s.prototype._hash=function(){var _=p.allocUnsafe(32);return _.writeInt32BE(this._a,0),_.writeInt32BE(this._b,4),_.writeInt32BE(this._c,8),_.writeInt32BE(this._d,12),_.writeInt32BE(this._e,16),_.writeInt32BE(this._f,20),_.writeInt32BE(this._g,24),_.writeInt32BE(this._h,28),_},o.exports=s},function(o,e,t){var n=t(3),c=t(31),p=t(13).Buffer,a=[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],f=new Array(160);function s(){this.init(),this._w=f,c.call(this,128,112)}function u(O,M,C){return C^O&(M^C)}function h(O,M,C){return O&M|C&(O|M)}function v(O,M){return(O>>>28|M<<4)^(M>>>2|O<<30)^(M>>>7|O<<25)}function b(O,M){return(O>>>14|M<<18)^(O>>>18|M<<14)^(M>>>9|O<<23)}function y(O,M){return(O>>>1|M<<31)^(O>>>8|M<<24)^O>>>7}function _(O,M){return(O>>>1|M<<31)^(O>>>8|M<<24)^(O>>>7|M<<25)}function E(O,M){return(O>>>19|M<<13)^(M>>>29|O<<3)^O>>>6}function S(O,M){return(O>>>19|M<<13)^(M>>>29|O<<3)^(O>>>6|M<<26)}function k(O,M){return O>>>0<M>>>0?1:0}n(s,c),s.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},s.prototype._update=function(O){for(var M=this._w,C=0|this._ah,N=0|this._bh,L=0|this._ch,F=0|this._dh,V=0|this._eh,H=0|this._fh,z=0|this._gh,R=0|this._hh,l=0|this._al,x=0|this._bl,d=0|this._cl,m=0|this._dl,g=0|this._el,w=0|this._fl,A=0|this._gl,P=0|this._hl,T=0;T<32;T+=2)M[T]=O.readInt32BE(4*T),M[T+1]=O.readInt32BE(4*T+4);for(;T<160;T+=2){var q=M[T-30],Z=M[T-30+1],I=y(q,Z),$=_(Z,q),K=E(q=M[T-4],Z=M[T-4+1]),j=S(Z,q),D=M[T-14],B=M[T-14+1],U=M[T-32],J=M[T-32+1],G=$+B|0,W=I+D+k(G,$)|0;W=(W=W+K+k(G=G+j|0,j)|0)+U+k(G=G+J|0,J)|0,M[T]=W,M[T+1]=G}for(var Y=0;Y<160;Y+=2){W=M[Y],G=M[Y+1];var ee=h(C,N,L),te=h(l,x,d),oe=v(C,l),fe=v(l,C),ne=b(V,g),ce=b(g,V),se=a[Y],ae=a[Y+1],he=u(V,H,z),me=u(g,w,A),le=P+ce|0,ye=R+ne+k(le,P)|0;ye=(ye=(ye=ye+he+k(le=le+me|0,me)|0)+se+k(le=le+ae|0,ae)|0)+W+k(le=le+G|0,G)|0;var Se=fe+te|0,pe=oe+ee+k(Se,fe)|0;R=z,P=A,z=H,A=w,H=V,w=g,V=F+ye+k(g=m+le|0,m)|0,F=L,m=d,L=N,d=x,N=C,x=l,C=ye+pe+k(l=le+Se|0,le)|0}this._al=this._al+l|0,this._bl=this._bl+x|0,this._cl=this._cl+d|0,this._dl=this._dl+m|0,this._el=this._el+g|0,this._fl=this._fl+w|0,this._gl=this._gl+A|0,this._hl=this._hl+P|0,this._ah=this._ah+C+k(this._al,l)|0,this._bh=this._bh+N+k(this._bl,x)|0,this._ch=this._ch+L+k(this._cl,d)|0,this._dh=this._dh+F+k(this._dl,m)|0,this._eh=this._eh+V+k(this._el,g)|0,this._fh=this._fh+H+k(this._fl,w)|0,this._gh=this._gh+z+k(this._gl,A)|0,this._hh=this._hh+R+k(this._hl,P)|0},s.prototype._hash=function(){var O=p.allocUnsafe(64);function M(C,N,L){O.writeInt32BE(C,L),O.writeInt32BE(N,L+4)}return M(this._ah,this._al,0),M(this._bh,this._bl,8),M(this._ch,this._cl,16),M(this._dh,this._dl,24),M(this._eh,this._el,32),M(this._fh,this._fl,40),M(this._gh,this._gl,48),M(this._hh,this._hl,56),O},o.exports=s},function(o,e){o.exports=function(t){if(typeof t!="string")throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.slice(0,2)==="0x"}},function(o,e,t){const n=(c,p)=>function(){const a=p.promiseModule,f=new Array(arguments.length);for(let s=0;s<arguments.length;s++)f[s]=arguments[s];return new a((s,u)=>{p.errorFirst?f.push(function(h,v){if(p.multiArgs){const b=new Array(arguments.length-1);for(let y=1;y<arguments.length;y++)b[y-1]=arguments[y];h?(b.unshift(h),u(b)):s(b)}else h?u(h):s(v)}):f.push(function(h){if(p.multiArgs){const v=new Array(arguments.length-1);for(let b=0;b<arguments.length;b++)v[b]=arguments[b];s(v)}else s(h)}),c.apply(this,f)})};o.exports=(c,p)=>{p=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},p);const a=s=>{const u=h=>typeof h=="string"?s===h:h.test(s);return p.include?p.include.some(u):!p.exclude.some(u)};let f;f=typeof c=="function"?function(){return p.excludeMain?c.apply(this,arguments):n(c,p).apply(this,arguments)}:Object.create(Object.getPrototypeOf(c));for(const s in c){const u=c[s];f[s]=typeof u=="function"&&a(s)?n(u,p):u}return f}},function(o,e,t){const n=t(44),c=t(296)();function p(s){this.currentProvider=s}function a(s){return function(){const u=this;var h=[].slice.call(arguments),v=h.pop();u.sendAsync({method:s,params:h},v)}}function f(s,u){return function(){const h=this;var v=[].slice.call(arguments),b=v.pop();v.length<s&&v.push("latest"),h.sendAsync({method:u,params:v},b)}}o.exports=p,p.prototype.getBalance=f(2,"eth_getBalance"),p.prototype.getCode=f(2,"eth_getCode"),p.prototype.getTransactionCount=f(2,"eth_getTransactionCount"),p.prototype.getStorageAt=f(3,"eth_getStorageAt"),p.prototype.call=f(2,"eth_call"),p.prototype.protocolVersion=a("eth_protocolVersion"),p.prototype.syncing=a("eth_syncing"),p.prototype.coinbase=a("eth_coinbase"),p.prototype.mining=a("eth_mining"),p.prototype.hashrate=a("eth_hashrate"),p.prototype.gasPrice=a("eth_gasPrice"),p.prototype.accounts=a("eth_accounts"),p.prototype.blockNumber=a("eth_blockNumber"),p.prototype.getBlockTransactionCountByHash=a("eth_getBlockTransactionCountByHash"),p.prototype.getBlockTransactionCountByNumber=a("eth_getBlockTransactionCountByNumber"),p.prototype.getUncleCountByBlockHash=a("eth_getUncleCountByBlockHash"),p.prototype.getUncleCountByBlockNumber=a("eth_getUncleCountByBlockNumber"),p.prototype.sign=a("eth_sign"),p.prototype.sendTransaction=a("eth_sendTransaction"),p.prototype.sendRawTransaction=a("eth_sendRawTransaction"),p.prototype.estimateGas=a("eth_estimateGas"),p.prototype.getBlockByHash=a("eth_getBlockByHash"),p.prototype.getBlockByNumber=a("eth_getBlockByNumber"),p.prototype.getTransactionByHash=a("eth_getTransactionByHash"),p.prototype.getTransactionByBlockHashAndIndex=a("eth_getTransactionByBlockHashAndIndex"),p.prototype.getTransactionByBlockNumberAndIndex=a("eth_getTransactionByBlockNumberAndIndex"),p.prototype.getTransactionReceipt=a("eth_getTransactionReceipt"),p.prototype.getUncleByBlockHashAndIndex=a("eth_getUncleByBlockHashAndIndex"),p.prototype.getUncleByBlockNumberAndIndex=a("eth_getUncleByBlockNumberAndIndex"),p.prototype.getCompilers=a("eth_getCompilers"),p.prototype.compileLLL=a("eth_compileLLL"),p.prototype.compileSolidity=a("eth_compileSolidity"),p.prototype.compileSerpent=a("eth_compileSerpent"),p.prototype.newFilter=a("eth_newFilter"),p.prototype.newBlockFilter=a("eth_newBlockFilter"),p.prototype.newPendingTransactionFilter=a("eth_newPendingTransactionFilter"),p.prototype.uninstallFilter=a("eth_uninstallFilter"),p.prototype.getFilterChanges=a("eth_getFilterChanges"),p.prototype.getFilterLogs=a("eth_getFilterLogs"),p.prototype.getLogs=a("eth_getLogs"),p.prototype.getWork=a("eth_getWork"),p.prototype.submitWork=a("eth_submitWork"),p.prototype.submitHashrate=a("eth_submitHashrate"),p.prototype.sendAsync=function(s,u){var h;this.currentProvider.sendAsync((h=s,n({id:c(),jsonrpc:"2.0",params:[]},h)),function(v,b){if(!v&&b.error&&(v=new Error("EthQuery - RPC Error - "+b.error.message)),v)return u(v);u(null,b.result)})}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(_,E,S){((0,n.default)(_)?b:y)(_,(0,h.default)(E),S)};var n=v(t(47)),c=v(t(145)),p=v(t(303)),a=v(t(148)),f=v(t(38)),s=v(t(64)),u=v(t(66)),h=v(t(23));function v(_){return _&&_.__esModule?_:{default:_}}function b(_,E,S){S=(0,s.default)(S||f.default);var k=0,O=0,M=_.length;function C(N,L){N?S(N):++O!==M&&L!==c.default||S(null)}for(M===0&&S(null);k<M;k++)E(_[k],k,(0,u.default)(C))}var y=(0,a.default)(p.default,1/0);o.exports=e.default},function(o,e,t){var n=t(141).Symbol;o.exports=n},function(o,e,t){var n=t(142),c=typeof self=="object"&&self&&self.Object===Object&&self,p=n||c||Function("return this")();o.exports=p},function(o,e,t){(function(n){var c=typeof n=="object"&&n&&n.Object===Object&&n;o.exports=c}).call(this,t(6))},function(o,e){o.exports=function(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}},function(o,e){o.exports=function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default={},o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(u){return function(h,v,b){if(b=(0,c.default)(b||n.default),u<=0||!h)return b(null);var y=(0,p.default)(h),_=!1,E=0,S=!1;function k(M,C){if(E-=1,M)_=!0,b(M);else{if(C===f.default||_&&E<=0)return _=!0,b(null);S||O()}}function O(){for(S=!0;E<u&&!_;){var M=y();if(M===null)return _=!0,void(E<=0&&b(null));E+=1,v(M.value,M.key,(0,a.default)(k))}S=!1}O()}};var n=s(t(38)),c=s(t(64)),p=s(t(304)),a=s(t(66)),f=s(t(145));function s(u){return u&&u.__esModule?u:{default:u}}o.exports=e.default},function(o,e){var t=Array.isArray;o.exports=t},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n,c){return function(p,a,f){return n(p,c,a,f)}},o.exports=e.default},function(o,e,t){const n=t(150);function c(s){return f(s)!=="never"}function p(s){var u=a(s);return u>=s.params.length?s.params:s.method==="eth_getBlockByNumber"?s.params.slice(1):s.params.slice(0,u)}function a(s){switch(s.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function f(s){switch(s.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}o.exports={cacheIdentifierForPayload:function(s,u={}){if(!c(s))return null;const{includeBlockRef:h}=u,v=h?s.params:p(s);return s.method+":"+n(v)},canCache:c,blockTagForPayload:function(s){var u=a(s);return u>=s.params.length?null:s.params[u]},paramsWithoutBlockTag:p,blockTagParamIndex:a,cacheTypeForPayload:f}},function(o,e,t){var n=typeof JSON!="undefined"?JSON:t(330);o.exports=function(a,f){f||(f={}),typeof f=="function"&&(f={cmp:f});var s=f.space||"";typeof s=="number"&&(s=Array(s+1).join(" "));var u,h=typeof f.cycles=="boolean"&&f.cycles,v=f.replacer||function(_,E){return E},b=f.cmp&&(u=f.cmp,function(_){return function(E,S){var k={key:E,value:_[E]},O={key:S,value:_[S]};return u(k,O)}}),y=[];return function _(E,S,k,O){var M=s?`
`+new Array(O+1).join(s):"",C=s?": ":":";if(k&&k.toJSON&&typeof k.toJSON=="function"&&(k=k.toJSON()),(k=v.call(E,S,k))!==void 0){if(typeof k!="object"||k===null)return n.stringify(k);if(c(k)){for(var N=[],L=0;L<k.length;L++){var F=_(k,L,k[L],O+1)||n.stringify(null);N.push(M+s+F)}return"["+N.join(",")+M+"]"}if(y.indexOf(k)!==-1){if(h)return n.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}y.push(k);var V=p(k).sort(b&&b(k));for(N=[],L=0;L<V.length;L++){var H=_(k,S=V[L],k[S],O+1);if(H){var z=n.stringify(S)+C+H;N.push(M+s+z)}}return y.splice(y.indexOf(k),1),"{"+N.join(",")+M+"}"}}({"":a},"",a,0)};var c=Array.isArray||function(a){return{}.toString.call(a)==="[object Array]"},p=Object.keys||function(a){var f=Object.prototype.hasOwnProperty||function(){return!0},s=[];for(var u in a)f.call(a,u)&&s.push(u);return s}},function(o,e,t){const n=t(375).Mutex,{createAsyncMiddleware:c}=t(152),p=t(156),a=t(348),f=t(351),s=t(352),{intToHex:u,hexToInt:h}=t(39);function v(_){return b(async(...E)=>{const S=await _(...E);return u(S.id)})}function b(_){return c(async(E,S)=>{const k=await _.apply(null,E.params);S.result=k})}function y(_,E){const S=[];for(let k in _)S.push(_[k]);return S}o.exports=function({blockTracker:_,provider:E}){let S=0,k={};const O=new n,M=function({mutex:d}){return m=>async(g,w,A,P)=>{(await d.acquire())(),m(g,w,A,P)}}({mutex:O}),C=p({eth_newFilter:M(v(L)),eth_newBlockFilter:M(v(F)),eth_newPendingTransactionFilter:M(v(V)),eth_uninstallFilter:M(b(R)),eth_getFilterChanges:M(b(H)),eth_getFilterLogs:M(b(z))}),N=async({oldBlock:d,newBlock:m})=>{if(k.length===0)return;const g=await O.acquire();try{await Promise.all(y(k).map(async w=>{try{await w.update({oldBlock:d,newBlock:m})}catch(A){console.error(A)}}))}catch(w){console.error(w)}g()};return C.newLogFilter=L,C.newBlockFilter=F,C.newPendingTransactionFilter=V,C.uninstallFilter=R,C.getFilterChanges=H,C.getFilterLogs=z,C.destroy=()=>{(async function(){const d=y(k).length;k={},x({prevFilterCount:d,newFilterCount:0})})()},C;async function L(d){const m=new a({provider:E,params:d});return await l(m),m}async function F(){const d=new f({provider:E});return await l(d),d}async function V(){const d=new s({provider:E});return await l(d),d}async function H(d){const m=h(d),g=k[m];if(!g)throw new Error(`No filter for index "${m}"`);return g.getChangesAndClear()}async function z(d){const m=h(d),g=k[m];if(!g)throw new Error(`No filter for index "${m}"`);return g.type==="log"?results=g.getAllResults():results=[],results}async function R(d){const m=h(d),g=k[m],w=Boolean(g);return w&&await async function(A){const P=y(k).length;delete k[A];const T=y(k).length;x({prevFilterCount:P,newFilterCount:T})}(m),w}async function l(d){const m=y(k).length,g=await _.getLatestBlock();return await d.initialize({currentBlock:g}),S++,k[S]=d,d.id=S,d.idHex=u(S),x({prevFilterCount:m,newFilterCount:y(k).length}),S}function x({prevFilterCount:d,newFilterCount:m}){d===0&&m>0?_.on("sync",N):d>0&&m===0&&_.removeListener("sync",N)}}},function(o,e,t){var n=this&&this.__createBinding||(Object.create?function(p,a,f,s){s===void 0&&(s=f),Object.defineProperty(p,s,{enumerable:!0,get:function(){return a[f]}})}:function(p,a,f,s){s===void 0&&(s=f),p[s]=a[f]}),c=this&&this.__exportStar||function(p,a){for(var f in p)f==="default"||Object.prototype.hasOwnProperty.call(a,f)||n(a,p,f)};Object.defineProperty(e,"__esModule",{value:!0}),c(t(340),e),c(t(341),e),c(t(342),e),c(t(153),e),c(t(154),e),c(t(346),e)},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.getUniqueId=void 0;let n=Math.floor(4294967295*Math.random());e.getUniqueId=function(){return n=(n+1)%4294967295,n}},function(o,e,t){var n=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.JsonRpcEngine=void 0;const c=n(t(69)),p=t(343);class a extends c.default{constructor(){super(),this._middleware=[]}push(u){this._middleware.push(u)}handle(u,h){if(h&&typeof h!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(u)?h?this._handleBatch(u,h):this._handleBatch(u):h?this._handle(u,h):this._promiseHandle(u)}asMiddleware(){return async(u,h,v,b)=>{try{const[y,_,E]=await a._runAllMiddleware(u,h,this._middleware);return _?(await a._runReturnHandlers(E),b(y)):v(async S=>{try{await a._runReturnHandlers(E)}catch(k){return S(k)}return S()})}catch(y){return b(y)}}}async _handleBatch(u,h){try{const v=await Promise.all(u.map(this._promiseHandle.bind(this)));return h?h(null,v):v}catch(v){if(h)return h(v);throw v}}_promiseHandle(u){return new Promise(h=>{this._handle(u,(v,b)=>{h(b)})})}async _handle(u,h){if(!u||Array.isArray(u)||typeof u!="object"){const _=new p.EthereumRpcError(p.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof u,{request:u});return h(_,{id:void 0,jsonrpc:"2.0",error:_})}if(typeof u.method!="string"){const _=new p.EthereumRpcError(p.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof u.method,{request:u});return h(_,{id:u.id,jsonrpc:"2.0",error:_})}const v=Object.assign({},u),b={id:v.id,jsonrpc:v.jsonrpc};let y=null;try{await this._processRequest(v,b)}catch(_){y=_}return y&&(delete b.result,b.error||(b.error=p.serializeError(y))),h(y,b)}async _processRequest(u,h){const[v,b,y]=await a._runAllMiddleware(u,h,this._middleware);if(a._checkForCompletion(u,h,b),await a._runReturnHandlers(y),v)throw v}static async _runAllMiddleware(u,h,v){const b=[];let y=null,_=!1;for(const E of v)if([y,_]=await a._runMiddleware(u,h,E,b),_)break;return[y,_,b.reverse()]}static _runMiddleware(u,h,v,b){return new Promise(y=>{const _=S=>{const k=S||h.error;k&&(h.error=p.serializeError(k)),y([k,!0])},E=S=>{h.error?_(h.error):(S&&(typeof S!="function"&&_(new p.EthereumRpcError(p.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof S}" for request:
${f(u)}`,{request:u})),b.push(S)),y([null,!1]))};try{v(u,h,E,_)}catch(S){_(S)}})}static async _runReturnHandlers(u){for(const h of u)await new Promise((v,b)=>{h(y=>y?b(y):v())})}static _checkForCompletion(u,h,v){if(!("result"in h)&&!("error"in h))throw new p.EthereumRpcError(p.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
`+f(u),{request:u});if(!v)throw new p.EthereumRpcError(p.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
`+f(u),{request:u})}}function f(s){return JSON.stringify(s,null,2)}e.JsonRpcEngine=a},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=t(71),c=t(70),p=n.errorCodes.rpc.internal,a={code:p,message:f(p)};function f(b,y="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(b)){const _=b.toString();if(v(n.errorValues,_))return n.errorValues[_].message;if(u(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return y}function s(b){if(!Number.isInteger(b))return!1;const y=b.toString();return!!n.errorValues[y]||!!u(b)}function u(b){return b>=-32099&&b<=-32e3}function h(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function v(b,y){return Object.prototype.hasOwnProperty.call(b,y)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=f,e.isValidCode=s,e.serializeError=function(b,{fallbackError:y=a,shouldIncludeStack:_=!1}={}){var E,S;if(!y||!Number.isInteger(y.code)||typeof y.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(b instanceof c.EthereumRpcError)return b.serialize();const k={};if(b&&typeof b=="object"&&!Array.isArray(b)&&v(b,"code")&&s(b.code)){const M=b;k.code=M.code,M.message&&typeof M.message=="string"?(k.message=M.message,v(M,"data")&&(k.data=M.data)):(k.message=f(k.code),k.data={originalError:h(b)})}else{k.code=y.code;const M=(E=b)===null||E===void 0?void 0:E.message;k.message=M&&typeof M=="string"?M:y.message,k.data={originalError:h(b)}}const O=(S=b)===null||S===void 0?void 0:S.stack;return _&&b&&O&&typeof O=="string"&&(k.stack=O),k}},function(o,e,t){o.exports=t(347)},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.getWindowMetadata=void 0;const n=t(10);e.getWindowMetadata=function(){let c,p;try{c=n.getDocumentOrThrow(),p=n.getLocationOrThrow()}catch{return null}function a(...s){const u=c.getElementsByTagName("meta");for(let h=0;h<u.length;h++){const v=u[h],b=["itemprop","property","name"].map(y=>v.getAttribute(y)).filter(y=>!!y&&s.includes(y));if(b.length&&b){const y=v.getAttribute("content");if(y)return y}}return""}const f=function(){let s=a("name","og:site_name","og:title","twitter:title");return s||(s=c.title),s}();return{description:a("description","og:description","twitter:description","keywords"),url:p.origin,icons:function(){const s=c.getElementsByTagName("link"),u=[];for(let h=0;h<s.length;h++){const v=s[h],b=v.getAttribute("rel");if(b&&b.toLowerCase().indexOf("icon")>-1){const y=v.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let _=p.protocol+"//"+p.host;if(y.indexOf("/")===0)_+=y;else{const E=p.pathname.split("/");E.pop(),_+=E.join("/")+"/"+y}u.push(_)}else if(y.indexOf("//")===0){const _=p.protocol+y;u.push(_)}else u.push(y)}}return u}(),name:f}}},function(o,e,t){(function(n){t.d(e,"a",function(){return y});var c=function(){for(var S=0,k=0,O=arguments.length;k<O;k++)S+=arguments[k].length;var M=Array(S),C=0;for(k=0;k<O;k++)for(var N=arguments[k],L=0,F=N.length;L<F;L++,C++)M[C]=N[L];return M},p=function(S,k,O){this.name=S,this.version=k,this.os=O,this.type="browser"},a=function(S){this.version=S,this.type="node",this.name="node",this.os=n.platform},f=function(S,k,O,M){this.name=S,this.version=k,this.os=O,this.bot=M,this.type="bot-device"},s=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},h=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,v=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],b=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function y(S){return S?E(S):typeof document=="undefined"&&typeof navigator!="undefined"&&navigator.product==="ReactNative"?new u:typeof navigator!="undefined"?E(navigator.userAgent):n!==void 0&&n.version?new a(n.version.slice(1)):null}function _(S){return S!==""&&v.reduce(function(k,O){var M=O[0],C=O[1];if(k)return k;var N=C.exec(S);return!!N&&[M,N]},!1)}function E(S){var k=_(S);if(!k)return null;var O=k[0],M=k[1];if(O==="searchbot")return new s;var C=M[1]&&M[1].split(/[._]/).slice(0,3);C?C.length<3&&(C=c(C,function(V){for(var H=[],z=0;z<V;z++)H.push("0");return H}(3-C.length))):C=[];var N=C.join("."),L=function(V){for(var H=0,z=b.length;H<z;H++){var R=b[H],l=R[0];if(R[1].exec(V))return l}return null}(S),F=h.exec(S);return F&&F[1]?new f(O,N,L,F[1]):new p(O,N,L)}}).call(this,t(5))},function(o,e,t){(function(n){var c=t(77).strict;o.exports=function(p){if(c(p)){var a=n.from(p.buffer);return p.byteLength!==p.buffer.byteLength&&(a=a.slice(p.byteOffset,p.byteOffset+p.byteLength)),a}return n.from(p)}}).call(this,t(2).Buffer)},function(o,e,t){(function(n,c){var p;/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/(function(){var a="input is invalid type",f=typeof window=="object",s=f?window:{};s.JS_SHA3_NO_WINDOW&&(f=!1);var u=!f&&typeof self=="object";!s.JS_SHA3_NO_NODE_JS&&typeof n=="object"&&n.versions&&n.versions.node?s=c:u&&(s=self);var h=!s.JS_SHA3_NO_COMMON_JS&&typeof o=="object"&&o.exports,v=t(171),b=!s.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",y="0123456789abcdef".split(""),_=[4,1024,262144,67108864],E=[0,8,16,24],S=[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],k=[224,256,384,512],O=[128,256],M=["hex","buffer","arrayBuffer","array","digest"],C={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),!b||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(I){return typeof I=="object"&&I.buffer&&I.buffer.constructor===ArrayBuffer});for(var N=function(I,$,K){return function(j){return new T(I,$,I).update(j)[K]()}},L=function(I,$,K){return function(j,D){return new T(I,$,D).update(j)[K]()}},F=function(I,$,K){return function(j,D,B,U){return l["cshake"+I].update(j,D,B,U)[K]()}},V=function(I,$,K){return function(j,D,B,U){return l["kmac"+I].update(j,D,B,U)[K]()}},H=function(I,$,K,j){for(var D=0;D<M.length;++D){var B=M[D];I[B]=$(K,j,B)}return I},z=function(I,$){var K=N(I,$,"hex");return K.create=function(){return new T(I,$,I)},K.update=function(j){return K.create().update(j)},H(K,N,I,$)},R=[{name:"keccak",padding:[1,256,65536,16777216],bits:k,createMethod:z},{name:"sha3",padding:[6,1536,393216,100663296],bits:k,createMethod:z},{name:"shake",padding:[31,7936,2031616,520093696],bits:O,createMethod:function(I,$){var K=L(I,$,"hex");return K.create=function(j){return new T(I,$,j)},K.update=function(j,D){return K.create(D).update(j)},H(K,L,I,$)}},{name:"cshake",padding:_,bits:O,createMethod:function(I,$){var K=C[I],j=F(I,0,"hex");return j.create=function(D,B,U){return B||U?new T(I,$,D).bytepad([B,U],K):l["shake"+I].create(D)},j.update=function(D,B,U,J){return j.create(B,U,J).update(D)},H(j,F,I,$)}},{name:"kmac",padding:_,bits:O,createMethod:function(I,$){var K=C[I],j=V(I,0,"hex");return j.create=function(D,B,U){return new q(I,$,B).bytepad(["KMAC",U],K).bytepad([D],K)},j.update=function(D,B,U,J){return j.create(D,U,J).update(B)},H(j,V,I,$)}}],l={},x=[],d=0;d<R.length;++d)for(var m=R[d],g=m.bits,w=0;w<g.length;++w){var A=m.name+"_"+g[w];if(x.push(A),l[A]=m.createMethod(g[w],m.padding),m.name!=="sha3"){var P=m.name+g[w];x.push(P),l[P]=l[A]}}function T(I,$,K){this.blocks=[],this.s=[],this.padding=$,this.outputBits=K,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(I<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=K>>5,this.extraBytes=(31&K)>>3;for(var j=0;j<50;++j)this.s[j]=0}function q(I,$,K){T.call(this,I,$,K)}T.prototype.update=function(I){if(this.finalized)throw new Error("finalize already called");var $,K=typeof I;if(K!=="string"){if(K!=="object")throw new Error(a);if(I===null)throw new Error(a);if(b&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!(Array.isArray(I)||b&&ArrayBuffer.isView(I)))throw new Error(a);$=!0}for(var j,D,B=this.blocks,U=this.byteCount,J=I.length,G=this.blockCount,W=0,Y=this.s;W<J;){if(this.reset)for(this.reset=!1,B[0]=this.block,j=1;j<G+1;++j)B[j]=0;if($)for(j=this.start;W<J&&j<U;++W)B[j>>2]|=I[W]<<E[3&j++];else for(j=this.start;W<J&&j<U;++W)(D=I.charCodeAt(W))<128?B[j>>2]|=D<<E[3&j++]:D<2048?(B[j>>2]|=(192|D>>6)<<E[3&j++],B[j>>2]|=(128|63&D)<<E[3&j++]):D<55296||D>=57344?(B[j>>2]|=(224|D>>12)<<E[3&j++],B[j>>2]|=(128|D>>6&63)<<E[3&j++],B[j>>2]|=(128|63&D)<<E[3&j++]):(D=65536+((1023&D)<<10|1023&I.charCodeAt(++W)),B[j>>2]|=(240|D>>18)<<E[3&j++],B[j>>2]|=(128|D>>12&63)<<E[3&j++],B[j>>2]|=(128|D>>6&63)<<E[3&j++],B[j>>2]|=(128|63&D)<<E[3&j++]);if(this.lastByteIndex=j,j>=U){for(this.start=j-U,this.block=B[G],j=0;j<G;++j)Y[j]^=B[j];Z(Y),this.reset=!0}else this.start=j}return this},T.prototype.encode=function(I,$){var K=255&I,j=1,D=[K];for(K=255&(I>>=8);K>0;)D.unshift(K),K=255&(I>>=8),++j;return $?D.push(j):D.unshift(j),this.update(D),D.length},T.prototype.encodeString=function(I){var $,K=typeof I;if(K!=="string"){if(K!=="object")throw new Error(a);if(I===null)throw new Error(a);if(b&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!(Array.isArray(I)||b&&ArrayBuffer.isView(I)))throw new Error(a);$=!0}var j=0,D=I.length;if($)j=D;else for(var B=0;B<I.length;++B){var U=I.charCodeAt(B);U<128?j+=1:U<2048?j+=2:U<55296||U>=57344?j+=3:(U=65536+((1023&U)<<10|1023&I.charCodeAt(++B)),j+=4)}return j+=this.encode(8*j),this.update(I),j},T.prototype.bytepad=function(I,$){for(var K=this.encode($),j=0;j<I.length;++j)K+=this.encodeString(I[j]);var D=$-K%$,B=[];return B.length=D,this.update(B),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var I=this.blocks,$=this.lastByteIndex,K=this.blockCount,j=this.s;if(I[$>>2]|=this.padding[3&$],this.lastByteIndex===this.byteCount)for(I[0]=I[K],$=1;$<K+1;++$)I[$]=0;for(I[K-1]|=2147483648,$=0;$<K;++$)j[$]^=I[$];Z(j)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var I,$=this.blockCount,K=this.s,j=this.outputBlocks,D=this.extraBytes,B=0,U=0,J="";U<j;){for(B=0;B<$&&U<j;++B,++U)I=K[B],J+=y[I>>4&15]+y[15&I]+y[I>>12&15]+y[I>>8&15]+y[I>>20&15]+y[I>>16&15]+y[I>>28&15]+y[I>>24&15];U%$==0&&(Z(K),B=0)}return D&&(I=K[B],J+=y[I>>4&15]+y[15&I],D>1&&(J+=y[I>>12&15]+y[I>>8&15]),D>2&&(J+=y[I>>20&15]+y[I>>16&15])),J},T.prototype.arrayBuffer=function(){this.finalize();var I,$=this.blockCount,K=this.s,j=this.outputBlocks,D=this.extraBytes,B=0,U=0,J=this.outputBits>>3;I=D?new ArrayBuffer(j+1<<2):new ArrayBuffer(J);for(var G=new Uint32Array(I);U<j;){for(B=0;B<$&&U<j;++B,++U)G[U]=K[B];U%$==0&&Z(K)}return D&&(G[B]=K[B],I=I.slice(0,J)),I},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var I,$,K=this.blockCount,j=this.s,D=this.outputBlocks,B=this.extraBytes,U=0,J=0,G=[];J<D;){for(U=0;U<K&&J<D;++U,++J)I=J<<2,$=j[U],G[I]=255&$,G[I+1]=$>>8&255,G[I+2]=$>>16&255,G[I+3]=$>>24&255;J%K==0&&Z(j)}return B&&(I=J<<2,$=j[U],G[I]=255&$,B>1&&(G[I+1]=$>>8&255),B>2&&(G[I+2]=$>>16&255)),G},q.prototype=new T,q.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var Z=function(I){var $,K,j,D,B,U,J,G,W,Y,ee,te,oe,fe,ne,ce,se,ae,he,me,le,ye,Se,pe,Oe,Le,_e,Fe,qe,Ee,je,ie,de,ke,Be,ge,Ue,De,we,Ve,et,Ie,Ge,Je,Re,He,tt,Te,We,Ze,Pe,rt,Ye,Ae,Xe,Qe,Ce,Ke,X,Q,re,ue,xe;for(j=0;j<48;j+=2)D=I[0]^I[10]^I[20]^I[30]^I[40],B=I[1]^I[11]^I[21]^I[31]^I[41],U=I[2]^I[12]^I[22]^I[32]^I[42],J=I[3]^I[13]^I[23]^I[33]^I[43],G=I[4]^I[14]^I[24]^I[34]^I[44],W=I[5]^I[15]^I[25]^I[35]^I[45],Y=I[6]^I[16]^I[26]^I[36]^I[46],ee=I[7]^I[17]^I[27]^I[37]^I[47],$=(te=I[8]^I[18]^I[28]^I[38]^I[48])^(U<<1|J>>>31),K=(oe=I[9]^I[19]^I[29]^I[39]^I[49])^(J<<1|U>>>31),I[0]^=$,I[1]^=K,I[10]^=$,I[11]^=K,I[20]^=$,I[21]^=K,I[30]^=$,I[31]^=K,I[40]^=$,I[41]^=K,$=D^(G<<1|W>>>31),K=B^(W<<1|G>>>31),I[2]^=$,I[3]^=K,I[12]^=$,I[13]^=K,I[22]^=$,I[23]^=K,I[32]^=$,I[33]^=K,I[42]^=$,I[43]^=K,$=U^(Y<<1|ee>>>31),K=J^(ee<<1|Y>>>31),I[4]^=$,I[5]^=K,I[14]^=$,I[15]^=K,I[24]^=$,I[25]^=K,I[34]^=$,I[35]^=K,I[44]^=$,I[45]^=K,$=G^(te<<1|oe>>>31),K=W^(oe<<1|te>>>31),I[6]^=$,I[7]^=K,I[16]^=$,I[17]^=K,I[26]^=$,I[27]^=K,I[36]^=$,I[37]^=K,I[46]^=$,I[47]^=K,$=Y^(D<<1|B>>>31),K=ee^(B<<1|D>>>31),I[8]^=$,I[9]^=K,I[18]^=$,I[19]^=K,I[28]^=$,I[29]^=K,I[38]^=$,I[39]^=K,I[48]^=$,I[49]^=K,fe=I[0],ne=I[1],He=I[11]<<4|I[10]>>>28,tt=I[10]<<4|I[11]>>>28,Fe=I[20]<<3|I[21]>>>29,qe=I[21]<<3|I[20]>>>29,Q=I[31]<<9|I[30]>>>23,re=I[30]<<9|I[31]>>>23,Ie=I[40]<<18|I[41]>>>14,Ge=I[41]<<18|I[40]>>>14,ke=I[2]<<1|I[3]>>>31,Be=I[3]<<1|I[2]>>>31,ce=I[13]<<12|I[12]>>>20,se=I[12]<<12|I[13]>>>20,Te=I[22]<<10|I[23]>>>22,We=I[23]<<10|I[22]>>>22,Ee=I[33]<<13|I[32]>>>19,je=I[32]<<13|I[33]>>>19,ue=I[42]<<2|I[43]>>>30,xe=I[43]<<2|I[42]>>>30,Ae=I[5]<<30|I[4]>>>2,Xe=I[4]<<30|I[5]>>>2,ge=I[14]<<6|I[15]>>>26,Ue=I[15]<<6|I[14]>>>26,ae=I[25]<<11|I[24]>>>21,he=I[24]<<11|I[25]>>>21,Ze=I[34]<<15|I[35]>>>17,Pe=I[35]<<15|I[34]>>>17,ie=I[45]<<29|I[44]>>>3,de=I[44]<<29|I[45]>>>3,pe=I[6]<<28|I[7]>>>4,Oe=I[7]<<28|I[6]>>>4,Qe=I[17]<<23|I[16]>>>9,Ce=I[16]<<23|I[17]>>>9,De=I[26]<<25|I[27]>>>7,we=I[27]<<25|I[26]>>>7,me=I[36]<<21|I[37]>>>11,le=I[37]<<21|I[36]>>>11,rt=I[47]<<24|I[46]>>>8,Ye=I[46]<<24|I[47]>>>8,Je=I[8]<<27|I[9]>>>5,Re=I[9]<<27|I[8]>>>5,Le=I[18]<<20|I[19]>>>12,_e=I[19]<<20|I[18]>>>12,Ke=I[29]<<7|I[28]>>>25,X=I[28]<<7|I[29]>>>25,Ve=I[38]<<8|I[39]>>>24,et=I[39]<<8|I[38]>>>24,ye=I[48]<<14|I[49]>>>18,Se=I[49]<<14|I[48]>>>18,I[0]=fe^~ce&ae,I[1]=ne^~se&he,I[10]=pe^~Le&Fe,I[11]=Oe^~_e&qe,I[20]=ke^~ge&De,I[21]=Be^~Ue&we,I[30]=Je^~He&Te,I[31]=Re^~tt&We,I[40]=Ae^~Qe&Ke,I[41]=Xe^~Ce&X,I[2]=ce^~ae&me,I[3]=se^~he&le,I[12]=Le^~Fe&Ee,I[13]=_e^~qe&je,I[22]=ge^~De&Ve,I[23]=Ue^~we&et,I[32]=He^~Te&Ze,I[33]=tt^~We&Pe,I[42]=Qe^~Ke&Q,I[43]=Ce^~X&re,I[4]=ae^~me&ye,I[5]=he^~le&Se,I[14]=Fe^~Ee&ie,I[15]=qe^~je&de,I[24]=De^~Ve&Ie,I[25]=we^~et&Ge,I[34]=Te^~Ze&rt,I[35]=We^~Pe&Ye,I[44]=Ke^~Q&ue,I[45]=X^~re&xe,I[6]=me^~ye&fe,I[7]=le^~Se&ne,I[16]=Ee^~ie&pe,I[17]=je^~de&Oe,I[26]=Ve^~Ie&ke,I[27]=et^~Ge&Be,I[36]=Ze^~rt&Je,I[37]=Pe^~Ye&Re,I[46]=Q^~ue&Ae,I[47]=re^~xe&Xe,I[8]=ye^~fe&ce,I[9]=Se^~ne&se,I[18]=ie^~pe&Le,I[19]=de^~Oe&_e,I[28]=Ie^~ke&ge,I[29]=Ge^~Be&Ue,I[38]=rt^~Je&He,I[39]=Ye^~Re&tt,I[48]=ue^~Ae&Qe,I[49]=xe^~Xe&Ce,I[0]^=S[j],I[1]^=S[j+1]};if(h)o.exports=l;else{for(d=0;d<x.length;++d)s[x[d]]=l[x[d]];v&&((p=function(){return l}.call(e,t,e,o))===void 0||(o.exports=p))}})()}).call(this,t(5),t(6))},function(o,e,t){t(7),t(24);var n=t(80);t.o(n,"payloadId")&&t.d(e,"payloadId",function(){return n.payloadId});var c=t(81);t.d(e,"payloadId",function(){return c.a}),t(82),t(83),t(88),t(89)},function(o,e,t){(function(n){var c=t(1),p=t(163);const a=n.WebSocket!==void 0?n.WebSocket:t(177);e.a=class{constructor(f){if(this.opts=f,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=f.protocol,this._version=f.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=f.subscriptions||[],this._netMonitor=f.netMonitor||new p.a,!f.url||typeof f.url!="string")throw new Error("Missing or invalid WebSocket url");this._url=f.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(f){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(f){}get connecting(){return this.readyState===0}set connected(f){}get connected(){return this.readyState===1}set closing(f){}get closing(){return this.readyState===2}set closed(f){}get closed(){return this.readyState===3}open(){this._socketCreate()}close(){this._socketClose()}send(f,s,u){if(!s||typeof s!="string")throw new Error("Missing or invalid topic field");this._socketSend({topic:s,type:"pub",payload:f,silent:!!u})}subscribe(f){this._socketSend({topic:f,type:"sub",payload:"",silent:!0})}on(f,s){this._events.push({event:f,callback:s})}_socketCreate(){if(this._nextSocket)return;const f=function(s,u,h){var v,b;const y=(s.startsWith("https")?s.replace("https","wss"):s.startsWith("http")?s.replace("http","ws"):s).split("?"),_=Object(c.isBrowser)()?{protocol:u,version:h,env:"browser",host:((v=Object(c.getLocation)())===null||v===void 0?void 0:v.host)||""}:{protocol:u,version:h,env:((b=Object(c.detectEnv)())===null||b===void 0?void 0:b.name)||""},E=Object(c.appendToQueryString)(Object(c.getQueryString)(y[1]||""),_);return y[0]+"?"+E}(this._url,this._protocol,this._version);if(this._nextSocket=new a(f),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=s=>this._socketReceive(s),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=s=>this._socketError(s),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(f){const s=JSON.stringify(f);this._socket&&this._socket.readyState===1?this._socket.send(s):(this._setToQueue(f),this._socketCreate())}async _socketReceive(f){let s;try{s=JSON.parse(f.data)}catch{return}if(this._socketSend({topic:s.topic,type:"ack",payload:"",silent:!0}),this._socket&&this._socket.readyState===1){const u=this._events.filter(h=>h.event==="message");u&&u.length&&u.forEach(h=>h.callback(s))}}_socketError(f){const s=this._events.filter(u=>u.event==="error");s&&s.length&&s.forEach(u=>u.callback(f))}_queueSubscriptions(){this._subscriptions.forEach(f=>this._queue.push({topic:f,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(f){this._queue.push(f)}_pushQueue(){this._queue.forEach(f=>this._socketSend(f)),this._queue=[]}}}).call(this,t(6))},function(o,e,t){e.a=class{constructor(){this._eventEmitters=[],typeof window!="undefined"&&window.addEventListener!==void 0&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(n,c){this._eventEmitters.push({event:n,callback:c})}trigger(n){let c=[];n&&(c=this._eventEmitters.filter(p=>p.event===n)),c.forEach(p=>{p.callback()})}}},function(o,e,t){var n=Object.prototype.hasOwnProperty,c="~";function p(){}function a(h,v,b){this.fn=h,this.context=v,this.once=b||!1}function f(h,v,b,y,_){if(typeof b!="function")throw new TypeError("The listener must be a function");var E=new a(b,y||h,_),S=c?c+v:v;return h._events[S]?h._events[S].fn?h._events[S]=[h._events[S],E]:h._events[S].push(E):(h._events[S]=E,h._eventsCount++),h}function s(h,v){--h._eventsCount==0?h._events=new p:delete h._events[v]}function u(){this._events=new p,this._eventsCount=0}Object.create&&(p.prototype=Object.create(null),new p().__proto__||(c=!1)),u.prototype.eventNames=function(){var h,v,b=[];if(this._eventsCount===0)return b;for(v in h=this._events)n.call(h,v)&&b.push(c?v.slice(1):v);return Object.getOwnPropertySymbols?b.concat(Object.getOwnPropertySymbols(h)):b},u.prototype.listeners=function(h){var v=c?c+h:h,b=this._events[v];if(!b)return[];if(b.fn)return[b.fn];for(var y=0,_=b.length,E=new Array(_);y<_;y++)E[y]=b[y].fn;return E},u.prototype.listenerCount=function(h){var v=c?c+h:h,b=this._events[v];return b?b.fn?1:b.length:0},u.prototype.emit=function(h,v,b,y,_,E){var S=c?c+h:h;if(!this._events[S])return!1;var k,O,M=this._events[S],C=arguments.length;if(M.fn){switch(M.once&&this.removeListener(h,M.fn,void 0,!0),C){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,v),!0;case 3:return M.fn.call(M.context,v,b),!0;case 4:return M.fn.call(M.context,v,b,y),!0;case 5:return M.fn.call(M.context,v,b,y,_),!0;case 6:return M.fn.call(M.context,v,b,y,_,E),!0}for(O=1,k=new Array(C-1);O<C;O++)k[O-1]=arguments[O];M.fn.apply(M.context,k)}else{var N,L=M.length;for(O=0;O<L;O++)switch(M[O].once&&this.removeListener(h,M[O].fn,void 0,!0),C){case 1:M[O].fn.call(M[O].context);break;case 2:M[O].fn.call(M[O].context,v);break;case 3:M[O].fn.call(M[O].context,v,b);break;case 4:M[O].fn.call(M[O].context,v,b,y);break;default:if(!k)for(N=1,k=new Array(C-1);N<C;N++)k[N-1]=arguments[N];M[O].fn.apply(M[O].context,k)}}return!0},u.prototype.on=function(h,v,b){return f(this,h,v,b,!1)},u.prototype.once=function(h,v,b){return f(this,h,v,b,!0)},u.prototype.removeListener=function(h,v,b,y){var _=c?c+h:h;if(!this._events[_])return this;if(!v)return s(this,_),this;var E=this._events[_];if(E.fn)E.fn!==v||y&&!E.once||b&&E.context!==b||s(this,_);else{for(var S=0,k=[],O=E.length;S<O;S++)(E[S].fn!==v||y&&!E[S].once||b&&E[S].context!==b)&&k.push(E[S]);k.length?this._events[_]=k.length===1?k[0]:k:s(this,_)}return this},u.prototype.removeAllListeners=function(h){var v;return h?(v=c?c+h:h,this._events[v]&&s(this,v)):(this._events=new p,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=c,u.EventEmitter=u,o.exports=u},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),function(c){for(var p in c)e.hasOwnProperty(p)||(e[p]=c[p])}(t(203));var n=t(56);e.XMLHttpRequestEventTarget=n.XMLHttpRequestEventTarget},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});const n=t(167),c=n.__importDefault(t(374)),p=n.__importDefault(t(178)),a=n.__importDefault(t(202)),f=t(1),s=t(224),u=t(334),h=t(338),v=t(339),b=t(353),y=t(369),_=t(372);e.default=class extends s{constructor(E){if(super({pollingInterval:E.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=p.default,this.qrcodeModalOptions=void 0,this.rpc=null,this.infuraId="",this.http=null,this.isConnecting=!1,this.connected=!1,this.connectCallbacks=[],this.accounts=[],this.chainId=1,this.rpcUrl="",this.enable=()=>n.__awaiter(this,void 0,void 0,function*(){const S=yield this.getWalletConnector();if(S)return this.start(),this.subscribeWalletConnector(),S.accounts;throw new Error("Failed to connect to WalleConnect")}),this.request=S=>n.__awaiter(this,void 0,void 0,function*(){return this.send(S)}),this.send=(S,k)=>n.__awaiter(this,void 0,void 0,function*(){if(typeof S=="string"){const O=S;let M=k;return O==="personal_sign"&&(M=(0,f.parsePersonalSign)(M)),this.sendAsyncPromise(O,M)}if((S=Object.assign({id:(0,f.payloadId)(),jsonrpc:"2.0"},S)).method==="personal_sign"&&(S.params=(0,f.parsePersonalSign)(S.params)),!k)return this.sendAsyncPromise(S.method,S.params);this.sendAsync(S,k)}),this.onConnect=S=>{this.connectCallbacks.push(S)},this.triggerConnect=S=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach(k=>k(S))},this.bridge=E.connector?E.connector.bridge:E.bridge||"https://bridge.walletconnect.org",this.qrcode=E.qrcode===void 0||E.qrcode!==!1,this.qrcodeModal=E.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=E.qrcodeModalOptions,this.wc=E.connector||new c.default({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:E==null?void 0:E.storageId,signingMethods:E==null?void 0:E.signingMethods,clientMeta:E==null?void 0:E.clientMeta}),this.rpc=E.rpc||null,!(this.rpc||E.infuraId&&typeof E.infuraId=="string"&&E.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=E.infuraId||"",this.chainId=(E==null?void 0:E.chainId)||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}disconnect(){return n.__awaiter(this,void 0,void 0,function*(){this.close()})}close(){return n.__awaiter(this,void 0,void 0,function*(){yield(yield this.getWalletConnector({disableSessionCreation:!0})).killSession(),yield this.onDisconnect()})}handleRequest(E){return n.__awaiter(this,void 0,void 0,function*(){try{let S,k=null;const O=yield this.getWalletConnector();switch(E.method){case"wc_killSession":yield this.close(),k=null;break;case"eth_accounts":k=O.accounts;break;case"eth_coinbase":k=O.accounts[0];break;case"eth_chainId":case"net_version":k=O.chainId;break;case"eth_uninstallFilter":this.sendAsync(E,M=>M),k=!0;break;default:S=yield this.handleOtherRequests(E)}return S||this.formatResponse(E,k)}catch(S){throw this.emit("error",S),S}})}handleOtherRequests(E){return n.__awaiter(this,void 0,void 0,function*(){if(!f.signingMethods.includes(E.method)&&E.method.startsWith("eth_"))return this.handleReadRequests(E);const S=yield this.getWalletConnector(),k=yield S.sendCustomRequest(E);return this.formatResponse(E,k)})}handleReadRequests(E){return n.__awaiter(this,void 0,void 0,function*(){if(!this.http){const S=new Error("HTTP Connection not available");throw this.emit("error",S),S}return this.http.send(E)})}formatResponse(E,S){return{id:E.id,jsonrpc:E.jsonrpc,result:S}}getWalletConnector(E={}){const{disableSessionCreation:S=!1}=E;return new Promise((k,O)=>{const M=this.wc;this.isConnecting?this.onConnect(C=>k(C)):M.connected||S?(this.connected||(this.connected=!0,this.updateState(M.session)),k(M)):(this.isConnecting=!0,M.on("modal_closed",()=>{O(new Error("User closed modal"))}),M.createSession({chainId:this.chainId}).then(()=>{M.on("connect",(C,N)=>{if(C)return this.isConnecting=!1,O(C);this.isConnecting=!1,this.connected=!0,N&&this.updateState(N.params[0]),this.emit("connect"),this.triggerConnect(M),k(M)})}).catch(C=>{this.isConnecting=!1,O(C)}))})}subscribeWalletConnector(){return n.__awaiter(this,void 0,void 0,function*(){const E=yield this.getWalletConnector();E.on("disconnect",S=>{S?this.emit("error",S):this.onDisconnect()}),E.on("session_update",(S,k)=>{S?this.emit("error",S):this.updateState(k.params[0])})})}onDisconnect(){return n.__awaiter(this,void 0,void 0,function*(){yield this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1})}updateState(E){return n.__awaiter(this,void 0,void 0,function*(){const{accounts:S,chainId:k,networkId:O,rpcUrl:M}=E;(!this.accounts||S&&this.accounts!==S)&&(this.accounts=S,this.emit("accountsChanged",S)),(!this.chainId||k&&this.chainId!==k)&&(this.chainId=k,this.emit("chainChanged",k)),(!this.networkId||O&&this.networkId!==O)&&(this.networkId=O,this.emit("networkChanged",O)),this.updateRpcUrl(this.chainId,M||"")})}updateRpcUrl(E,S=""){const k={infuraId:this.infuraId,custom:this.rpc||void 0};(S=S||(0,f.getRpcUrl)(E,k))?(this.rpcUrl=S,this.updateHttpConnection()):this.emit("error",new Error("No RPC Url available for chainId: "+E))}updateHttpConnection(){this.rpcUrl&&(this.http=new a.default(this.rpcUrl),this.http.on("payload",E=>this.emit("payload",E)),this.http.on("error",E=>this.emit("error",E)))}sendAsyncPromise(E,S){return new Promise((k,O)=>{this.sendAsync({id:(0,f.payloadId)(),jsonrpc:"2.0",method:E,params:S||[]},(M,C)=>{M?O(M):k(C.result)})})}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new h({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new u),this.addProvider(new _),this.addProvider(new v),this.addProvider(new y),this.addProvider(new b(this.configWallet())),this.addProvider({handleRequest:(E,S,k)=>n.__awaiter(this,void 0,void 0,function*(){try{const{error:O,result:M}=yield this.handleRequest(E);k(O,M)}catch(O){k(O)}}),setEngine:E=>E})}configWallet(){return{getAccounts:E=>n.__awaiter(this,void 0,void 0,function*(){try{const S=(yield this.getWalletConnector()).accounts;S&&S.length?E(null,S):E(new Error("Failed to get accounts"))}catch(S){E(S)}}),processMessage:(E,S)=>n.__awaiter(this,void 0,void 0,function*(){try{const k=yield this.getWalletConnector(),O=yield k.signMessage([E.from,E.data]);S(null,O)}catch(k){S(k)}}),processPersonalMessage:(E,S)=>n.__awaiter(this,void 0,void 0,function*(){try{const k=yield this.getWalletConnector(),O=yield k.signPersonalMessage([E.data,E.from]);S(null,O)}catch(k){S(k)}}),processSignTransaction:(E,S)=>n.__awaiter(this,void 0,void 0,function*(){try{const k=yield this.getWalletConnector(),O=yield k.signTransaction(E);S(null,O)}catch(k){S(k)}}),processTransaction:(E,S)=>n.__awaiter(this,void 0,void 0,function*(){try{const k=yield this.getWalletConnector(),O=yield k.sendTransaction(E);S(null,O)}catch(k){S(k)}}),processTypedMessage:(E,S)=>n.__awaiter(this,void 0,void 0,function*(){try{const k=yield this.getWalletConnector(),O=yield k.signTypedData([E.from,E.data]);S(null,O)}catch(k){S(k)}})}}}},function(o,e,t){t.r(e),t.d(e,"__extends",function(){return c}),t.d(e,"__assign",function(){return p}),t.d(e,"__rest",function(){return a}),t.d(e,"__decorate",function(){return f}),t.d(e,"__param",function(){return s}),t.d(e,"__metadata",function(){return u}),t.d(e,"__awaiter",function(){return h}),t.d(e,"__generator",function(){return v}),t.d(e,"__exportStar",function(){return b}),t.d(e,"__values",function(){return y}),t.d(e,"__read",function(){return _}),t.d(e,"__spread",function(){return E}),t.d(e,"__await",function(){return S}),t.d(e,"__asyncGenerator",function(){return k}),t.d(e,"__asyncDelegator",function(){return O}),t.d(e,"__asyncValues",function(){return M}),t.d(e,"__makeTemplateObject",function(){return C}),t.d(e,"__importStar",function(){return N}),t.d(e,"__importDefault",function(){return L});/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var n=function(F,V){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,z){H.__proto__=z}||function(H,z){for(var R in z)z.hasOwnProperty(R)&&(H[R]=z[R])})(F,V)};function c(F,V){function H(){this.constructor=F}n(F,V),F.prototype=V===null?Object.create(V):(H.prototype=V.prototype,new H)}var p=function(){return(p=Object.assign||function(F){for(var V,H=1,z=arguments.length;H<z;H++)for(var R in V=arguments[H])Object.prototype.hasOwnProperty.call(V,R)&&(F[R]=V[R]);return F}).apply(this,arguments)};function a(F,V){var H={};for(var z in F)Object.prototype.hasOwnProperty.call(F,z)&&V.indexOf(z)<0&&(H[z]=F[z]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(z=Object.getOwnPropertySymbols(F);R<z.length;R++)V.indexOf(z[R])<0&&(H[z[R]]=F[z[R]])}return H}function f(F,V,H,z){var R,l=arguments.length,x=l<3?V:z===null?z=Object.getOwnPropertyDescriptor(V,H):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(F,V,H,z);else for(var d=F.length-1;d>=0;d--)(R=F[d])&&(x=(l<3?R(x):l>3?R(V,H,x):R(V,H))||x);return l>3&&x&&Object.defineProperty(V,H,x),x}function s(F,V){return function(H,z){V(H,z,F)}}function u(F,V){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(F,V)}function h(F,V,H,z){return new(H||(H=Promise))(function(R,l){function x(g){try{m(z.next(g))}catch(w){l(w)}}function d(g){try{m(z.throw(g))}catch(w){l(w)}}function m(g){g.done?R(g.value):new H(function(w){w(g.value)}).then(x,d)}m((z=z.apply(F,V||[])).next())})}function v(F,V){var H,z,R,l,x={label:0,sent:function(){if(1&R[0])throw R[1];return R[1]},trys:[],ops:[]};return l={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(m){return function(g){return function(w){if(H)throw new TypeError("Generator is already executing.");for(;x;)try{if(H=1,z&&(R=2&w[0]?z.return:w[0]?z.throw||((R=z.return)&&R.call(z),0):z.next)&&!(R=R.call(z,w[1])).done)return R;switch(z=0,R&&(w=[2&w[0],R.value]),w[0]){case 0:case 1:R=w;break;case 4:return x.label++,{value:w[1],done:!1};case 5:x.label++,z=w[1],w=[0];continue;case 7:w=x.ops.pop(),x.trys.pop();continue;default:if(R=x.trys,!((R=R.length>0&&R[R.length-1])||w[0]!==6&&w[0]!==2)){x=0;continue}if(w[0]===3&&(!R||w[1]>R[0]&&w[1]<R[3])){x.label=w[1];break}if(w[0]===6&&x.label<R[1]){x.label=R[1],R=w;break}if(R&&x.label<R[2]){x.label=R[2],x.ops.push(w);break}R[2]&&x.ops.pop(),x.trys.pop();continue}w=V.call(F,x)}catch(A){w=[6,A],z=0}finally{H=R=0}if(5&w[0])throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}([m,g])}}}function b(F,V){for(var H in F)V.hasOwnProperty(H)||(V[H]=F[H])}function y(F){var V=typeof Symbol=="function"&&F[Symbol.iterator],H=0;return V?V.call(F):{next:function(){return F&&H>=F.length&&(F=void 0),{value:F&&F[H++],done:!F}}}}function _(F,V){var H=typeof Symbol=="function"&&F[Symbol.iterator];if(!H)return F;var z,R,l=H.call(F),x=[];try{for(;(V===void 0||V-- >0)&&!(z=l.next()).done;)x.push(z.value)}catch(d){R={error:d}}finally{try{z&&!z.done&&(H=l.return)&&H.call(l)}finally{if(R)throw R.error}}return x}function E(){for(var F=[],V=0;V<arguments.length;V++)F=F.concat(_(arguments[V]));return F}function S(F){return this instanceof S?(this.v=F,this):new S(F)}function k(F,V,H){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var z,R=H.apply(F,V||[]),l=[];return z={},x("next"),x("throw"),x("return"),z[Symbol.asyncIterator]=function(){return this},z;function x(A){R[A]&&(z[A]=function(P){return new Promise(function(T,q){l.push([A,P,T,q])>1||d(A,P)})})}function d(A,P){try{(T=R[A](P)).value instanceof S?Promise.resolve(T.value.v).then(m,g):w(l[0][2],T)}catch(q){w(l[0][3],q)}var T}function m(A){d("next",A)}function g(A){d("throw",A)}function w(A,P){A(P),l.shift(),l.length&&d(l[0][0],l[0][1])}}function O(F){var V,H;return V={},z("next"),z("throw",function(R){throw R}),z("return"),V[Symbol.iterator]=function(){return this},V;function z(R,l){V[R]=F[R]?function(x){return(H=!H)?{value:S(F[R](x)),done:R==="return"}:l?l(x):x}:l}}function M(F){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var V,H=F[Symbol.asyncIterator];return H?H.call(F):(F=y(F),V={},z("next"),z("throw"),z("return"),V[Symbol.asyncIterator]=function(){return this},V);function z(R){V[R]=F[R]&&function(l){return new Promise(function(x,d){(function(m,g,w,A){Promise.resolve(A).then(function(P){m({value:P,done:w})},g)})(x,d,(l=F[R](l)).done,l.value)})}}}function C(F,V){return Object.defineProperty?Object.defineProperty(F,"raw",{value:V}):F.raw=V,F}function N(F){if(F&&F.__esModule)return F;var V={};if(F!=null)for(var H in F)Object.hasOwnProperty.call(F,H)&&(V[H]=F[H]);return V.default=F,V}function L(F){return F&&F.__esModule?F:{default:F}}},function(o,e){},function(o,e,t){e.byteLength=function(v){var b=u(v),y=b[0],_=b[1];return 3*(y+_)/4-_},e.toByteArray=function(v){var b,y,_=u(v),E=_[0],S=_[1],k=new p(function(C,N,L){return 3*(N+L)/4-L}(0,E,S)),O=0,M=S>0?E-4:E;for(y=0;y<M;y+=4)b=c[v.charCodeAt(y)]<<18|c[v.charCodeAt(y+1)]<<12|c[v.charCodeAt(y+2)]<<6|c[v.charCodeAt(y+3)],k[O++]=b>>16&255,k[O++]=b>>8&255,k[O++]=255&b;return S===2&&(b=c[v.charCodeAt(y)]<<2|c[v.charCodeAt(y+1)]>>4,k[O++]=255&b),S===1&&(b=c[v.charCodeAt(y)]<<10|c[v.charCodeAt(y+1)]<<4|c[v.charCodeAt(y+2)]>>2,k[O++]=b>>8&255,k[O++]=255&b),k},e.fromByteArray=function(v){for(var b,y=v.length,_=y%3,E=[],S=0,k=y-_;S<k;S+=16383)E.push(h(v,S,S+16383>k?k:S+16383));return _===1?(b=v[y-1],E.push(n[b>>2]+n[b<<4&63]+"==")):_===2&&(b=(v[y-2]<<8)+v[y-1],E.push(n[b>>10]+n[b>>4&63]+n[b<<2&63]+"=")),E.join("")};for(var n=[],c=[],p=typeof Uint8Array!="undefined"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,s=a.length;f<s;++f)n[f]=a[f],c[a.charCodeAt(f)]=f;function u(v){var b=v.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=v.indexOf("=");return y===-1&&(y=b),[y,y===b?0:4-y%4]}function h(v,b,y){for(var _,E,S=[],k=b;k<y;k+=3)_=(v[k]<<16&16711680)+(v[k+1]<<8&65280)+(255&v[k+2]),S.push(n[(E=_)>>18&63]+n[E>>12&63]+n[E>>6&63]+n[63&E]);return S.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(o,e){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */e.read=function(t,n,c,p,a){var f,s,u=8*a-p-1,h=(1<<u)-1,v=h>>1,b=-7,y=c?a-1:0,_=c?-1:1,E=t[n+y];for(y+=_,f=E&(1<<-b)-1,E>>=-b,b+=u;b>0;f=256*f+t[n+y],y+=_,b-=8);for(s=f&(1<<-b)-1,f>>=-b,b+=p;b>0;s=256*s+t[n+y],y+=_,b-=8);if(f===0)f=1-v;else{if(f===h)return s?NaN:1/0*(E?-1:1);s+=Math.pow(2,p),f-=v}return(E?-1:1)*s*Math.pow(2,f-p)},e.write=function(t,n,c,p,a,f){var s,u,h,v=8*f-a-1,b=(1<<v)-1,y=b>>1,_=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=p?0:f-1,S=p?1:-1,k=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(u=isNaN(n)?1:0,s=b):(s=Math.floor(Math.log(n)/Math.LN2),n*(h=Math.pow(2,-s))<1&&(s--,h*=2),(n+=s+y>=1?_/h:_*Math.pow(2,1-y))*h>=2&&(s++,h/=2),s+y>=b?(u=0,s=b):s+y>=1?(u=(n*h-1)*Math.pow(2,a),s+=y):(u=n*Math.pow(2,y-1)*Math.pow(2,a),s=0));a>=8;t[c+E]=255&u,E+=S,u/=256,a-=8);for(s=s<<a|u,v+=a;v>0;t[c+E]=255&s,E+=S,s/=256,v-=8);t[c+E-S]|=128*k}},function(o,e){(function(t){o.exports=t}).call(this,{})},function(o,e,t){(function(n){function c(){return(n==null?void 0:n.crypto)||(n==null?void 0:n.msCrypto)||{}}function p(){const a=c();return a.subtle||a.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=c,e.getSubtleCrypto=p,e.isBrowserCryptoAvailable=function(){return!!c()&&!!p()}}).call(this,t(6))},function(o,e,t){(function(n){function c(){return typeof document=="undefined"&&typeof navigator!="undefined"&&navigator.product==="ReactNative"}function p(){return n!==void 0&&n.versions!==void 0&&n.versions.node!==void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=c,e.isNode=p,e.isBrowser=function(){return!c()&&!p()}}).call(this,t(5))},function(o,e,t){o.exports=n=>encodeURIComponent(n).replace(/[!'()*]/g,c=>"%"+c.charCodeAt(0).toString(16).toUpperCase())},function(o,e,t){var n=new RegExp("%[a-f0-9]{2}","gi"),c=new RegExp("(%[a-f0-9]{2})+","gi");function p(f,s){try{return decodeURIComponent(f.join(""))}catch{}if(f.length===1)return f;s=s||1;var u=f.slice(0,s),h=f.slice(s);return Array.prototype.concat.call([],p(u),p(h))}function a(f){try{return decodeURIComponent(f)}catch{for(var s=f.match(n),u=1;u<s.length;u++)s=(f=p(s,u).join("")).match(n);return f}}o.exports=function(f){if(typeof f!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof f+"`");try{return f=f.replace(/\+/g," "),decodeURIComponent(f)}catch{return function(u){for(var h={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},v=c.exec(u);v;){try{h[v[0]]=decodeURIComponent(v[0])}catch{var b=a(v[0]);b!==v[0]&&(h[v[0]]=b)}v=c.exec(u)}h["%C2"]="\uFFFD";for(var y=Object.keys(h),_=0;_<y.length;_++){var E=y[_];u=u.replace(new RegExp(E,"g"),h[E])}return u}(f)}}},function(o,e,t){o.exports=(n,c)=>{if(typeof n!="string"||typeof c!="string")throw new TypeError("Expected the arguments to be of type `string`");if(c==="")return[n];const p=n.indexOf(c);return p===-1?[n]:[n.slice(0,p),n.slice(p+c.length)]}},function(o,e,t){o.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(o,e,t){(function(n){function c(F){return F&&typeof F=="object"&&"default"in F?F.default:F}var p=t(76),a=c(t(179)),f=c(t(200)),s=t(376);typeof Symbol!="undefined"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),typeof Symbol!="undefined"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function u(F){return s.createElement("div",{className:"walletconnect-modal__header"},s.createElement("img",{src:"data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",className:"walletconnect-modal__headerLogo"}),s.createElement("p",null,"WalletConnect"),s.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:F.onClose},s.createElement("div",{id:"walletconnect-qrcode-close",className:"walletconnect-modal__close__icon"},s.createElement("div",{className:"walletconnect-modal__close__line1"}),s.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function h(F){return s.createElement("a",{className:"walletconnect-connect__button",href:F.href,id:"walletconnect-connect-button-"+F.name,onClick:F.onClick,rel:"noopener noreferrer",style:{backgroundColor:F.color},target:"_blank"},F.name)}function v(F){var V=F.color,H=F.href,z=F.name,R=F.logo,l=F.onClick;return s.createElement("a",{className:"walletconnect-modal__base__row",href:H,onClick:l,rel:"noopener noreferrer",target:"_blank"},s.createElement("h3",{className:"walletconnect-modal__base__row__h3"},z),s.createElement("div",{className:"walletconnect-modal__base__row__right"},s.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+R+"') "+V,backgroundSize:"100%"}}),s.createElement("img",{src:"data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E",className:"walletconnect-modal__base__row__right__caret"})))}function b(F){var V=F.color,H=F.href,z=F.name,R=F.logo,l=F.onClick,x=window.innerWidth<768?(z.length>8?2.5:2.7)+"vw":"inherit";return s.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:H,onClick:l,rel:"noopener noreferrer",target:"_blank"},s.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+R+"') "+V,backgroundSize:"100%"}}),s.createElement("div",{style:{fontSize:x},className:"walletconnect-connect__button__text"},z))}function y(F){var V=p.isAndroid(),H=s.useState(""),z=H[0],R=H[1],l=s.useState(""),x=l[0],d=l[1],m=s.useState(1),g=m[0],w=m[1],A=x?F.links.filter(function(j){return j.name.toLowerCase().includes(x.toLowerCase())}):F.links,P=F.errorMessage,T=x||A.length>5,q=Math.ceil(A.length/12),Z=[12*(g-1)+1,12*g],I=A.length?A.filter(function(j,D){return D+1>=Z[0]&&D+1<=Z[1]}):[],$=!(V||!(q>1)),K=void 0;return s.createElement("div",null,s.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},V?F.text.connect_mobile_wallet:F.text.choose_preferred_wallet),!V&&s.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:z,onChange:function(j){R(j.target.value),clearTimeout(K),j.target.value?K=setTimeout(function(){d(j.target.value),w(1)},1e3):(R(""),d(""),w(1))}}),s.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(V?"__android":T&&A.length?"__wrap":"")},V?s.createElement(h,{name:F.text.connect,color:"rgb(64, 153, 255)",href:F.uri,onClick:s.useCallback(function(){p.saveMobileLinkInfo({name:"Unknown",href:F.uri})},[])}):I.length?I.map(function(j){var D=j.color,B=j.name,U=j.shortName,J=j.logo,G=p.formatIOSMobile(F.uri,j),W=s.useCallback(function(){p.saveMobileLinkInfo({name:B,href:G})},[I]);return T?s.createElement(b,{color:D,href:G,name:U||B,logo:J,onClick:W}):s.createElement(v,{color:D,href:G,name:B,logo:J,onClick:W})}):s.createElement(s.Fragment,null,s.createElement("p",null,P.length?F.errorMessage:F.links.length&&!A.length?F.text.no_wallets_found:F.text.loading))),$&&s.createElement("div",{className:"walletconnect-modal__footer"},Array(q).fill(0).map(function(j,D){var B=D+1,U=g===B;return s.createElement("a",{style:{margin:"auto 10px",fontWeight:U?"bold":"normal"},onClick:function(){return w(B)}},B)})))}function _(F){var V=!!F.message.trim();return s.createElement("div",{className:"walletconnect-qrcode__notification"+(V?" notification__show":"")},F.message)}function E(F){var V=s.useState(""),H=V[0],z=V[1],R=s.useState(""),l=R[0],x=R[1];return s.useEffect(function(){try{return Promise.resolve(function(d){try{var m="";return Promise.resolve(a.toString(d,{margin:0,type:"svg"})).then(function(g){return typeof g=="string"&&(m=g.replace("<svg",'<svg class="walletconnect-qrcode__image"')),m})}catch(g){return Promise.reject(g)}}(F.uri)).then(function(d){x(d)})}catch(d){Promise.reject(d)}},[]),s.createElement("div",null,s.createElement("p",{id:"walletconnect-qrcode-text",className:"walletconnect-qrcode__text"},F.text.scan_qrcode_with_wallet),s.createElement("div",{dangerouslySetInnerHTML:{__html:l}}),s.createElement("div",{className:"walletconnect-modal__footer"},s.createElement("a",{onClick:function(){f(F.uri)?(z(F.text.copied_to_clipboard),setInterval(function(){return z("")},1200)):(z("Error"),setInterval(function(){return z("")},1200))}},F.text.copy_to_clipboard)),s.createElement(_,{message:H}))}function S(F){var V=p.isAndroid(),H=p.isMobile(),z=H?F.qrcodeModalOptions&&F.qrcodeModalOptions.mobileLinks?F.qrcodeModalOptions.mobileLinks:void 0:F.qrcodeModalOptions&&F.qrcodeModalOptions.desktopLinks?F.qrcodeModalOptions.desktopLinks:void 0,R=s.useState(!1),l=R[0],x=R[1],d=s.useState(!1),m=d[0],g=d[1],w=s.useState(!H),A=w[0],P=w[1],T={mobile:H,text:F.text,uri:F.uri,qrcodeModalOptions:F.qrcodeModalOptions},q=s.useState(""),Z=q[0],I=q[1],$=s.useState(!1),K=$[0],j=$[1],D=s.useState([]),B=D[0],U=D[1],J=s.useState(""),G=J[0],W=J[1],Y=function(){m||l||z&&!z.length||B.length>0||s.useEffect(function(){(function(){try{if(V)return Promise.resolve();x(!0);var te=function(oe,fe){try{var ne=oe()}catch(ce){return fe(ce)}return ne&&ne.then?ne.then(void 0,fe):ne}(function(){var oe=F.qrcodeModalOptions&&F.qrcodeModalOptions.registryUrl?F.qrcodeModalOptions.registryUrl:p.getWalletRegistryUrl();return Promise.resolve(fetch(oe)).then(function(fe){return Promise.resolve(fe.json()).then(function(ne){var ce=ne.listings,se=H?"mobile":"desktop",ae=p.getMobileLinkRegistry(p.formatMobileRegistry(ce,se),z);x(!1),g(!0),W(ae.length?"":F.text.no_supported_wallets),U(ae);var he=ae.length===1;he&&(I(p.formatIOSMobile(F.uri,ae[0])),P(!0)),j(he)})})},function(oe){x(!1),g(!0),W(F.text.something_went_wrong),console.error(oe)});Promise.resolve(te&&te.then?te.then(function(){}):void 0)}catch(oe){return Promise.reject(oe)}})()})};Y();var ee=H?A:!A;return s.createElement("div",{id:"walletconnect-qrcode-modal",className:"walletconnect-qrcode__base animated fadeIn"},s.createElement("div",{className:"walletconnect-modal__base"},s.createElement(u,{onClose:F.onClose}),K&&A?s.createElement("div",{className:"walletconnect-modal__single_wallet"},s.createElement("a",{onClick:function(){return p.saveMobileLinkInfo({name:B[0].name,href:Z})},href:Z,rel:"noopener noreferrer",target:"_blank"},F.text.connect_with+" "+(K?B[0].name:"")+" \u203A")):V||l||!l&&B.length?s.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(ee?" right__selected":"")},s.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),H?s.createElement(s.Fragment,null,s.createElement("a",{onClick:function(){return P(!1),Y()}},F.text.mobile),s.createElement("a",{onClick:function(){return P(!0)}},F.text.qrcode)):s.createElement(s.Fragment,null,s.createElement("a",{onClick:function(){return P(!0)}},F.text.qrcode),s.createElement("a",{onClick:function(){return P(!1),Y()}},F.text.desktop))):null,s.createElement("div",null,A||!V&&!l&&!B.length?s.createElement(E,Object.assign({},T)):s.createElement(y,Object.assign({},T,{links:B,errorMessage:G})))))}var k={de:{choose_preferred_wallet:"W\xE4hle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterst\xFCtzten Wallet",no_wallets_found:"keine Wallet gefunden"},en:{choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},es:{choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera m\xF3vil",scan_qrcode_with_wallet:"Escanea el c\xF3digo QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"C\xF3digo QR",mobile:"M\xF3vil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo sali\xF3 mal",no_supported_wallets:"Todav\xEDa no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr:{choose_preferred_wallet:"Choisissez votre portefeuille pr\xE9f\xE9r\xE9",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copi\xE9!",connect_with:"Connectez-vous \xE0 l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourn\xE9",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouv\xE9"},ko:{choose_preferred_wallet:"\uC6D0\uD558\uB294 \uC9C0\uAC11\uC744 \uC120\uD0DD\uD558\uC138\uC694",connect_mobile_wallet:"\uBAA8\uBC14\uC77C \uC9C0\uAC11\uACFC \uC5F0\uACB0",scan_qrcode_with_wallet:"WalletConnect \uC9C0\uC6D0 \uC9C0\uAC11\uC5D0\uC11C QR\uCF54\uB4DC\uB97C \uC2A4\uCE94\uD558\uC138\uC694",connect:"\uC5F0\uACB0",qrcode:"QR \uCF54\uB4DC",mobile:"\uBAA8\uBC14\uC77C",desktop:"\uB370\uC2A4\uD06C\uD0D1",copy_to_clipboard:"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC",copied_to_clipboard:"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4!",connect_with:"\uC640 \uC5F0\uACB0\uD558\uB2E4",loading:"\uB85C\uB4DC \uC911...",something_went_wrong:"\uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.",no_supported_wallets:"\uC544\uC9C1 \uC9C0\uC6D0\uB418\uB294 \uC9C0\uAC11\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",no_wallets_found:"\uC9C0\uAC11\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"},pt:{choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se \xE0 carteira m\xF3vel",scan_qrcode_with_wallet:"Ler o c\xF3digo QR com uma carteira compat\xEDvel com WalletConnect",connect:"Conectar",qrcode:"C\xF3digo QR",mobile:"M\xF3vel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda n\xE3o h\xE1 carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh:{choose_preferred_wallet:"\u9009\u62E9\u4F60\u7684\u94B1\u5305",connect_mobile_wallet:"\u8FDE\u63A5\u81F3\u79FB\u52A8\u7AEF\u94B1\u5305",scan_qrcode_with_wallet:"\u4F7F\u7528\u517C\u5BB9 WalletConnect \u7684\u94B1\u5305\u626B\u63CF\u4E8C\u7EF4\u7801",connect:"\u8FDE\u63A5",qrcode:"\u4E8C\u7EF4\u7801",mobile:"\u79FB\u52A8",desktop:"\u684C\u9762",copy_to_clipboard:"\u590D\u5236\u5230\u526A\u8D34\u677F",copied_to_clipboard:"\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F\uFF01",connect_with:"\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u8FDE\u63A5",loading:"\u6B63\u5728\u52A0\u8F7D...",something_went_wrong:"\u51FA\u4E86\u95EE\u9898",no_supported_wallets:"\u76EE\u524D\u8FD8\u6CA1\u6709\u652F\u6301\u7684\u94B1\u5305",no_wallets_found:"\u6CA1\u6709\u627E\u5230\u94B1\u5305"},fa:{choose_preferred_wallet:"\u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u062E\u0648\u062F \u0631\u0627 \u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F",connect_mobile_wallet:"\u0628\u0647 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0648\u0635\u0644 \u0634\u0648\u06CC\u062F",scan_qrcode_with_wallet:"\u06A9\u062F QR \u0631\u0627 \u0628\u0627 \u06CC\u06A9 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0633\u0627\u0632\u06AF\u0627\u0631 \u0628\u0627 WalletConnect \u0627\u0633\u06A9\u0646 \u06A9\u0646\u06CC\u062F",connect:"\u0627\u062A\u0635\u0627\u0644",qrcode:"\u06A9\u062F QR",mobile:"\u0633\u06CC\u0627\u0631",desktop:"\u062F\u0633\u06A9\u062A\u0627\u067E",copy_to_clipboard:"\u06A9\u067E\u06CC \u0628\u0647 \u06A9\u0644\u06CC\u067E \u0628\u0648\u0631\u062F",copied_to_clipboard:"\u062F\u0631 \u06A9\u0644\u06CC\u067E \u0628\u0648\u0631\u062F \u06A9\u067E\u06CC \u0634\u062F!",connect_with:"\u0627\u0631\u062A\u0628\u0627\u0637 \u0628\u0627",loading:"...\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",something_went_wrong:"\u0645\u0634\u06A9\u0644\u06CC \u067E\u06CC\u0634 \u0622\u0645\u062F",no_supported_wallets:"\u0647\u0646\u0648\u0632 \u0647\u06CC\u0686 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0634\u062F\u0647 \u0627\u06CC \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F",no_wallets_found:"\u0647\u06CC\u0686 \u06A9\u06CC\u0641 \u067E\u0648\u0644\u06CC \u067E\u06CC\u062F\u0627 \u0646\u0634\u062F"}};function O(){var F=p.getDocumentOrThrow(),V=F.getElementById("walletconnect-qrcode-modal");V&&(V.className=V.className.replace("fadeIn","fadeOut"),setTimeout(function(){var H=F.getElementById("walletconnect-wrapper");H&&F.body.removeChild(H)},300))}function M(F){return function(){O(),F&&F()}}function C(F,V,H){(function(){var l=p.getDocumentOrThrow(),x=l.getElementById("walletconnect-style-sheet");x&&l.head.removeChild(x);var d=l.createElement("style");d.setAttribute("id","walletconnect-style-sheet"),d.innerText=`:root {
--animation-duration: 300ms;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.animated {
animation-duration: var(--animation-duration);
animation-fill-mode: both;
}
.fadeIn {
animation-name: fadeIn;
}
.fadeOut {
animation-name: fadeOut;
}
#walletconnect-wrapper {
-webkit-user-select: none;
align-items: center;
display: flex;
height: 100%;
justify-content: center;
left: 0;
pointer-events: none;
position: fixed;
top: 0;
user-select: none;
width: 100%;
z-index: 99999999999999;
}
.walletconnect-modal__headerLogo {
height: 21px;
}
.walletconnect-modal__header p {
color: #ffffff;
font-size: 20px;
font-weight: 600;
margin: 0;
align-items: flex-start;
display: flex;
flex: 1;
margin-left: 5px;
}
.walletconnect-modal__close__wrapper {
position: absolute;
top: 0px;
right: 0px;
z-index: 10000;
background: white;
border-radius: 26px;
padding: 6px;
box-sizing: border-box;
width: 26px;
height: 26px;
cursor: pointer;
}
.walletconnect-modal__close__icon {
position: relative;
top: 7px;
right: 0;
display: flex;
align-items: center;
justify-content: center;
transform: rotate(45deg);
}
.walletconnect-modal__close__line1 {
position: absolute;
width: 100%;
border: 1px solid rgb(48, 52, 59);
}
.walletconnect-modal__close__line2 {
position: absolute;
width: 100%;
border: 1px solid rgb(48, 52, 59);
transform: rotate(90deg);
}
.walletconnect-qrcode__base {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
background: rgba(37, 41, 46, 0.95);
height: 100%;
left: 0;
pointer-events: auto;
position: fixed;
top: 0;
transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
width: 100%;
will-change: opacity;
padding: 40px;
box-sizing: border-box;
}
.walletconnect-qrcode__text {
color: rgba(60, 66, 82, 0.6);
font-size: 16px;
font-weight: 600;
letter-spacing: 0;
line-height: 1.1875em;
margin: 10px 0 20px 0;
text-align: center;
width: 100%;
}
@media only screen and (max-width: 768px) {
.walletconnect-qrcode__text {
font-size: 4vw;
}
}
@media only screen and (max-width: 320px) {
.walletconnect-qrcode__text {
font-size: 14px;
}
}
.walletconnect-qrcode__image {
width: calc(100% - 30px);
box-sizing: border-box;
cursor: none;
margin: 0 auto;
}
.walletconnect-qrcode__notification {
position: absolute;
bottom: 0;
left: 0;
right: 0;
font-size: 16px;
padding: 16px 20px;
border-radius: 16px;
text-align: center;
transition: all 0.1s ease-in-out;
background: white;
color: black;
margin-bottom: -60px;
opacity: 0;
}
.walletconnect-qrcode__notification.notification__show {
opacity: 1;
}
@media only screen and (max-width: 768px) {
.walletconnect-modal__header {
height: 130px;
}
.walletconnect-modal__base {
overflow: auto;
}
}
@media only screen and (min-device-width: 415px) and (max-width: 768px) {
#content {
max-width: 768px;
box-sizing: border-box;
}
}
@media only screen and (min-width: 375px) and (max-width: 415px) {
#content {
max-width: 414px;
box-sizing: border-box;
}
}
@media only screen and (min-width: 320px) and (max-width: 375px) {
#content {
max-width: 375px;
box-sizing: border-box;
}
}
@media only screen and (max-width: 320px) {
#content {
max-width: 320px;
box-sizing: border-box;
}
}
.walletconnect-modal__base {
-webkit-font-smoothing: antialiased;
background: #ffffff;
border-radius: 24px;
box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);
font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,
-apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
"Open Sans", "Helvetica Neue", sans-serif;
margin-top: 41px;
padding: 24px 24px 22px;
pointer-events: auto;
position: relative;
text-align: center;
transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
will-change: transform;
overflow: visible;
transform: translateY(-50%);
top: 50%;
max-width: 500px;
margin: auto;
}
@media only screen and (max-width: 320px) {
.walletconnect-modal__base {
padding: 24px 12px;
}
}
.walletconnect-modal__base .hidden {
transform: translateY(150%);
transition: 0.125s cubic-bezier(0.4, 0, 1, 1);
}
.walletconnect-modal__header {
align-items: center;
display: flex;
height: 26px;
left: 0;
justify-content: space-between;
position: absolute;
top: -42px;
width: 100%;
}
.walletconnect-modal__base .wc-logo {
align-items: center;
display: flex;
height: 26px;
margin-top: 15px;
padding-bottom: 15px;
pointer-events: auto;
}
.walletconnect-modal__base .wc-logo div {
background-color: #3399ff;
height: 21px;
margin-right: 5px;
mask-image: url("images/wc-logo.svg") center no-repeat;
width: 32px;
}
.walletconnect-modal__base .wc-logo p {
color: #ffffff;
font-size: 20px;
font-weight: 600;
margin: 0;
}
.walletconnect-modal__base h2 {
color: rgba(60, 66, 82, 0.6);
font-size: 16px;
font-weight: 600;
letter-spacing: 0;
line-height: 1.1875em;
margin: 0 0 19px 0;
text-align: center;
width: 100%;
}
.walletconnect-modal__base__row {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
align-items: center;
border-radius: 20px;
cursor: pointer;
display: flex;
height: 56px;
justify-content: space-between;
padding: 0 15px;
position: relative;
margin: 0px 0px 8px;
text-align: left;
transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
will-change: transform;
text-decoration: none;
}
.walletconnect-modal__base__row:hover {
background: rgba(60, 66, 82, 0.06);
}
.walletconnect-modal__base__row:active {
background: rgba(60, 66, 82, 0.06);
transform: scale(0.975);
transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.walletconnect-modal__base__row__h3 {
color: #25292e;
font-size: 20px;
font-weight: 700;
margin: 0;
padding-bottom: 3px;
}
.walletconnect-modal__base__row__right {
align-items: center;
display: flex;
justify-content: center;
}
.walletconnect-modal__base__row__right__app-icon {
border-radius: 8px;
height: 34px;
margin: 0 11px 2px 0;
width: 34px;
background-size: 100%;
box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);
}
.walletconnect-modal__base__row__right__caret {
height: 18px;
opacity: 0.3;
transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
width: 8px;
will-change: opacity;
}
.walletconnect-modal__base__row:hover .caret,
.walletconnect-modal__base__row:active .caret {
opacity: 0.6;
}
.walletconnect-modal__mobile__toggle {
width: 80%;
display: flex;
margin: 0 auto;
position: relative;
overflow: hidden;
border-radius: 8px;
margin-bottom: 18px;
background: #d4d5d9;
}
.walletconnect-modal__single_wallet {
display: flex;
justify-content: center;
margin-top: 7px;
margin-bottom: 18px;
}
.walletconnect-modal__single_wallet a {
cursor: pointer;
color: rgb(64, 153, 255);
font-size: 21px;
font-weight: 800;
text-decoration: none !important;
margin: 0 auto;
}
.walletconnect-modal__mobile__toggle_selector {
width: calc(50% - 8px);
background: white;
position: absolute;
border-radius: 5px;
height: calc(100% - 8px);
top: 4px;
transition: all 0.2s ease-in-out;
transform: translate3d(4px, 0, 0);
}
.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {
transform: translate3d(calc(100% + 12px), 0, 0);
}
.walletconnect-modal__mobile__toggle a {
font-size: 12px;
width: 50%;
text-align: center;
padding: 8px;
margin: 0;
font-weight: 600;
z-index: 1;
}
.walletconnect-modal__footer {
display: flex;
justify-content: center;
margin-top: 20px;
}
@media only screen and (max-width: 768px) {
.walletconnect-modal__footer {
margin-top: 5vw;
}
}
.walletconnect-modal__footer a {
cursor: pointer;
color: #898d97;
font-size: 15px;
margin: 0 auto;
}
@media only screen and (max-width: 320px) {
.walletconnect-modal__footer a {
font-size: 14px;
}
}
.walletconnect-connect__buttons__wrapper {
max-height: 44vh;
}
.walletconnect-connect__buttons__wrapper__android {
margin: 50% 0;
}
.walletconnect-connect__buttons__wrapper__wrap {
display: grid;
grid-template-columns: repeat(4, 1fr);
margin: 10px 0;
}
@media only screen and (min-width: 768px) {
.walletconnect-connect__buttons__wrapper__wrap {
margin-top: 40px;
}
}
.walletconnect-connect__button {
background-color: rgb(64, 153, 255);
padding: 12px;
border-radius: 8px;
text-decoration: none;
color: rgb(255, 255, 255);
font-weight: 500;
}
.walletconnect-connect__button__icon_anchor {
cursor: pointer;
display: flex;
justify-content: flex-start;
align-items: center;
margin: 8px;
width: 42px;
justify-self: center;
flex-direction: column;
text-decoration: none !important;
}
@media only screen and (max-width: 320px) {
.walletconnect-connect__button__icon_anchor {
margin: 4px;
}
}
.walletconnect-connect__button__icon {
border-radius: 10px;
height: 42px;
margin: 0;
width: 42px;
background-size: cover !important;
box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);
}
.walletconnect-connect__button__text {
color: #424952;
font-size: 2.7vw;
text-decoration: none !important;
padding: 0;
margin-top: 1.8vw;
font-weight: 600;
}
@media only screen and (min-width: 768px) {
.walletconnect-connect__button__text {
font-size: 16px;
margin-top: 12px;
}
}
.walletconnect-search__input {
border: none;
background: #d4d5d9;
border-style: none;
padding: 8px 16px;
outline: none;
font-style: normal;
font-stretch: normal;
font-size: 16px;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: normal;
text-align: left;
border-radius: 8px;
width: calc(100% - 16px);
margin: 0;
margin-bottom: 8px;
}
`,l.head.appendChild(d)})();var z,R=function(){var l=p.getDocumentOrThrow(),x=l.createElement("div");return x.setAttribute("id","walletconnect-wrapper"),l.body.appendChild(x),x}();s.render(s.createElement(S,{text:(z=p.getNavigatorOrThrow().language.split("-")[0]||"en",k[z]||k.en),uri:F,onClose:M(V),qrcodeModalOptions:H}),R)}var N=function(){return n!==void 0&&n.versions!==void 0&&n.versions.node!==void 0},L={open:function(F,V,H){console.log(F),N()?function(z){a.toString(z,{type:"terminal"}).then(console.log)}(F):C(F,V,H)},close:function(){N()||O()}};o.exports=L}).call(this,t(5))},function(o,e,t){var n=t(180),c=t(181),p=t(198),a=t(199);function f(s,u,h,v,b){var y=[].slice.call(arguments,1),_=y.length,E=typeof y[_-1]=="function";if(!E&&!n())throw new Error("Callback required as last argument");if(!E){if(_<1)throw new Error("Too few arguments provided");return _===1?(h=u,u=v=void 0):_!==2||u.getContext||(v=h,h=u,u=void 0),new Promise(function(k,O){try{var M=c.create(h,v);k(s(M,u,v))}catch(C){O(C)}})}if(_<2)throw new Error("Too few arguments provided");_===2?(b=h,h=u,u=v=void 0):_===3&&(u.getContext&&b===void 0?(b=v,v=void 0):(b=v,v=h,h=u,u=void 0));try{var S=c.create(h,v);b(null,s(S,u,v))}catch(k){b(k)}}e.create=c.create,e.toCanvas=f.bind(null,p.render),e.toDataURL=f.bind(null,p.renderToDataURL),e.toString=f.bind(null,function(s,u,h){return a.render(s,h)})},function(o,e){o.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}},function(o,e,t){var n=t(26),c=t(17),p=t(51),a=t(182),f=t(183),s=t(184),u=t(185),h=t(186),v=t(98),b=t(187),y=t(190),_=t(191),E=t(18),S=t(192),k=t(50);function O(N,L,F){var V,H,z=N.size,R=_.getEncodedBits(L,F);for(V=0;V<15;V++)H=(R>>V&1)==1,V<6?N.set(V,8,H,!0):V<8?N.set(V+1,8,H,!0):N.set(z-15+V,8,H,!0),V<8?N.set(8,z-V-1,H,!0):V<9?N.set(8,15-V-1+1,H,!0):N.set(8,15-V-1,H,!0);N.set(z-8,8,1,!0)}function M(N,L,F){var V=new a;F.forEach(function(l){V.put(l.mode.bit,4),V.put(l.getLength(),E.getCharCountIndicator(l.mode,N)),l.write(V)});var H=8*(c.getSymbolTotalCodewords(N)-v.getTotalCodewordsCount(N,L));for(V.getLengthInBits()+4<=H&&V.put(0,4);V.getLengthInBits()%8!=0;)V.putBit(0);for(var z=(H-V.getLengthInBits())/8,R=0;R<z;R++)V.put(R%2?17:236,8);return function(l,x,d){for(var m=c.getSymbolTotalCodewords(x),g=v.getTotalCodewordsCount(x,d),w=m-g,A=v.getBlocksCount(x,d),P=A-m%A,T=Math.floor(m/A),q=Math.floor(w/A),Z=q+1,I=T-q,$=new b(I),K=0,j=new Array(A),D=new Array(A),B=0,U=n.from(l.buffer),J=0;J<A;J++){var G=J<P?q:Z;j[J]=U.slice(K,K+G),D[J]=$.encode(j[J]),K+=G,B=Math.max(B,G)}var W,Y,ee=n.alloc(m),te=0;for(W=0;W<B;W++)for(Y=0;Y<A;Y++)W<j[Y].length&&(ee[te++]=j[Y][W]);for(W=0;W<I;W++)for(Y=0;Y<A;Y++)ee[te++]=D[Y][W];return ee}(V,N,L)}function C(N,L,F,V){var H;if(k(N))H=S.fromArray(N);else{if(typeof N!="string")throw new Error("Invalid data");var z=L;if(!z){var R=S.rawSplit(N);z=y.getBestVersionForData(R,F)}H=S.fromString(N,z||40)}var l=y.getBestVersionForData(H,F);if(!l)throw new Error("The amount of data is too big to be stored in a QR Code");if(L){if(L<l)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+l+`.
`)}else L=l;var x=M(L,F,H),d=c.getSymbolSize(L),m=new f(d);return function(g,w){for(var A=g.size,P=u.getPositions(w),T=0;T<P.length;T++)for(var q=P[T][0],Z=P[T][1],I=-1;I<=7;I++)if(!(q+I<=-1||A<=q+I))for(var $=-1;$<=7;$++)Z+$<=-1||A<=Z+$||(I>=0&&I<=6&&($===0||$===6)||$>=0&&$<=6&&(I===0||I===6)||I>=2&&I<=4&&$>=2&&$<=4?g.set(q+I,Z+$,!0,!0):g.set(q+I,Z+$,!1,!0))}(m,L),function(g){for(var w=g.size,A=8;A<w-8;A++){var P=A%2==0;g.set(A,6,P,!0),g.set(6,A,P,!0)}}(m),function(g,w){for(var A=s.getPositions(w),P=0;P<A.length;P++)for(var T=A[P][0],q=A[P][1],Z=-2;Z<=2;Z++)for(var I=-2;I<=2;I++)Z===-2||Z===2||I===-2||I===2||Z===0&&I===0?g.set(T+Z,q+I,!0,!0):g.set(T+Z,q+I,!1,!0)}(m,L),O(m,F,0),L>=7&&function(g,w){for(var A,P,T,q=g.size,Z=y.getEncodedBits(w),I=0;I<18;I++)A=Math.floor(I/3),P=I%3+q-8-3,T=(Z>>I&1)==1,g.set(A,P,T,!0),g.set(P,A,T,!0)}(m,L),function(g,w){for(var A=g.size,P=-1,T=A-1,q=7,Z=0,I=A-1;I>0;I-=2)for(I===6&&I--;;){for(var $=0;$<2;$++)if(!g.isReserved(T,I-$)){var K=!1;Z<w.length&&(K=(w[Z]>>>q&1)==1),g.set(T,I-$,K),--q===-1&&(Z++,q=7)}if((T+=P)<0||A<=T){T-=P,P=-P;break}}}(m,x),isNaN(V)&&(V=h.getBestMask(m,O.bind(null,m,F))),h.applyMask(V,m),O(m,F,V),{modules:m,version:L,errorCorrectionLevel:F,maskPattern:V,segments:H}}e.create=function(N,L){if(N===void 0||N==="")throw new Error("No input text");var F,V,H=p.M;return L!==void 0&&(H=p.from(L.errorCorrectionLevel,p.M),F=y.from(L.version),V=h.from(L.maskPattern),L.toSJISFunc&&c.setToSJISFunction(L.toSJISFunc)),C(N,F,H,V)}},function(o,e){function t(){this.buffer=[],this.length=0}t.prototype={get:function(n){var c=Math.floor(n/8);return(this.buffer[c]>>>7-n%8&1)==1},put:function(n,c){for(var p=0;p<c;p++)this.putBit((n>>>c-p-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(n){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0),n&&(this.buffer[c]|=128>>>this.length%8),this.length++}},o.exports=t},function(o,e,t){var n=t(26);function c(p){if(!p||p<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=p,this.data=n.alloc(p*p),this.reservedBit=n.alloc(p*p)}c.prototype.set=function(p,a,f,s){var u=p*this.size+a;this.data[u]=f,s&&(this.reservedBit[u]=!0)},c.prototype.get=function(p,a){return this.data[p*this.size+a]},c.prototype.xor=function(p,a,f){this.data[p*this.size+a]^=f},c.prototype.isReserved=function(p,a){return this.reservedBit[p*this.size+a]},o.exports=c},function(o,e,t){var n=t(17).getSymbolSize;e.getRowColCoords=function(c){if(c===1)return[];for(var p=Math.floor(c/7)+2,a=n(c),f=a===145?26:2*Math.ceil((a-13)/(2*p-2)),s=[a-7],u=1;u<p-1;u++)s[u]=s[u-1]-f;return s.push(6),s.reverse()},e.getPositions=function(c){for(var p=[],a=e.getRowColCoords(c),f=a.length,s=0;s<f;s++)for(var u=0;u<f;u++)s===0&&u===0||s===0&&u===f-1||s===f-1&&u===0||p.push([a[s],a[u]]);return p}},function(o,e,t){var n=t(17).getSymbolSize;e.getPositions=function(c){var p=n(c);return[[0,0],[p-7,0],[0,p-7]]}},function(o,e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t=3,n=3,c=40,p=10;function a(f,s,u){switch(f){case e.Patterns.PATTERN000:return(s+u)%2==0;case e.Patterns.PATTERN001:return s%2==0;case e.Patterns.PATTERN010:return u%3==0;case e.Patterns.PATTERN011:return(s+u)%3==0;case e.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(u/3))%2==0;case e.Patterns.PATTERN101:return s*u%2+s*u%3==0;case e.Patterns.PATTERN110:return(s*u%2+s*u%3)%2==0;case e.Patterns.PATTERN111:return(s*u%3+(s+u)%2)%2==0;default:throw new Error("bad maskPattern:"+f)}}e.isValid=function(f){return f!=null&&f!==""&&!isNaN(f)&&f>=0&&f<=7},e.from=function(f){return e.isValid(f)?parseInt(f,10):void 0},e.getPenaltyN1=function(f){for(var s=f.size,u=0,h=0,v=0,b=null,y=null,_=0;_<s;_++){h=v=0,b=y=null;for(var E=0;E<s;E++){var S=f.get(_,E);S===b?h++:(h>=5&&(u+=t+(h-5)),b=S,h=1),(S=f.get(E,_))===y?v++:(v>=5&&(u+=t+(v-5)),y=S,v=1)}h>=5&&(u+=t+(h-5)),v>=5&&(u+=t+(v-5))}return u},e.getPenaltyN2=function(f){for(var s=f.size,u=0,h=0;h<s-1;h++)for(var v=0;v<s-1;v++){var b=f.get(h,v)+f.get(h,v+1)+f.get(h+1,v)+f.get(h+1,v+1);b!==4&&b!==0||u++}return u*n},e.getPenaltyN3=function(f){for(var s=f.size,u=0,h=0,v=0,b=0;b<s;b++){h=v=0;for(var y=0;y<s;y++)h=h<<1&2047|f.get(b,y),y>=10&&(h===1488||h===93)&&u++,v=v<<1&2047|f.get(y,b),y>=10&&(v===1488||v===93)&&u++}return u*c},e.getPenaltyN4=function(f){for(var s=0,u=f.data.length,h=0;h<u;h++)s+=f.data[h];return Math.abs(Math.ceil(100*s/u/5)-10)*p},e.applyMask=function(f,s){for(var u=s.size,h=0;h<u;h++)for(var v=0;v<u;v++)s.isReserved(v,h)||s.xor(v,h,a(f,v,h))},e.getBestMask=function(f,s){for(var u=Object.keys(e.Patterns).length,h=0,v=1/0,b=0;b<u;b++){s(b),e.applyMask(b,f);var y=e.getPenaltyN1(f)+e.getPenaltyN2(f)+e.getPenaltyN3(f)+e.getPenaltyN4(f);e.applyMask(b,f),y<v&&(v=y,h=b)}return h}},function(o,e,t){var n=t(26),c=t(188),p=t(2).Buffer;function a(f){this.genPoly=void 0,this.degree=f,this.degree&&this.initialize(this.degree)}a.prototype.initialize=function(f){this.degree=f,this.genPoly=c.generateECPolynomial(this.degree)},a.prototype.encode=function(f){if(!this.genPoly)throw new Error("Encoder not initialized");var s=n.alloc(this.degree),u=p.concat([f,s],f.length+this.degree),h=c.mod(u,this.genPoly),v=this.degree-h.length;if(v>0){var b=n.alloc(this.degree);return h.copy(b,v),b}return h},o.exports=a},function(o,e,t){var n=t(26),c=t(189);e.mul=function(p,a){for(var f=n.alloc(p.length+a.length-1),s=0;s<p.length;s++)for(var u=0;u<a.length;u++)f[s+u]^=c.mul(p[s],a[u]);return f},e.mod=function(p,a){for(var f=n.from(p);f.length-a.length>=0;){for(var s=f[0],u=0;u<a.length;u++)f[u]^=c.mul(a[u],s);for(var h=0;h<f.length&&f[h]===0;)h++;f=f.slice(h)}return f},e.generateECPolynomial=function(p){for(var a=n.from([1]),f=0;f<p;f++)a=e.mul(a,[1,c.exp(f)]);return a}},function(o,e,t){var n=t(26),c=n.alloc(512),p=n.alloc(256);(function(){for(var a=1,f=0;f<255;f++)c[f]=a,p[a]=f,256&(a<<=1)&&(a^=285);for(f=255;f<512;f++)c[f]=c[f-255]})(),e.log=function(a){if(a<1)throw new Error("log("+a+")");return p[a]},e.exp=function(a){return c[a]},e.mul=function(a,f){return a===0||f===0?0:c[p[a]+p[f]]}},function(o,e,t){var n=t(17),c=t(98),p=t(51),a=t(18),f=t(99),s=t(50),u=n.getBCHDigit(7973);function h(b,y){return a.getCharCountIndicator(b,y)+4}function v(b,y){var _=0;return b.forEach(function(E){var S=h(E.mode,y);_+=S+E.getBitsLength()}),_}e.from=function(b,y){return f.isValid(b)?parseInt(b,10):y},e.getCapacity=function(b,y,_){if(!f.isValid(b))throw new Error("Invalid QR Code version");_===void 0&&(_=a.BYTE);var E=8*(n.getSymbolTotalCodewords(b)-c.getTotalCodewordsCount(b,y));if(_===a.MIXED)return E;var S=E-h(_,b);switch(_){case a.NUMERIC:return Math.floor(S/10*3);case a.ALPHANUMERIC:return Math.floor(S/11*2);case a.KANJI:return Math.floor(S/13);case a.BYTE:default:return Math.floor(S/8)}},e.getBestVersionForData=function(b,y){var _,E=p.from(y,p.M);if(s(b)){if(b.length>1)return function(S,k){for(var O=1;O<=40;O++)if(v(S,O)<=e.getCapacity(O,k,a.MIXED))return O}(b,E);if(b.length===0)return 1;_=b[0]}else _=b;return function(S,k,O){for(var M=1;M<=40;M++)if(k<=e.getCapacity(M,O,S))return M}(_.mode,_.getLength(),E)},e.getEncodedBits=function(b){if(!f.isValid(b)||b<7)throw new Error("Invalid QR Code version");for(var y=b<<12;n.getBCHDigit(y)-u>=0;)y^=7973<<n.getBCHDigit(y)-u;return b<<12|y}},function(o,e,t){var n=t(17),c=n.getBCHDigit(1335);e.getEncodedBits=function(p,a){for(var f=p.bit<<3|a,s=f<<10;n.getBCHDigit(s)-c>=0;)s^=1335<<n.getBCHDigit(s)-c;return 21522^(f<<10|s)}},function(o,e,t){var n=t(18),c=t(193),p=t(194),a=t(195),f=t(196),s=t(100),u=t(17),h=t(197);function v(S){return unescape(encodeURIComponent(S)).length}function b(S,k,O){for(var M,C=[];(M=S.exec(O))!==null;)C.push({data:M[0],index:M.index,mode:k,length:M[0].length});return C}function y(S){var k,O,M=b(s.NUMERIC,n.NUMERIC,S),C=b(s.ALPHANUMERIC,n.ALPHANUMERIC,S);return u.isKanjiModeEnabled()?(k=b(s.BYTE,n.BYTE,S),O=b(s.KANJI,n.KANJI,S)):(k=b(s.BYTE_KANJI,n.BYTE,S),O=[]),M.concat(C,k,O).sort(function(N,L){return N.index-L.index}).map(function(N){return{data:N.data,mode:N.mode,length:N.length}})}function _(S,k){switch(k){case n.NUMERIC:return c.getBitsLength(S);case n.ALPHANUMERIC:return p.getBitsLength(S);case n.KANJI:return f.getBitsLength(S);case n.BYTE:return a.getBitsLength(S)}}function E(S,k){var O,M=n.getBestModeForData(S);if((O=n.from(k,M))!==n.BYTE&&O.bit<M.bit)throw new Error('"'+S+'" cannot be encoded with mode '+n.toString(O)+`.
Suggested mode is: `+n.toString(M));switch(O!==n.KANJI||u.isKanjiModeEnabled()||(O=n.BYTE),O){case n.NUMERIC:return new c(S);case n.ALPHANUMERIC:return new p(S);case n.KANJI:return new f(S);case n.BYTE:return new a(S)}}e.fromArray=function(S){return S.reduce(function(k,O){return typeof O=="string"?k.push(E(O,null)):O.data&&k.push(E(O.data,O.mode)),k},[])},e.fromString=function(S,k){for(var O=function(L,F){for(var V={},H={start:{}},z=["start"],R=0;R<L.length;R++){for(var l=L[R],x=[],d=0;d<l.length;d++){var m=l[d],g=""+R+d;x.push(g),V[g]={node:m,lastCount:0},H[g]={};for(var w=0;w<z.length;w++){var A=z[w];V[A]&&V[A].node.mode===m.mode?(H[A][g]=_(V[A].lastCount+m.length,m.mode)-_(V[A].lastCount,m.mode),V[A].lastCount+=m.length):(V[A]&&(V[A].lastCount=m.length),H[A][g]=_(m.length,m.mode)+4+n.getCharCountIndicator(m.mode,F))}}z=x}for(w=0;w<z.length;w++)H[z[w]].end=0;return{map:H,table:V}}(function(L){for(var F=[],V=0;V<L.length;V++){var H=L[V];switch(H.mode){case n.NUMERIC:F.push([H,{data:H.data,mode:n.ALPHANUMERIC,length:H.length},{data:H.data,mode:n.BYTE,length:H.length}]);break;case n.ALPHANUMERIC:F.push([H,{data:H.data,mode:n.BYTE,length:H.length}]);break;case n.KANJI:F.push([H,{data:H.data,mode:n.BYTE,length:v(H.data)}]);break;case n.BYTE:F.push([{data:H.data,mode:n.BYTE,length:v(H.data)}])}}return F}(y(S,u.isKanjiModeEnabled())),k),M=h.find_path(O.map,"start","end"),C=[],N=1;N<M.length-1;N++)C.push(O.table[M[N]].node);return e.fromArray(function(L){return L.reduce(function(F,V){var H=F.length-1>=0?F[F.length-1]:null;return H&&H.mode===V.mode?(F[F.length-1].data+=V.data,F):(F.push(V),F)},[])}(C))},e.rawSplit=function(S){return e.fromArray(y(S,u.isKanjiModeEnabled()))}},function(o,e,t){var n=t(18);function c(p){this.mode=n.NUMERIC,this.data=p.toString()}c.getBitsLength=function(p){return 10*Math.floor(p/3)+(p%3?p%3*3+1:0)},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(p){var a,f,s;for(a=0;a+3<=this.data.length;a+=3)f=this.data.substr(a,3),s=parseInt(f,10),p.put(s,10);var u=this.data.length-a;u>0&&(f=this.data.substr(a),s=parseInt(f,10),p.put(s,3*u+1))},o.exports=c},function(o,e,t){var n=t(18),c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function p(a){this.mode=n.ALPHANUMERIC,this.data=a}p.getBitsLength=function(a){return 11*Math.floor(a/2)+a%2*6},p.prototype.getLength=function(){return this.data.length},p.prototype.getBitsLength=function(){return p.getBitsLength(this.data.length)},p.prototype.write=function(a){var f;for(f=0;f+2<=this.data.length;f+=2){var s=45*c.indexOf(this.data[f]);s+=c.indexOf(this.data[f+1]),a.put(s,11)}this.data.length%2&&a.put(c.indexOf(this.data[f]),6)},o.exports=p},function(o,e,t){var n=t(26),c=t(18);function p(a){this.mode=c.BYTE,this.data=n.from(a)}p.getBitsLength=function(a){return 8*a},p.prototype.getLength=function(){return this.data.length},p.prototype.getBitsLength=function(){return p.getBitsLength(this.data.length)},p.prototype.write=function(a){for(var f=0,s=this.data.length;f<s;f++)a.put(this.data[f],8)},o.exports=p},function(o,e,t){var n=t(18),c=t(17);function p(a){this.mode=n.KANJI,this.data=a}p.getBitsLength=function(a){return 13*a},p.prototype.getLength=function(){return this.data.length},p.prototype.getBitsLength=function(){return p.getBitsLength(this.data.length)},p.prototype.write=function(a){var f;for(f=0;f<this.data.length;f++){var s=c.toSJIS(this.data[f]);if(s>=33088&&s<=40956)s-=33088;else{if(!(s>=57408&&s<=60351))throw new Error("Invalid SJIS character: "+this.data[f]+`
Make sure your charset is UTF-8`);s-=49472}s=192*(s>>>8&255)+(255&s),a.put(s,13)}},o.exports=p},function(o,e,t){var n={single_source_shortest_paths:function(c,p,a){var f={},s={};s[p]=0;var u,h,v,b,y,_,E,S=n.PriorityQueue.make();for(S.push(p,0);!S.empty();)for(v in h=(u=S.pop()).value,b=u.cost,y=c[h]||{})y.hasOwnProperty(v)&&(_=b+y[v],E=s[v],(s[v]===void 0||E>_)&&(s[v]=_,S.push(v,_),f[v]=h));if(a!==void 0&&s[a]===void 0){var k=["Could not find a path from ",p," to ",a,"."].join("");throw new Error(k)}return f},extract_shortest_path_from_predecessor_list:function(c,p){for(var a=[],f=p;f;)a.push(f),c[f],f=c[f];return a.reverse(),a},find_path:function(c,p,a){var f=n.single_source_shortest_paths(c,p,a);return n.extract_shortest_path_from_predecessor_list(f,a)},PriorityQueue:{make:function(c){var p,a=n.PriorityQueue,f={};for(p in c=c||{},a)a.hasOwnProperty(p)&&(f[p]=a[p]);return f.queue=[],f.sorter=c.sorter||a.default_sorter,f},default_sorter:function(c,p){return c.cost-p.cost},push:function(c,p){var a={value:c,cost:p};this.queue.push(a),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};o.exports=n},function(o,e,t){var n=t(101);e.render=function(c,p,a){var f=a,s=p;f!==void 0||p&&p.getContext||(f=p,p=void 0),p||(s=function(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}()),f=n.getOptions(f);var u=n.getImageWidth(c.modules.size,f),h=s.getContext("2d"),v=h.createImageData(u,u);return n.qrToImageData(v.data,c,f),function(b,y,_){b.clearRect(0,0,y.width,y.height),y.style||(y.style={}),y.height=_,y.width=_,y.style.height=_+"px",y.style.width=_+"px"}(h,s,u),h.putImageData(v,0,0),s},e.renderToDataURL=function(c,p,a){var f=a;f!==void 0||p&&p.getContext||(f=p,p=void 0),f||(f={});var s=e.render(c,p,f),u=f.type||"image/png",h=f.rendererOpts||{};return s.toDataURL(u,h.quality)}},function(o,e,t){var n=t(101);function c(a,f){var s=a.a/255,u=f+'="'+a.hex+'"';return s<1?u+" "+f+'-opacity="'+s.toFixed(2).slice(1)+'"':u}function p(a,f,s){var u=a+f;return s!==void 0&&(u+=" "+s),u}e.render=function(a,f,s){var u=n.getOptions(f),h=a.modules.size,v=a.modules.data,b=h+2*u.margin,y=u.color.light.a?"<path "+c(u.color.light,"fill")+' d="M0 0h'+b+"v"+b+'H0z"/>':"",_="<path "+c(u.color.dark,"stroke")+' d="'+function(k,O,M){for(var C="",N=0,L=!1,F=0,V=0;V<k.length;V++){var H=Math.floor(V%O),z=Math.floor(V/O);H||L||(L=!0),k[V]?(F++,V>0&&H>0&&k[V-1]||(C+=L?p("M",H+M,.5+z+M):p("m",N,0),N=0,L=!1),H+1<O&&k[V+1]||(C+=p("h",F),F=0)):N++}return C}(v,h,u.margin)+'"/>',E='viewBox="0 0 '+b+" "+b+'"',S='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+E+' shape-rendering="crispEdges">'+y+_+`</svg>
`;return typeof s=="function"&&s(null,S),S}},function(o,e,t){var n=t(201),c={"text/plain":"Text","text/html":"Url",default:"Text"};o.exports=function(p,a){var f,s,u,h,v,b,y=!1;a||(a={}),f=a.debug||!1;try{if(u=n(),h=document.createRange(),v=document.getSelection(),(b=document.createElement("span")).textContent=p,b.style.all="unset",b.style.position="fixed",b.style.top=0,b.style.clip="rect(0, 0, 0, 0)",b.style.whiteSpace="pre",b.style.webkitUserSelect="text",b.style.MozUserSelect="text",b.style.msUserSelect="text",b.style.userSelect="text",b.addEventListener("copy",function(_){if(_.stopPropagation(),a.format)if(_.preventDefault(),_.clipboardData===void 0){f&&console.warn("unable to use e.clipboardData"),f&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var E=c[a.format]||c.default;window.clipboardData.setData(E,p)}else _.clipboardData.clearData(),_.clipboardData.setData(a.format,p);a.onCopy&&(_.preventDefault(),a.onCopy(_.clipboardData))}),document.body.appendChild(b),h.selectNodeContents(b),v.addRange(h),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");y=!0}catch(_){f&&console.error("unable to copy using execCommand: ",_),f&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(a.format||"text",p),a.onCopy&&a.onCopy(window.clipboardData),y=!0}catch(E){f&&console.error("unable to copy using clipboardData: ",E),f&&console.error("falling back to prompt"),s=function(S){var k=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return S.replace(/#{\s*key\s*}/g,k)}("message"in a?a.message:"Copy to clipboard: #{key}, Enter"),window.prompt(s,p)}}finally{v&&(typeof v.removeRange=="function"?v.removeRange(h):v.removeAllRanges()),b&&document.body.removeChild(b),u()}return y}},function(o,e){o.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var n=document.activeElement,c=[],p=0;p<t.rangeCount;p++)c.push(t.getRangeAt(p));switch(n.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":n.blur();break;default:n=null}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||c.forEach(function(a){t.addRange(a)}),n&&n.focus()}}},function(o,e,t){t.r(e);var n=t(164),c=t.n(n),p=t(165),a=t(1);const f=Object(a.getFromWindow)("XMLHttpRequest")||p.XMLHttpRequest;class s extends c.a{constructor(h){super(),this.url=h}formatError(h,v,b=-1){return{error:{message:v,code:b},id:h.id,jsonrpc:h.jsonrpc}}send(h,v){return new Promise(b=>{if(h.method==="eth_subscribe"){const S=this.formatError(h,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",S),b(S)}const y=new f;let _=!1;const E=(S,k)=>{if(!_)if(y.abort(),_=!0,v)v(S,k);else{const{id:O,jsonrpc:M}=h,C=S?{id:O,jsonrpc:M,error:{message:S.message,code:S.code}}:{id:O,jsonrpc:M,result:k};this.emit("payload",C),b(C)}};y.open("POST",this.url,!0),y.setRequestHeader("Content-Type","application/json"),y.timeout=6e4,y.onerror=E,y.ontimeout=E,y.onreadystatechange=()=>{if(y.readyState===4)try{const S=JSON.parse(y.responseText);E(S.error,S.result)}catch(S){E(S)}},y.send(JSON.stringify(h))})}}e.default=s},function(o,e,t){(function(n,c){var p,a=this&&this.__extends||(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,M){O.__proto__=M}||function(O,M){for(var C in M)M.hasOwnProperty(C)&&(O[C]=M[C])},function(O,M){function C(){this.constructor=O}p(O,M),O.prototype=M===null?Object.create(M):(C.prototype=M.prototype,new C)}),f=this&&this.__assign||Object.assign||function(O){for(var M,C=1,N=arguments.length;C<N;C++)for(var L in M=arguments[C])Object.prototype.hasOwnProperty.call(M,L)&&(O[L]=M[L]);return O};Object.defineProperty(e,"__esModule",{value:!0});var s=t(102),u=t(218),h=t(219),v=t(55),b=t(220),y=t(221),_=t(56),E=t(222),S=t(223),k=function(O){function M(C){C===void 0&&(C={});var N=O.call(this)||this;return N.UNSENT=M.UNSENT,N.OPENED=M.OPENED,N.HEADERS_RECEIVED=M.HEADERS_RECEIVED,N.LOADING=M.LOADING,N.DONE=M.DONE,N.onreadystatechange=null,N.readyState=M.UNSENT,N.response=null,N.responseText="",N.responseType="",N.status=0,N.statusText="",N.timeout=0,N.upload=new E.XMLHttpRequestUpload,N.responseUrl="",N.withCredentials=!1,N._method=null,N._url=null,N._sync=!1,N._headers={},N._loweredHeaders={},N._mimeOverride=null,N._request=null,N._response=null,N._responseParts=null,N._responseHeaders=null,N._aborting=null,N._error=null,N._loadedBytes=0,N._totalBytes=0,N._lengthComputable=!1,N._restrictedMethods={CONNECT:!0,TRACE:!0,TRACK:!0},N._restrictedHeaders={"accept-charset":!0,"accept-encoding":!0,"access-control-request-headers":!0,"access-control-request-method":!0,connection:!0,"content-length":!0,cookie:!0,cookie2:!0,date:!0,dnt:!0,expect:!0,host:!0,"keep-alive":!0,origin:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,via:!0},N._privateHeaders={"set-cookie":!0,"set-cookie2":!0},N._userAgent="Mozilla/5.0 ("+h.type()+" "+h.arch()+") node.js/"+n.versions.node+" v8/"+n.versions.v8,N._anonymous=C.anon||!1,N}return a(M,O),M.prototype.open=function(C,N,L,F,V){if(L===void 0&&(L=!0),C=C.toUpperCase(),this._restrictedMethods[C])throw new M.SecurityError("HTTP method "+C+" is not allowed in XHR");var H=this._parseUrl(N,F,V);this.readyState===M.HEADERS_RECEIVED||(this.readyState,M.LOADING),this._method=C,this._url=H,this._sync=!L,this._headers={},this._loweredHeaders={},this._mimeOverride=null,this._setReadyState(M.OPENED),this._request=null,this._response=null,this.status=0,this.statusText="",this._responseParts=[],this._responseHeaders=null,this._loadedBytes=0,this._totalBytes=0,this._lengthComputable=!1},M.prototype.setRequestHeader=function(C,N){if(this.readyState!==M.OPENED)throw new M.InvalidStateError("XHR readyState must be OPENED");var L=C.toLowerCase();this._restrictedHeaders[L]||/^sec-/.test(L)||/^proxy-/.test(L)?console.warn('Refused to set unsafe header "'+C+'"'):(N=N.toString(),this._loweredHeaders[L]!=null?(C=this._loweredHeaders[L],this._headers[C]=this._headers[C]+", "+N):(this._loweredHeaders[L]=C,this._headers[C]=N))},M.prototype.send=function(C){if(this.readyState!==M.OPENED)throw new M.InvalidStateError("XHR readyState must be OPENED");if(this._request)throw new M.InvalidStateError("send() already called");switch(this._url.protocol){case"file:":return this._sendFile(C);case"http:":case"https:":return this._sendHttp(C);default:throw new M.NetworkError("Unsupported protocol "+this._url.protocol)}},M.prototype.abort=function(){this._request!=null&&(this._request.abort(),this._setError(),this._dispatchProgress("abort"),this._dispatchProgress("loadend"))},M.prototype.getResponseHeader=function(C){if(this._responseHeaders==null||C==null)return null;var N=C.toLowerCase();return this._responseHeaders.hasOwnProperty(N)?this._responseHeaders[C.toLowerCase()]:null},M.prototype.getAllResponseHeaders=function(){var C=this;return this._responseHeaders==null?"":Object.keys(this._responseHeaders).map(function(N){return N+": "+C._responseHeaders[N]}).join(`\r
`)},M.prototype.overrideMimeType=function(C){if(this.readyState===M.LOADING||this.readyState===M.DONE)throw new M.InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");this._mimeOverride=C.toLowerCase()},M.prototype.nodejsSet=function(C){if(this.nodejsHttpAgent=C.httpAgent||this.nodejsHttpAgent,this.nodejsHttpsAgent=C.httpsAgent||this.nodejsHttpsAgent,C.hasOwnProperty("baseUrl")){if(C.baseUrl!=null&&!v.parse(C.baseUrl,!1,!0).protocol)throw new M.SyntaxError("baseUrl must be an absolute URL");this.nodejsBaseUrl=C.baseUrl}},M.nodejsSet=function(C){M.prototype.nodejsSet(C)},M.prototype._setReadyState=function(C){this.readyState=C,this.dispatchEvent(new b.ProgressEvent("readystatechange"))},M.prototype._sendFile=function(C){throw new Error("Protocol file: not implemented")},M.prototype._sendHttp=function(C){if(this._sync)throw new Error("Synchronous XHR processing not implemented");!C||this._method!=="GET"&&this._method!=="HEAD"?C=C||"":(console.warn("Discarding entity body for "+this._method+" requests"),C=null),this.upload._setData(C),this._finalizeHeaders(),this._sendHxxpRequest()},M.prototype._sendHxxpRequest=function(){var C=this;if(this.withCredentials){var N=M.cookieJar.getCookies(S.CookieAccessInfo(this._url.hostname,this._url.pathname,this._url.protocol==="https:")).toValueString();this._headers.cookie=this._headers.cookie2=N}var L=this._url.protocol==="http:"?[s,this.nodejsHttpAgent]:[u,this.nodejsHttpsAgent],F=L[0],V=L[1],H=F.request.bind(F)({hostname:this._url.hostname,port:+this._url.port,path:this._url.path,auth:this._url.auth,method:this._method,headers:this._headers,agent:V});this._request=H,this.timeout&&H.setTimeout(this.timeout,function(){return C._onHttpTimeout(H)}),H.on("response",function(z){return C._onHttpResponse(H,z)}),H.on("error",function(z){return C._onHttpRequestError(H,z)}),this.upload._startUpload(H),this._request===H&&this._dispatchProgress("loadstart")},M.prototype._finalizeHeaders=function(){this._headers=f({},this._headers,{Connection:"keep-alive",Host:this._url.host,"User-Agent":this._userAgent},this._anonymous?{Referer:"about:blank"}:{}),this.upload._finalizeHeaders(this._headers,this._loweredHeaders)},M.prototype._onHttpResponse=function(C,N){var L=this;if(this._request===C){if(this.withCredentials&&(N.headers["set-cookie"]||N.headers["set-cookie2"])&&M.cookieJar.setCookies(N.headers["set-cookie"]||N.headers["set-cookie2"]),[301,302,303,307,308].indexOf(N.statusCode)>=0)return this._url=this._parseUrl(N.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),this._headers["Content-Type"]!=null&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=N,this._response.on("data",function(V){return L._onHttpResponseData(N,V)}),this._response.on("end",function(){return L._onHttpResponseEnd(N)}),this._response.on("close",function(){return L._onHttpResponseClose(N)}),this.responseUrl=this._url.href.split("#")[0],this.status=N.statusCode,this.statusText=s.STATUS_CODES[this.status],this._parseResponseHeaders(N);var F=this._responseHeaders["content-length"]||"";this._totalBytes=+F,this._lengthComputable=!!F,this._setReadyState(M.HEADERS_RECEIVED)}},M.prototype._onHttpResponseData=function(C,N){this._response===C&&(this._responseParts.push(new c(N)),this._loadedBytes+=N.length,this.readyState!==M.LOADING&&this._setReadyState(M.LOADING),this._dispatchProgress("progress"))},M.prototype._onHttpResponseEnd=function(C){this._response===C&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(M.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},M.prototype._onHttpResponseClose=function(C){if(this._response===C){var N=this._request;this._setError(),N.abort(),this._setReadyState(M.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},M.prototype._onHttpTimeout=function(C){this._request===C&&(this._setError(),C.abort(),this._setReadyState(M.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},M.prototype._onHttpRequestError=function(C,N){this._request===C&&(this._setError(),C.abort(),this._setReadyState(M.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},M.prototype._dispatchProgress=function(C){var N=new M.ProgressEvent(C);N.lengthComputable=this._lengthComputable,N.loaded=this._loadedBytes,N.total=this._totalBytes,this.dispatchEvent(N)},M.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},M.prototype._parseUrl=function(C,N,L){var F=this.nodejsBaseUrl==null?C:v.resolve(this.nodejsBaseUrl,C),V=v.parse(F,!1,!0);V.hash=null;var H=(V.auth||"").split(":"),z=H[0],R=H[1];return(z||R||N||L)&&(V.auth=(N||z||"")+":"+(L||R||"")),V},M.prototype._parseResponseHeaders=function(C){for(var N in this._responseHeaders={},C.headers){var L=N.toLowerCase();this._privateHeaders[L]||(this._responseHeaders[L]=C.headers[N])}this._mimeOverride!=null&&(this._responseHeaders["content-type"]=this._mimeOverride)},M.prototype._parseResponse=function(){var C=c.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(C.toString("utf-8"))}catch{this.response=null}return;case"buffer":return this.responseText=null,void(this.response=C);case"arraybuffer":this.responseText=null;for(var N=new ArrayBuffer(C.length),L=new Uint8Array(N),F=0;F<C.length;F++)L[F]=C[F];return void(this.response=N);case"text":default:try{this.responseText=C.toString(this._parseResponseEncoding())}catch{this.responseText=C.toString("binary")}this.response=this.responseText}},M.prototype._parseResponseEncoding=function(){return/;\s*charset=(.*)$/.exec(this._responseHeaders["content-type"]||"")[1]||"utf-8"},M.ProgressEvent=b.ProgressEvent,M.InvalidStateError=y.InvalidStateError,M.NetworkError=y.NetworkError,M.SecurityError=y.SecurityError,M.SyntaxError=y.SyntaxError,M.XMLHttpRequestUpload=E.XMLHttpRequestUpload,M.UNSENT=0,M.OPENED=1,M.HEADERS_RECEIVED=2,M.LOADING=3,M.DONE=4,M.cookieJar=S.CookieJar(),M}(_.XMLHttpRequestEventTarget);e.XMLHttpRequest=k,k.prototype.nodejsHttpAgent=s.globalAgent,k.prototype.nodejsHttpsAgent=u.globalAgent,k.prototype.nodejsBaseUrl=null}).call(this,t(5),t(2).Buffer)},function(o,e,t){(function(n,c,p){var a=t(103),f=t(3),s=t(104),u=t(34),h=t(211),v=s.IncomingMessage,b=s.readyStates,y=o.exports=function(E){var S,k=this;u.Writable.call(k),k._opts=E,k._body=[],k._headers={},E.auth&&k.setHeader("Authorization","Basic "+new n(E.auth).toString("base64")),Object.keys(E.headers).forEach(function(M){k.setHeader(M,E.headers[M])});var O=!0;if(E.mode==="disable-fetch"||"requestTimeout"in E&&!a.abortController)O=!1,S=!0;else if(E.mode==="prefer-streaming")S=!1;else if(E.mode==="allow-wrong-content-type")S=!a.overrideMimeType;else{if(E.mode&&E.mode!=="default"&&E.mode!=="prefer-fast")throw new Error("Invalid value for opts.mode");S=!0}k._mode=function(M,C){return a.fetch&&C?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&M?"arraybuffer":a.vbArray&&M?"text:vbarray":"text"}(S,O),k._fetchTimer=null,k.on("finish",function(){k._onFinish()})};f(y,u.Writable),y.prototype.setHeader=function(E,S){var k=E.toLowerCase();_.indexOf(k)===-1&&(this._headers[k]={name:E,value:S})},y.prototype.getHeader=function(E){var S=this._headers[E.toLowerCase()];return S?S.value:null},y.prototype.removeHeader=function(E){delete this._headers[E.toLowerCase()]},y.prototype._onFinish=function(){var E=this;if(!E._destroyed){var S=E._opts,k=E._headers,O=null;S.method!=="GET"&&S.method!=="HEAD"&&(O=a.arraybuffer?h(n.concat(E._body)):a.blobConstructor?new c.Blob(E._body.map(function(F){return h(F)}),{type:(k["content-type"]||{}).value||""}):n.concat(E._body).toString());var M=[];if(Object.keys(k).forEach(function(F){var V=k[F].name,H=k[F].value;Array.isArray(H)?H.forEach(function(z){M.push([V,z])}):M.push([V,H])}),E._mode==="fetch"){var C=null;if(a.abortController){var N=new AbortController;C=N.signal,E._fetchAbortController=N,"requestTimeout"in S&&S.requestTimeout!==0&&(E._fetchTimer=c.setTimeout(function(){E.emit("requestTimeout"),E._fetchAbortController&&E._fetchAbortController.abort()},S.requestTimeout))}c.fetch(E._opts.url,{method:E._opts.method,headers:M,body:O||void 0,mode:"cors",credentials:S.withCredentials?"include":"same-origin",signal:C}).then(function(F){E._fetchResponse=F,E._connect()},function(F){c.clearTimeout(E._fetchTimer),E._destroyed||E.emit("error",F)})}else{var L=E._xhr=new c.XMLHttpRequest;try{L.open(E._opts.method,E._opts.url,!0)}catch(F){return void p.nextTick(function(){E.emit("error",F)})}"responseType"in L&&(L.responseType=E._mode.split(":")[0]),"withCredentials"in L&&(L.withCredentials=!!S.withCredentials),E._mode==="text"&&"overrideMimeType"in L&&L.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in S&&(L.timeout=S.requestTimeout,L.ontimeout=function(){E.emit("requestTimeout")}),M.forEach(function(F){L.setRequestHeader(F[0],F[1])}),E._response=null,L.onreadystatechange=function(){switch(L.readyState){case b.LOADING:case b.DONE:E._onXHRProgress()}},E._mode==="moz-chunked-arraybuffer"&&(L.onprogress=function(){E._onXHRProgress()}),L.onerror=function(){E._destroyed||E.emit("error",new Error("XHR error"))};try{L.send(O)}catch(F){return void p.nextTick(function(){E.emit("error",F)})}}}},y.prototype._onXHRProgress=function(){(function(E){try{var S=E.status;return S!==null&&S!==0}catch{return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},y.prototype._connect=function(){var E=this;E._destroyed||(E._response=new v(E._xhr,E._fetchResponse,E._mode,E._fetchTimer),E._response.on("error",function(S){E.emit("error",S)}),E.emit("response",E._response))},y.prototype._write=function(E,S,k){this._body.push(E),k()},y.prototype.abort=y.prototype.destroy=function(){this._destroyed=!0,c.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},y.prototype.end=function(E,S,k){typeof E=="function"&&(k=E,E=void 0),u.Writable.prototype.end.call(this,E,S,k)},y.prototype.flushHeaders=function(){},y.prototype.setTimeout=function(){},y.prototype.setNoDelay=function(){},y.prototype.setSocketKeepAlive=function(){};var _=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,t(2).Buffer,t(6),t(5))},function(o,e){},function(o,e,t){var n=t(52).Buffer,c=t(207);o.exports=function(){function p(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,p),this.head=null,this.tail=null,this.length=0}return p.prototype.push=function(a){var f={data:a,next:null};this.length>0?this.tail.next=f:this.head=f,this.tail=f,++this.length},p.prototype.unshift=function(a){var f={data:a,next:this.head};this.length===0&&(this.tail=f),this.head=f,++this.length},p.prototype.shift=function(){if(this.length!==0){var a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}},p.prototype.clear=function(){this.head=this.tail=null,this.length=0},p.prototype.join=function(a){if(this.length===0)return"";for(var f=this.head,s=""+f.data;f=f.next;)s+=a+f.data;return s},p.prototype.concat=function(a){if(this.length===0)return n.alloc(0);if(this.length===1)return this.head.data;for(var f,s,u,h=n.allocUnsafe(a>>>0),v=this.head,b=0;v;)f=v.data,s=h,u=b,f.copy(s,u),b+=v.data.length,v=v.next;return h},p}(),c&&c.inspect&&c.inspect.custom&&(o.exports.prototype[c.inspect.custom]=function(){var p=c.inspect({length:this.length});return this.constructor.name+" "+p})},function(o,e){},function(o,e,t){(function(n,c){(function(p,a){if(!p.setImmediate){var f,s,u,h,v,b=1,y={},_=!1,E=p.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(p);S=S&&S.setTimeout?S:p,{}.toString.call(p.process)==="[object process]"?f=function(M){c.nextTick(function(){O(M)})}:function(){if(p.postMessage&&!p.importScripts){var M=!0,C=p.onmessage;return p.onmessage=function(){M=!1},p.postMessage("","*"),p.onmessage=C,M}}()?(h="setImmediate$"+Math.random()+"$",v=function(M){M.source===p&&typeof M.data=="string"&&M.data.indexOf(h)===0&&O(+M.data.slice(h.length))},p.addEventListener?p.addEventListener("message",v,!1):p.attachEvent("onmessage",v),f=function(M){p.postMessage(h+M,"*")}):p.MessageChannel?((u=new MessageChannel).port1.onmessage=function(M){O(M.data)},f=function(M){u.port2.postMessage(M)}):E&&"onreadystatechange"in E.createElement("script")?(s=E.documentElement,f=function(M){var C=E.createElement("script");C.onreadystatechange=function(){O(M),C.onreadystatechange=null,s.removeChild(C),C=null},s.appendChild(C)}):f=function(M){setTimeout(O,0,M)},S.setImmediate=function(M){typeof M!="function"&&(M=new Function(""+M));for(var C=new Array(arguments.length-1),N=0;N<C.length;N++)C[N]=arguments[N+1];var L={callback:M,args:C};return y[b]=L,f(b),b++},S.clearImmediate=k}function k(M){delete y[M]}function O(M){if(_)setTimeout(O,0,M);else{var C=y[M];if(C){_=!0;try{(function(N){var L=N.callback,F=N.args;switch(F.length){case 0:L();break;case 1:L(F[0]);break;case 2:L(F[0],F[1]);break;case 3:L(F[0],F[1],F[2]);break;default:L.apply(void 0,F)}})(C)}finally{k(M),_=!1}}}}})(typeof self=="undefined"?n===void 0?this:n:self)}).call(this,t(6),t(5))},function(o,e,t){var n=t(2),c=n.Buffer;function p(f,s){for(var u in f)s[u]=f[u]}function a(f,s,u){return c(f,s,u)}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=n:(p(n,e),e.Buffer=a),p(c,a),a.from=function(f,s,u){if(typeof f=="number")throw new TypeError("Argument must not be a number");return c(f,s,u)},a.alloc=function(f,s,u){if(typeof f!="number")throw new TypeError("Argument must be a number");var h=c(f);return s!==void 0?typeof u=="string"?h.fill(s,u):h.fill(s):h.fill(0),h},a.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return c(f)},a.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(f)}},function(o,e,t){o.exports=p;var n=t(109),c=Object.create(t(35));function p(a){if(!(this instanceof p))return new p(a);n.call(this,a)}c.inherits=t(3),c.inherits(p,n),p.prototype._transform=function(a,f,s){s(null,a)}},function(o,e,t){var n=t(2).Buffer;o.exports=function(c){if(c instanceof Uint8Array){if(c.byteOffset===0&&c.byteLength===c.buffer.byteLength)return c.buffer;if(typeof c.buffer.slice=="function")return c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength)}if(n.isBuffer(c)){for(var p=new Uint8Array(c.length),a=c.length,f=0;f<a;f++)p[f]=c[f];return p.buffer}throw new Error("Argument must be a Buffer")}},function(o,e){o.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(o,e,t){(function(n,c){var p;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(a){e&&e.nodeType,n&&n.nodeType;var f=typeof c=="object"&&c;f.global!==f&&f.window!==f&&f.self;var s,u=2147483647,h=/^xn--/,v=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=Math.floor,E=String.fromCharCode;function S(H){throw new RangeError(y[H])}function k(H,z){for(var R=H.length,l=[];R--;)l[R]=z(H[R]);return l}function O(H,z){var R=H.split("@"),l="";return R.length>1&&(l=R[0]+"@",H=R[1]),l+k((H=H.replace(b,".")).split("."),z).join(".")}function M(H){for(var z,R,l=[],x=0,d=H.length;x<d;)(z=H.charCodeAt(x++))>=55296&&z<=56319&&x<d?(64512&(R=H.charCodeAt(x++)))==56320?l.push(((1023&z)<<10)+(1023&R)+65536):(l.push(z),x--):l.push(z);return l}function C(H){return k(H,function(z){var R="";return z>65535&&(R+=E((z-=65536)>>>10&1023|55296),z=56320|1023&z),R+=E(z)}).join("")}function N(H,z){return H+22+75*(H<26)-((z!=0)<<5)}function L(H,z,R){var l=0;for(H=R?_(H/700):H>>1,H+=_(H/z);H>455;l+=36)H=_(H/35);return _(l+36*H/(H+38))}function F(H){var z,R,l,x,d,m,g,w,A,P,T,q=[],Z=H.length,I=0,$=128,K=72;for((R=H.lastIndexOf("-"))<0&&(R=0),l=0;l<R;++l)H.charCodeAt(l)>=128&&S("not-basic"),q.push(H.charCodeAt(l));for(x=R>0?R+1:0;x<Z;){for(d=I,m=1,g=36;x>=Z&&S("invalid-input"),((w=(T=H.charCodeAt(x++))-48<10?T-22:T-65<26?T-65:T-97<26?T-97:36)>=36||w>_((u-I)/m))&&S("overflow"),I+=w*m,!(w<(A=g<=K?1:g>=K+26?26:g-K));g+=36)m>_(u/(P=36-A))&&S("overflow"),m*=P;K=L(I-d,z=q.length+1,d==0),_(I/z)>u-$&&S("overflow"),$+=_(I/z),I%=z,q.splice(I++,0,$)}return C(q)}function V(H){var z,R,l,x,d,m,g,w,A,P,T,q,Z,I,$,K=[];for(q=(H=M(H)).length,z=128,R=0,d=72,m=0;m<q;++m)(T=H[m])<128&&K.push(E(T));for(l=x=K.length,x&&K.push("-");l<q;){for(g=u,m=0;m<q;++m)(T=H[m])>=z&&T<g&&(g=T);for(g-z>_((u-R)/(Z=l+1))&&S("overflow"),R+=(g-z)*Z,z=g,m=0;m<q;++m)if((T=H[m])<z&&++R>u&&S("overflow"),T==z){for(w=R,A=36;!(w<(P=A<=d?1:A>=d+26?26:A-d));A+=36)$=w-P,I=36-P,K.push(E(N(P+$%I,0))),w=_($/I);K.push(E(N(w,0))),d=L(R,Z,l==x),R=0,++l}++R,++z}return K.join("")}s={version:"1.4.1",ucs2:{decode:M,encode:C},decode:F,encode:V,toASCII:function(H){return O(H,function(z){return v.test(z)?"xn--"+V(z):z})},toUnicode:function(H){return O(H,function(z){return h.test(z)?F(z.slice(4).toLowerCase()):z})}},(p=function(){return s}.call(e,t,e,n))===void 0||(n.exports=p)})()}).call(this,t(25)(o),t(6))},function(o,e,t){o.exports={isString:function(n){return typeof n=="string"},isObject:function(n){return typeof n=="object"&&n!==null},isNull:function(n){return n===null},isNullOrUndefined:function(n){return n==null}}},function(o,e,t){e.decode=e.parse=t(216),e.encode=e.stringify=t(217)},function(o,e,t){function n(p,a){return Object.prototype.hasOwnProperty.call(p,a)}o.exports=function(p,a,f,s){a=a||"&",f=f||"=";var u={};if(typeof p!="string"||p.length===0)return u;var h=/\+/g;p=p.split(a);var v=1e3;s&&typeof s.maxKeys=="number"&&(v=s.maxKeys);var b=p.length;v>0&&b>v&&(b=v);for(var y=0;y<b;++y){var _,E,S,k,O=p[y].replace(h,"%20"),M=O.indexOf(f);M>=0?(_=O.substr(0,M),E=O.substr(M+1)):(_=O,E=""),S=decodeURIComponent(_),k=decodeURIComponent(E),n(u,S)?c(u[S])?u[S].push(k):u[S]=[u[S],k]:u[S]=k}return u};var c=Array.isArray||function(p){return Object.prototype.toString.call(p)==="[object Array]"}},function(o,e,t){var n=function(f){switch(typeof f){case"string":return f;case"boolean":return f?"true":"false";case"number":return isFinite(f)?f:"";default:return""}};o.exports=function(f,s,u,h){return s=s||"&",u=u||"=",f===null&&(f=void 0),typeof f=="object"?p(a(f),function(v){var b=encodeURIComponent(n(v))+u;return c(f[v])?p(f[v],function(y){return b+encodeURIComponent(n(y))}).join(s):b+encodeURIComponent(n(f[v]))}).join(s):h?encodeURIComponent(n(h))+u+encodeURIComponent(n(f)):""};var c=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"};function p(f,s){if(f.map)return f.map(s);for(var u=[],h=0;h<f.length;h++)u.push(s(f[h],h));return u}var a=Object.keys||function(f){var s=[];for(var u in f)Object.prototype.hasOwnProperty.call(f,u)&&s.push(u);return s}},function(o,e,t){var n=t(102),c=t(55),p=o.exports;for(var a in n)n.hasOwnProperty(a)&&(p[a]=n[a]);function f(s){if(typeof s=="string"&&(s=c.parse(s)),s.protocol||(s.protocol="https:"),s.protocol!=="https:")throw new Error('Protocol "'+s.protocol+'" not supported. Expected "https:"');return s}p.request=function(s,u){return s=f(s),n.request.call(this,s,u)},p.get=function(s,u){return s=f(s),n.get.call(this,s,u)}},function(o,e){e.endianness=function(){return"LE"},e.hostname=function(){return typeof location!="undefined"?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return typeof navigator!="undefined"?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL=`
`,e.homedir=function(){return"/"}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(c){this.type=c,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0};e.ProgressEvent=n},function(o,e,t){var n,c=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var v in h)h.hasOwnProperty(v)&&(u[v]=h[v])},function(u,h){function v(){this.constructor=u}n(u,h),u.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)});Object.defineProperty(e,"__esModule",{value:!0});var p=function(u){function h(){return u!==null&&u.apply(this,arguments)||this}return c(h,u),h}(Error);e.SecurityError=p;var a=function(u){function h(){return u!==null&&u.apply(this,arguments)||this}return c(h,u),h}(Error);e.InvalidStateError=a;var f=function(u){function h(){return u!==null&&u.apply(this,arguments)||this}return c(h,u),h}(Error);e.NetworkError=f;var s=function(u){function h(){return u!==null&&u.apply(this,arguments)||this}return c(h,u),h}(Error);e.SyntaxError=s},function(o,e,t){(function(n){var c,p=this&&this.__extends||(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,s){f.__proto__=s}||function(f,s){for(var u in s)s.hasOwnProperty(u)&&(f[u]=s[u])},function(f,s){function u(){this.constructor=f}c(f,s),f.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)});Object.defineProperty(e,"__esModule",{value:!0});var a=function(f){function s(){var u=f.call(this)||this;return u._contentType=null,u._body=null,u._reset(),u}return p(s,f),s.prototype._reset=function(){this._contentType=null,this._body=null},s.prototype._setData=function(u){if(u!=null)if(typeof u=="string")u.length!==0&&(this._contentType="text/plain;charset=UTF-8"),this._body=new n(u,"utf-8");else if(n.isBuffer(u))this._body=u;else if(u instanceof ArrayBuffer){for(var h=new n(u.byteLength),v=new Uint8Array(u),b=0;b<u.byteLength;b++)h[b]=v[b];this._body=h}else{if(!(u.buffer&&u.buffer instanceof ArrayBuffer))throw new Error("Unsupported send() data "+u);h=new n(u.byteLength);var y=u.byteOffset;for(v=new Uint8Array(u.buffer),b=0;b<u.byteLength;b++)h[b]=v[b+y];this._body=h}},s.prototype._finalizeHeaders=function(u,h){this._contentType&&!h["content-type"]&&(u["Content-Type"]=this._contentType),this._body&&(u["Content-Length"]=this._body.length.toString())},s.prototype._startUpload=function(u){this._body&&u.write(this._body),u.end()},s}(t(56).XMLHttpRequestEventTarget);e.XMLHttpRequestUpload=a}).call(this,t(2).Buffer)},function(o,e){(function(){function t(a,f,s,u){return this instanceof t?(this.domain=a||void 0,this.path=f||"/",this.secure=!!s,this.script=!!u,this):new t(a,f,s,u)}function n(a,f,s){return a instanceof n?a:this instanceof n?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(s||"/"),this.explicit_path=!1,this.domain=f||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,a&&this.parse(a,f,s),this):new n(a,f,s)}t.All=Object.freeze(Object.create(null)),e.CookieAccessInfo=t,e.Cookie=n,n.prototype.toString=function(){var a=[this.name+"="+this.value];return this.expiration_date!==1/0&&a.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&a.push("domain="+this.domain),this.path&&a.push("path="+this.path),this.secure&&a.push("secure"),this.noscript&&a.push("httponly"),a.join("; ")},n.prototype.toValueString=function(){return this.name+"="+this.value};var c=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function p(){var a,f;return this instanceof p?(a=Object.create(null),this.setCookie=function(s,u,h){var v,b;if(v=(s=new n(s,u,h)).expiration_date<=Date.now(),a[s.name]!==void 0){for(f=a[s.name],b=0;b<f.length;b+=1)if(f[b].collidesWith(s))return v?(f.splice(b,1),f.length===0&&delete a[s.name],!1):(f[b]=s,s);return!v&&(f.push(s),s)}return!v&&(a[s.name]=[s],a[s.name])},this.getCookie=function(s,u){var h,v;if(f=a[s]){for(v=0;v<f.length;v+=1)if((h=f[v]).expiration_date<=Date.now())f.length===0&&delete a[h.name];else if(h.matches(u))return h}},this.getCookies=function(s){var u,h,v=[];for(u in a)(h=this.getCookie(u,s))&&v.push(h);return v.toString=function(){return v.join(":")},v.toValueString=function(){return v.map(function(b){return b.toValueString()}).join("; ")},v},this):new p}n.prototype.parse=function(a,f,s){if(this instanceof n){var u,h=a.split(";").filter(function(_){return!!_}),v=h[0].match(/([^=]+)=([\s\S]*)/);if(!v)return void console.warn("Invalid cookie header encountered. Header: '"+a+"'");var b=v[1],y=v[2];if(typeof b!="string"||b.length===0||typeof y!="string")return void console.warn("Unable to extract values from cookie header. Cookie: '"+a+"'");for(this.name=b,this.value=y,u=1;u<h.length;u+=1)switch(b=(v=h[u].match(/([^=]+)(?:=([\s\S]*))?/))[1].trim().toLowerCase(),y=v[2],b){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=y?Number(Date.parse(y)):1/0;break;case"path":this.path=y?y.trim():"",this.explicit_path=!0;break;case"domain":this.domain=y?y.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0}return this.explicit_path||(this.path=s||"/"),this.explicit_domain||(this.domain=f),this}return new n().parse(a,f,s)},n.prototype.matches=function(a){return a===t.All||!(this.noscript&&a.script||this.secure&&!a.secure||!this.collidesWith(a))},n.prototype.collidesWith=function(a){if(this.path&&!a.path||this.domain&&!a.domain||this.path&&a.path.indexOf(this.path)!==0||this.explicit_path&&a.path.indexOf(this.path)!==0)return!1;var f=a.domain&&a.domain.replace(/^[\.]/,""),s=this.domain&&this.domain.replace(/^[\.]/,"");if(s===f)return!0;if(s){if(!this.explicit_domain)return!1;var u=f.indexOf(s);return u!==-1&&u===f.length-s.length}return!0},e.CookieJar=p,p.prototype.setCookies=function(a,f,s){var u,h,v=[];for(a=(a=Array.isArray(a)?a:a.split(c)).map(function(b){return new n(b,f,s)}),u=0;u<a.length;u+=1)h=a[u],this.setCookie(h,f,s)&&v.push(h);return v}})()},function(o,e,t){const n=t(12).EventEmitter,c=t(21).inherits,p=t(36),a=t(294),f=t(298),s=t(326),u=t(329),h=(t(149),t(67)),v=function(){};function b(y){n.call(this),this.setMaxListeners(30),y=y||{};const _={sendAsync:this._handleAsync.bind(this)},E=y.blockTrackerProvider||_;this._blockTracker=y.blockTracker||new a({provider:E,pollingInterval:y.pollingInterval||4e3,setSkipCacheFlag:!0}),this._ready=new u,this.currentBlock=null,this._providers=[]}o.exports=b,c(b,n),b.prototype.start=function(y=v){const _=this;_._ready.go(),_._blockTracker.on("latest",E=>{_._getBlockByNumberWithRetry(E,(S,k)=>{if(S)return void this.emit("error",S);if(!k)return console.log(k),void this.emit("error",new Error("Could not find block"));const O=(M=k,{number:p.toBuffer(M.number),hash:p.toBuffer(M.hash),parentHash:p.toBuffer(M.parentHash),nonce:p.toBuffer(M.nonce),mixHash:p.toBuffer(M.mixHash),sha3Uncles:p.toBuffer(M.sha3Uncles),logsBloom:p.toBuffer(M.logsBloom),transactionsRoot:p.toBuffer(M.transactionsRoot),stateRoot:p.toBuffer(M.stateRoot),receiptsRoot:p.toBuffer(M.receiptRoot||M.receiptsRoot),miner:p.toBuffer(M.miner),difficulty:p.toBuffer(M.difficulty),totalDifficulty:p.toBuffer(M.totalDifficulty),size:p.toBuffer(M.size),extraData:p.toBuffer(M.extraData),gasLimit:p.toBuffer(M.gasLimit),gasUsed:p.toBuffer(M.gasUsed),timestamp:p.toBuffer(M.timestamp),transactions:M.transactions});var M;_._setCurrentBlock(O),_.emit("rawBlock",k),_.emit("latest",k)})}),_._blockTracker.on("sync",_.emit.bind(_,"sync")),_._blockTracker.on("error",_.emit.bind(_,"error")),_._running=!0,_.emit("start")},b.prototype.stop=function(){this._blockTracker.removeAllListeners(),this._running=!1,this.emit("stop")},b.prototype.isRunning=function(){return this._running},b.prototype.addProvider=function(y,_){const E=this;typeof _=="number"?E._providers.splice(_,0,y):E._providers.push(y),y.setEngine(this)},b.prototype.removeProvider=function(y){const _=this._providers.indexOf(y);if(_<0)throw new Error("Provider not found.");this._providers.splice(_,1)},b.prototype.send=function(y){throw new Error("Web3ProviderEngine does not support synchronous requests.")},b.prototype.sendAsync=function(y,_){const E=this;E._ready.await(function(){Array.isArray(y)?f(y,E._handleAsync.bind(E),_):E._handleAsync(y,_)})},b.prototype._getBlockByNumberWithRetry=function(y,_){const E=this;let S=5;return void k();function k(){E._getBlockByNumber(y,O)}function O(M,C){return M?_(M):C?void _(null,C):S>0?(S--,void setTimeout(function(){k()},1e3)):void _(null,null)}},b.prototype._getBlockByNumber=function(y,_){const E=h({method:"eth_getBlockByNumber",params:[y,!1],skipCache:!0});this._handleAsync(E,(S,k)=>S?_(S):_(null,k.result))},b.prototype._handleAsync=function(y,_){var E=this,S=-1,k=null,O=null,M=[];function C(N,L){O=N,k=L,s(M,function(F,V){F?F(O,k,V):V()},function(){var F={id:y.id,jsonrpc:y.jsonrpc,result:k};O!=null?(F.error={message:O.stack||O.message||O,code:-32e3},_(O,F)):_(null,F)})}(function N(L){if(S+=1,M.unshift(L),S>=E._providers.length)C(new Error('Request for method "'+y.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{E._providers[S].handleRequest(y,N,C)}catch(F){C(F)}})()},b.prototype._setCurrentBlock=function(y){this.currentBlock=y,this.emit("block",y)}},function(o,e){o.exports=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}},function(o,e){typeof Object.create=="function"?o.exports=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:o.exports=function(t,n){t.super_=n;var c=function(){};c.prototype=n.prototype,t.prototype=new c,t.prototype.constructor=t}},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.createHashFunction=function(c){return function(p){var a=c();return a.update(p),n.from(a.digest())}}}).call(this,t(2).Buffer)},function(o,e,t){o.exports=t(229)(t(239))},function(o,e,t){const n=t(230),c=t(238);o.exports=function(p){const a=n(p),f=c(p);return function(s,u){switch(typeof s=="string"?s.toLowerCase():s){case"keccak224":return new a(1152,448,null,224,u);case"keccak256":return new a(1088,512,null,256,u);case"keccak384":return new a(832,768,null,384,u);case"keccak512":return new a(576,1024,null,512,u);case"sha3-224":return new a(1152,448,6,224,u);case"sha3-256":return new a(1088,512,6,256,u);case"sha3-384":return new a(832,768,6,384,u);case"sha3-512":return new a(576,1024,6,512,u);case"shake128":return new f(1344,256,31,u);case"shake256":return new f(1088,512,31,u);default:throw new Error("Invald algorithm: "+s)}}}},function(o,e,t){(function(n){const{Transform:c}=t(111);o.exports=p=>class ml extends c{constructor(f,s,u,h,v){super(v),this._rate=f,this._capacity=s,this._delimitedSuffix=u,this._hashBitLength=h,this._options=v,this._state=new p,this._state.initialize(f,s),this._finalized=!1}_transform(f,s,u){let h=null;try{this.update(f,s)}catch(v){h=v}u(h)}_flush(f){let s=null;try{this.push(this.digest())}catch(u){s=u}f(s)}update(f,s){if(!n.isBuffer(f)&&typeof f!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(f)||(f=n.from(f,s)),this._state.absorb(f),this}digest(f){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let s=this._state.squeeze(this._hashBitLength/8);return f!==void 0&&(s=s.toString(f)),this._resetState(),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const f=new ml(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(f._state),f._finalized=this._finalized,f}}}).call(this,t(2).Buffer)},function(o,e){},function(o,e,t){function n(u,h){var v=Object.keys(u);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(u);h&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(u,y).enumerable})),v.push.apply(v,b)}return v}function c(u,h,v){return h in u?Object.defineProperty(u,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):u[h]=v,u}function p(u,h){for(var v=0;v<h.length;v++){var b=h[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(u,b.key,b)}}var a=t(2).Buffer,f=t(233).inspect,s=f&&f.custom||"inspect";o.exports=function(){function u(){(function(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")})(this,u),this.head=null,this.tail=null,this.length=0}var h,v;return h=u,(v=[{key:"push",value:function(b){var y={data:b,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(b){var y={data:b,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var y=this.head,_=""+y.data;y=y.next;)_+=b+y.data;return _}},{key:"concat",value:function(b){if(this.length===0)return a.alloc(0);for(var y,_,E,S=a.allocUnsafe(b>>>0),k=this.head,O=0;k;)y=k.data,_=S,E=O,a.prototype.copy.call(y,_,E),O+=k.data.length,k=k.next;return S}},{key:"consume",value:function(b,y){var _;return b<this.head.data.length?(_=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):_=b===this.head.data.length?this.shift():y?this._getString(b):this._getBuffer(b),_}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var y=this.head,_=1,E=y.data;for(b-=E.length;y=y.next;){var S=y.data,k=b>S.length?S.length:b;if(k===S.length?E+=S:E+=S.slice(0,b),(b-=k)==0){k===S.length?(++_,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=S.slice(k));break}++_}return this.length-=_,E}},{key:"_getBuffer",value:function(b){var y=a.allocUnsafe(b),_=this.head,E=1;for(_.data.copy(y),b-=_.data.length;_=_.next;){var S=_.data,k=b>S.length?S.length:b;if(S.copy(y,y.length-b,0,k),(b-=k)==0){k===S.length?(++E,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=S.slice(k));break}++E}return this.length-=E,y}},{key:s,value:function(b,y){return f(this,function(_){for(var E=1;E<arguments.length;E++){var S=arguments[E]!=null?arguments[E]:{};E%2?n(Object(S),!0).forEach(function(k){c(_,k,S[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(S)):n(Object(S)).forEach(function(k){Object.defineProperty(_,k,Object.getOwnPropertyDescriptor(S,k))})}return _}({},y,{depth:0,customInspect:!1}))}}])&&p(h.prototype,v),u}()},function(o,e){},function(o,e,t){(function(n){var c;function p(M,C,N){return C in M?Object.defineProperty(M,C,{value:N,enumerable:!0,configurable:!0,writable:!0}):M[C]=N,M}var a=t(57),f=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),h=Symbol("ended"),v=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function _(M,C){return{value:M,done:C}}function E(M){var C=M[f];if(C!==null){var N=M[y].read();N!==null&&(M[v]=null,M[f]=null,M[s]=null,C(_(N,!1)))}}function S(M){n.nextTick(E,M)}var k=Object.getPrototypeOf(function(){}),O=Object.setPrototypeOf((p(c={get stream(){return this[y]},next:function(){var M=this,C=this[u];if(C!==null)return Promise.reject(C);if(this[h])return Promise.resolve(_(void 0,!0));if(this[y].destroyed)return new Promise(function(V,H){n.nextTick(function(){M[u]?H(M[u]):V(_(void 0,!0))})});var N,L=this[v];if(L)N=new Promise(function(V,H){return function(z,R){V.then(function(){H[h]?z(_(void 0,!0)):H[b](z,R)},R)}}(L,this));else{var F=this[y].read();if(F!==null)return Promise.resolve(_(F,!1));N=new Promise(this[b])}return this[v]=N,N}},Symbol.asyncIterator,function(){return this}),p(c,"return",function(){var M=this;return new Promise(function(C,N){M[y].destroy(null,function(L){L?N(L):C(_(void 0,!0))})})}),c),k);o.exports=function(M){var C,N=Object.create(O,(p(C={},y,{value:M,writable:!0}),p(C,f,{value:null,writable:!0}),p(C,s,{value:null,writable:!0}),p(C,u,{value:null,writable:!0}),p(C,h,{value:M._readableState.endEmitted,writable:!0}),p(C,b,{value:function(L,F){var V=N[y].read();V?(N[v]=null,N[f]=null,N[s]=null,L(_(V,!1))):(N[f]=L,N[s]=F)},writable:!0}),C));return N[v]=null,a(M,function(L){if(L&&L.code!=="ERR_STREAM_PREMATURE_CLOSE"){var F=N[s];return F!==null&&(N[v]=null,N[f]=null,N[s]=null,F(L)),void(N[u]=L)}var V=N[f];V!==null&&(N[v]=null,N[f]=null,N[s]=null,V(_(void 0,!0))),N[h]=!0}),M.on("readable",S.bind(null,N)),N}}).call(this,t(5))},function(o,e){o.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(o,e,t){o.exports=c;var n=t(117);function c(p){if(!(this instanceof c))return new c(p);n.call(this,p)}t(3)(c,n),c.prototype._transform=function(p,a,f){f(null,p)}},function(o,e,t){var n,c=t(27).codes,p=c.ERR_MISSING_ARGS,a=c.ERR_STREAM_DESTROYED;function f(b){if(b)throw b}function s(b,y,_,E){E=function(O){var M=!1;return function(){M||(M=!0,O.apply(void 0,arguments))}}(E);var S=!1;b.on("close",function(){S=!0}),n===void 0&&(n=t(57)),n(b,{readable:y,writable:_},function(O){if(O)return E(O);S=!0,E()});var k=!1;return function(O){if(!S&&!k)return k=!0,function(M){return M.setHeader&&typeof M.abort=="function"}(b)?b.abort():typeof b.destroy=="function"?b.destroy():void E(O||new a("pipe"))}}function u(b){b()}function h(b,y){return b.pipe(y)}function v(b){return b.length?typeof b[b.length-1]!="function"?f:b.pop():f}o.exports=function(){for(var b=arguments.length,y=new Array(b),_=0;_<b;_++)y[_]=arguments[_];var E,S=v(y);if(Array.isArray(y[0])&&(y=y[0]),y.length<2)throw new p("streams");var k=y.map(function(O,M){var C=M<y.length-1;return s(O,C,M>0,function(N){E||(E=N),N&&k.forEach(u),C||(k.forEach(u),S(E))})});return y.reduce(h)}},function(o,e,t){(function(n){const{Transform:c}=t(111);o.exports=p=>class gl extends c{constructor(f,s,u,h){super(h),this._rate=f,this._capacity=s,this._delimitedSuffix=u,this._options=h,this._state=new p,this._state.initialize(f,s),this._finalized=!1}_transform(f,s,u){let h=null;try{this.update(f,s)}catch(v){h=v}u(h)}_flush(){}_read(f){this.push(this.squeeze(f))}update(f,s){if(!n.isBuffer(f)&&typeof f!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(f)||(f=n.from(f,s)),this._state.absorb(f),this}squeeze(f,s){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let u=this._state.squeeze(f);return s!==void 0&&(u=u.toString(s)),u}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const f=new gl(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(f._state),f._finalized=this._finalized,f}}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){const c=t(240);function p(){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}p.prototype.initialize=function(a,f){for(let s=0;s<50;++s)this.state[s]=0;this.blockSize=a/8,this.count=0,this.squeezing=!1},p.prototype.absorb=function(a){for(let f=0;f<a.length;++f)this.state[~~(this.count/4)]^=a[f]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(c.p1600(this.state),this.count=0)},p.prototype.absorbLastFewBits=function(a){this.state[~~(this.count/4)]^=a<<this.count%4*8,(128&a)!=0&&this.count===this.blockSize-1&&c.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,c.p1600(this.state),this.count=0,this.squeezing=!0},p.prototype.squeeze=function(a){this.squeezing||this.absorbLastFewBits(1);const f=n.alloc(a);for(let s=0;s<a;++s)f[s]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(c.p1600(this.state),this.count=0);return f},p.prototype.copy=function(a){for(let f=0;f<50;++f)a.state[f]=this.state[f];a.blockSize=this.blockSize,a.count=this.count,a.squeezing=this.squeezing},o.exports=p}).call(this,t(2).Buffer)},function(o,e){const t=[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];e.p1600=function(n){for(let c=0;c<24;++c){const p=n[0]^n[10]^n[20]^n[30]^n[40],a=n[1]^n[11]^n[21]^n[31]^n[41],f=n[2]^n[12]^n[22]^n[32]^n[42],s=n[3]^n[13]^n[23]^n[33]^n[43],u=n[4]^n[14]^n[24]^n[34]^n[44],h=n[5]^n[15]^n[25]^n[35]^n[45],v=n[6]^n[16]^n[26]^n[36]^n[46],b=n[7]^n[17]^n[27]^n[37]^n[47],y=n[8]^n[18]^n[28]^n[38]^n[48],_=n[9]^n[19]^n[29]^n[39]^n[49];let E=y^(f<<1|s>>>31),S=_^(s<<1|f>>>31);const k=n[0]^E,O=n[1]^S,M=n[10]^E,C=n[11]^S,N=n[20]^E,L=n[21]^S,F=n[30]^E,V=n[31]^S,H=n[40]^E,z=n[41]^S;E=p^(u<<1|h>>>31),S=a^(h<<1|u>>>31);const R=n[2]^E,l=n[3]^S,x=n[12]^E,d=n[13]^S,m=n[22]^E,g=n[23]^S,w=n[32]^E,A=n[33]^S,P=n[42]^E,T=n[43]^S;E=f^(v<<1|b>>>31),S=s^(b<<1|v>>>31);const q=n[4]^E,Z=n[5]^S,I=n[14]^E,$=n[15]^S,K=n[24]^E,j=n[25]^S,D=n[34]^E,B=n[35]^S,U=n[44]^E,J=n[45]^S;E=u^(y<<1|_>>>31),S=h^(_<<1|y>>>31);const G=n[6]^E,W=n[7]^S,Y=n[16]^E,ee=n[17]^S,te=n[26]^E,oe=n[27]^S,fe=n[36]^E,ne=n[37]^S,ce=n[46]^E,se=n[47]^S;E=v^(p<<1|a>>>31),S=b^(a<<1|p>>>31);const ae=n[8]^E,he=n[9]^S,me=n[18]^E,le=n[19]^S,ye=n[28]^E,Se=n[29]^S,pe=n[38]^E,Oe=n[39]^S,Le=n[48]^E,_e=n[49]^S,Fe=k,qe=O,Ee=C<<4|M>>>28,je=M<<4|C>>>28,ie=N<<3|L>>>29,de=L<<3|N>>>29,ke=V<<9|F>>>23,Be=F<<9|V>>>23,ge=H<<18|z>>>14,Ue=z<<18|H>>>14,De=R<<1|l>>>31,we=l<<1|R>>>31,Ve=d<<12|x>>>20,et=x<<12|d>>>20,Ie=m<<10|g>>>22,Ge=g<<10|m>>>22,Je=A<<13|w>>>19,Re=w<<13|A>>>19,He=P<<2|T>>>30,tt=T<<2|P>>>30,Te=Z<<30|q>>>2,We=q<<30|Z>>>2,Ze=I<<6|$>>>26,Pe=$<<6|I>>>26,rt=j<<11|K>>>21,Ye=K<<11|j>>>21,Ae=D<<15|B>>>17,Xe=B<<15|D>>>17,Qe=J<<29|U>>>3,Ce=U<<29|J>>>3,Ke=G<<28|W>>>4,X=W<<28|G>>>4,Q=ee<<23|Y>>>9,re=Y<<23|ee>>>9,ue=te<<25|oe>>>7,xe=oe<<25|te>>>7,Me=fe<<21|ne>>>11,ze=ne<<21|fe>>>11,$e=se<<24|ce>>>8,it=ce<<24|se>>>8,Ne=ae<<27|he>>>5,ve=he<<27|ae>>>5,st=me<<20|le>>>12,dt=le<<20|me>>>12,vt=Se<<7|ye>>>25,mt=ye<<7|Se>>>25,_t=pe<<8|Oe>>>24,at=Oe<<8|pe>>>24,xt=Le<<14|_e>>>18,ut=_e<<14|Le>>>18;n[0]=Fe^~Ve&rt,n[1]=qe^~et&Ye,n[10]=Ke^~st&ie,n[11]=X^~dt&de,n[20]=De^~Ze&ue,n[21]=we^~Pe&xe,n[30]=Ne^~Ee&Ie,n[31]=ve^~je&Ge,n[40]=Te^~Q&vt,n[41]=We^~re&mt,n[2]=Ve^~rt&Me,n[3]=et^~Ye&ze,n[12]=st^~ie&Je,n[13]=dt^~de&Re,n[22]=Ze^~ue&_t,n[23]=Pe^~xe&at,n[32]=Ee^~Ie&Ae,n[33]=je^~Ge&Xe,n[42]=Q^~vt&ke,n[43]=re^~mt&Be,n[4]=rt^~Me&xt,n[5]=Ye^~ze&ut,n[14]=ie^~Je&Qe,n[15]=de^~Re&Ce,n[24]=ue^~_t&ge,n[25]=xe^~at&Ue,n[34]=Ie^~Ae&$e,n[35]=Ge^~Xe&it,n[44]=vt^~ke&He,n[45]=mt^~Be&tt,n[6]=Me^~xt&Fe,n[7]=ze^~ut&qe,n[16]=Je^~Qe&Ke,n[17]=Re^~Ce&X,n[26]=_t^~ge&De,n[27]=at^~Ue&we,n[36]=Ae^~$e&Ne,n[37]=Xe^~it&ve,n[46]=ke^~He&Te,n[47]=Be^~tt&We,n[8]=xt^~Fe&Ve,n[9]=ut^~qe&et,n[18]=Qe^~Ke&st,n[19]=Ce^~X&dt,n[28]=ge^~De&Ze,n[29]=Ue^~we&Pe,n[38]=$e^~Ne&Ee,n[39]=it^~ve&je,n[48]=He^~Te&Q,n[49]=tt^~We&re,n[0]^=t[2*c],n[1]^=t[2*c+1]}}},function(o,e,t){(function(n){var c=t(118),p=t(266),a=t(267),f=function(s){return s.length===32&&c.privateKeyVerify(Uint8Array.from(s))};o.exports={privateKeyVerify:f,privateKeyExport:function(s,u){if(s.length!==32)throw new RangeError("private key length is invalid");var h=p.privateKeyExport(s,u);return a.privateKeyExport(s,h,u)},privateKeyImport:function(s){if((s=a.privateKeyImport(s))!==null&&s.length===32&&f(s))return s;throw new Error("couldn't import from DER format")},privateKeyNegate:function(s){return n.from(c.privateKeyNegate(Uint8Array.from(s)))},privateKeyModInverse:function(s){if(s.length!==32)throw new Error("private key length is invalid");return n.from(p.privateKeyModInverse(Uint8Array.from(s)))},privateKeyTweakAdd:function(s,u){return n.from(c.privateKeyTweakAdd(Uint8Array.from(s),u))},privateKeyTweakMul:function(s,u){return n.from(c.privateKeyTweakMul(Uint8Array.from(s),Uint8Array.from(u)))},publicKeyCreate:function(s,u){return n.from(c.publicKeyCreate(Uint8Array.from(s),u))},publicKeyConvert:function(s,u){return n.from(c.publicKeyConvert(Uint8Array.from(s),u))},publicKeyVerify:function(s){return(s.length===33||s.length===65)&&c.publicKeyVerify(Uint8Array.from(s))},publicKeyTweakAdd:function(s,u,h){return n.from(c.publicKeyTweakAdd(Uint8Array.from(s),Uint8Array.from(u),h))},publicKeyTweakMul:function(s,u,h){return n.from(c.publicKeyTweakMul(Uint8Array.from(s),Uint8Array.from(u),h))},publicKeyCombine:function(s,u){var h=[];return s.forEach(function(v){h.push(Uint8Array.from(v))}),n.from(c.publicKeyCombine(h,u))},signatureNormalize:function(s){return n.from(c.signatureNormalize(Uint8Array.from(s)))},signatureExport:function(s){return n.from(c.signatureExport(Uint8Array.from(s)))},signatureImport:function(s){return n.from(c.signatureImport(Uint8Array.from(s)))},signatureImportLax:function(s){if(s.length===0)throw new RangeError("signature length is invalid");var u=a.signatureImportLax(s);if(u===null)throw new Error("couldn't parse DER signature");return p.signatureImport(u)},sign:function(s,u,h){if(h===null)throw new TypeError("options should be an Object");var v=void 0;if(h){if(v={},h.data===null)throw new TypeError("options.data should be a Buffer");if(h.data){if(h.data.length!==32)throw new RangeError("options.data length is invalid");v.data=new Uint8Array(h.data)}if(h.noncefn===null)throw new TypeError("options.noncefn should be a Function");h.noncefn&&(v.noncefn=function(y,_,E,S,k){var O=E!=null?n.from(E):null,M=S!=null?n.from(S):null,C=n.from("");return h.noncefn&&(C=h.noncefn(n.from(y),n.from(_),O,M,k)),Uint8Array.from(C)})}var b=c.ecdsaSign(Uint8Array.from(s),Uint8Array.from(u),v);return{signature:n.from(b.signature),recovery:b.recid}},verify:function(s,u,h){return c.ecdsaVerify(Uint8Array.from(u),Uint8Array.from(s),h)},recover:function(s,u,h,v){return n.from(c.ecdsaRecover(Uint8Array.from(u),h,Uint8Array.from(s),v))},ecdh:function(s,u){return n.from(c.ecdh(Uint8Array.from(s),Uint8Array.from(u),{}))},ecdhUnsafe:function(s,u,h){if(s.length!==33&&s.length!==65)throw new RangeError("public key length is invalid");if(u.length!==32)throw new RangeError("private key length is invalid");return n.from(p.ecdhUnsafe(Uint8Array.from(s),Uint8Array.from(u),h))}}}).call(this,t(2).Buffer)},function(o,e){const t="Impossible case. Please create issue.",n="The tweak was out of range or the resulted private key is invalid",c="The tweak was out of range or equal to zero",p="Unknow error on context randomization",a="Private Key is invalid",f="Public Key could not be parsed",s="Public Key serialization error",u="The sum of the public keys is not valid",h="Signature could not be parsed",v="The nonce generation function failed, or the private key was invalid",b="Public key could not be recover",y="Scalar was invalid (zero or overflow)";function _(M,C){if(!M)throw new Error(C)}function E(M,C,N){if(_(C instanceof Uint8Array,`Expected ${M} to be an Uint8Array`),N!==void 0)if(Array.isArray(N)){const L=`Expected ${M} to be an Uint8Array with length [${N.join(", ")}]`;_(N.includes(C.length),L)}else{const L=`Expected ${M} to be an Uint8Array with length ${N}`;_(C.length===N,L)}}function S(M){_(O(M)==="Boolean","Expected compressed to be a Boolean")}function k(M=N=>new Uint8Array(N),C){return typeof M=="function"&&(M=M(C)),E("output",M,C),M}function O(M){return Object.prototype.toString.call(M).slice(8,-1)}o.exports=M=>({contextRandomize(C){switch(_(C===null||C instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),C!==null&&E("seed",C,32),M.contextRandomize(C)){case 1:throw new Error(p)}},privateKeyVerify:C=>(E("private key",C,32),M.privateKeyVerify(C)===0),privateKeyNegate(C){switch(E("private key",C,32),M.privateKeyNegate(C)){case 0:return C;case 1:throw new Error(t)}},privateKeyTweakAdd(C,N){switch(E("private key",C,32),E("tweak",N,32),M.privateKeyTweakAdd(C,N)){case 0:return C;case 1:throw new Error(n)}},privateKeyTweakMul(C,N){switch(E("private key",C,32),E("tweak",N,32),M.privateKeyTweakMul(C,N)){case 0:return C;case 1:throw new Error(c)}},publicKeyVerify:C=>(E("public key",C,[33,65]),M.publicKeyVerify(C)===0),publicKeyCreate(C,N=!0,L){switch(E("private key",C,32),S(N),L=k(L,N?33:65),M.publicKeyCreate(L,C)){case 0:return L;case 1:throw new Error(a);case 2:throw new Error(s)}},publicKeyConvert(C,N=!0,L){switch(E("public key",C,[33,65]),S(N),L=k(L,N?33:65),M.publicKeyConvert(L,C)){case 0:return L;case 1:throw new Error(f);case 2:throw new Error(s)}},publicKeyNegate(C,N=!0,L){switch(E("public key",C,[33,65]),S(N),L=k(L,N?33:65),M.publicKeyNegate(L,C)){case 0:return L;case 1:throw new Error(f);case 2:throw new Error(t);case 3:throw new Error(s)}},publicKeyCombine(C,N=!0,L){_(Array.isArray(C),"Expected public keys to be an Array"),_(C.length>0,"Expected public keys array will have more than zero items");for(const F of C)E("public key",F,[33,65]);switch(S(N),L=k(L,N?33:65),M.publicKeyCombine(L,C)){case 0:return L;case 1:throw new Error(f);case 2:throw new Error(u);case 3:throw new Error(s)}},publicKeyTweakAdd(C,N,L=!0,F){switch(E("public key",C,[33,65]),E("tweak",N,32),S(L),F=k(F,L?33:65),M.publicKeyTweakAdd(F,C,N)){case 0:return F;case 1:throw new Error(f);case 2:throw new Error(n)}},publicKeyTweakMul(C,N,L=!0,F){switch(E("public key",C,[33,65]),E("tweak",N,32),S(L),F=k(F,L?33:65),M.publicKeyTweakMul(F,C,N)){case 0:return F;case 1:throw new Error(f);case 2:throw new Error(c)}},signatureNormalize(C){switch(E("signature",C,64),M.signatureNormalize(C)){case 0:return C;case 1:throw new Error(h)}},signatureExport(C,N){E("signature",C,64);const L={output:N=k(N,72),outputlen:72};switch(M.signatureExport(L,C)){case 0:return N.slice(0,L.outputlen);case 1:throw new Error(h);case 2:throw new Error(t)}},signatureImport(C,N){switch(E("signature",C),N=k(N,64),M.signatureImport(N,C)){case 0:return N;case 1:throw new Error(h);case 2:throw new Error(t)}},ecdsaSign(C,N,L={},F){E("message",C,32),E("private key",N,32),_(O(L)==="Object","Expected options to be an Object"),L.data!==void 0&&E("options.data",L.data),L.noncefn!==void 0&&_(O(L.noncefn)==="Function","Expected options.noncefn to be a Function");const V={signature:F=k(F,64),recid:null};switch(M.ecdsaSign(V,C,N,L.data,L.noncefn)){case 0:return V;case 1:throw new Error(v);case 2:throw new Error(t)}},ecdsaVerify(C,N,L){switch(E("signature",C,64),E("message",N,32),E("public key",L,[33,65]),M.ecdsaVerify(C,N,L)){case 0:return!0;case 3:return!1;case 1:throw new Error(h);case 2:throw new Error(f)}},ecdsaRecover(C,N,L,F=!0,V){switch(E("signature",C,64),_(O(N)==="Number"&&N>=0&&N<=3,"Expected recovery id to be a Number within interval [0, 3]"),E("message",L,32),S(F),V=k(V,F?33:65),M.ecdsaRecover(V,C,N,L)){case 0:return V;case 1:throw new Error(h);case 2:throw new Error(b);case 3:throw new Error(t)}},ecdh(C,N,L={},F){switch(E("public key",C,[33,65]),E("private key",N,32),_(O(L)==="Object","Expected options to be an Object"),L.data!==void 0&&E("options.data",L.data),L.hashfn!==void 0?(_(O(L.hashfn)==="Function","Expected options.hashfn to be a Function"),L.xbuf!==void 0&&E("options.xbuf",L.xbuf,32),L.ybuf!==void 0&&E("options.ybuf",L.ybuf,32),E("output",F)):F=k(F,32),M.ecdh(F,C,N,L.data,L.hashfn,L.xbuf,L.ybuf)){case 0:return F;case 1:throw new Error(f);case 2:throw new Error(y)}}})},function(o,e,t){const n=new(t(58)).ec("secp256k1"),c=n.curve,p=c.n.constructor;function a(s){const u=s[0];switch(u){case 2:case 3:return s.length!==33?null:function(h,v){let b=new p(v);if(b.cmp(c.p)>=0)return null;b=b.toRed(c.red);let y=b.redSqr().redIMul(b).redIAdd(c.b).redSqrt();return h===3!==y.isOdd()&&(y=y.redNeg()),n.keyPair({pub:{x:b,y}})}(u,s.subarray(1,33));case 4:case 6:case 7:return s.length!==65?null:function(h,v,b){let y=new p(v),_=new p(b);if(y.cmp(c.p)>=0||_.cmp(c.p)>=0||(y=y.toRed(c.red),_=_.toRed(c.red),(h===6||h===7)&&_.isOdd()!==(h===7)))return null;const E=y.redSqr().redIMul(y);return _.redSqr().redISub(E.redIAdd(c.b)).isZero()?n.keyPair({pub:{x:y,y:_}}):null}(u,s.subarray(1,33),s.subarray(33,65));default:return null}}function f(s,u){const h=u.encode(null,s.length===33);for(let v=0;v<s.length;++v)s[v]=h[v]}o.exports={contextRandomize:()=>0,privateKeyVerify(s){const u=new p(s);return u.cmp(c.n)<0&&!u.isZero()?0:1},privateKeyNegate(s){const u=new p(s),h=c.n.sub(u).umod(c.n).toArrayLike(Uint8Array,"be",32);return s.set(h),0},privateKeyTweakAdd(s,u){const h=new p(u);if(h.cmp(c.n)>=0||(h.iadd(new p(s)),h.cmp(c.n)>=0&&h.isub(c.n),h.isZero()))return 1;const v=h.toArrayLike(Uint8Array,"be",32);return s.set(v),0},privateKeyTweakMul(s,u){let h=new p(u);if(h.cmp(c.n)>=0||h.isZero())return 1;h.imul(new p(s)),h.cmp(c.n)>=0&&(h=h.umod(c.n));const v=h.toArrayLike(Uint8Array,"be",32);return s.set(v),0},publicKeyVerify:s=>a(s)===null?1:0,publicKeyCreate(s,u){const h=new p(u);return h.cmp(c.n)>=0||h.isZero()?1:(f(s,n.keyFromPrivate(u).getPublic()),0)},publicKeyConvert(s,u){const h=a(u);return h===null?1:(f(s,h.getPublic()),0)},publicKeyNegate(s,u){const h=a(u);if(h===null)return 1;const v=h.getPublic();return v.y=v.y.redNeg(),f(s,v),0},publicKeyCombine(s,u){const h=new Array(u.length);for(let b=0;b<u.length;++b)if(h[b]=a(u[b]),h[b]===null)return 1;let v=h[0].getPublic();for(let b=1;b<h.length;++b)v=v.add(h[b].pub);return v.isInfinity()?2:(f(s,v),0)},publicKeyTweakAdd(s,u,h){const v=a(u);if(v===null)return 1;if((h=new p(h)).cmp(c.n)>=0)return 2;const b=v.getPublic().add(c.g.mul(h));return b.isInfinity()?2:(f(s,b),0)},publicKeyTweakMul(s,u,h){const v=a(u);return v===null?1:(h=new p(h)).cmp(c.n)>=0||h.isZero()?2:(f(s,v.getPublic().mul(h)),0)},signatureNormalize(s){const u=new p(s.subarray(0,32)),h=new p(s.subarray(32,64));return u.cmp(c.n)>=0||h.cmp(c.n)>=0?1:(h.cmp(n.nh)===1&&s.set(c.n.sub(h).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(s,u){const h=u.subarray(0,32),v=u.subarray(32,64);if(new p(h).cmp(c.n)>=0||new p(v).cmp(c.n)>=0)return 1;const{output:b}=s;let y=b.subarray(4,37);y[0]=0,y.set(h,1);let _=33,E=0;for(;_>1&&y[E]===0&&!(128&y[E+1]);--_,++E);if(y=y.subarray(E),128&y[0]||_>1&&y[0]===0&&!(128&y[1]))return 1;let S=b.subarray(39,72);S[0]=0,S.set(v,1);let k=33,O=0;for(;k>1&&S[O]===0&&!(128&S[O+1]);--k,++O);return S=S.subarray(O),128&S[0]||k>1&&S[0]===0&&!(128&S[1])?1:(s.outputlen=6+_+k,b[0]=48,b[1]=s.outputlen-2,b[2]=2,b[3]=y.length,b.set(y,4),b[4+_]=2,b[5+_]=S.length,b.set(S,6+_),0)},signatureImport(s,u){if(u.length<8||u.length>72||u[0]!==48||u[1]!==u.length-2||u[2]!==2)return 1;const h=u[3];if(h===0||5+h>=u.length||u[4+h]!==2)return 1;const v=u[5+h];if(v===0||6+h+v!==u.length||128&u[4]||h>1&&u[4]===0&&!(128&u[5])||128&u[h+6]||v>1&&u[h+6]===0&&!(128&u[h+7]))return 1;let b=u.subarray(4,4+h);if(b.length===33&&b[0]===0&&(b=b.subarray(1)),b.length>32)return 1;let y=u.subarray(6+h);if(y.length===33&&y[0]===0&&(y=y.slice(1)),y.length>32)throw new Error("S length is too long");let _=new p(b);_.cmp(c.n)>=0&&(_=new p(0));let E=new p(u.subarray(6+h));return E.cmp(c.n)>=0&&(E=new p(0)),s.set(_.toArrayLike(Uint8Array,"be",32),0),s.set(E.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(s,u,h,v,b){if(b){const E=b;b=S=>{const k=E(u,h,null,v,S);if(!(k instanceof Uint8Array&&k.length===32))throw new Error("This is the way");return new p(k)}}const y=new p(h);if(y.cmp(c.n)>=0||y.isZero())return 1;let _;try{_=n.sign(u,h,{canonical:!0,k:b,pers:v})}catch{return 1}return s.signature.set(_.r.toArrayLike(Uint8Array,"be",32),0),s.signature.set(_.s.toArrayLike(Uint8Array,"be",32),32),s.recid=_.recoveryParam,0},ecdsaVerify(s,u,h){const v={r:s.subarray(0,32),s:s.subarray(32,64)},b=new p(v.r),y=new p(v.s);if(b.cmp(c.n)>=0||y.cmp(c.n)>=0)return 1;if(y.cmp(n.nh)===1||b.isZero()||y.isZero())return 3;const _=a(h);if(_===null)return 2;const E=_.getPublic();return n.verify(u,v,E)?0:3},ecdsaRecover(s,u,h,v){const b={r:u.slice(0,32),s:u.slice(32,64)},y=new p(b.r),_=new p(b.s);if(y.cmp(c.n)>=0||_.cmp(c.n)>=0)return 1;if(y.isZero()||_.isZero())return 2;let E;try{E=n.recoverPubKey(v,b,h)}catch{return 2}return f(s,E),0},ecdh(s,u,h,v,b,y,_){const E=a(u);if(E===null)return 1;const S=new p(h);if(S.cmp(c.n)>=0||S.isZero())return 2;const k=E.getPublic().mul(S);if(b===void 0){const O=k.encode(null,!0),M=n.hash().update(O).digest();for(let C=0;C<32;++C)s[C]=M[C]}else{y||(y=new Uint8Array(32));const O=k.getX().toArray("be",32);for(let N=0;N<32;++N)y[N]=O[N];_||(_=new Uint8Array(32));const M=k.getY().toArray("be",32);for(let N=0;N<32;++N)_[N]=M[N];const C=b(y,_,v);if(!(C instanceof Uint8Array&&C.length===s.length))return 2;s.set(C)}return 0}}},function(o){o.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(o,e){},function(o,e){},function(o,e,t){var n=t(11),c=t(16),p=t(3),a=t(45),f=n.assert;function s(v){a.call(this,"short",v),this.a=new c(v.a,16).toRed(this.red),this.b=new c(v.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(v),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(v,b,y,_){a.BasePoint.call(this,v,"affine"),b===null&&y===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new c(b,16),this.y=new c(y,16),_&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(v,b,y,_){a.BasePoint.call(this,v,"jacobian"),b===null&&y===null&&_===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new c(0)):(this.x=new c(b,16),this.y=new c(y,16),this.z=new c(_,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}p(s,a),o.exports=s,s.prototype._getEndomorphism=function(v){if(this.zeroA&&this.g&&this.n&&this.p.modn(3)===1){var b,y;if(v.beta)b=new c(v.beta,16).toRed(this.red);else{var _=this._getEndoRoots(this.p);b=(b=_[0].cmp(_[1])<0?_[0]:_[1]).toRed(this.red)}if(v.lambda)y=new c(v.lambda,16);else{var E=this._getEndoRoots(this.n);this.g.mul(E[0]).x.cmp(this.g.x.redMul(b))===0?y=E[0]:(y=E[1],f(this.g.mul(y).x.cmp(this.g.x.redMul(b))===0))}return{beta:b,lambda:y,basis:v.basis?v.basis.map(function(S){return{a:new c(S.a,16),b:new c(S.b,16)}}):this._getEndoBasis(y)}}},s.prototype._getEndoRoots=function(v){var b=v===this.p?this.red:c.mont(v),y=new c(2).toRed(b).redInvm(),_=y.redNeg(),E=new c(3).toRed(b).redNeg().redSqrt().redMul(y);return[_.redAdd(E).fromRed(),_.redSub(E).fromRed()]},s.prototype._getEndoBasis=function(v){for(var b,y,_,E,S,k,O,M,C,N=this.n.ushrn(Math.floor(this.n.bitLength()/2)),L=v,F=this.n.clone(),V=new c(1),H=new c(0),z=new c(0),R=new c(1),l=0;L.cmpn(0)!==0;){var x=F.div(L);M=F.sub(x.mul(L)),C=z.sub(x.mul(V));var d=R.sub(x.mul(H));if(!_&&M.cmp(N)<0)b=O.neg(),y=V,_=M.neg(),E=C;else if(_&&++l==2)break;O=M,F=L,L=M,z=V,V=C,R=H,H=d}S=M.neg(),k=C;var m=_.sqr().add(E.sqr());return S.sqr().add(k.sqr()).cmp(m)>=0&&(S=b,k=y),_.negative&&(_=_.neg(),E=E.neg()),S.negative&&(S=S.neg(),k=k.neg()),[{a:_,b:E},{a:S,b:k}]},s.prototype._endoSplit=function(v){var b=this.endo.basis,y=b[0],_=b[1],E=_.b.mul(v).divRound(this.n),S=y.b.neg().mul(v).divRound(this.n),k=E.mul(y.a),O=S.mul(_.a),M=E.mul(y.b),C=S.mul(_.b);return{k1:v.sub(k).sub(O),k2:M.add(C).neg()}},s.prototype.pointFromX=function(v,b){(v=new c(v,16)).red||(v=v.toRed(this.red));var y=v.redSqr().redMul(v).redIAdd(v.redMul(this.a)).redIAdd(this.b),_=y.redSqrt();if(_.redSqr().redSub(y).cmp(this.zero)!==0)throw new Error("invalid point");var E=_.fromRed().isOdd();return(b&&!E||!b&&E)&&(_=_.redNeg()),this.point(v,_)},s.prototype.validate=function(v){if(v.inf)return!0;var b=v.x,y=v.y,_=this.a.redMul(b),E=b.redSqr().redMul(b).redIAdd(_).redIAdd(this.b);return y.redSqr().redISub(E).cmpn(0)===0},s.prototype._endoWnafMulAdd=function(v,b,y){for(var _=this._endoWnafT1,E=this._endoWnafT2,S=0;S<v.length;S++){var k=this._endoSplit(b[S]),O=v[S],M=O._getBeta();k.k1.negative&&(k.k1.ineg(),O=O.neg(!0)),k.k2.negative&&(k.k2.ineg(),M=M.neg(!0)),_[2*S]=O,_[2*S+1]=M,E[2*S]=k.k1,E[2*S+1]=k.k2}for(var C=this._wnafMulAdd(1,_,E,2*S,y),N=0;N<2*S;N++)_[N]=null,E[N]=null;return C},p(u,a.BasePoint),s.prototype.point=function(v,b,y){return new u(this,v,b,y)},s.prototype.pointFromJSON=function(v,b){return u.fromJSON(this,v,b)},u.prototype._getBeta=function(){if(this.curve.endo){var v=this.precomputed;if(v&&v.beta)return v.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(v){var y=this.curve,_=function(E){return y.point(E.x.redMul(y.endo.beta),E.y)};v.beta=b,b.precomputed={beta:null,naf:v.naf&&{wnd:v.naf.wnd,points:v.naf.points.map(_)},doubles:v.doubles&&{step:v.doubles.step,points:v.doubles.points.map(_)}}}return b}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(v,b,y){typeof b=="string"&&(b=JSON.parse(b));var _=v.point(b[0],b[1],y);if(!b[2])return _;function E(k){return v.point(k[0],k[1],y)}var S=b[2];return _.precomputed={beta:null,doubles:S.doubles&&{step:S.doubles.step,points:[_].concat(S.doubles.points.map(E))},naf:S.naf&&{wnd:S.naf.wnd,points:[_].concat(S.naf.points.map(E))}},_},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(v){if(this.inf)return v;if(v.inf)return this;if(this.eq(v))return this.dbl();if(this.neg().eq(v))return this.curve.point(null,null);if(this.x.cmp(v.x)===0)return this.curve.point(null,null);var b=this.y.redSub(v.y);b.cmpn(0)!==0&&(b=b.redMul(this.x.redSub(v.x).redInvm()));var y=b.redSqr().redISub(this.x).redISub(v.x),_=b.redMul(this.x.redSub(y)).redISub(this.y);return this.curve.point(y,_)},u.prototype.dbl=function(){if(this.inf)return this;var v=this.y.redAdd(this.y);if(v.cmpn(0)===0)return this.curve.point(null,null);var b=this.curve.a,y=this.x.redSqr(),_=v.redInvm(),E=y.redAdd(y).redIAdd(y).redIAdd(b).redMul(_),S=E.redSqr().redISub(this.x.redAdd(this.x)),k=E.redMul(this.x.redSub(S)).redISub(this.y);return this.curve.point(S,k)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(v){return v=new c(v,16),this.isInfinity()?this:this._hasDoubles(v)?this.curve._fixedNafMul(this,v):this.curve.endo?this.curve._endoWnafMulAdd([this],[v]):this.curve._wnafMul(this,v)},u.prototype.mulAdd=function(v,b,y){var _=[this,b],E=[v,y];return this.curve.endo?this.curve._endoWnafMulAdd(_,E):this.curve._wnafMulAdd(1,_,E,2)},u.prototype.jmulAdd=function(v,b,y){var _=[this,b],E=[v,y];return this.curve.endo?this.curve._endoWnafMulAdd(_,E,!0):this.curve._wnafMulAdd(1,_,E,2,!0)},u.prototype.eq=function(v){return this===v||this.inf===v.inf&&(this.inf||this.x.cmp(v.x)===0&&this.y.cmp(v.y)===0)},u.prototype.neg=function(v){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(v&&this.precomputed){var y=this.precomputed,_=function(E){return E.neg()};b.precomputed={naf:y.naf&&{wnd:y.naf.wnd,points:y.naf.points.map(_)},doubles:y.doubles&&{step:y.doubles.step,points:y.doubles.points.map(_)}}}return b},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},p(h,a.BasePoint),s.prototype.jpoint=function(v,b,y){return new h(this,v,b,y)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var v=this.z.redInvm(),b=v.redSqr(),y=this.x.redMul(b),_=this.y.redMul(b).redMul(v);return this.curve.point(y,_)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(v){if(this.isInfinity())return v;if(v.isInfinity())return this;var b=v.z.redSqr(),y=this.z.redSqr(),_=this.x.redMul(b),E=v.x.redMul(y),S=this.y.redMul(b.redMul(v.z)),k=v.y.redMul(y.redMul(this.z)),O=_.redSub(E),M=S.redSub(k);if(O.cmpn(0)===0)return M.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var C=O.redSqr(),N=C.redMul(O),L=_.redMul(C),F=M.redSqr().redIAdd(N).redISub(L).redISub(L),V=M.redMul(L.redISub(F)).redISub(S.redMul(N)),H=this.z.redMul(v.z).redMul(O);return this.curve.jpoint(F,V,H)},h.prototype.mixedAdd=function(v){if(this.isInfinity())return v.toJ();if(v.isInfinity())return this;var b=this.z.redSqr(),y=this.x,_=v.x.redMul(b),E=this.y,S=v.y.redMul(b).redMul(this.z),k=y.redSub(_),O=E.redSub(S);if(k.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var M=k.redSqr(),C=M.redMul(k),N=y.redMul(M),L=O.redSqr().redIAdd(C).redISub(N).redISub(N),F=O.redMul(N.redISub(L)).redISub(E.redMul(C)),V=this.z.redMul(k);return this.curve.jpoint(L,F,V)},h.prototype.dblp=function(v){if(v===0)return this;if(this.isInfinity())return this;if(!v)return this.dbl();var b;if(this.curve.zeroA||this.curve.threeA){var y=this;for(b=0;b<v;b++)y=y.dbl();return y}var _=this.curve.a,E=this.curve.tinv,S=this.x,k=this.y,O=this.z,M=O.redSqr().redSqr(),C=k.redAdd(k);for(b=0;b<v;b++){var N=S.redSqr(),L=C.redSqr(),F=L.redSqr(),V=N.redAdd(N).redIAdd(N).redIAdd(_.redMul(M)),H=S.redMul(L),z=V.redSqr().redISub(H.redAdd(H)),R=H.redISub(z),l=V.redMul(R);l=l.redIAdd(l).redISub(F);var x=C.redMul(O);b+1<v&&(M=M.redMul(F)),S=z,O=x,C=l}return this.curve.jpoint(S,C.redMul(E),O)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var v,b,y;if(this.zOne){var _=this.x.redSqr(),E=this.y.redSqr(),S=E.redSqr(),k=this.x.redAdd(E).redSqr().redISub(_).redISub(S);k=k.redIAdd(k);var O=_.redAdd(_).redIAdd(_),M=O.redSqr().redISub(k).redISub(k),C=S.redIAdd(S);C=(C=C.redIAdd(C)).redIAdd(C),v=M,b=O.redMul(k.redISub(M)).redISub(C),y=this.y.redAdd(this.y)}else{var N=this.x.redSqr(),L=this.y.redSqr(),F=L.redSqr(),V=this.x.redAdd(L).redSqr().redISub(N).redISub(F);V=V.redIAdd(V);var H=N.redAdd(N).redIAdd(N),z=H.redSqr(),R=F.redIAdd(F);R=(R=R.redIAdd(R)).redIAdd(R),v=z.redISub(V).redISub(V),b=H.redMul(V.redISub(v)).redISub(R),y=(y=this.y.redMul(this.z)).redIAdd(y)}return this.curve.jpoint(v,b,y)},h.prototype._threeDbl=function(){var v,b,y;if(this.zOne){var _=this.x.redSqr(),E=this.y.redSqr(),S=E.redSqr(),k=this.x.redAdd(E).redSqr().redISub(_).redISub(S);k=k.redIAdd(k);var O=_.redAdd(_).redIAdd(_).redIAdd(this.curve.a),M=O.redSqr().redISub(k).redISub(k);v=M;var C=S.redIAdd(S);C=(C=C.redIAdd(C)).redIAdd(C),b=O.redMul(k.redISub(M)).redISub(C),y=this.y.redAdd(this.y)}else{var N=this.z.redSqr(),L=this.y.redSqr(),F=this.x.redMul(L),V=this.x.redSub(N).redMul(this.x.redAdd(N));V=V.redAdd(V).redIAdd(V);var H=F.redIAdd(F),z=(H=H.redIAdd(H)).redAdd(H);v=V.redSqr().redISub(z),y=this.y.redAdd(this.z).redSqr().redISub(L).redISub(N);var R=L.redSqr();R=(R=(R=R.redIAdd(R)).redIAdd(R)).redIAdd(R),b=V.redMul(H.redISub(v)).redISub(R)}return this.curve.jpoint(v,b,y)},h.prototype._dbl=function(){var v=this.curve.a,b=this.x,y=this.y,_=this.z,E=_.redSqr().redSqr(),S=b.redSqr(),k=y.redSqr(),O=S.redAdd(S).redIAdd(S).redIAdd(v.redMul(E)),M=b.redAdd(b),C=(M=M.redIAdd(M)).redMul(k),N=O.redSqr().redISub(C.redAdd(C)),L=C.redISub(N),F=k.redSqr();F=(F=(F=F.redIAdd(F)).redIAdd(F)).redIAdd(F);var V=O.redMul(L).redISub(F),H=y.redAdd(y).redMul(_);return this.curve.jpoint(N,V,H)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var v=this.x.redSqr(),b=this.y.redSqr(),y=this.z.redSqr(),_=b.redSqr(),E=v.redAdd(v).redIAdd(v),S=E.redSqr(),k=this.x.redAdd(b).redSqr().redISub(v).redISub(_),O=(k=(k=(k=k.redIAdd(k)).redAdd(k).redIAdd(k)).redISub(S)).redSqr(),M=_.redIAdd(_);M=(M=(M=M.redIAdd(M)).redIAdd(M)).redIAdd(M);var C=E.redIAdd(k).redSqr().redISub(S).redISub(O).redISub(M),N=b.redMul(C);N=(N=N.redIAdd(N)).redIAdd(N);var L=this.x.redMul(O).redISub(N);L=(L=L.redIAdd(L)).redIAdd(L);var F=this.y.redMul(C.redMul(M.redISub(C)).redISub(k.redMul(O)));F=(F=(F=F.redIAdd(F)).redIAdd(F)).redIAdd(F);var V=this.z.redAdd(k).redSqr().redISub(y).redISub(O);return this.curve.jpoint(L,F,V)},h.prototype.mul=function(v,b){return v=new c(v,b),this.curve._wnafMul(this,v)},h.prototype.eq=function(v){if(v.type==="affine")return this.eq(v.toJ());if(this===v)return!0;var b=this.z.redSqr(),y=v.z.redSqr();if(this.x.redMul(y).redISub(v.x.redMul(b)).cmpn(0)!==0)return!1;var _=b.redMul(this.z),E=y.redMul(v.z);return this.y.redMul(E).redISub(v.y.redMul(_)).cmpn(0)===0},h.prototype.eqXToP=function(v){var b=this.z.redSqr(),y=v.toRed(this.curve.red).redMul(b);if(this.x.cmp(y)===0)return!0;for(var _=v.clone(),E=this.curve.redN.redMul(b);;){if(_.iadd(this.curve.n),_.cmp(this.curve.p)>=0)return!1;if(y.redIAdd(E),this.x.cmp(y)===0)return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return this.z.cmpn(0)===0}},function(o,e,t){var n=t(16),c=t(3),p=t(45),a=t(11);function f(u){p.call(this,"mont",u),this.a=new n(u.a,16).toRed(this.red),this.b=new n(u.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function s(u,h,v){p.BasePoint.call(this,u,"projective"),h===null&&v===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(h,16),this.z=new n(v,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}c(f,p),o.exports=f,f.prototype.validate=function(u){var h=u.normalize().x,v=h.redSqr(),b=v.redMul(h).redAdd(v.redMul(this.a)).redAdd(h);return b.redSqrt().redSqr().cmp(b)===0},c(s,p.BasePoint),f.prototype.decodePoint=function(u,h){return this.point(a.toArray(u,h),1)},f.prototype.point=function(u,h){return new s(this,u,h)},f.prototype.pointFromJSON=function(u){return s.fromJSON(this,u)},s.prototype.precompute=function(){},s.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},s.fromJSON=function(u,h){return new s(u,h[0],h[1]||u.one)},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.z.cmpn(0)===0},s.prototype.dbl=function(){var u=this.x.redAdd(this.z).redSqr(),h=this.x.redSub(this.z).redSqr(),v=u.redSub(h),b=u.redMul(h),y=v.redMul(h.redAdd(this.curve.a24.redMul(v)));return this.curve.point(b,y)},s.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.diffAdd=function(u,h){var v=this.x.redAdd(this.z),b=this.x.redSub(this.z),y=u.x.redAdd(u.z),_=u.x.redSub(u.z).redMul(v),E=y.redMul(b),S=h.z.redMul(_.redAdd(E).redSqr()),k=h.x.redMul(_.redISub(E).redSqr());return this.curve.point(S,k)},s.prototype.mul=function(u){for(var h=u.clone(),v=this,b=this.curve.point(null,null),y=[];h.cmpn(0)!==0;h.iushrn(1))y.push(h.andln(1));for(var _=y.length-1;_>=0;_--)y[_]===0?(v=v.diffAdd(b,this),b=b.dbl()):(b=v.diffAdd(b,this),v=v.dbl());return b},s.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.eq=function(u){return this.getX().cmp(u.getX())===0},s.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(o,e,t){var n=t(11),c=t(16),p=t(3),a=t(45),f=n.assert;function s(h){this.twisted=(0|h.a)!=1,this.mOneA=this.twisted&&(0|h.a)==-1,this.extended=this.mOneA,a.call(this,"edwards",h),this.a=new c(h.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new c(h.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new c(h.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|h.c)==1}function u(h,v,b,y,_){a.BasePoint.call(this,h,"projective"),v===null&&b===null&&y===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new c(v,16),this.y=new c(b,16),this.z=y?new c(y,16):this.curve.one,this.t=_&&new c(_,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}p(s,a),o.exports=s,s.prototype._mulA=function(h){return this.mOneA?h.redNeg():this.a.redMul(h)},s.prototype._mulC=function(h){return this.oneC?h:this.c.redMul(h)},s.prototype.jpoint=function(h,v,b,y){return this.point(h,v,b,y)},s.prototype.pointFromX=function(h,v){(h=new c(h,16)).red||(h=h.toRed(this.red));var b=h.redSqr(),y=this.c2.redSub(this.a.redMul(b)),_=this.one.redSub(this.c2.redMul(this.d).redMul(b)),E=y.redMul(_.redInvm()),S=E.redSqrt();if(S.redSqr().redSub(E).cmp(this.zero)!==0)throw new Error("invalid point");var k=S.fromRed().isOdd();return(v&&!k||!v&&k)&&(S=S.redNeg()),this.point(h,S)},s.prototype.pointFromY=function(h,v){(h=new c(h,16)).red||(h=h.toRed(this.red));var b=h.redSqr(),y=b.redSub(this.c2),_=b.redMul(this.d).redMul(this.c2).redSub(this.a),E=y.redMul(_.redInvm());if(E.cmp(this.zero)===0){if(v)throw new Error("invalid point");return this.point(this.zero,h)}var S=E.redSqrt();if(S.redSqr().redSub(E).cmp(this.zero)!==0)throw new Error("invalid point");return S.fromRed().isOdd()!==v&&(S=S.redNeg()),this.point(S,h)},s.prototype.validate=function(h){if(h.isInfinity())return!0;h.normalize();var v=h.x.redSqr(),b=h.y.redSqr(),y=v.redMul(this.a).redAdd(b),_=this.c2.redMul(this.one.redAdd(this.d.redMul(v).redMul(b)));return y.cmp(_)===0},p(u,a.BasePoint),s.prototype.pointFromJSON=function(h){return u.fromJSON(this,h)},s.prototype.point=function(h,v,b,y){return new u(this,h,v,b,y)},u.fromJSON=function(h,v){return new u(h,v[0],v[1],v[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},u.prototype._extDbl=function(){var h=this.x.redSqr(),v=this.y.redSqr(),b=this.z.redSqr();b=b.redIAdd(b);var y=this.curve._mulA(h),_=this.x.redAdd(this.y).redSqr().redISub(h).redISub(v),E=y.redAdd(v),S=E.redSub(b),k=y.redSub(v),O=_.redMul(S),M=E.redMul(k),C=_.redMul(k),N=S.redMul(E);return this.curve.point(O,M,N,C)},u.prototype._projDbl=function(){var h,v,b,y,_,E,S=this.x.redAdd(this.y).redSqr(),k=this.x.redSqr(),O=this.y.redSqr();if(this.curve.twisted){var M=(y=this.curve._mulA(k)).redAdd(O);this.zOne?(h=S.redSub(k).redSub(O).redMul(M.redSub(this.curve.two)),v=M.redMul(y.redSub(O)),b=M.redSqr().redSub(M).redSub(M)):(_=this.z.redSqr(),E=M.redSub(_).redISub(_),h=S.redSub(k).redISub(O).redMul(E),v=M.redMul(y.redSub(O)),b=M.redMul(E))}else y=k.redAdd(O),_=this.curve._mulC(this.z).redSqr(),E=y.redSub(_).redSub(_),h=this.curve._mulC(S.redISub(y)).redMul(E),v=this.curve._mulC(y).redMul(k.redISub(O)),b=y.redMul(E);return this.curve.point(h,v,b)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(h){var v=this.y.redSub(this.x).redMul(h.y.redSub(h.x)),b=this.y.redAdd(this.x).redMul(h.y.redAdd(h.x)),y=this.t.redMul(this.curve.dd).redMul(h.t),_=this.z.redMul(h.z.redAdd(h.z)),E=b.redSub(v),S=_.redSub(y),k=_.redAdd(y),O=b.redAdd(v),M=E.redMul(S),C=k.redMul(O),N=E.redMul(O),L=S.redMul(k);return this.curve.point(M,C,L,N)},u.prototype._projAdd=function(h){var v,b,y=this.z.redMul(h.z),_=y.redSqr(),E=this.x.redMul(h.x),S=this.y.redMul(h.y),k=this.curve.d.redMul(E).redMul(S),O=_.redSub(k),M=_.redAdd(k),C=this.x.redAdd(this.y).redMul(h.x.redAdd(h.y)).redISub(E).redISub(S),N=y.redMul(O).redMul(C);return this.curve.twisted?(v=y.redMul(M).redMul(S.redSub(this.curve._mulA(E))),b=O.redMul(M)):(v=y.redMul(M).redMul(S.redSub(E)),b=this.curve._mulC(O).redMul(M)),this.curve.point(N,v,b)},u.prototype.add=function(h){return this.isInfinity()?h:h.isInfinity()?this:this.curve.extended?this._extAdd(h):this._projAdd(h)},u.prototype.mul=function(h){return this._hasDoubles(h)?this.curve._fixedNafMul(this,h):this.curve._wnafMul(this,h)},u.prototype.mulAdd=function(h,v,b){return this.curve._wnafMulAdd(1,[this,v],[h,b],2,!1)},u.prototype.jmulAdd=function(h,v,b){return this.curve._wnafMulAdd(1,[this,v],[h,b],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var h=this.z.redInvm();return this.x=this.x.redMul(h),this.y=this.y.redMul(h),this.t&&(this.t=this.t.redMul(h)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(h){return this===h||this.getX().cmp(h.getX())===0&&this.getY().cmp(h.getY())===0},u.prototype.eqXToP=function(h){var v=h.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(v)===0)return!0;for(var b=h.clone(),y=this.curve.redN.redMul(this.z);;){if(b.iadd(this.curve.n),b.cmp(this.curve.p)>=0)return!1;if(v.redIAdd(y),this.x.cmp(v)===0)return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},function(o,e,t){e.sha1=t(251),e.sha224=t(252),e.sha256=t(124),e.sha384=t(253),e.sha512=t(125)},function(o,e,t){var n=t(15),c=t(37),p=t(123),a=n.rotl32,f=n.sum32,s=n.sum32_5,u=p.ft_1,h=c.BlockHash,v=[1518500249,1859775393,2400959708,3395469782];function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(b,h),o.exports=b,b.blockSize=512,b.outSize=160,b.hmacStrength=80,b.padLength=64,b.prototype._update=function(y,_){for(var E=this.W,S=0;S<16;S++)E[S]=y[_+S];for(;S<E.length;S++)E[S]=a(E[S-3]^E[S-8]^E[S-14]^E[S-16],1);var k=this.h[0],O=this.h[1],M=this.h[2],C=this.h[3],N=this.h[4];for(S=0;S<E.length;S++){var L=~~(S/20),F=s(a(k,5),u(L,O,M,C),N,E[S],v[L]);N=C,C=M,M=a(O,30),O=k,k=F}this.h[0]=f(this.h[0],k),this.h[1]=f(this.h[1],O),this.h[2]=f(this.h[2],M),this.h[3]=f(this.h[3],C),this.h[4]=f(this.h[4],N)},b.prototype._digest=function(y){return y==="hex"?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(o,e,t){var n=t(15),c=t(124);function p(){if(!(this instanceof p))return new p;c.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(p,c),o.exports=p,p.blockSize=512,p.outSize=224,p.hmacStrength=192,p.padLength=64,p.prototype._digest=function(a){return a==="hex"?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(o,e,t){var n=t(15),c=t(125);function p(){if(!(this instanceof p))return new p;c.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(p,c),o.exports=p,p.blockSize=1024,p.outSize=384,p.hmacStrength=192,p.padLength=128,p.prototype._digest=function(a){return a==="hex"?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(o,e,t){var n=t(15),c=t(37),p=n.rotl32,a=n.sum32,f=n.sum32_3,s=n.sum32_4,u=c.BlockHash;function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function v(O,M,C,N){return O<=15?M^C^N:O<=31?M&C|~M&N:O<=47?(M|~C)^N:O<=63?M&N|C&~N:M^(C|~N)}function b(O){return O<=15?0:O<=31?1518500249:O<=47?1859775393:O<=63?2400959708:2840853838}function y(O){return O<=15?1352829926:O<=31?1548603684:O<=47?1836072691:O<=63?2053994217:0}n.inherits(h,u),e.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(O,M){for(var C=this.h[0],N=this.h[1],L=this.h[2],F=this.h[3],V=this.h[4],H=C,z=N,R=L,l=F,x=V,d=0;d<80;d++){var m=a(p(s(C,v(d,N,L,F),O[_[d]+M],b(d)),S[d]),V);C=V,V=F,F=p(L,10),L=N,N=m,m=a(p(s(H,v(79-d,z,R,l),O[E[d]+M],y(d)),k[d]),x),H=x,x=l,l=p(R,10),R=z,z=m}m=f(this.h[1],L,l),this.h[1]=f(this.h[2],F,x),this.h[2]=f(this.h[3],V,H),this.h[3]=f(this.h[4],C,z),this.h[4]=f(this.h[0],N,R),this.h[0]=m},h.prototype._digest=function(O){return O==="hex"?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var _=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],E=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],S=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],k=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(o,e,t){var n=t(15),c=t(22);function p(a,f,s){if(!(this instanceof p))return new p(a,f,s);this.Hash=a,this.blockSize=a.blockSize/8,this.outSize=a.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(f,s))}o.exports=p,p.prototype._init=function(a){a.length>this.blockSize&&(a=new this.Hash().update(a).digest()),c(a.length<=this.blockSize);for(var f=a.length;f<this.blockSize;f++)a.push(0);for(f=0;f<a.length;f++)a[f]^=54;for(this.inner=new this.Hash().update(a),f=0;f<a.length;f++)a[f]^=106;this.outer=new this.Hash().update(a)},p.prototype.update=function(a,f){return this.inner.update(a,f),this},p.prototype.digest=function(a){return this.outer.update(this.inner.digest()),this.outer.digest(a)}},function(o,e){o.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(o,e,t){var n=t(16),c=t(258),p=t(11),a=t(59),f=t(121),s=p.assert,u=t(259),h=t(260);function v(b){if(!(this instanceof v))return new v(b);typeof b=="string"&&(s(Object.prototype.hasOwnProperty.call(a,b),"Unknown curve "+b),b=a[b]),b instanceof a.PresetCurve&&(b={curve:b}),this.curve=b.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=b.curve.g,this.g.precompute(b.curve.n.bitLength()+1),this.hash=b.hash||b.curve.hash}o.exports=v,v.prototype.keyPair=function(b){return new u(this,b)},v.prototype.keyFromPrivate=function(b,y){return u.fromPrivate(this,b,y)},v.prototype.keyFromPublic=function(b,y){return u.fromPublic(this,b,y)},v.prototype.genKeyPair=function(b){b||(b={});for(var y=new c({hash:this.hash,pers:b.pers,persEnc:b.persEnc||"utf8",entropy:b.entropy||f(this.hash.hmacStrength),entropyEnc:b.entropy&&b.entropyEnc||"utf8",nonce:this.n.toArray()}),_=this.n.byteLength(),E=this.n.sub(new n(2));;){var S=new n(y.generate(_));if(!(S.cmp(E)>0))return S.iaddn(1),this.keyFromPrivate(S)}},v.prototype._truncateToN=function(b,y){var _=8*b.byteLength()-this.n.bitLength();return _>0&&(b=b.ushrn(_)),!y&&b.cmp(this.n)>=0?b.sub(this.n):b},v.prototype.sign=function(b,y,_,E){typeof _=="object"&&(E=_,_=null),E||(E={}),y=this.keyFromPrivate(y,_),b=this._truncateToN(new n(b,16));for(var S=this.n.byteLength(),k=y.getPrivate().toArray("be",S),O=b.toArray("be",S),M=new c({hash:this.hash,entropy:k,nonce:O,pers:E.pers,persEnc:E.persEnc||"utf8"}),C=this.n.sub(new n(1)),N=0;;N++){var L=E.k?E.k(N):new n(M.generate(this.n.byteLength()));if(!((L=this._truncateToN(L,!0)).cmpn(1)<=0||L.cmp(C)>=0)){var F=this.g.mul(L);if(!F.isInfinity()){var V=F.getX(),H=V.umod(this.n);if(H.cmpn(0)!==0){var z=L.invm(this.n).mul(H.mul(y.getPrivate()).iadd(b));if((z=z.umod(this.n)).cmpn(0)!==0){var R=(F.getY().isOdd()?1:0)|(V.cmp(H)!==0?2:0);return E.canonical&&z.cmp(this.nh)>0&&(z=this.n.sub(z),R^=1),new h({r:H,s:z,recoveryParam:R})}}}}}},v.prototype.verify=function(b,y,_,E){b=this._truncateToN(new n(b,16)),_=this.keyFromPublic(_,E);var S=(y=new h(y,"hex")).r,k=y.s;if(S.cmpn(1)<0||S.cmp(this.n)>=0||k.cmpn(1)<0||k.cmp(this.n)>=0)return!1;var O,M=k.invm(this.n),C=M.mul(b).umod(this.n),N=M.mul(S).umod(this.n);return this.curve._maxwellTrick?!(O=this.g.jmulAdd(C,_.getPublic(),N)).isInfinity()&&O.eqXToP(S):!(O=this.g.mulAdd(C,_.getPublic(),N)).isInfinity()&&O.getX().umod(this.n).cmp(S)===0},v.prototype.recoverPubKey=function(b,y,_,E){s((3&_)===_,"The recovery param is more than two bits"),y=new h(y,E);var S=this.n,k=new n(b),O=y.r,M=y.s,C=1&_,N=_>>1;if(O.cmp(this.curve.p.umod(this.curve.n))>=0&&N)throw new Error("Unable to find sencond key candinate");O=N?this.curve.pointFromX(O.add(this.curve.n),C):this.curve.pointFromX(O,C);var L=y.r.invm(S),F=S.sub(k).mul(L).umod(S),V=M.mul(L).umod(S);return this.g.mulAdd(F,O,V)},v.prototype.getKeyRecoveryParam=function(b,y,_,E){if((y=new h(y,E)).recoveryParam!==null)return y.recoveryParam;for(var S=0;S<4;S++){var k;try{k=this.recoverPubKey(b,y,S)}catch{continue}if(k.eq(_))return S}throw new Error("Unable to find valid recovery factor")}},function(o,e,t){var n=t(60),c=t(120),p=t(22);function a(f){if(!(this instanceof a))return new a(f);this.hash=f.hash,this.predResist=!!f.predResist,this.outLen=this.hash.outSize,this.minEntropy=f.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var s=c.toArray(f.entropy,f.entropyEnc||"hex"),u=c.toArray(f.nonce,f.nonceEnc||"hex"),h=c.toArray(f.pers,f.persEnc||"hex");p(s.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(s,u,h)}o.exports=a,a.prototype._init=function(f,s,u){var h=f.concat(s).concat(u);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var v=0;v<this.V.length;v++)this.K[v]=0,this.V[v]=1;this._update(h),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(f){var s=this._hmac().update(this.V).update([0]);f&&(s=s.update(f)),this.K=s.digest(),this.V=this._hmac().update(this.V).digest(),f&&(this.K=this._hmac().update(this.V).update([1]).update(f).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(f,s,u,h){typeof s!="string"&&(h=u,u=s,s=null),f=c.toArray(f,s),u=c.toArray(u,h),p(f.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(f.concat(u||[])),this._reseed=1},a.prototype.generate=function(f,s,u,h){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof s!="string"&&(h=u,u=s,s=null),u&&(u=c.toArray(u,h||"hex"),this._update(u));for(var v=[];v.length<f;)this.V=this._hmac().update(this.V).digest(),v=v.concat(this.V);var b=v.slice(0,f);return this._update(u),this._reseed++,c.encode(b,s)}},function(o,e,t){var n=t(16),c=t(11).assert;function p(a,f){this.ec=a,this.priv=null,this.pub=null,f.priv&&this._importPrivate(f.priv,f.privEnc),f.pub&&this._importPublic(f.pub,f.pubEnc)}o.exports=p,p.fromPublic=function(a,f,s){return f instanceof p?f:new p(a,{pub:f,pubEnc:s})},p.fromPrivate=function(a,f,s){return f instanceof p?f:new p(a,{priv:f,privEnc:s})},p.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},p.prototype.getPublic=function(a,f){return typeof a=="string"&&(f=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),f?this.pub.encode(f,a):this.pub},p.prototype.getPrivate=function(a){return a==="hex"?this.priv.toString(16,2):this.priv},p.prototype._importPrivate=function(a,f){this.priv=new n(a,f||16),this.priv=this.priv.umod(this.ec.curve.n)},p.prototype._importPublic=function(a,f){if(a.x||a.y)return this.ec.curve.type==="mont"?c(a.x,"Need x coordinate"):this.ec.curve.type!=="short"&&this.ec.curve.type!=="edwards"||c(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y));this.pub=this.ec.curve.decodePoint(a,f)},p.prototype.derive=function(a){return a.validate()||c(a.validate(),"public point not validated"),a.mul(this.priv).getX()},p.prototype.sign=function(a,f,s){return this.ec.sign(a,this,f,s)},p.prototype.verify=function(a,f){return this.ec.verify(a,f,this)},p.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(o,e,t){var n=t(16),c=t(11),p=c.assert;function a(v,b){if(v instanceof a)return v;this._importDER(v,b)||(p(v.r&&v.s,"Signature without r or s"),this.r=new n(v.r,16),this.s=new n(v.s,16),v.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=v.recoveryParam)}function f(){this.place=0}function s(v,b){var y=v[b.place++];if(!(128&y))return y;var _=15&y;if(_===0||_>4)return!1;for(var E=0,S=0,k=b.place;S<_;S++,k++)E<<=8,E|=v[k],E>>>=0;return!(E<=127)&&(b.place=k,E)}function u(v){for(var b=0,y=v.length-1;!v[b]&&!(128&v[b+1])&&b<y;)b++;return b===0?v:v.slice(b)}function h(v,b){if(b<128)v.push(b);else{var y=1+(Math.log(b)/Math.LN2>>>3);for(v.push(128|y);--y;)v.push(b>>>(y<<3)&255);v.push(b)}}o.exports=a,a.prototype._importDER=function(v,b){v=c.toArray(v,b);var y=new f;if(v[y.place++]!==48)return!1;var _=s(v,y);if(_===!1||_+y.place!==v.length||v[y.place++]!==2)return!1;var E=s(v,y);if(E===!1)return!1;var S=v.slice(y.place,E+y.place);if(y.place+=E,v[y.place++]!==2)return!1;var k=s(v,y);if(k===!1||v.length!==k+y.place)return!1;var O=v.slice(y.place,k+y.place);if(S[0]===0){if(!(128&S[1]))return!1;S=S.slice(1)}if(O[0]===0){if(!(128&O[1]))return!1;O=O.slice(1)}return this.r=new n(S),this.s=new n(O),this.recoveryParam=null,!0},a.prototype.toDER=function(v){var b=this.r.toArray(),y=this.s.toArray();for(128&b[0]&&(b=[0].concat(b)),128&y[0]&&(y=[0].concat(y)),b=u(b),y=u(y);!(y[0]||128&y[1]);)y=y.slice(1);var _=[2];h(_,b.length),(_=_.concat(b)).push(2),h(_,y.length);var E=_.concat(y),S=[48];return h(S,E.length),S=S.concat(E),c.encode(S,v)}},function(o,e,t){var n=t(60),c=t(59),p=t(11),a=p.assert,f=p.parseBytes,s=t(262),u=t(263);function h(v){if(a(v==="ed25519","only tested with ed25519 so far"),!(this instanceof h))return new h(v);v=c[v].curve,this.curve=v,this.g=v.g,this.g.precompute(v.n.bitLength()+1),this.pointClass=v.point().constructor,this.encodingLength=Math.ceil(v.n.bitLength()/8),this.hash=n.sha512}o.exports=h,h.prototype.sign=function(v,b){v=f(v);var y=this.keyFromSecret(b),_=this.hashInt(y.messagePrefix(),v),E=this.g.mul(_),S=this.encodePoint(E),k=this.hashInt(S,y.pubBytes(),v).mul(y.priv()),O=_.add(k).umod(this.curve.n);return this.makeSignature({R:E,S:O,Rencoded:S})},h.prototype.verify=function(v,b,y){v=f(v),b=this.makeSignature(b);var _=this.keyFromPublic(y),E=this.hashInt(b.Rencoded(),_.pubBytes(),v),S=this.g.mul(b.S());return b.R().add(_.pub().mul(E)).eq(S)},h.prototype.hashInt=function(){for(var v=this.hash(),b=0;b<arguments.length;b++)v.update(arguments[b]);return p.intFromLE(v.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(v){return s.fromPublic(this,v)},h.prototype.keyFromSecret=function(v){return s.fromSecret(this,v)},h.prototype.makeSignature=function(v){return v instanceof u?v:new u(this,v)},h.prototype.encodePoint=function(v){var b=v.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=v.getX().isOdd()?128:0,b},h.prototype.decodePoint=function(v){var b=(v=p.parseBytes(v)).length-1,y=v.slice(0,b).concat(-129&v[b]),_=(128&v[b])!=0,E=p.intFromLE(y);return this.curve.pointFromY(E,_)},h.prototype.encodeInt=function(v){return v.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(v){return p.intFromLE(v)},h.prototype.isPoint=function(v){return v instanceof this.pointClass}},function(o,e,t){var n=t(11),c=n.assert,p=n.parseBytes,a=n.cachedProperty;function f(s,u){this.eddsa=s,this._secret=p(u.secret),s.isPoint(u.pub)?this._pub=u.pub:this._pubBytes=p(u.pub)}f.fromPublic=function(s,u){return u instanceof f?u:new f(s,{pub:u})},f.fromSecret=function(s,u){return u instanceof f?u:new f(s,{secret:u})},f.prototype.secret=function(){return this._secret},a(f,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(f,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(f,"privBytes",function(){var s=this.eddsa,u=this.hash(),h=s.encodingLength-1,v=u.slice(0,s.encodingLength);return v[0]&=248,v[h]&=127,v[h]|=64,v}),a(f,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(f,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(f,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),f.prototype.sign=function(s){return c(this._secret,"KeyPair can only verify"),this.eddsa.sign(s,this)},f.prototype.verify=function(s,u){return this.eddsa.verify(s,u,this)},f.prototype.getSecret=function(s){return c(this._secret,"KeyPair is public only"),n.encode(this.secret(),s)},f.prototype.getPublic=function(s){return n.encode(this.pubBytes(),s)},o.exports=f},function(o,e,t){var n=t(16),c=t(11),p=c.assert,a=c.cachedProperty,f=c.parseBytes;function s(u,h){this.eddsa=u,typeof h!="object"&&(h=f(h)),Array.isArray(h)&&(h={R:h.slice(0,u.encodingLength),S:h.slice(u.encodingLength)}),p(h.R&&h.S,"Signature without R or S"),u.isPoint(h.R)&&(this._R=h.R),h.S instanceof n&&(this._S=h.S),this._Rencoded=Array.isArray(h.R)?h.R:h.Rencoded,this._Sencoded=Array.isArray(h.S)?h.S:h.Sencoded}a(s,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(s,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(s,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(s,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),s.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},s.prototype.toHex=function(){return c.encode(this.toBytes(),"hex").toUpperCase()},o.exports=s},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=t(265);e.getRandomBytes=function(c){return new Promise(function(p,a){n(c,function(f,s){f?a(f):p(s)})})},e.getRandomBytesSync=function(c){return n(c)}},function(o,e,t){(function(n,c){var p=t(13).Buffer,a=n.crypto||n.msCrypto;a&&a.getRandomValues?o.exports=function(f,s){if(f>4294967295)throw new RangeError("requested too many random bytes");var u=p.allocUnsafe(f);if(f>0)if(f>65536)for(var h=0;h<f;h+=65536)a.getRandomValues(u.slice(h,h+65536));else a.getRandomValues(u);return typeof s=="function"?c.nextTick(function(){s(null,u)}):u}:o.exports=function(){throw new Error(`Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11`)}}).call(this,t(6),t(5))},function(o,e,t){(function(n){var c=t(9),p=new(t(58)).ec("secp256k1"),a=p.curve;e.privateKeyExport=function(s,u){var h=new c(s);if(h.ucmp(a.n)>=0)throw new Error("couldn't export to DER format");var v=p.g.mul(h);return f(v.getX(),v.getY(),u)},e.privateKeyModInverse=function(s){var u=new c(s);if(u.ucmp(a.n)>=0||u.isZero())throw new Error("private key range is invalid");return u.invm(a.n).toArrayLike(n,"be",32)},e.signatureImport=function(s){var u=new c(s.r);u.ucmp(a.n)>=0&&(u=new c(0));var h=new c(s.s);return h.ucmp(a.n)>=0&&(h=new c(0)),n.concat([u.toArrayLike(n,"be",32),h.toArrayLike(n,"be",32)])},e.ecdhUnsafe=function(s,u,h){var v=p.keyFromPublic(s),b=new c(u);if(b.ucmp(a.n)>=0||b.isZero())throw new Error("scalar was invalid (zero or overflow)");var y=v.pub.mul(b);return f(y.getX(),y.getY(),h)};var f=function(s,u,h){var v=void 0;return h?((v=n.alloc(33))[0]=u.isOdd()?3:2,s.toArrayLike(n,"be",32).copy(v,1)):((v=n.alloc(65))[0]=4,s.toArrayLike(n,"be",32).copy(v,1),u.toArrayLike(n,"be",32).copy(v,33)),v}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){var c=n.from([48,129,211,2,1,1,4,32,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,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,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,0,0,0,0,0,0,0,0,0]),p=n.from([48,130,1,19,2,1,1,4,32,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,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e.privateKeyExport=function(a,f,s){var u=n.from(s?c:p);return a.copy(u,s?8:9),f.copy(u,s?181:214),u},e.privateKeyImport=function(a){var f=a.length,s=0;if(f<s+1||a[s]!==48||f<(s+=1)+1||!(128&a[s]))return null;var u=127&a[s];if(u<1||u>2||f<(s+=1)+u)return null;var h=a[s+u-1]|(u>1?a[s+u-2]<<8:0);return f<(s+=u)+h||f<s+3||a[s]!==2||a[s+1]!==1||a[s+2]!==1||f<(s+=3)+2||a[s]!==4||a[s+1]>32||f<s+2+a[s+1]?null:a.slice(s+2,s+2+a[s+1])},e.signatureImportLax=function(a){var f=n.alloc(32,0),s=n.alloc(32,0),u=a.length,h=0;if(a[h++]!==48)return null;var v=a[h++];if(128&v&&(h+=v-128)>u||a[h++]!==2)return null;var b=a[h++];if(128&b){if(h+(v=b-128)>u)return null;for(;v>0&&a[h]===0;h+=1,v-=1);for(b=0;v>0;h+=1,v-=1)b=(b<<8)+a[h]}if(b>u-h)return null;var y=h;if(h+=b,a[h++]!==2)return null;var _=a[h++];if(128&_){if(h+(v=_-128)>u)return null;for(;v>0&&a[h]===0;h+=1,v-=1);for(_=0;v>0;h+=1,v-=1)_=(_<<8)+a[h]}if(_>u-h)return null;var E=h;for(h+=_;b>0&&a[y]===0;b-=1,y+=1);if(b>32)return null;var S=a.slice(y,y+b);for(S.copy(f,32-S.length);_>0&&a[E]===0;_-=1,E+=1);if(_>32)return null;var k=a.slice(E,E+_);return k.copy(s,32-k.length),{r:f,s}}}).call(this,t(2).Buffer)},function(o,e,t){/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var n=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;function a(f){if(f==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(f)}o.exports=function(){try{if(!Object.assign)return!1;var f=new String("abc");if(f[5]="de",Object.getOwnPropertyNames(f)[0]==="5")return!1;for(var s={},u=0;u<10;u++)s["_"+String.fromCharCode(u)]=u;if(Object.getOwnPropertyNames(s).map(function(v){return s[v]}).join("")!=="0123456789")return!1;var h={};return"abcdefghijklmnopqrst".split("").forEach(function(v){h[v]=v}),Object.keys(Object.assign({},h)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(f,s){for(var u,h,v=a(f),b=1;b<arguments.length;b++){for(var y in u=Object(arguments[b]))c.call(u,y)&&(v[y]=u[y]);if(n){h=n(u);for(var _=0;_<h.length;_++)p.call(u,h[_])&&(v[h[_]]=u[h[_]])}}return v}},function(o,e,t){(function(n){(function(c,p){function a(d,m){if(!d)throw new Error(m||"Assertion failed")}function f(d,m){d.super_=m;var g=function(){};g.prototype=m.prototype,d.prototype=new g,d.prototype.constructor=d}function s(d,m,g){if(s.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&(m!=="le"&&m!=="be"||(g=m,m=10),this._init(d||0,m||10,g||"be"))}var u;typeof c=="object"?c.exports=s:p.BN=s,s.BN=s,s.wordSize=26;try{u=typeof window!="undefined"&&window.Buffer!==void 0?window.Buffer:t(270).Buffer}catch{}function h(d,m){var g=d.charCodeAt(m);return g>=48&&g<=57?g-48:g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:void a(!1,"Invalid character in "+d)}function v(d,m,g){var w=h(d,g);return g-1>=m&&(w|=h(d,g-1)<<4),w}function b(d,m,g,w){for(var A=0,P=0,T=Math.min(d.length,g),q=m;q<T;q++){var Z=d.charCodeAt(q)-48;A*=w,P=Z>=49?Z-49+10:Z>=17?Z-17+10:Z,a(Z>=0&&P<w,"Invalid character"),A+=P}return A}function y(d,m){d.words=m.words,d.length=m.length,d.negative=m.negative,d.red=m.red}if(s.isBN=function(d){return d instanceof s||d!==null&&typeof d=="object"&&d.constructor.wordSize===s.wordSize&&Array.isArray(d.words)},s.max=function(d,m){return d.cmp(m)>0?d:m},s.min=function(d,m){return d.cmp(m)<0?d:m},s.prototype._init=function(d,m,g){if(typeof d=="number")return this._initNumber(d,m,g);if(typeof d=="object")return this._initArray(d,m,g);m==="hex"&&(m=16),a(m===(0|m)&&m>=2&&m<=36);var w=0;(d=d.toString().replace(/\s+/g,""))[0]==="-"&&(w++,this.negative=1),w<d.length&&(m===16?this._parseHex(d,w,g):(this._parseBase(d,m,w),g==="le"&&this._initArray(this.toArray(),m,g)))},s.prototype._initNumber=function(d,m,g){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[67108863&d],this.length=1):d<4503599627370496?(this.words=[67108863&d,d/67108864&67108863],this.length=2):(a(d<9007199254740992),this.words=[67108863&d,d/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),m,g)},s.prototype._initArray=function(d,m,g){if(a(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var A,P,T=0;if(g==="be")for(w=d.length-1,A=0;w>=0;w-=3)P=d[w]|d[w-1]<<8|d[w-2]<<16,this.words[A]|=P<<T&67108863,this.words[A+1]=P>>>26-T&67108863,(T+=24)>=26&&(T-=26,A++);else if(g==="le")for(w=0,A=0;w<d.length;w+=3)P=d[w]|d[w+1]<<8|d[w+2]<<16,this.words[A]|=P<<T&67108863,this.words[A+1]=P>>>26-T&67108863,(T+=24)>=26&&(T-=26,A++);return this._strip()},s.prototype._parseHex=function(d,m,g){this.length=Math.ceil((d.length-m)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var A,P=0,T=0;if(g==="be")for(w=d.length-1;w>=m;w-=2)A=v(d,m,w)<<P,this.words[T]|=67108863&A,P>=18?(P-=18,T+=1,this.words[T]|=A>>>26):P+=8;else for(w=(d.length-m)%2==0?m+1:m;w<d.length;w+=2)A=v(d,m,w)<<P,this.words[T]|=67108863&A,P>=18?(P-=18,T+=1,this.words[T]|=A>>>26):P+=8;this._strip()},s.prototype._parseBase=function(d,m,g){this.words=[0],this.length=1;for(var w=0,A=1;A<=67108863;A*=m)w++;w--,A=A/m|0;for(var P=d.length-g,T=P%w,q=Math.min(P,P-T)+g,Z=0,I=g;I<q;I+=w)Z=b(d,I,I+w,m),this.imuln(A),this.words[0]+Z<67108864?this.words[0]+=Z:this._iaddn(Z);if(T!==0){var $=1;for(Z=b(d,I,d.length,m),I=0;I<T;I++)$*=m;this.imuln($),this.words[0]+Z<67108864?this.words[0]+=Z:this._iaddn(Z)}this._strip()},s.prototype.copy=function(d){d.words=new Array(this.length);for(var m=0;m<this.length;m++)d.words[m]=this.words[m];d.length=this.length,d.negative=this.negative,d.red=this.red},s.prototype._move=function(d){y(d,this)},s.prototype.clone=function(){var d=new s(null);return this.copy(d),d},s.prototype._expand=function(d){for(;this.length<d;)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!="undefined"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=_}catch{s.prototype.inspect=_}else s.prototype.inspect=_;function _(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","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"],S=[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],k=[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(d,m){var g;if(m=0|m||1,(d=d||10)===16||d==="hex"){g="";for(var w=0,A=0,P=0;P<this.length;P++){var T=this.words[P],q=(16777215&(T<<w|A)).toString(16);g=(A=T>>>24-w&16777215)!==0||P!==this.length-1?E[6-q.length]+q+g:q+g,(w+=2)>=26&&(w-=26,P--)}for(A!==0&&(g=A.toString(16)+g);g.length%m!=0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(d===(0|d)&&d>=2&&d<=36){var Z=S[d],I=k[d];g="";var $=this.clone();for($.negative=0;!$.isZero();){var K=$.modrn(I).toString(d);g=($=$.idivn(I)).isZero()?K+g:E[Z-K.length]+K+g}for(this.isZero()&&(g="0"+g);g.length%m!=0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}a(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=67108864*this.words[1]:this.length===3&&this.words[2]===1?d+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},s.prototype.toJSON=function(){return this.toString(16,2)},u&&(s.prototype.toBuffer=function(d,m){return this.toArrayLike(u,d,m)}),s.prototype.toArray=function(d,m){return this.toArrayLike(Array,d,m)};function O(d,m,g){g.negative=m.negative^d.negative;var w=d.length+m.length|0;g.length=w,w=w-1|0;var A=0|d.words[0],P=0|m.words[0],T=A*P,q=67108863&T,Z=T/67108864|0;g.words[0]=q;for(var I=1;I<w;I++){for(var $=Z>>>26,K=67108863&Z,j=Math.min(I,m.length-1),D=Math.max(0,I-d.length+1);D<=j;D++){var B=I-D|0;$+=(T=(A=0|d.words[B])*(P=0|m.words[D])+K)/67108864|0,K=67108863&T}g.words[I]=0|K,Z=0|$}return Z!==0?g.words[I]=0|Z:g.length--,g._strip()}s.prototype.toArrayLike=function(d,m,g){this._strip();var w=this.byteLength(),A=g||Math.max(1,w);a(w<=A,"byte array longer than desired length"),a(A>0,"Requested array length <= 0");var P=function(T,q){return T.allocUnsafe?T.allocUnsafe(q):new T(q)}(d,A);return this["_toArrayLike"+(m==="le"?"LE":"BE")](P,w),P},s.prototype._toArrayLikeLE=function(d,m){for(var g=0,w=0,A=0,P=0;A<this.length;A++){var T=this.words[A]<<P|w;d[g++]=255&T,g<d.length&&(d[g++]=T>>8&255),g<d.length&&(d[g++]=T>>16&255),P===6?(g<d.length&&(d[g++]=T>>24&255),w=0,P=0):(w=T>>>24,P+=2)}if(g<d.length)for(d[g++]=w;g<d.length;)d[g++]=0},s.prototype._toArrayLikeBE=function(d,m){for(var g=d.length-1,w=0,A=0,P=0;A<this.length;A++){var T=this.words[A]<<P|w;d[g--]=255&T,g>=0&&(d[g--]=T>>8&255),g>=0&&(d[g--]=T>>16&255),P===6?(g>=0&&(d[g--]=T>>24&255),w=0,P=0):(w=T>>>24,P+=2)}if(g>=0)for(d[g--]=w;g>=0;)d[g--]=0},Math.clz32?s.prototype._countBits=function(d){return 32-Math.clz32(d)}:s.prototype._countBits=function(d){var m=d,g=0;return m>=4096&&(g+=13,m>>>=13),m>=64&&(g+=7,m>>>=7),m>=8&&(g+=4,m>>>=4),m>=2&&(g+=2,m>>>=2),g+m},s.prototype._zeroBits=function(d){if(d===0)return 26;var m=d,g=0;return(8191&m)==0&&(g+=13,m>>>=13),(127&m)==0&&(g+=7,m>>>=7),(15&m)==0&&(g+=4,m>>>=4),(3&m)==0&&(g+=2,m>>>=2),(1&m)==0&&g++,g},s.prototype.bitLength=function(){var d=this.words[this.length-1],m=this._countBits(d);return 26*(this.length-1)+m},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,m=0;m<this.length;m++){var g=this._zeroBits(this.words[m]);if(d+=g,g!==26)break}return d},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},s.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).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(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var m=0;m<d.length;m++)this.words[m]=this.words[m]|d.words[m];return this._strip()},s.prototype.ior=function(d){return a((this.negative|d.negative)==0),this.iuor(d)},s.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},s.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},s.prototype.iuand=function(d){var m;m=this.length>d.length?d:this;for(var g=0;g<m.length;g++)this.words[g]=this.words[g]&d.words[g];return this.length=m.length,this._strip()},s.prototype.iand=function(d){return a((this.negative|d.negative)==0),this.iuand(d)},s.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},s.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},s.prototype.iuxor=function(d){var m,g;this.length>d.length?(m=this,g=d):(m=d,g=this);for(var w=0;w<g.length;w++)this.words[w]=m.words[w]^g.words[w];if(this!==m)for(;w<m.length;w++)this.words[w]=m.words[w];return this.length=m.length,this._strip()},s.prototype.ixor=function(d){return a((this.negative|d.negative)==0),this.iuxor(d)},s.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},s.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},s.prototype.inotn=function(d){a(typeof d=="number"&&d>=0);var m=0|Math.ceil(d/26),g=d%26;this._expand(m),g>0&&m--;for(var w=0;w<m;w++)this.words[w]=67108863&~this.words[w];return g>0&&(this.words[w]=~this.words[w]&67108863>>26-g),this._strip()},s.prototype.notn=function(d){return this.clone().inotn(d)},s.prototype.setn=function(d,m){a(typeof d=="number"&&d>=0);var g=d/26|0,w=d%26;return this._expand(g+1),this.words[g]=m?this.words[g]|1<<w:this.words[g]&~(1<<w),this._strip()},s.prototype.iadd=function(d){var m,g,w;if(this.negative!==0&&d.negative===0)return this.negative=0,m=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,m=this.isub(d),d.negative=1,m._normSign();this.length>d.length?(g=this,w=d):(g=d,w=this);for(var A=0,P=0;P<w.length;P++)m=(0|g.words[P])+(0|w.words[P])+A,this.words[P]=67108863&m,A=m>>>26;for(;A!==0&&P<g.length;P++)m=(0|g.words[P])+A,this.words[P]=67108863&m,A=m>>>26;if(this.length=g.length,A!==0)this.words[this.length]=A,this.length++;else if(g!==this)for(;P<g.length;P++)this.words[P]=g.words[P];return this},s.prototype.add=function(d){var m;return d.negative!==0&&this.negative===0?(d.negative=0,m=this.sub(d),d.negative^=1,m):d.negative===0&&this.negative!==0?(this.negative=0,m=d.sub(this),this.negative=1,m):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},s.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var m=this.iadd(d);return d.negative=1,m._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var g,w,A=this.cmp(d);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;A>0?(g=this,w=d):(g=d,w=this);for(var P=0,T=0;T<w.length;T++)P=(m=(0|g.words[T])-(0|w.words[T])+P)>>26,this.words[T]=67108863&m;for(;P!==0&&T<g.length;T++)P=(m=(0|g.words[T])+P)>>26,this.words[T]=67108863&m;if(P===0&&T<g.length&&g!==this)for(;T<g.length;T++)this.words[T]=g.words[T];return this.length=Math.max(this.length,T),g!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(d){return this.clone().isub(d)};var M=function(d,m,g){var w,A,P,T=d.words,q=m.words,Z=g.words,I=0,$=0|T[0],K=8191&$,j=$>>>13,D=0|T[1],B=8191&D,U=D>>>13,J=0|T[2],G=8191&J,W=J>>>13,Y=0|T[3],ee=8191&Y,te=Y>>>13,oe=0|T[4],fe=8191&oe,ne=oe>>>13,ce=0|T[5],se=8191&ce,ae=ce>>>13,he=0|T[6],me=8191&he,le=he>>>13,ye=0|T[7],Se=8191&ye,pe=ye>>>13,Oe=0|T[8],Le=8191&Oe,_e=Oe>>>13,Fe=0|T[9],qe=8191&Fe,Ee=Fe>>>13,je=0|q[0],ie=8191&je,de=je>>>13,ke=0|q[1],Be=8191&ke,ge=ke>>>13,Ue=0|q[2],De=8191&Ue,we=Ue>>>13,Ve=0|q[3],et=8191&Ve,Ie=Ve>>>13,Ge=0|q[4],Je=8191&Ge,Re=Ge>>>13,He=0|q[5],tt=8191&He,Te=He>>>13,We=0|q[6],Ze=8191&We,Pe=We>>>13,rt=0|q[7],Ye=8191&rt,Ae=rt>>>13,Xe=0|q[8],Qe=8191&Xe,Ce=Xe>>>13,Ke=0|q[9],X=8191&Ke,Q=Ke>>>13;g.negative=d.negative^m.negative,g.length=19;var re=(I+(w=Math.imul(K,ie))|0)+((8191&(A=(A=Math.imul(K,de))+Math.imul(j,ie)|0))<<13)|0;I=((P=Math.imul(j,de))+(A>>>13)|0)+(re>>>26)|0,re&=67108863,w=Math.imul(B,ie),A=(A=Math.imul(B,de))+Math.imul(U,ie)|0,P=Math.imul(U,de);var ue=(I+(w=w+Math.imul(K,Be)|0)|0)+((8191&(A=(A=A+Math.imul(K,ge)|0)+Math.imul(j,Be)|0))<<13)|0;I=((P=P+Math.imul(j,ge)|0)+(A>>>13)|0)+(ue>>>26)|0,ue&=67108863,w=Math.imul(G,ie),A=(A=Math.imul(G,de))+Math.imul(W,ie)|0,P=Math.imul(W,de),w=w+Math.imul(B,Be)|0,A=(A=A+Math.imul(B,ge)|0)+Math.imul(U,Be)|0,P=P+Math.imul(U,ge)|0;var xe=(I+(w=w+Math.imul(K,De)|0)|0)+((8191&(A=(A=A+Math.imul(K,we)|0)+Math.imul(j,De)|0))<<13)|0;I=((P=P+Math.imul(j,we)|0)+(A>>>13)|0)+(xe>>>26)|0,xe&=67108863,w=Math.imul(ee,ie),A=(A=Math.imul(ee,de))+Math.imul(te,ie)|0,P=Math.imul(te,de),w=w+Math.imul(G,Be)|0,A=(A=A+Math.imul(G,ge)|0)+Math.imul(W,Be)|0,P=P+Math.imul(W,ge)|0,w=w+Math.imul(B,De)|0,A=(A=A+Math.imul(B,we)|0)+Math.imul(U,De)|0,P=P+Math.imul(U,we)|0;var Me=(I+(w=w+Math.imul(K,et)|0)|0)+((8191&(A=(A=A+Math.imul(K,Ie)|0)+Math.imul(j,et)|0))<<13)|0;I=((P=P+Math.imul(j,Ie)|0)+(A>>>13)|0)+(Me>>>26)|0,Me&=67108863,w=Math.imul(fe,ie),A=(A=Math.imul(fe,de))+Math.imul(ne,ie)|0,P=Math.imul(ne,de),w=w+Math.imul(ee,Be)|0,A=(A=A+Math.imul(ee,ge)|0)+Math.imul(te,Be)|0,P=P+Math.imul(te,ge)|0,w=w+Math.imul(G,De)|0,A=(A=A+Math.imul(G,we)|0)+Math.imul(W,De)|0,P=P+Math.imul(W,we)|0,w=w+Math.imul(B,et)|0,A=(A=A+Math.imul(B,Ie)|0)+Math.imul(U,et)|0,P=P+Math.imul(U,Ie)|0;var ze=(I+(w=w+Math.imul(K,Je)|0)|0)+((8191&(A=(A=A+Math.imul(K,Re)|0)+Math.imul(j,Je)|0))<<13)|0;I=((P=P+Math.imul(j,Re)|0)+(A>>>13)|0)+(ze>>>26)|0,ze&=67108863,w=Math.imul(se,ie),A=(A=Math.imul(se,de))+Math.imul(ae,ie)|0,P=Math.imul(ae,de),w=w+Math.imul(fe,Be)|0,A=(A=A+Math.imul(fe,ge)|0)+Math.imul(ne,Be)|0,P=P+Math.imul(ne,ge)|0,w=w+Math.imul(ee,De)|0,A=(A=A+Math.imul(ee,we)|0)+Math.imul(te,De)|0,P=P+Math.imul(te,we)|0,w=w+Math.imul(G,et)|0,A=(A=A+Math.imul(G,Ie)|0)+Math.imul(W,et)|0,P=P+Math.imul(W,Ie)|0,w=w+Math.imul(B,Je)|0,A=(A=A+Math.imul(B,Re)|0)+Math.imul(U,Je)|0,P=P+Math.imul(U,Re)|0;var $e=(I+(w=w+Math.imul(K,tt)|0)|0)+((8191&(A=(A=A+Math.imul(K,Te)|0)+Math.imul(j,tt)|0))<<13)|0;I=((P=P+Math.imul(j,Te)|0)+(A>>>13)|0)+($e>>>26)|0,$e&=67108863,w=Math.imul(me,ie),A=(A=Math.imul(me,de))+Math.imul(le,ie)|0,P=Math.imul(le,de),w=w+Math.imul(se,Be)|0,A=(A=A+Math.imul(se,ge)|0)+Math.imul(ae,Be)|0,P=P+Math.imul(ae,ge)|0,w=w+Math.imul(fe,De)|0,A=(A=A+Math.imul(fe,we)|0)+Math.imul(ne,De)|0,P=P+Math.imul(ne,we)|0,w=w+Math.imul(ee,et)|0,A=(A=A+Math.imul(ee,Ie)|0)+Math.imul(te,et)|0,P=P+Math.imul(te,Ie)|0,w=w+Math.imul(G,Je)|0,A=(A=A+Math.imul(G,Re)|0)+Math.imul(W,Je)|0,P=P+Math.imul(W,Re)|0,w=w+Math.imul(B,tt)|0,A=(A=A+Math.imul(B,Te)|0)+Math.imul(U,tt)|0,P=P+Math.imul(U,Te)|0;var it=(I+(w=w+Math.imul(K,Ze)|0)|0)+((8191&(A=(A=A+Math.imul(K,Pe)|0)+Math.imul(j,Ze)|0))<<13)|0;I=((P=P+Math.imul(j,Pe)|0)+(A>>>13)|0)+(it>>>26)|0,it&=67108863,w=Math.imul(Se,ie),A=(A=Math.imul(Se,de))+Math.imul(pe,ie)|0,P=Math.imul(pe,de),w=w+Math.imul(me,Be)|0,A=(A=A+Math.imul(me,ge)|0)+Math.imul(le,Be)|0,P=P+Math.imul(le,ge)|0,w=w+Math.imul(se,De)|0,A=(A=A+Math.imul(se,we)|0)+Math.imul(ae,De)|0,P=P+Math.imul(ae,we)|0,w=w+Math.imul(fe,et)|0,A=(A=A+Math.imul(fe,Ie)|0)+Math.imul(ne,et)|0,P=P+Math.imul(ne,Ie)|0,w=w+Math.imul(ee,Je)|0,A=(A=A+Math.imul(ee,Re)|0)+Math.imul(te,Je)|0,P=P+Math.imul(te,Re)|0,w=w+Math.imul(G,tt)|0,A=(A=A+Math.imul(G,Te)|0)+Math.imul(W,tt)|0,P=P+Math.imul(W,Te)|0,w=w+Math.imul(B,Ze)|0,A=(A=A+Math.imul(B,Pe)|0)+Math.imul(U,Ze)|0,P=P+Math.imul(U,Pe)|0;var Ne=(I+(w=w+Math.imul(K,Ye)|0)|0)+((8191&(A=(A=A+Math.imul(K,Ae)|0)+Math.imul(j,Ye)|0))<<13)|0;I=((P=P+Math.imul(j,Ae)|0)+(A>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,w=Math.imul(Le,ie),A=(A=Math.imul(Le,de))+Math.imul(_e,ie)|0,P=Math.imul(_e,de),w=w+Math.imul(Se,Be)|0,A=(A=A+Math.imul(Se,ge)|0)+Math.imul(pe,Be)|0,P=P+Math.imul(pe,ge)|0,w=w+Math.imul(me,De)|0,A=(A=A+Math.imul(me,we)|0)+Math.imul(le,De)|0,P=P+Math.imul(le,we)|0,w=w+Math.imul(se,et)|0,A=(A=A+Math.imul(se,Ie)|0)+Math.imul(ae,et)|0,P=P+Math.imul(ae,Ie)|0,w=w+Math.imul(fe,Je)|0,A=(A=A+Math.imul(fe,Re)|0)+Math.imul(ne,Je)|0,P=P+Math.imul(ne,Re)|0,w=w+Math.imul(ee,tt)|0,A=(A=A+Math.imul(ee,Te)|0)+Math.imul(te,tt)|0,P=P+Math.imul(te,Te)|0,w=w+Math.imul(G,Ze)|0,A=(A=A+Math.imul(G,Pe)|0)+Math.imul(W,Ze)|0,P=P+Math.imul(W,Pe)|0,w=w+Math.imul(B,Ye)|0,A=(A=A+Math.imul(B,Ae)|0)+Math.imul(U,Ye)|0,P=P+Math.imul(U,Ae)|0;var ve=(I+(w=w+Math.imul(K,Qe)|0)|0)+((8191&(A=(A=A+Math.imul(K,Ce)|0)+Math.imul(j,Qe)|0))<<13)|0;I=((P=P+Math.imul(j,Ce)|0)+(A>>>13)|0)+(ve>>>26)|0,ve&=67108863,w=Math.imul(qe,ie),A=(A=Math.imul(qe,de))+Math.imul(Ee,ie)|0,P=Math.imul(Ee,de),w=w+Math.imul(Le,Be)|0,A=(A=A+Math.imul(Le,ge)|0)+Math.imul(_e,Be)|0,P=P+Math.imul(_e,ge)|0,w=w+Math.imul(Se,De)|0,A=(A=A+Math.imul(Se,we)|0)+Math.imul(pe,De)|0,P=P+Math.imul(pe,we)|0,w=w+Math.imul(me,et)|0,A=(A=A+Math.imul(me,Ie)|0)+Math.imul(le,et)|0,P=P+Math.imul(le,Ie)|0,w=w+Math.imul(se,Je)|0,A=(A=A+Math.imul(se,Re)|0)+Math.imul(ae,Je)|0,P=P+Math.imul(ae,Re)|0,w=w+Math.imul(fe,tt)|0,A=(A=A+Math.imul(fe,Te)|0)+Math.imul(ne,tt)|0,P=P+Math.imul(ne,Te)|0,w=w+Math.imul(ee,Ze)|0,A=(A=A+Math.imul(ee,Pe)|0)+Math.imul(te,Ze)|0,P=P+Math.imul(te,Pe)|0,w=w+Math.imul(G,Ye)|0,A=(A=A+Math.imul(G,Ae)|0)+Math.imul(W,Ye)|0,P=P+Math.imul(W,Ae)|0,w=w+Math.imul(B,Qe)|0,A=(A=A+Math.imul(B,Ce)|0)+Math.imul(U,Qe)|0,P=P+Math.imul(U,Ce)|0;var st=(I+(w=w+Math.imul(K,X)|0)|0)+((8191&(A=(A=A+Math.imul(K,Q)|0)+Math.imul(j,X)|0))<<13)|0;I=((P=P+Math.imul(j,Q)|0)+(A>>>13)|0)+(st>>>26)|0,st&=67108863,w=Math.imul(qe,Be),A=(A=Math.imul(qe,ge))+Math.imul(Ee,Be)|0,P=Math.imul(Ee,ge),w=w+Math.imul(Le,De)|0,A=(A=A+Math.imul(Le,we)|0)+Math.imul(_e,De)|0,P=P+Math.imul(_e,we)|0,w=w+Math.imul(Se,et)|0,A=(A=A+Math.imul(Se,Ie)|0)+Math.imul(pe,et)|0,P=P+Math.imul(pe,Ie)|0,w=w+Math.imul(me,Je)|0,A=(A=A+Math.imul(me,Re)|0)+Math.imul(le,Je)|0,P=P+Math.imul(le,Re)|0,w=w+Math.imul(se,tt)|0,A=(A=A+Math.imul(se,Te)|0)+Math.imul(ae,tt)|0,P=P+Math.imul(ae,Te)|0,w=w+Math.imul(fe,Ze)|0,A=(A=A+Math.imul(fe,Pe)|0)+Math.imul(ne,Ze)|0,P=P+Math.imul(ne,Pe)|0,w=w+Math.imul(ee,Ye)|0,A=(A=A+Math.imul(ee,Ae)|0)+Math.imul(te,Ye)|0,P=P+Math.imul(te,Ae)|0,w=w+Math.imul(G,Qe)|0,A=(A=A+Math.imul(G,Ce)|0)+Math.imul(W,Qe)|0,P=P+Math.imul(W,Ce)|0;var dt=(I+(w=w+Math.imul(B,X)|0)|0)+((8191&(A=(A=A+Math.imul(B,Q)|0)+Math.imul(U,X)|0))<<13)|0;I=((P=P+Math.imul(U,Q)|0)+(A>>>13)|0)+(dt>>>26)|0,dt&=67108863,w=Math.imul(qe,De),A=(A=Math.imul(qe,we))+Math.imul(Ee,De)|0,P=Math.imul(Ee,we),w=w+Math.imul(Le,et)|0,A=(A=A+Math.imul(Le,Ie)|0)+Math.imul(_e,et)|0,P=P+Math.imul(_e,Ie)|0,w=w+Math.imul(Se,Je)|0,A=(A=A+Math.imul(Se,Re)|0)+Math.imul(pe,Je)|0,P=P+Math.imul(pe,Re)|0,w=w+Math.imul(me,tt)|0,A=(A=A+Math.imul(me,Te)|0)+Math.imul(le,tt)|0,P=P+Math.imul(le,Te)|0,w=w+Math.imul(se,Ze)|0,A=(A=A+Math.imul(se,Pe)|0)+Math.imul(ae,Ze)|0,P=P+Math.imul(ae,Pe)|0,w=w+Math.imul(fe,Ye)|0,A=(A=A+Math.imul(fe,Ae)|0)+Math.imul(ne,Ye)|0,P=P+Math.imul(ne,Ae)|0,w=w+Math.imul(ee,Qe)|0,A=(A=A+Math.imul(ee,Ce)|0)+Math.imul(te,Qe)|0,P=P+Math.imul(te,Ce)|0;var vt=(I+(w=w+Math.imul(G,X)|0)|0)+((8191&(A=(A=A+Math.imul(G,Q)|0)+Math.imul(W,X)|0))<<13)|0;I=((P=P+Math.imul(W,Q)|0)+(A>>>13)|0)+(vt>>>26)|0,vt&=67108863,w=Math.imul(qe,et),A=(A=Math.imul(qe,Ie))+Math.imul(Ee,et)|0,P=Math.imul(Ee,Ie),w=w+Math.imul(Le,Je)|0,A=(A=A+Math.imul(Le,Re)|0)+Math.imul(_e,Je)|0,P=P+Math.imul(_e,Re)|0,w=w+Math.imul(Se,tt)|0,A=(A=A+Math.imul(Se,Te)|0)+Math.imul(pe,tt)|0,P=P+Math.imul(pe,Te)|0,w=w+Math.imul(me,Ze)|0,A=(A=A+Math.imul(me,Pe)|0)+Math.imul(le,Ze)|0,P=P+Math.imul(le,Pe)|0,w=w+Math.imul(se,Ye)|0,A=(A=A+Math.imul(se,Ae)|0)+Math.imul(ae,Ye)|0,P=P+Math.imul(ae,Ae)|0,w=w+Math.imul(fe,Qe)|0,A=(A=A+Math.imul(fe,Ce)|0)+Math.imul(ne,Qe)|0,P=P+Math.imul(ne,Ce)|0;var mt=(I+(w=w+Math.imul(ee,X)|0)|0)+((8191&(A=(A=A+Math.imul(ee,Q)|0)+Math.imul(te,X)|0))<<13)|0;I=((P=P+Math.imul(te,Q)|0)+(A>>>13)|0)+(mt>>>26)|0,mt&=67108863,w=Math.imul(qe,Je),A=(A=Math.imul(qe,Re))+Math.imul(Ee,Je)|0,P=Math.imul(Ee,Re),w=w+Math.imul(Le,tt)|0,A=(A=A+Math.imul(Le,Te)|0)+Math.imul(_e,tt)|0,P=P+Math.imul(_e,Te)|0,w=w+Math.imul(Se,Ze)|0,A=(A=A+Math.imul(Se,Pe)|0)+Math.imul(pe,Ze)|0,P=P+Math.imul(pe,Pe)|0,w=w+Math.imul(me,Ye)|0,A=(A=A+Math.imul(me,Ae)|0)+Math.imul(le,Ye)|0,P=P+Math.imul(le,Ae)|0,w=w+Math.imul(se,Qe)|0,A=(A=A+Math.imul(se,Ce)|0)+Math.imul(ae,Qe)|0,P=P+Math.imul(ae,Ce)|0;var _t=(I+(w=w+Math.imul(fe,X)|0)|0)+((8191&(A=(A=A+Math.imul(fe,Q)|0)+Math.imul(ne,X)|0))<<13)|0;I=((P=P+Math.imul(ne,Q)|0)+(A>>>13)|0)+(_t>>>26)|0,_t&=67108863,w=Math.imul(qe,tt),A=(A=Math.imul(qe,Te))+Math.imul(Ee,tt)|0,P=Math.imul(Ee,Te),w=w+Math.imul(Le,Ze)|0,A=(A=A+Math.imul(Le,Pe)|0)+Math.imul(_e,Ze)|0,P=P+Math.imul(_e,Pe)|0,w=w+Math.imul(Se,Ye)|0,A=(A=A+Math.imul(Se,Ae)|0)+Math.imul(pe,Ye)|0,P=P+Math.imul(pe,Ae)|0,w=w+Math.imul(me,Qe)|0,A=(A=A+Math.imul(me,Ce)|0)+Math.imul(le,Qe)|0,P=P+Math.imul(le,Ce)|0;var at=(I+(w=w+Math.imul(se,X)|0)|0)+((8191&(A=(A=A+Math.imul(se,Q)|0)+Math.imul(ae,X)|0))<<13)|0;I=((P=P+Math.imul(ae,Q)|0)+(A>>>13)|0)+(at>>>26)|0,at&=67108863,w=Math.imul(qe,Ze),A=(A=Math.imul(qe,Pe))+Math.imul(Ee,Ze)|0,P=Math.imul(Ee,Pe),w=w+Math.imul(Le,Ye)|0,A=(A=A+Math.imul(Le,Ae)|0)+Math.imul(_e,Ye)|0,P=P+Math.imul(_e,Ae)|0,w=w+Math.imul(Se,Qe)|0,A=(A=A+Math.imul(Se,Ce)|0)+Math.imul(pe,Qe)|0,P=P+Math.imul(pe,Ce)|0;var xt=(I+(w=w+Math.imul(me,X)|0)|0)+((8191&(A=(A=A+Math.imul(me,Q)|0)+Math.imul(le,X)|0))<<13)|0;I=((P=P+Math.imul(le,Q)|0)+(A>>>13)|0)+(xt>>>26)|0,xt&=67108863,w=Math.imul(qe,Ye),A=(A=Math.imul(qe,Ae))+Math.imul(Ee,Ye)|0,P=Math.imul(Ee,Ae),w=w+Math.imul(Le,Qe)|0,A=(A=A+Math.imul(Le,Ce)|0)+Math.imul(_e,Qe)|0,P=P+Math.imul(_e,Ce)|0;var ut=(I+(w=w+Math.imul(Se,X)|0)|0)+((8191&(A=(A=A+Math.imul(Se,Q)|0)+Math.imul(pe,X)|0))<<13)|0;I=((P=P+Math.imul(pe,Q)|0)+(A>>>13)|0)+(ut>>>26)|0,ut&=67108863,w=Math.imul(qe,Qe),A=(A=Math.imul(qe,Ce))+Math.imul(Ee,Qe)|0,P=Math.imul(Ee,Ce);var Ot=(I+(w=w+Math.imul(Le,X)|0)|0)+((8191&(A=(A=A+Math.imul(Le,Q)|0)+Math.imul(_e,X)|0))<<13)|0;I=((P=P+Math.imul(_e,Q)|0)+(A>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Pt=(I+(w=Math.imul(qe,X))|0)+((8191&(A=(A=Math.imul(qe,Q))+Math.imul(Ee,X)|0))<<13)|0;return I=((P=Math.imul(Ee,Q))+(A>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,Z[0]=re,Z[1]=ue,Z[2]=xe,Z[3]=Me,Z[4]=ze,Z[5]=$e,Z[6]=it,Z[7]=Ne,Z[8]=ve,Z[9]=st,Z[10]=dt,Z[11]=vt,Z[12]=mt,Z[13]=_t,Z[14]=at,Z[15]=xt,Z[16]=ut,Z[17]=Ot,Z[18]=Pt,I!==0&&(Z[19]=I,g.length++),g};function C(d,m,g){g.negative=m.negative^d.negative,g.length=d.length+m.length;for(var w=0,A=0,P=0;P<g.length-1;P++){var T=A;A=0;for(var q=67108863&w,Z=Math.min(P,m.length-1),I=Math.max(0,P-d.length+1);I<=Z;I++){var $=P-I,K=(0|d.words[$])*(0|m.words[I]),j=67108863&K;q=67108863&(j=j+q|0),A+=(T=(T=T+(K/67108864|0)|0)+(j>>>26)|0)>>>26,T&=67108863}g.words[P]=q,w=T,T=A}return w!==0?g.words[P]=w:g.length--,g._strip()}function N(d,m,g){return C(d,m,g)}Math.imul||(M=O),s.prototype.mulTo=function(d,m){var g=this.length+d.length;return this.length===10&&d.length===10?M(this,d,m):g<63?O(this,d,m):g<1024?C(this,d,m):N(this,d,m)},s.prototype.mul=function(d){var m=new s(null);return m.words=new Array(this.length+d.length),this.mulTo(d,m)},s.prototype.mulf=function(d){var m=new s(null);return m.words=new Array(this.length+d.length),N(this,d,m)},s.prototype.imul=function(d){return this.clone().mulTo(d,this)},s.prototype.imuln=function(d){var m=d<0;m&&(d=-d),a(typeof d=="number"),a(d<67108864);for(var g=0,w=0;w<this.length;w++){var A=(0|this.words[w])*d,P=(67108863&A)+(67108863&g);g>>=26,g+=A/67108864|0,g+=P>>>26,this.words[w]=67108863&P}return g!==0&&(this.words[w]=g,this.length++),m?this.ineg():this},s.prototype.muln=function(d){return this.clone().imuln(d)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(d){var m=function(P){for(var T=new Array(P.bitLength()),q=0;q<T.length;q++){var Z=q/26|0,I=q%26;T[q]=P.words[Z]>>>I&1}return T}(d);if(m.length===0)return new s(1);for(var g=this,w=0;w<m.length&&m[w]===0;w++,g=g.sqr());if(++w<m.length)for(var A=g.sqr();w<m.length;w++,A=A.sqr())m[w]!==0&&(g=g.mul(A));return g},s.prototype.iushln=function(d){a(typeof d=="number"&&d>=0);var m,g=d%26,w=(d-g)/26,A=67108863>>>26-g<<26-g;if(g!==0){var P=0;for(m=0;m<this.length;m++){var T=this.words[m]&A,q=(0|this.words[m])-T<<g;this.words[m]=q|P,P=T>>>26-g}P&&(this.words[m]=P,this.length++)}if(w!==0){for(m=this.length-1;m>=0;m--)this.words[m+w]=this.words[m];for(m=0;m<w;m++)this.words[m]=0;this.length+=w}return this._strip()},s.prototype.ishln=function(d){return a(this.negative===0),this.iushln(d)},s.prototype.iushrn=function(d,m,g){var w;a(typeof d=="number"&&d>=0),w=m?(m-m%26)/26:0;var A=d%26,P=Math.min((d-A)/26,this.length),T=67108863^67108863>>>A<<A,q=g;if(w-=P,w=Math.max(0,w),q){for(var Z=0;Z<P;Z++)q.words[Z]=this.words[Z];q.length=P}if(P!==0)if(this.length>P)for(this.length-=P,Z=0;Z<this.length;Z++)this.words[Z]=this.words[Z+P];else this.words[0]=0,this.length=1;var I=0;for(Z=this.length-1;Z>=0&&(I!==0||Z>=w);Z--){var $=0|this.words[Z];this.words[Z]=I<<26-A|$>>>A,I=$&T}return q&&I!==0&&(q.words[q.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(d,m,g){return a(this.negative===0),this.iushrn(d,m,g)},s.prototype.shln=function(d){return this.clone().ishln(d)},s.prototype.ushln=function(d){return this.clone().iushln(d)},s.prototype.shrn=function(d){return this.clone().ishrn(d)},s.prototype.ushrn=function(d){return this.clone().iushrn(d)},s.prototype.testn=function(d){a(typeof d=="number"&&d>=0);var m=d%26,g=(d-m)/26,w=1<<m;return!(this.length<=g)&&!!(this.words[g]&w)},s.prototype.imaskn=function(d){a(typeof d=="number"&&d>=0);var m=d%26,g=(d-m)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(m!==0&&g++,this.length=Math.min(g,this.length),m!==0){var w=67108863^67108863>>>m<<m;this.words[this.length-1]&=w}return this._strip()},s.prototype.maskn=function(d){return this.clone().imaskn(d)},s.prototype.iaddn=function(d){return a(typeof d=="number"),a(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(0|this.words[0])<=d?(this.words[0]=d-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},s.prototype._iaddn=function(d){this.words[0]+=d;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(d){if(a(typeof d=="number"),a(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this._strip()},s.prototype.addn=function(d){return this.clone().iaddn(d)},s.prototype.subn=function(d){return this.clone().isubn(d)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(d,m,g){var w,A,P=d.length+g;this._expand(P);var T=0;for(w=0;w<d.length;w++){A=(0|this.words[w+g])+T;var q=(0|d.words[w])*m;T=((A-=67108863&q)>>26)-(q/67108864|0),this.words[w+g]=67108863&A}for(;w<this.length-g;w++)T=(A=(0|this.words[w+g])+T)>>26,this.words[w+g]=67108863&A;if(T===0)return this._strip();for(a(T===-1),T=0,w=0;w<this.length;w++)T=(A=-(0|this.words[w])+T)>>26,this.words[w]=67108863&A;return this.negative=1,this._strip()},s.prototype._wordDiv=function(d,m){var g=(this.length,d.length),w=this.clone(),A=d,P=0|A.words[A.length-1];(g=26-this._countBits(P))!==0&&(A=A.ushln(g),w.iushln(g),P=0|A.words[A.length-1]);var T,q=w.length-A.length;if(m!=="mod"){(T=new s(null)).length=q+1,T.words=new Array(T.length);for(var Z=0;Z<T.length;Z++)T.words[Z]=0}var I=w.clone()._ishlnsubmul(A,1,q);I.negative===0&&(w=I,T&&(T.words[q]=1));for(var $=q-1;$>=0;$--){var K=67108864*(0|w.words[A.length+$])+(0|w.words[A.length+$-1]);for(K=Math.min(K/P|0,67108863),w._ishlnsubmul(A,K,$);w.negative!==0;)K--,w.negative=0,w._ishlnsubmul(A,1,$),w.isZero()||(w.negative^=1);T&&(T.words[$]=K)}return T&&T._strip(),w._strip(),m!=="div"&&g!==0&&w.iushrn(g),{div:T||null,mod:w}},s.prototype.divmod=function(d,m,g){return a(!d.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&d.negative===0?(P=this.neg().divmod(d,m),m!=="mod"&&(w=P.div.neg()),m!=="div"&&(A=P.mod.neg(),g&&A.negative!==0&&A.iadd(d)),{div:w,mod:A}):this.negative===0&&d.negative!==0?(P=this.divmod(d.neg(),m),m!=="mod"&&(w=P.div.neg()),{div:w,mod:P.mod}):(this.negative&d.negative)!=0?(P=this.neg().divmod(d.neg(),m),m!=="div"&&(A=P.mod.neg(),g&&A.negative!==0&&A.isub(d)),{div:P.div,mod:A}):d.length>this.length||this.cmp(d)<0?{div:new s(0),mod:this}:d.length===1?m==="div"?{div:this.divn(d.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new s(this.modrn(d.words[0]))}:this._wordDiv(d,m);var w,A,P},s.prototype.div=function(d){return this.divmod(d,"div",!1).div},s.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},s.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},s.prototype.divRound=function(d){var m=this.divmod(d);if(m.mod.isZero())return m.div;var g=m.div.negative!==0?m.mod.isub(d):m.mod,w=d.ushrn(1),A=d.andln(1),P=g.cmp(w);return P<0||A===1&&P===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(d){var m=d<0;m&&(d=-d),a(d<=67108863);for(var g=(1<<26)%d,w=0,A=this.length-1;A>=0;A--)w=(g*w+(0|this.words[A]))%d;return m?-w:w},s.prototype.modn=function(d){return this.modrn(d)},s.prototype.idivn=function(d){var m=d<0;m&&(d=-d),a(d<=67108863);for(var g=0,w=this.length-1;w>=0;w--){var A=(0|this.words[w])+67108864*g;this.words[w]=A/d|0,g=A%d}return this._strip(),m?this.ineg():this},s.prototype.divn=function(d){return this.clone().idivn(d)},s.prototype.egcd=function(d){a(d.negative===0),a(!d.isZero());var m=this,g=d.clone();m=m.negative!==0?m.umod(d):m.clone();for(var w=new s(1),A=new s(0),P=new s(0),T=new s(1),q=0;m.isEven()&&g.isEven();)m.iushrn(1),g.iushrn(1),++q;for(var Z=g.clone(),I=m.clone();!m.isZero();){for(var $=0,K=1;(m.words[0]&K)==0&&$<26;++$,K<<=1);if($>0)for(m.iushrn($);$-- >0;)(w.isOdd()||A.isOdd())&&(w.iadd(Z),A.isub(I)),w.iushrn(1),A.iushrn(1);for(var j=0,D=1;(g.words[0]&D)==0&&j<26;++j,D<<=1);if(j>0)for(g.iushrn(j);j-- >0;)(P.isOdd()||T.isOdd())&&(P.iadd(Z),T.isub(I)),P.iushrn(1),T.iushrn(1);m.cmp(g)>=0?(m.isub(g),w.isub(P),A.isub(T)):(g.isub(m),P.isub(w),T.isub(A))}return{a:P,b:T,gcd:g.iushln(q)}},s.prototype._invmp=function(d){a(d.negative===0),a(!d.isZero());var m=this,g=d.clone();m=m.negative!==0?m.umod(d):m.clone();for(var w,A=new s(1),P=new s(0),T=g.clone();m.cmpn(1)>0&&g.cmpn(1)>0;){for(var q=0,Z=1;(m.words[0]&Z)==0&&q<26;++q,Z<<=1);if(q>0)for(m.iushrn(q);q-- >0;)A.isOdd()&&A.iadd(T),A.iushrn(1);for(var I=0,$=1;(g.words[0]&$)==0&&I<26;++I,$<<=1);if(I>0)for(g.iushrn(I);I-- >0;)P.isOdd()&&P.iadd(T),P.iushrn(1);m.cmp(g)>=0?(m.isub(g),A.isub(P)):(g.isub(m),P.isub(A))}return(w=m.cmpn(1)===0?A:P).cmpn(0)<0&&w.iadd(d),w},s.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var m=this.clone(),g=d.clone();m.negative=0,g.negative=0;for(var w=0;m.isEven()&&g.isEven();w++)m.iushrn(1),g.iushrn(1);for(;;){for(;m.isEven();)m.iushrn(1);for(;g.isEven();)g.iushrn(1);var A=m.cmp(g);if(A<0){var P=m;m=g,g=P}else if(A===0||g.cmpn(1)===0)break;m.isub(g)}return g.iushln(w)},s.prototype.invm=function(d){return this.egcd(d).a.umod(d)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(d){return this.words[0]&d},s.prototype.bincn=function(d){a(typeof d=="number");var m=d%26,g=(d-m)/26,w=1<<m;if(this.length<=g)return this._expand(g+1),this.words[g]|=w,this;for(var A=w,P=g;A!==0&&P<this.length;P++){var T=0|this.words[P];A=(T+=A)>>>26,T&=67108863,this.words[P]=T}return A!==0&&(this.words[P]=A,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(d){var m,g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;if(this._strip(),this.length>1)m=1;else{g&&(d=-d),a(d<=67108863,"Number is too big");var w=0|this.words[0];m=w===d?0:w<d?-1:1}return this.negative!==0?0|-m:m},s.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var m=this.ucmp(d);return this.negative!==0?0|-m:m},s.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var m=0,g=this.length-1;g>=0;g--){var w=0|this.words[g],A=0|d.words[g];if(w!==A){w<A?m=-1:w>A&&(m=1);break}}return m},s.prototype.gtn=function(d){return this.cmpn(d)===1},s.prototype.gt=function(d){return this.cmp(d)===1},s.prototype.gten=function(d){return this.cmpn(d)>=0},s.prototype.gte=function(d){return this.cmp(d)>=0},s.prototype.ltn=function(d){return this.cmpn(d)===-1},s.prototype.lt=function(d){return this.cmp(d)===-1},s.prototype.lten=function(d){return this.cmpn(d)<=0},s.prototype.lte=function(d){return this.cmp(d)<=0},s.prototype.eqn=function(d){return this.cmpn(d)===0},s.prototype.eq=function(d){return this.cmp(d)===0},s.red=function(d){return new l(d)},s.prototype.toRed=function(d){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},s.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(d){return this.red=d,this},s.prototype.forceRed=function(d){return a(!this.red,"Already a number in reduction context"),this._forceRed(d)},s.prototype.redAdd=function(d){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},s.prototype.redIAdd=function(d){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},s.prototype.redSub=function(d){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},s.prototype.redISub=function(d){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},s.prototype.redShl=function(d){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},s.prototype.redMul=function(d){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},s.prototype.redIMul=function(d){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},s.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(d){return a(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var L={k256:null,p224:null,p192:null,p25519:null};function F(d,m){this.name=d,this.p=new s(m,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function V(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function H(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function z(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function R(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function l(d){if(typeof d=="string"){var m=s._prime(d);this.m=m.p,this.prime=m}else a(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}function x(d){l.call(this,d),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)}F.prototype._tmp=function(){var d=new s(null);return d.words=new Array(Math.ceil(this.n/13)),d},F.prototype.ireduce=function(d){var m,g=d;do this.split(g,this.tmp),m=(g=(g=this.imulK(g)).iadd(this.tmp)).bitLength();while(m>this.n);var w=m<this.n?-1:g.ucmp(this.p);return w===0?(g.words[0]=0,g.length=1):w>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},F.prototype.split=function(d,m){d.iushrn(this.n,0,m)},F.prototype.imulK=function(d){return d.imul(this.k)},f(V,F),V.prototype.split=function(d,m){for(var g=Math.min(d.length,9),w=0;w<g;w++)m.words[w]=d.words[w];if(m.length=g,d.length<=9)return d.words[0]=0,void(d.length=1);var A=d.words[9];for(m.words[m.length++]=4194303&A,w=10;w<d.length;w++){var P=0|d.words[w];d.words[w-10]=(4194303&P)<<4|A>>>22,A=P}A>>>=22,d.words[w-10]=A,A===0&&d.length>10?d.length-=10:d.length-=9},V.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var m=0,g=0;g<d.length;g++){var w=0|d.words[g];m+=977*w,d.words[g]=67108863&m,m=64*w+(m/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d},f(H,F),f(z,F),f(R,F),R.prototype.imulK=function(d){for(var m=0,g=0;g<d.length;g++){var w=19*(0|d.words[g])+m,A=67108863&w;w>>>=26,d.words[g]=A,m=w}return m!==0&&(d.words[d.length++]=m),d},s._prime=function(d){if(L[d])return L[d];var m;if(d==="k256")m=new V;else if(d==="p224")m=new H;else if(d==="p192")m=new z;else{if(d!=="p25519")throw new Error("Unknown prime "+d);m=new R}return L[d]=m,m},l.prototype._verify1=function(d){a(d.negative===0,"red works only with positives"),a(d.red,"red works only with red numbers")},l.prototype._verify2=function(d,m){a((d.negative|m.negative)==0,"red works only with positives"),a(d.red&&d.red===m.red,"red works only with red numbers")},l.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(y(d,d.umod(this.m)._forceRed(this)),d)},l.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},l.prototype.add=function(d,m){this._verify2(d,m);var g=d.add(m);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},l.prototype.iadd=function(d,m){this._verify2(d,m);var g=d.iadd(m);return g.cmp(this.m)>=0&&g.isub(this.m),g},l.prototype.sub=function(d,m){this._verify2(d,m);var g=d.sub(m);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},l.prototype.isub=function(d,m){this._verify2(d,m);var g=d.isub(m);return g.cmpn(0)<0&&g.iadd(this.m),g},l.prototype.shl=function(d,m){return this._verify1(d),this.imod(d.ushln(m))},l.prototype.imul=function(d,m){return this._verify2(d,m),this.imod(d.imul(m))},l.prototype.mul=function(d,m){return this._verify2(d,m),this.imod(d.mul(m))},l.prototype.isqr=function(d){return this.imul(d,d.clone())},l.prototype.sqr=function(d){return this.mul(d,d)},l.prototype.sqrt=function(d){if(d.isZero())return d.clone();var m=this.m.andln(3);if(a(m%2==1),m===3){var g=this.m.add(new s(1)).iushrn(2);return this.pow(d,g)}for(var w=this.m.subn(1),A=0;!w.isZero()&&w.andln(1)===0;)A++,w.iushrn(1);a(!w.isZero());var P=new s(1).toRed(this),T=P.redNeg(),q=this.m.subn(1).iushrn(1),Z=this.m.bitLength();for(Z=new s(2*Z*Z).toRed(this);this.pow(Z,q).cmp(T)!==0;)Z.redIAdd(T);for(var I=this.pow(Z,w),$=this.pow(d,w.addn(1).iushrn(1)),K=this.pow(d,w),j=A;K.cmp(P)!==0;){for(var D=K,B=0;D.cmp(P)!==0;B++)D=D.redSqr();a(B<j);var U=this.pow(I,new s(1).iushln(j-B-1));$=$.redMul(U),I=U.redSqr(),K=K.redMul(I),j=B}return $},l.prototype.invm=function(d){var m=d._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},l.prototype.pow=function(d,m){if(m.isZero())return new s(1).toRed(this);if(m.cmpn(1)===0)return d.clone();var g=new Array(16);g[0]=new s(1).toRed(this),g[1]=d;for(var w=2;w<g.length;w++)g[w]=this.mul(g[w-1],d);var A=g[0],P=0,T=0,q=m.bitLength()%26;for(q===0&&(q=26),w=m.length-1;w>=0;w--){for(var Z=m.words[w],I=q-1;I>=0;I--){var $=Z>>I&1;A!==g[0]&&(A=this.sqr(A)),$!==0||P!==0?(P<<=1,P|=$,(++T===4||w===0&&I===0)&&(A=this.mul(A,g[P]),T=0,P=0)):T=0}q=26}return A},l.prototype.convertTo=function(d){var m=d.umod(this.m);return m===d?m.clone():m},l.prototype.convertFrom=function(d){var m=d.clone();return m.red=null,m},s.mont=function(d){return new x(d)},f(x,l),x.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},x.prototype.convertFrom=function(d){var m=this.imod(d.mul(this.rinv));return m.red=null,m},x.prototype.imul=function(d,m){if(d.isZero()||m.isZero())return d.words[0]=0,d.length=1,d;var g=d.imul(m),w=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=g.isub(w).iushrn(this.shift),P=A;return A.cmp(this.m)>=0?P=A.isub(this.m):A.cmpn(0)<0&&(P=A.iadd(this.m)),P._forceRed(this)},x.prototype.mul=function(d,m){if(d.isZero()||m.isZero())return new s(0)._forceRed(this);var g=d.mul(m),w=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=g.isub(w).iushrn(this.shift),P=A;return A.cmp(this.m)>=0?P=A.isub(this.m):A.cmpn(0)<0&&(P=A.iadd(this.m)),P._forceRed(this)},x.prototype.invm=function(d){return this.imod(d._invmp(this.m).mul(this.r2))._forceRed(this)}})(n,this)}).call(this,t(25)(o))},function(o,e){},function(o,e,t){var n=t(3),c=t(127),p=t(13).Buffer,a=new Array(16);function f(){c.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function s(y,_){return y<<_|y>>>32-_}function u(y,_,E,S,k,O,M){return s(y+(_&E|~_&S)+k+O|0,M)+_|0}function h(y,_,E,S,k,O,M){return s(y+(_&S|E&~S)+k+O|0,M)+_|0}function v(y,_,E,S,k,O,M){return s(y+(_^E^S)+k+O|0,M)+_|0}function b(y,_,E,S,k,O,M){return s(y+(E^(_|~S))+k+O|0,M)+_|0}n(f,c),f.prototype._update=function(){for(var y=a,_=0;_<16;++_)y[_]=this._block.readInt32LE(4*_);var E=this._a,S=this._b,k=this._c,O=this._d;E=u(E,S,k,O,y[0],3614090360,7),O=u(O,E,S,k,y[1],3905402710,12),k=u(k,O,E,S,y[2],606105819,17),S=u(S,k,O,E,y[3],3250441966,22),E=u(E,S,k,O,y[4],4118548399,7),O=u(O,E,S,k,y[5],1200080426,12),k=u(k,O,E,S,y[6],2821735955,17),S=u(S,k,O,E,y[7],4249261313,22),E=u(E,S,k,O,y[8],1770035416,7),O=u(O,E,S,k,y[9],2336552879,12),k=u(k,O,E,S,y[10],4294925233,17),S=u(S,k,O,E,y[11],2304563134,22),E=u(E,S,k,O,y[12],1804603682,7),O=u(O,E,S,k,y[13],4254626195,12),k=u(k,O,E,S,y[14],2792965006,17),E=h(E,S=u(S,k,O,E,y[15],1236535329,22),k,O,y[1],4129170786,5),O=h(O,E,S,k,y[6],3225465664,9),k=h(k,O,E,S,y[11],643717713,14),S=h(S,k,O,E,y[0],3921069994,20),E=h(E,S,k,O,y[5],3593408605,5),O=h(O,E,S,k,y[10],38016083,9),k=h(k,O,E,S,y[15],3634488961,14),S=h(S,k,O,E,y[4],3889429448,20),E=h(E,S,k,O,y[9],568446438,5),O=h(O,E,S,k,y[14],3275163606,9),k=h(k,O,E,S,y[3],4107603335,14),S=h(S,k,O,E,y[8],1163531501,20),E=h(E,S,k,O,y[13],2850285829,5),O=h(O,E,S,k,y[2],4243563512,9),k=h(k,O,E,S,y[7],1735328473,14),E=v(E,S=h(S,k,O,E,y[12],2368359562,20),k,O,y[5],4294588738,4),O=v(O,E,S,k,y[8],2272392833,11),k=v(k,O,E,S,y[11],1839030562,16),S=v(S,k,O,E,y[14],4259657740,23),E=v(E,S,k,O,y[1],2763975236,4),O=v(O,E,S,k,y[4],1272893353,11),k=v(k,O,E,S,y[7],4139469664,16),S=v(S,k,O,E,y[10],3200236656,23),E=v(E,S,k,O,y[13],681279174,4),O=v(O,E,S,k,y[0],3936430074,11),k=v(k,O,E,S,y[3],3572445317,16),S=v(S,k,O,E,y[6],76029189,23),E=v(E,S,k,O,y[9],3654602809,4),O=v(O,E,S,k,y[12],3873151461,11),k=v(k,O,E,S,y[15],530742520,16),E=b(E,S=v(S,k,O,E,y[2],3299628645,23),k,O,y[0],4096336452,6),O=b(O,E,S,k,y[7],1126891415,10),k=b(k,O,E,S,y[14],2878612391,15),S=b(S,k,O,E,y[5],4237533241,21),E=b(E,S,k,O,y[12],1700485571,6),O=b(O,E,S,k,y[3],2399980690,10),k=b(k,O,E,S,y[10],4293915773,15),S=b(S,k,O,E,y[1],2240044497,21),E=b(E,S,k,O,y[8],1873313359,6),O=b(O,E,S,k,y[15],4264355552,10),k=b(k,O,E,S,y[6],2734768916,15),S=b(S,k,O,E,y[13],1309151649,21),E=b(E,S,k,O,y[4],4149444226,6),O=b(O,E,S,k,y[11],3174756917,10),k=b(k,O,E,S,y[2],718787259,15),S=b(S,k,O,E,y[9],3951481745,21),this._a=this._a+E|0,this._b=this._b+S|0,this._c=this._c+k|0,this._d=this._d+O|0},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var y=p.allocUnsafe(16);return y.writeInt32LE(this._a,0),y.writeInt32LE(this._b,4),y.writeInt32LE(this._c,8),y.writeInt32LE(this._d,12),y},o.exports=f},function(o,e,t){(e=o.exports=t(128)).Stream=e,e.Readable=e,e.Writable=t(132),e.Duplex=t(30),e.Transform=t(133),e.PassThrough=t(278),e.finished=t(62),e.pipeline=t(279)},function(o,e){},function(o,e,t){function n(u,h){var v=Object.keys(u);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(u);h&&(b=b.filter(function(y){return Object.getOwnPropertyDescriptor(u,y).enumerable})),v.push.apply(v,b)}return v}function c(u,h,v){return h in u?Object.defineProperty(u,h,{value:v,enumerable:!0,configurable:!0,writable:!0}):u[h]=v,u}function p(u,h){for(var v=0;v<h.length;v++){var b=h[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(u,b.key,b)}}var a=t(2).Buffer,f=t(275).inspect,s=f&&f.custom||"inspect";o.exports=function(){function u(){(function(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")})(this,u),this.head=null,this.tail=null,this.length=0}var h,v;return h=u,(v=[{key:"push",value:function(b){var y={data:b,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(b){var y={data:b,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var y=this.head,_=""+y.data;y=y.next;)_+=b+y.data;return _}},{key:"concat",value:function(b){if(this.length===0)return a.alloc(0);for(var y,_,E,S=a.allocUnsafe(b>>>0),k=this.head,O=0;k;)y=k.data,_=S,E=O,a.prototype.copy.call(y,_,E),O+=k.data.length,k=k.next;return S}},{key:"consume",value:function(b,y){var _;return b<this.head.data.length?(_=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):_=b===this.head.data.length?this.shift():y?this._getString(b):this._getBuffer(b),_}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var y=this.head,_=1,E=y.data;for(b-=E.length;y=y.next;){var S=y.data,k=b>S.length?S.length:b;if(k===S.length?E+=S:E+=S.slice(0,b),(b-=k)==0){k===S.length?(++_,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=S.slice(k));break}++_}return this.length-=_,E}},{key:"_getBuffer",value:function(b){var y=a.allocUnsafe(b),_=this.head,E=1;for(_.data.copy(y),b-=_.data.length;_=_.next;){var S=_.data,k=b>S.length?S.length:b;if(S.copy(y,y.length-b,0,k),(b-=k)==0){k===S.length?(++E,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=S.slice(k));break}++E}return this.length-=E,y}},{key:s,value:function(b,y){return f(this,function(_){for(var E=1;E<arguments.length;E++){var S=arguments[E]!=null?arguments[E]:{};E%2?n(Object(S),!0).forEach(function(k){c(_,k,S[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(S)):n(Object(S)).forEach(function(k){Object.defineProperty(_,k,Object.getOwnPropertyDescriptor(S,k))})}return _}({},y,{depth:0,customInspect:!1}))}}])&&p(h.prototype,v),u}()},function(o,e){},function(o,e,t){(function(n){var c;function p(M,C,N){return C in M?Object.defineProperty(M,C,{value:N,enumerable:!0,configurable:!0,writable:!0}):M[C]=N,M}var a=t(62),f=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),h=Symbol("ended"),v=Symbol("lastPromise"),b=Symbol("handlePromise"),y=Symbol("stream");function _(M,C){return{value:M,done:C}}function E(M){var C=M[f];if(C!==null){var N=M[y].read();N!==null&&(M[v]=null,M[f]=null,M[s]=null,C(_(N,!1)))}}function S(M){n.nextTick(E,M)}var k=Object.getPrototypeOf(function(){}),O=Object.setPrototypeOf((p(c={get stream(){return this[y]},next:function(){var M=this,C=this[u];if(C!==null)return Promise.reject(C);if(this[h])return Promise.resolve(_(void 0,!0));if(this[y].destroyed)return new Promise(function(V,H){n.nextTick(function(){M[u]?H(M[u]):V(_(void 0,!0))})});var N,L=this[v];if(L)N=new Promise(function(V,H){return function(z,R){V.then(function(){H[h]?z(_(void 0,!0)):H[b](z,R)},R)}}(L,this));else{var F=this[y].read();if(F!==null)return Promise.resolve(_(F,!1));N=new Promise(this[b])}return this[v]=N,N}},Symbol.asyncIterator,function(){return this}),p(c,"return",function(){var M=this;return new Promise(function(C,N){M[y].destroy(null,function(L){L?N(L):C(_(void 0,!0))})})}),c),k);o.exports=function(M){var C,N=Object.create(O,(p(C={},y,{value:M,writable:!0}),p(C,f,{value:null,writable:!0}),p(C,s,{value:null,writable:!0}),p(C,u,{value:null,writable:!0}),p(C,h,{value:M._readableState.endEmitted,writable:!0}),p(C,b,{value:function(L,F){var V=N[y].read();V?(N[v]=null,N[f]=null,N[s]=null,L(_(V,!1))):(N[f]=L,N[s]=F)},writable:!0}),C));return N[v]=null,a(M,function(L){if(L&&L.code!=="ERR_STREAM_PREMATURE_CLOSE"){var F=N[s];return F!==null&&(N[v]=null,N[f]=null,N[s]=null,F(L)),void(N[u]=L)}var V=N[f];V!==null&&(N[v]=null,N[f]=null,N[s]=null,V(_(void 0,!0))),N[h]=!0}),M.on("readable",S.bind(null,N)),N}}).call(this,t(5))},function(o,e){o.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(o,e,t){o.exports=c;var n=t(133);function c(p){if(!(this instanceof c))return new c(p);n.call(this,p)}t(3)(c,n),c.prototype._transform=function(p,a,f){f(null,p)}},function(o,e,t){var n,c=t(29).codes,p=c.ERR_MISSING_ARGS,a=c.ERR_STREAM_DESTROYED;function f(b){if(b)throw b}function s(b,y,_,E){E=function(O){var M=!1;return function(){M||(M=!0,O.apply(void 0,arguments))}}(E);var S=!1;b.on("close",function(){S=!0}),n===void 0&&(n=t(62)),n(b,{readable:y,writable:_},function(O){if(O)return E(O);S=!0,E()});var k=!1;return function(O){if(!S&&!k)return k=!0,function(M){return M.setHeader&&typeof M.abort=="function"}(b)?b.abort():typeof b.destroy=="function"?b.destroy():void E(O||new a("pipe"))}}function u(b){b()}function h(b,y){return b.pipe(y)}function v(b){return b.length?typeof b[b.length-1]!="function"?f:b.pop():f}o.exports=function(){for(var b=arguments.length,y=new Array(b),_=0;_<b;_++)y[_]=arguments[_];var E,S=v(y);if(Array.isArray(y[0])&&(y=y[0]),y.length<2)throw new p("streams");var k=y.map(function(O,M){var C=M<y.length-1;return s(O,C,M>0,function(N){E||(E=N),N&&k.forEach(u),C||(k.forEach(u),S(E))})});return y.reduce(h)}},function(o,e,t){var n=t(2).Buffer,c=t(3),p=t(127),a=new Array(16),f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],s=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],h=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],v=[0,1518500249,1859775393,2400959708,2840853838],b=[1352829926,1548603684,1836072691,2053994217,0];function y(){p.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function _(C,N){return C<<N|C>>>32-N}function E(C,N,L,F,V,H,z,R){return _(C+(N^L^F)+H+z|0,R)+V|0}function S(C,N,L,F,V,H,z,R){return _(C+(N&L|~N&F)+H+z|0,R)+V|0}function k(C,N,L,F,V,H,z,R){return _(C+((N|~L)^F)+H+z|0,R)+V|0}function O(C,N,L,F,V,H,z,R){return _(C+(N&F|L&~F)+H+z|0,R)+V|0}function M(C,N,L,F,V,H,z,R){return _(C+(N^(L|~F))+H+z|0,R)+V|0}c(y,p),y.prototype._update=function(){for(var C=a,N=0;N<16;++N)C[N]=this._block.readInt32LE(4*N);for(var L=0|this._a,F=0|this._b,V=0|this._c,H=0|this._d,z=0|this._e,R=0|this._a,l=0|this._b,x=0|this._c,d=0|this._d,m=0|this._e,g=0;g<80;g+=1){var w,A;g<16?(w=E(L,F,V,H,z,C[f[g]],v[0],u[g]),A=M(R,l,x,d,m,C[s[g]],b[0],h[g])):g<32?(w=S(L,F,V,H,z,C[f[g]],v[1],u[g]),A=O(R,l,x,d,m,C[s[g]],b[1],h[g])):g<48?(w=k(L,F,V,H,z,C[f[g]],v[2],u[g]),A=k(R,l,x,d,m,C[s[g]],b[2],h[g])):g<64?(w=O(L,F,V,H,z,C[f[g]],v[3],u[g]),A=S(R,l,x,d,m,C[s[g]],b[3],h[g])):(w=M(L,F,V,H,z,C[f[g]],v[4],u[g]),A=E(R,l,x,d,m,C[s[g]],b[4],h[g])),L=z,z=H,H=_(V,10),V=F,F=w,R=m,m=d,d=_(x,10),x=l,l=A}var P=this._b+V+d|0;this._b=this._c+H+m|0,this._c=this._d+z+R|0,this._d=this._e+L+l|0,this._e=this._a+F+x|0,this._a=P},y.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var C=n.alloc?n.alloc(20):new n(20);return C.writeInt32LE(this._a,0),C.writeInt32LE(this._b,4),C.writeInt32LE(this._c,8),C.writeInt32LE(this._d,12),C.writeInt32LE(this._e,16),C},o.exports=y},function(o,e,t){(e=o.exports=function(n){n=n.toLowerCase();var c=e[n];if(!c)throw new Error(n+" is not supported (we accept pull requests)");return new c}).sha=t(282),e.sha1=t(283),e.sha224=t(284),e.sha256=t(134),e.sha384=t(285),e.sha512=t(135)},function(o,e,t){var n=t(3),c=t(31),p=t(13).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function s(){this.init(),this._w=f,c.call(this,64,56)}function u(v){return v<<30|v>>>2}function h(v,b,y,_){return v===0?b&y|~b&_:v===2?b&y|b&_|y&_:b^y^_}n(s,c),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(v){for(var b,y=this._w,_=0|this._a,E=0|this._b,S=0|this._c,k=0|this._d,O=0|this._e,M=0;M<16;++M)y[M]=v.readInt32BE(4*M);for(;M<80;++M)y[M]=y[M-3]^y[M-8]^y[M-14]^y[M-16];for(var C=0;C<80;++C){var N=~~(C/20),L=0|((b=_)<<5|b>>>27)+h(N,E,S,k)+O+y[C]+a[N];O=k,k=S,S=u(E),E=_,_=L}this._a=_+this._a|0,this._b=E+this._b|0,this._c=S+this._c|0,this._d=k+this._d|0,this._e=O+this._e|0},s.prototype._hash=function(){var v=p.allocUnsafe(20);return v.writeInt32BE(0|this._a,0),v.writeInt32BE(0|this._b,4),v.writeInt32BE(0|this._c,8),v.writeInt32BE(0|this._d,12),v.writeInt32BE(0|this._e,16),v},o.exports=s},function(o,e,t){var n=t(3),c=t(31),p=t(13).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function s(){this.init(),this._w=f,c.call(this,64,56)}function u(b){return b<<5|b>>>27}function h(b){return b<<30|b>>>2}function v(b,y,_,E){return b===0?y&_|~y&E:b===2?y&_|y&E|_&E:y^_^E}n(s,c),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(b){for(var y,_=this._w,E=0|this._a,S=0|this._b,k=0|this._c,O=0|this._d,M=0|this._e,C=0;C<16;++C)_[C]=b.readInt32BE(4*C);for(;C<80;++C)_[C]=(y=_[C-3]^_[C-8]^_[C-14]^_[C-16])<<1|y>>>31;for(var N=0;N<80;++N){var L=~~(N/20),F=u(E)+v(L,S,k,O)+M+_[N]+a[L]|0;M=O,O=k,k=h(S),S=E,E=F}this._a=E+this._a|0,this._b=S+this._b|0,this._c=k+this._c|0,this._d=O+this._d|0,this._e=M+this._e|0},s.prototype._hash=function(){var b=p.allocUnsafe(20);return b.writeInt32BE(0|this._a,0),b.writeInt32BE(0|this._b,4),b.writeInt32BE(0|this._c,8),b.writeInt32BE(0|this._d,12),b.writeInt32BE(0|this._e,16),b},o.exports=s},function(o,e,t){var n=t(3),c=t(134),p=t(31),a=t(13).Buffer,f=new Array(64);function s(){this.init(),this._w=f,p.call(this,64,56)}n(s,c),s.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},s.prototype._hash=function(){var u=a.allocUnsafe(28);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u},o.exports=s},function(o,e,t){var n=t(3),c=t(135),p=t(31),a=t(13).Buffer,f=new Array(160);function s(){this.init(),this._w=f,p.call(this,128,112)}n(s,c),s.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},s.prototype._hash=function(){var u=a.allocUnsafe(48);function h(v,b,y){u.writeInt32BE(v,y),u.writeInt32BE(b,y+4)}return h(this._ah,this._al,0),h(this._bh,this._bl,8),h(this._ch,this._cl,16),h(this._dh,this._dl,24),h(this._eh,this._el,32),h(this._fh,this._fl,40),u},o.exports=s},function(o,e,t){var n=t(13).Buffer,c=t(287).Transform,p=t(20).StringDecoder;function a(f){c.call(this),this.hashMode=typeof f=="string",this.hashMode?this[f]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(3)(a,c),a.prototype.update=function(f,s,u){typeof f=="string"&&(f=n.from(f,s));var h=this._update(f);return this.hashMode?this:(u&&(h=this._toString(h,u)),h)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(f,s,u){var h;try{this.hashMode?this._update(f):this.push(this._update(f))}catch(v){h=v}finally{u(h)}},a.prototype._flush=function(f){var s;try{this.push(this.__final())}catch(u){s=u}f(s)},a.prototype._finalOrDigest=function(f){var s=this.__final()||n.alloc(0);return f&&(s=this._toString(s,f,!0)),s},a.prototype._toString=function(f,s,u){if(this._decoder||(this._decoder=new p(s),this._encoding=s),this._encoding!==s)throw new Error("can't switch encodings");var h=this._decoder.write(f);return u&&(h+=this._decoder.end()),h},o.exports=a},function(o,e,t){o.exports=c;var n=t(12).EventEmitter;function c(){n.call(this)}t(3)(c,n),c.Readable=t(34),c.Writable=t(288),c.Duplex=t(289),c.Transform=t(290),c.PassThrough=t(291),c.Stream=c,c.prototype.pipe=function(p,a){var f=this;function s(E){p.writable&&p.write(E)===!1&&f.pause&&f.pause()}function u(){f.readable&&f.resume&&f.resume()}f.on("data",s),p.on("drain",u),p._isStdio||a&&a.end===!1||(f.on("end",v),f.on("close",b));var h=!1;function v(){h||(h=!0,p.end())}function b(){h||(h=!0,typeof p.destroy=="function"&&p.destroy())}function y(E){if(_(),n.listenerCount(this,"error")===0)throw E}function _(){f.removeListener("data",s),p.removeListener("drain",u),f.removeListener("end",v),f.removeListener("close",b),f.removeListener("error",y),p.removeListener("error",y),f.removeListener("end",_),f.removeListener("close",_),p.removeListener("close",_)}return f.on("error",y),p.on("error",y),f.on("end",_),f.on("close",_),p.on("close",_),p.emit("pipe",f),p}},function(o,e,t){o.exports=t(53)},function(o,e,t){o.exports=t(19)},function(o,e,t){o.exports=t(34).Transform},function(o,e,t){o.exports=t(34).PassThrough},function(o,e,t){var n=t(2),c=n.Buffer;function p(f,s){for(var u in f)s[u]=f[u]}function a(f,s,u){return c(f,s,u)}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=n:(p(n,e),e.Buffer=a),p(c,a),a.from=function(f,s,u){if(typeof f=="number")throw new TypeError("Argument must not be a number");return c(f,s,u)},a.alloc=function(f,s,u){if(typeof f!="number")throw new TypeError("Argument must be a number");var h=c(f);return s!==void 0?typeof u=="string"?h.fill(s,u):h.fill(s):h.fill(0),h},a.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return c(f)},a.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(f)}},function(o,e,t){var n=t(136);o.exports=function(c){return typeof c!="string"?c:n(c)?c.slice(2):c}},function(o,e,t){const n=t(137),c=t(295);function p(a,f){return new Promise(s=>{const u=setTimeout(s,a);u.unref&&f&&u.unref()})}o.exports=class extends c{constructor(a={}){if(!a.provider)throw new Error("PollingBlockTracker - no provider specified.");const f=a.pollingInterval||2e4,s=a.retryTimeout||f/10,u=a.keepEventLoopActive===void 0||a.keepEventLoopActive,h=a.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:f},a)),this._provider=a.provider,this._pollingInterval=f,this._retryTimeout=s,this._keepEventLoopActive=u,this._setSkipCacheFlag=h}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch(a=>this.emit("error",a))}async _performSync(){for(;this._isRunning;)try{await this._updateLatestBlock(),await p(this._pollingInterval,!this._keepEventLoopActive)}catch(a){const f=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
`+a.stack);try{this.emit("error",f)}catch{console.error(f)}await p(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){const a=await this._fetchLatestBlock();this._newPotentialLatest(a)}async _fetchLatestBlock(){const a={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(a.skipCache=!0);const f=await n(s=>this._provider.sendAsync(a,s))();if(f.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
`+f.error);return f.result}}},function(o,e,t){t(138),t(137);const n=t(297),c=(f,s)=>f+s,p=["sync","latest"];function a(f){return Number.parseInt(f,16)}o.exports=class extends n{constructor(f={}){super(),this._blockResetDuration=f.blockResetDuration||2e4,this._blockResetTimeout,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()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(f=>this.once("latest",f))}removeAllListeners(f){f?super.removeAllListeners(f):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(f,s){p.includes(f)&&this._maybeStart()}_onRemoveListener(f,s){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return p.map(f=>this.listenerCount(f)).reduce(c)}_newPotentialLatest(f){const s=this._currentBlock;s&&a(f)<=a(s)||this._setCurrentBlock(f)}_setCurrentBlock(f){const s=this._currentBlock;this._currentBlock=f,this.emit("latest",f),this.emit("sync",{oldBlock:s,newBlock:f})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}},function(o,e){o.exports=function(t){var n=(t=t||{}).max||Number.MAX_SAFE_INTEGER,c=t.start!==void 0?t.start:Math.floor(Math.random()*n);return function(){return c%=n,c++}}},function(o,e,t){const n=t(21),c=t(12);var p=typeof Reflect=="object"?Reflect:null,a=p&&typeof p.apply=="function"?p.apply:function(h,v,b){return Function.prototype.apply.call(h,v,b)};function f(){c.call(this)}function s(h,v,b){try{a(h,v,b)}catch(y){setTimeout(()=>{throw y})}}function u(h,v){for(var b=new Array(v),y=0;y<v;++y)b[y]=h[y];return b}o.exports=f,n.inherits(f,c),f.prototype.emit=function(h){for(var v=[],b=1;b<arguments.length;b++)v.push(arguments[b]);var y=h==="error",_=this._events;if(_!==void 0)y=y&&_.error===void 0;else if(!y)return!1;if(y){var E;if(v.length>0&&(E=v[0]),E instanceof Error)throw E;var S=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw S.context=E,S}var k=_[h];if(k===void 0)return!1;if(typeof k=="function")s(k,this,v);else{var O=k.length,M=u(k,O);for(b=0;b<O;++b)s(M[b],this,v)}return!0}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=p(t(299)),c=p(t(325));function p(a){return a&&a.__esModule?a:{default:a}}e.default=(0,n.default)(c.default),o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(a){return function(f,s,u){return a(n.default,f,(0,c.default)(s),u)}};var n=p(t(139)),c=p(t(23));function p(a){return a&&a.__esModule?a:{default:a}}o.exports=e.default},function(o,e,t){var n=t(63),c=t(143);o.exports=function(p){if(!c(p))return!1;var a=n(p);return a=="[object Function]"||a=="[object GeneratorFunction]"||a=="[object AsyncFunction]"||a=="[object Proxy]"}},function(o,e,t){var n=t(140),c=Object.prototype,p=c.hasOwnProperty,a=c.toString,f=n?n.toStringTag:void 0;o.exports=function(s){var u=p.call(s,f),h=s[f];try{s[f]=void 0;var v=!0}catch{}var b=a.call(s);return v&&(u?s[f]=h:delete s[f]),b}},function(o,e){var t=Object.prototype.toString;o.exports=function(n){return t.call(n)}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(a,f,s,u){(0,n.default)(f)(a,(0,c.default)(s),u)};var n=p(t(146)),c=p(t(23));function p(a){return a&&a.__esModule?a:{default:a}}o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(f){if((0,n.default)(f))return function(y){var _=-1,E=y.length;return function(){return++_<E?{value:y[_],key:_}:null}}(f);var s=(0,c.default)(f);return s?function(y){var _=-1;return function(){var E=y.next();return E.done?null:(_++,{value:E.value,key:_})}}(s):(u=f,h=(0,p.default)(u),v=-1,b=h.length,function y(){var _=h[++v];return _==="__proto__"?y():v<b?{value:u[_],key:_}:null});var u,h,v,b};var n=a(t(47)),c=a(t(305)),p=a(t(306));function a(f){return f&&f.__esModule?f:{default:f}}o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(c){return n&&c[n]&&c[n]()};var n=typeof Symbol=="function"&&Symbol.iterator;o.exports=e.default},function(o,e,t){var n=t(307),c=t(318),p=t(47);o.exports=function(a){return p(a)?n(a):c(a)}},function(o,e,t){var n=t(308),c=t(309),p=t(147),a=t(311),f=t(313),s=t(314),u=Object.prototype.hasOwnProperty;o.exports=function(h,v){var b=p(h),y=!b&&c(h),_=!b&&!y&&a(h),E=!b&&!y&&!_&&s(h),S=b||y||_||E,k=S?n(h.length,String):[],O=k.length;for(var M in h)!v&&!u.call(h,M)||S&&(M=="length"||_&&(M=="offset"||M=="parent")||E&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||f(M,O))||k.push(M);return k}},function(o,e){o.exports=function(t,n){for(var c=-1,p=Array(t);++c<t;)p[c]=n(c);return p}},function(o,e,t){var n=t(310),c=t(65),p=Object.prototype,a=p.hasOwnProperty,f=p.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(u){return c(u)&&a.call(u,"callee")&&!f.call(u,"callee")};o.exports=s},function(o,e,t){var n=t(63),c=t(65);o.exports=function(p){return c(p)&&n(p)=="[object Arguments]"}},function(o,e,t){(function(n){var c=t(141),p=t(312),a=e&&!e.nodeType&&e,f=a&&typeof n=="object"&&n&&!n.nodeType&&n,s=f&&f.exports===a?c.Buffer:void 0,u=(s?s.isBuffer:void 0)||p;n.exports=u}).call(this,t(25)(o))},function(o,e){o.exports=function(){return!1}},function(o,e){var t=/^(?:0|[1-9]\d*)$/;o.exports=function(n,c){var p=typeof n;return!!(c=c==null?9007199254740991:c)&&(p=="number"||p!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<c}},function(o,e,t){var n=t(315),c=t(316),p=t(317),a=p&&p.isTypedArray,f=a?c(a):n;o.exports=f},function(o,e,t){var n=t(63),c=t(144),p=t(65),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,o.exports=function(f){return p(f)&&c(f.length)&&!!a[n(f)]}},function(o,e){o.exports=function(t){return function(n){return t(n)}}},function(o,e,t){(function(n){var c=t(142),p=e&&!e.nodeType&&e,a=p&&typeof n=="object"&&n&&!n.nodeType&&n,f=a&&a.exports===p&&c.process,s=function(){try{var u=a&&a.require&&a.require("util").types;return u||f&&f.binding&&f.binding("util")}catch{}}();n.exports=s}).call(this,t(25)(o))},function(o,e,t){var n=t(319),c=t(320),p=Object.prototype.hasOwnProperty;o.exports=function(a){if(!n(a))return c(a);var f=[];for(var s in Object(a))p.call(a,s)&&s!="constructor"&&f.push(s);return f}},function(o,e){var t=Object.prototype;o.exports=function(n){var c=n&&n.constructor;return n===(typeof c=="function"&&c.prototype||t)}},function(o,e,t){var n=t(321)(Object.keys,Object);o.exports=n},function(o,e){o.exports=function(t,n){return function(c){return t(n(c))}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(u){return(0,c.default)(function(h,v){var b;try{b=u.apply(this,h)}catch(y){return v(y)}(0,n.default)(b)&&typeof b.then=="function"?b.then(function(y){f(v,null,y)},function(y){f(v,y.message?y:new Error(y))}):v(null,b)})};var n=a(t(143)),c=a(t(323)),p=a(t(324));function a(u){return u&&u.__esModule?u:{default:u}}function f(u,h,v){try{u(h,v)}catch(b){(0,p.default)(s,b)}}function s(u){throw u}o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(a){return function(){var f=(0,p.default)(arguments),s=f.pop();a.call(this,f,s)}};var n,c=t(48),p=(n=c)&&n.__esModule?n:{default:n};o.exports=e.default},function(o,e,t){(function(n,c){Object.defineProperty(e,"__esModule",{value:!0}),e.hasNextTick=e.hasSetImmediate=void 0,e.fallback=v,e.wrap=b;var p,a=t(48),f=(p=a)&&p.__esModule?p:{default:p},s,u=e.hasSetImmediate=typeof n=="function"&&n,h=e.hasNextTick=typeof c=="object"&&typeof c.nextTick=="function";function v(y){setTimeout(y,0)}function b(y){return function(_){var E=(0,f.default)(arguments,1);y(function(){_.apply(null,E)})}}s=u?n:h?c.nextTick:v,e.default=b(s)}).call(this,t(108).setImmediate,t(5))},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(a,f,s,u){u=u||n.default,f=f||[];var h=[],v=0,b=(0,c.default)(s);a(f,function(y,_,E){var S=v++;b(y,function(k,O){h[S]=O,E(k)})},function(y){u(y,h)})};var n=p(t(38)),c=p(t(23));function p(a){return a&&a.__esModule?a:{default:a}}o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=p(t(327)),c=p(t(148));function p(a){return a&&a.__esModule?a:{default:a}}e.default=(0,c.default)(n.default,1),o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(f,s,u,h){(0,n.default)(s)(f,(0,c.default)((0,p.default)(u)),h)};var n=a(t(146)),c=a(t(328)),p=a(t(23));function a(f){return f&&f.__esModule?f:{default:f}}o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return function(c,p,a){return n(c,a)}},o.exports=e.default},function(o,e,t){const n=t(12).EventEmitter,c=t(21).inherits;function p(){n.call(this),this.isLocked=!0}o.exports=p,c(p,n),p.prototype.go=function(){this.isLocked=!1,this.emit("unlock")},p.prototype.stop=function(){this.isLocked=!0,this.emit("lock")},p.prototype.await=function(a){const f=this;f.isLocked?f.once("unlock",a):setTimeout(a)}},function(o,e,t){e.parse=t(331),e.stringify=t(332)},function(o,e){var t,n,c,p,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:" "},f=function(b){throw{name:"SyntaxError",message:b,at:t,text:c}},s=function(b){return b&&b!==n&&f("Expected '"+b+"' instead of '"+n+"'"),n=c.charAt(t),t+=1,n},u=function(){var b,y="";for(n==="-"&&(y="-",s("-"));n>="0"&&n<="9";)y+=n,s();if(n===".")for(y+=".";s()&&n>="0"&&n<="9";)y+=n;if(n==="e"||n==="E")for(y+=n,s(),n!=="-"&&n!=="+"||(y+=n,s());n>="0"&&n<="9";)y+=n,s();if(b=+y,isFinite(b))return b;f("Bad number")},h=function(){var b,y,_,E="";if(n==='"')for(;s();){if(n==='"')return s(),E;if(n==="\\")if(s(),n==="u"){for(_=0,y=0;y<4&&(b=parseInt(s(),16),isFinite(b));y+=1)_=16*_+b;E+=String.fromCharCode(_)}else{if(typeof a[n]!="string")break;E+=a[n]}else E+=n}f("Bad string")},v=function(){for(;n&&n<=" ";)s()};p=function(){switch(v(),n){case"{":return function(){var b,y={};if(n==="{"){if(s("{"),v(),n==="}")return s("}"),y;for(;n;){if(b=h(),v(),s(":"),Object.hasOwnProperty.call(y,b)&&f('Duplicate key "'+b+'"'),y[b]=p(),v(),n==="}")return s("}"),y;s(","),v()}}f("Bad object")}();case"[":return function(){var b=[];if(n==="["){if(s("["),v(),n==="]")return s("]"),b;for(;n;){if(b.push(p()),v(),n==="]")return s("]"),b;s(","),v()}}f("Bad array")}();case'"':return h();case"-":return u();default:return n>="0"&&n<="9"?u():function(){switch(n){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}f("Unexpected '"+n+"'")}()}},o.exports=function(b,y){var _;return c=b,t=0,n=" ",_=p(),v(),n&&f("Syntax error"),typeof y=="function"?function E(S,k){var O,M,C=S[k];if(C&&typeof C=="object")for(O in C)Object.prototype.hasOwnProperty.call(C,O)&&((M=E(C,O))!==void 0?C[O]=M:delete C[O]);return y.call(S,k,C)}({"":_},""):_}},function(o,e){var t,n,c,p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function f(s){return p.lastIndex=0,p.test(s)?'"'+s.replace(p,function(u){var h=a[u];return typeof h=="string"?h:"\\u"+("0000"+u.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'}o.exports=function(s,u,h){var v;if(t="",n="",typeof h=="number")for(v=0;v<h;v+=1)n+=" ";else typeof h=="string"&&(n=h);if(c=u,u&&typeof u!="function"&&(typeof u!="object"||typeof u.length!="number"))throw new Error("JSON.stringify");return function b(y,_){var E,S,k,O,M,C=t,N=_[y];switch(N&&typeof N=="object"&&typeof N.toJSON=="function"&&(N=N.toJSON(y)),typeof c=="function"&&(N=c.call(_,y,N)),typeof N){case"string":return f(N);case"number":return isFinite(N)?String(N):"null";case"boolean":case"null":return String(N);case"object":if(!N)return"null";if(t+=n,M=[],Object.prototype.toString.apply(N)==="[object Array]"){for(O=N.length,E=0;E<O;E+=1)M[E]=b(E,N)||"null";return k=M.length===0?"[]":t?`[
`+t+M.join(`,
`+t)+`
`+C+"]":"["+M.join(",")+"]",t=C,k}if(c&&typeof c=="object")for(O=c.length,E=0;E<O;E+=1)typeof(S=c[E])=="string"&&(k=b(S,N))&&M.push(f(S)+(t?": ":":")+k);else for(S in N)Object.prototype.hasOwnProperty.call(N,S)&&(k=b(S,N))&&M.push(f(S)+(t?": ":":")+k);return k=M.length===0?"{}":t?`{
`+t+M.join(`,
`+t)+`
`+C+"}":"{"+M.join(",")+"}",t=C,k}}("",{"":s})}},function(o,e){o.exports=function(){return Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}},function(o,e,t){const n=t(68),c=t(335);o.exports=class extends n{constructor(p){super(({blockTracker:a})=>c(Object.assign({blockTracker:a},p)))}}},function(o,e,t){const n=t(336),c=t(337),p=[void 0,null,"<nil>"];o.exports=function(f={}){const{blockTracker:s}=f;if(!s)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");const u=new a,h={perma:u,block:u,fork:u};return c(async(v,b,y)=>{if(v.skipCache)return y();const _=n.cacheTypeForPayload(v),E=h[_];if(!E||!E.canCacheRequest(v))return y();let S,k=n.blockTagForPayload(v);if(k||(k="latest"),k==="earliest")S="0x00";else if(k==="latest"){const M=await s.getLatestBlock();u.clearBefore(M),S=M}else S=k;const O=await E.get(v,S);O===void 0?(await y(),await E.set(v,S,b.result)):b.result=O})};class a{constructor(){this.cache={}}getBlockCacheForPayload(s,u){const h=Number.parseInt(u,16);let v=this.cache[h];if(!v){const b={};this.cache[h]=b,v=b}return v}async get(s,u){const h=this.getBlockCacheForPayload(s,u);if(!!h)return h[n.cacheIdentifierForPayload(s,!0)]}async set(s,u,h){!this.canCacheResult(s,h)||(this.getBlockCacheForPayload(s,u)[n.cacheIdentifierForPayload(s,!0)]=h)}canCacheRequest(s){return n.canCache(s)?n.blockTagForPayload(s)!=="pending":!1}canCacheResult(s,u){if(!p.includes(u))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(s.method)||u&&u.blockHash&&u.blockHash!=="0x0000000000000000000000000000000000000000000000000000000000000000")}clearBefore(s){const u=this,h=Number.parseInt(s,16);Object.keys(u.cache).map(Number).filter(v=>v<h).forEach(v=>delete u.cache[v])}}},function(o,e,t){const n=t(150);function c(s){return f(s)!=="never"}function p(s){const u=a(s);return u>=s.params.length?s.params:s.method==="eth_getBlockByNumber"?s.params.slice(1):s.params.slice(0,u)}function a(s){switch(s.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function f(s){switch(s.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}o.exports={cacheIdentifierForPayload:function(s,u){const h=u?p(s):s.params;return c(s)?s.method+":"+n(h):null},canCache:c,blockTagForPayload:function(s){let u=a(s);return u>=s.params.length?null:s.params[u]},paramsWithoutBlockTag:p,blockTagParamIndex:a,cacheTypeForPayload:f}},function(o,e){o.exports=function(t){return(n,c,p,a)=>{let f;const s=new Promise(v=>{f=v});let u,h;t(n,c,async()=>{h=!0,p(v=>{u=v,f()}),await s}).then(async()=>{h?(await s,u(null)):a(null)}).catch(v=>{u?u(v):a(v)})}}},function(o,e,t){const n=t(21).inherits,c=t(49);function p(a){a=a||{},this.staticResponses=a}o.exports=p,n(p,c),p.prototype.handleRequest=function(a,f,s){var u=this.staticResponses[a.method];typeof u=="function"?u(a,f,s):u!==void 0?setTimeout(()=>s(null,u)):f()}},function(o,e,t){const n=t(68),c=t(151);o.exports=class extends n{constructor(){super(({blockTracker:p,provider:a,engine:f})=>c({blockTracker:p,provider:a}))}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createIdRemapMiddleware=void 0;const n=t(153);e.createIdRemapMiddleware=function(){return(c,p,a,f)=>{const s=c.id,u=n.getUniqueId();c.id=u,p.id=u,a(h=>{c.id=s,p.id=s,h()})}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createAsyncMiddleware=void 0,e.createAsyncMiddleware=function(n){return async(c,p,a,f)=>{let s;const u=new Promise(y=>{s=y});let h=null,v=!1;const b=async()=>{v=!0,a(y=>{h=y,s()}),await u};try{await n(c,p,b),v?(await u,h(null)):f(null)}catch(y){h?h(y):f(y)}}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createScaffoldMiddleware=void 0,e.createScaffoldMiddleware=function(n){return(c,p,a,f)=>{const s=n[c.method];return s===void 0?a():typeof s=="function"?s(c,p,a,f):(p.result=s,f())}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const n=t(70);Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const c=t(155);Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return c.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return c.getMessageFromCode}});const p=t(345);Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return p.ethErrors}});const a=t(71);Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})},function(o,e){o.exports=p,p.default=p,p.stable=s,p.stableStringify=s;var t=[],n=[];function c(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function p(h,v,b,y){var _;y===void 0&&(y=c()),function S(k,O,M,C,N,L,F){var V;if(L+=1,typeof k=="object"&&k!==null){for(V=0;V<C.length;V++)if(C[V]===k)return void a("[Circular]",k,O,N);if(F.depthLimit!==void 0&&L>F.depthLimit||F.edgesLimit!==void 0&&M+1>F.edgesLimit)return void a("[...]",k,O,N);if(C.push(k),Array.isArray(k))for(V=0;V<k.length;V++)S(k[V],V,V,C,k,L,F);else{var H=Object.keys(k);for(V=0;V<H.length;V++){var z=H[V];S(k[z],z,V,C,k,L,F)}}C.pop()}}(h,"",0,[],void 0,0,y);try{_=n.length===0?JSON.stringify(h,v,b):JSON.stringify(h,u(v),b)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var E=t.pop();E.length===4?Object.defineProperty(E[0],E[1],E[3]):E[0][E[1]]=E[2]}}return _}function a(h,v,b,y){var _=Object.getOwnPropertyDescriptor(y,b);_.get!==void 0?_.configurable?(Object.defineProperty(y,b,{value:h}),t.push([y,b,v,_])):n.push([v,b,h]):(y[b]=h,t.push([y,b,v]))}function f(h,v){return h<v?-1:h>v?1:0}function s(h,v,b,y){y===void 0&&(y=c());var _,E=function k(O,M,C,N,L,F,V){var H;if(F+=1,typeof O=="object"&&O!==null){for(H=0;H<N.length;H++)if(N[H]===O)return void a("[Circular]",O,M,L);try{if(typeof O.toJSON=="function")return}catch{return}if(V.depthLimit!==void 0&&F>V.depthLimit||V.edgesLimit!==void 0&&C+1>V.edgesLimit)return void a("[...]",O,M,L);if(N.push(O),Array.isArray(O))for(H=0;H<O.length;H++)k(O[H],H,H,N,O,F,V);else{var z={},R=Object.keys(O).sort(f);for(H=0;H<R.length;H++){var l=R[H];k(O[l],l,H,N,O,F,V),z[l]=O[l]}if(L===void 0)return z;t.push([L,M,O]),L[M]=z}N.pop()}}(h,"",0,[],void 0,0,y)||h;try{_=n.length===0?JSON.stringify(E,v,b):JSON.stringify(E,u(v),b)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var S=t.pop();S.length===4?Object.defineProperty(S[0],S[1],S[3]):S[0][S[1]]=S[2]}}return _}function u(h){return h=h!==void 0?h:function(v,b){return b},function(v,b){if(n.length>0)for(var y=0;y<n.length;y++){var _=n[y];if(_[1]===v&&_[0]===b){b=_[2],n.splice(y,1);break}}return h.call(this,v,b)}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.ethErrors=void 0;const n=t(70),c=t(155),p=t(71);function a(u,h){const[v,b]=s(h);return new n.EthereumRpcError(u,v||c.getMessageFromCode(u),b)}function f(u,h){const[v,b]=s(h);return new n.EthereumProviderError(u,v||c.getMessageFromCode(u),b)}function s(u){if(u){if(typeof u=="string")return[u];if(typeof u=="object"&&!Array.isArray(u)){const{message:h,data:v}=u;if(h&&typeof h!="string")throw new Error("Must specify string message.");return[h||void 0,v]}}return[]}e.ethErrors={rpc:{parse:u=>a(p.errorCodes.rpc.parse,u),invalidRequest:u=>a(p.errorCodes.rpc.invalidRequest,u),invalidParams:u=>a(p.errorCodes.rpc.invalidParams,u),methodNotFound:u=>a(p.errorCodes.rpc.methodNotFound,u),internal:u=>a(p.errorCodes.rpc.internal,u),server:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:h}=u;if(!Number.isInteger(h)||h>-32005||h<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return a(h,u)},invalidInput:u=>a(p.errorCodes.rpc.invalidInput,u),resourceNotFound:u=>a(p.errorCodes.rpc.resourceNotFound,u),resourceUnavailable:u=>a(p.errorCodes.rpc.resourceUnavailable,u),transactionRejected:u=>a(p.errorCodes.rpc.transactionRejected,u),methodNotSupported:u=>a(p.errorCodes.rpc.methodNotSupported,u),limitExceeded:u=>a(p.errorCodes.rpc.limitExceeded,u)},provider:{userRejectedRequest:u=>f(p.errorCodes.provider.userRejectedRequest,u),unauthorized:u=>f(p.errorCodes.provider.unauthorized,u),unsupportedMethod:u=>f(p.errorCodes.provider.unsupportedMethod,u),disconnected:u=>f(p.errorCodes.provider.disconnected,u),chainDisconnected:u=>f(p.errorCodes.provider.chainDisconnected,u),custom:u=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:h,message:v,data:b}=u;if(!v||typeof v!="string")throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(h,v,b)}}}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMiddleware=void 0;const n=t(154);e.mergeMiddleware=function(c){const p=new n.JsonRpcEngine;return c.forEach(a=>p.push(a)),p.asMiddleware()}},function(o,e){o.exports=function(t){return(n,c,p,a)=>{const f=t[n.method];return f===void 0?p():typeof f=="function"?f(n,c,p,a):(c.result=f,a())}}},function(o,e,t){const n=t(138),c=t(349),p=t(350),{bnToHex:a,hexToInt:f,incrementHexInt:s,minBlockRef:u,blockRefIsNumber:h}=t(39);o.exports=class extends p{constructor({provider:v,params:b}){super(),this.type="log",this.ethQuery=new n(v),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},b),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(y=>y.toLowerCase()))}async initialize({currentBlock:v}){let b=this.params.fromBlock;["latest","pending"].includes(b)&&(b=v),b==="earliest"&&(b="0x0"),this.params.fromBlock=b;const y=u(this.params.toBlock,v),_=Object.assign({},this.params,{toBlock:y}),E=await this._fetchLogs(_);this.addInitialResults(E)}async update({oldBlock:v,newBlock:b}){const y=b;let _;_=v?s(v):b;const E=Object.assign({},this.params,{fromBlock:_,toBlock:y}),S=(await this._fetchLogs(E)).filter(k=>this.matchLog(k));this.addResults(S)}async _fetchLogs(v){return await c(b=>this.ethQuery.getLogs(v,b))()}matchLog(v){if(f(this.params.fromBlock)>=f(v.blockNumber)||h(this.params.toBlock)&&f(this.params.toBlock)<=f(v.blockNumber))return!1;const b=v.address&&v.address.toLowerCase();return this.params.address&&b&&!this.params.address.includes(b)?!1:this.params.topics.every((y,_)=>{let E=v.topics[_];if(!E)return!1;E=E.toLowerCase();let S=Array.isArray(y)?y:[y];return S.includes(null)?!0:(S=S.map(k=>k.toLowerCase()),S.includes(E))})}}},function(o,e,t){const n=(p,a,f,s)=>function(...u){return new a.promiseModule((h,v)=>{a.multiArgs?u.push((...y)=>{a.errorFirst?y[0]?v(y):(y.shift(),h(y)):h(y)}):a.errorFirst?u.push((y,_)=>{y?v(y):h(_)}):u.push(h),Reflect.apply(p,this===f?s:this,u)})},c=new WeakMap;o.exports=(p,a)=>{a={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...a};const f=typeof p;if(p===null||f!=="object"&&f!=="function")throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${p===null?"null":f}\``);const s=new WeakMap,u=new Proxy(p,{apply(h,v,b){const y=s.get(h);if(y)return Reflect.apply(y,v,b);const _=a.excludeMain?h:n(h,a,u,h);return s.set(h,_),Reflect.apply(_,v,b)},get(h,v){const b=h[v];if(!((_,E)=>{let S=c.get(_);if(S||(S={},c.set(_,S)),E in S)return S[E];const k=N=>typeof N=="string"||typeof E=="symbol"?E===N:N.test(E),O=Reflect.getOwnPropertyDescriptor(_,E),M=O===void 0||O.writable||O.configurable,C=(a.include?a.include.some(k):!a.exclude.some(k))&&M;return S[E]=C,C})(h,v)||b===Function.prototype[v])return b;const y=s.get(b);if(y)return y;if(typeof b=="function"){const _=n(b,a,u,h);return s.set(b,_),_}return b}});return u}},function(o,e,t){const n=t(72);o.exports=class extends n{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(c){this.allResults=this.allResults.concat(c),super.addResults(c)}addInitialResults(c){this.allResults=this.allResults.concat(c),super.addInitialResults(c)}getAllResults(){return this.allResults}}},function(o,e,t){const n=t(72),c=t(73),{incrementHexInt:p}=t(39);o.exports=class extends n{constructor({provider:a,params:f}){super(),this.type="block",this.provider=a}async update({oldBlock:a,newBlock:f}){const s=f,u=p(a),h=(await c({provider:this.provider,fromBlock:u,toBlock:s})).map(v=>v.hash);this.addResults(h)}}},function(o,e,t){const n=t(72),c=t(73),{incrementHexInt:p}=t(39);o.exports=class extends n{constructor({provider:a}){super(),this.type="tx",this.provider=a}async update({oldBlock:a}){const f=a,s=p(a),u=await c({provider:this.provider,fromBlock:s,toBlock:f}),h=[];for(const v of u)h.push(...v.transactions);this.addResults(h)}}},function(o,e,t){const n=t(354),c=t(355),p=t(21).inherits,a=t(36),f=t(357),s=t(44),u=t(367),h=t(49),v=t(368),b=/^[0-9A-Fa-f]+$/g;function y(M){this.nonceLock=u(1),M.getAccounts&&(this.getAccounts=M.getAccounts),M.processTransaction&&(this.processTransaction=M.processTransaction),M.processMessage&&(this.processMessage=M.processMessage),M.processPersonalMessage&&(this.processPersonalMessage=M.processPersonalMessage),M.processTypedMessage&&(this.processTypedMessage=M.processTypedMessage),this.approveTransaction=M.approveTransaction||this.autoApprove,this.approveMessage=M.approveMessage||this.autoApprove,this.approvePersonalMessage=M.approvePersonalMessage||this.autoApprove,this.approveDecryptMessage=M.approveDecryptMessage||this.autoApprove,this.approveEncryptionPublicKey=M.approveEncryptionPublicKey||this.autoApprove,this.approveTypedMessage=M.approveTypedMessage||this.autoApprove,M.signTransaction&&(this.signTransaction=M.signTransaction||O("signTransaction")),M.signMessage&&(this.signMessage=M.signMessage||O("signMessage")),M.signPersonalMessage&&(this.signPersonalMessage=M.signPersonalMessage||O("signPersonalMessage")),M.decryptMessage&&(this.decryptMessage=M.decryptMessage||O("decryptMessage")),M.encryptionPublicKey&&(this.encryptionPublicKey=M.encryptionPublicKey||O("encryptionPublicKey")),M.signTypedMessage&&(this.signTypedMessage=M.signTypedMessage||O("signTypedMessage")),M.recoverPersonalSignature&&(this.recoverPersonalSignature=M.recoverPersonalSignature),M.publishTransaction&&(this.publishTransaction=M.publishTransaction),this.estimateGas=M.estimateGas||this.estimateGas,this.getGasPrice=M.getGasPrice||this.getGasPrice}function _(M){return M.toLowerCase()}function E(M){const C=a.addHexPrefix(M);return a.isValidAddress(C)}function S(M){const C=a.addHexPrefix(M);return!a.isValidAddress(C)&&k(M)}function k(M){return typeof M!="string"||M.slice(0,2)!=="0x"?!1:M.slice(2).match(b)}function O(M){return function(C,N){N(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+M+'" fn in constructor options'))}}o.exports=y,p(y,h),y.prototype.handleRequest=function(M,C,N){const L=this;let F,V,H,z,R;switch(L._parityRequests={},L._parityRequestCount=0,M.method){case"eth_coinbase":return void L.getAccounts(function(l,x){if(l)return N(l);let d=x[0]||null;N(null,d)});case"eth_accounts":return void L.getAccounts(function(l,x){if(l)return N(l);N(null,x)});case"eth_sendTransaction":return F=M.params[0],void n([l=>L.validateTransaction(F,l),l=>L.processTransaction(F,l)],N);case"eth_signTransaction":return F=M.params[0],void n([l=>L.validateTransaction(F,l),l=>L.processSignTransaction(F,l)],N);case"eth_sign":return R=M.params[0],z=M.params[1],H=M.params[2]||{},V=s(H,{from:R,data:z}),void n([l=>L.validateMessage(V,l),l=>L.processMessage(V,l)],N);case"personal_sign":return function(){const l=M.params[0];if(S(M.params[1])&&E(l)){let x="The eth_personalSign method requires params ordered ";x+="[message, address]. This was previously handled incorrectly, ",x+="and has been corrected automatically. ",x+="Please switch this param order for smooth behavior in the future.",console.warn(x),R=M.params[0],z=M.params[1]}else z=M.params[0],R=M.params[1];H=M.params[2]||{},V=s(H,{from:R,data:z}),n([x=>L.validatePersonalMessage(V,x),x=>L.processPersonalMessage(V,x)],N)}();case"eth_decryptMessage":return function(){const l=M.params[0];if(S(M.params[1])&&E(l)){let x="The eth_decryptMessage method requires params ordered ";x+="[message, address]. This was previously handled incorrectly, ",x+="and has been corrected automatically. ",x+="Please switch this param order for smooth behavior in the future.",console.warn(x),R=M.params[0],z=M.params[1]}else z=M.params[0],R=M.params[1];H=M.params[2]||{},V=s(H,{from:R,data:z}),n([x=>L.validateDecryptMessage(V,x),x=>L.processDecryptMessage(V,x)],N)}();case"encryption_public_key":return function(){const l=M.params[0];n([x=>L.validateEncryptionPublicKey(l,x),x=>L.processEncryptionPublicKey(l,x)],N)}();case"personal_ecRecover":return function(){z=M.params[0];let l=M.params[1];H=M.params[2]||{},V=s(H,{sig:l,data:z}),L.recoverPersonalSignature(V,N)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){const l=M.params[0],x=M.params[1];E(l)?(R=l,z=x):(z=l,R=x),H=M.params[2]||{},V=s(H,{from:R,data:z}),n([d=>L.validateTypedMessage(V,d),d=>L.processTypedMessage(V,d)],N)}();case"parity_postTransaction":return F=M.params[0],void L.parityPostTransaction(F,N);case"parity_postSign":return R=M.params[0],z=M.params[1],void L.parityPostSign(R,z,N);case"parity_checkRequest":return function(){const l=M.params[0];L.parityCheckRequest(l,N)}();case"parity_defaultAccount":return void L.getAccounts(function(l,x){if(l)return N(l);const d=x[0]||null;N(null,d)});default:return void C()}},y.prototype.getAccounts=function(M){M(null,[])},y.prototype.processTransaction=function(M,C){const N=this;n([L=>N.approveTransaction(M,L),(L,F)=>N.checkApproval("transaction",L,F),L=>N.finalizeAndSubmitTx(M,L)],C)},y.prototype.processSignTransaction=function(M,C){const N=this;n([L=>N.approveTransaction(M,L),(L,F)=>N.checkApproval("transaction",L,F),L=>N.finalizeTx(M,L)],C)},y.prototype.processMessage=function(M,C){const N=this;n([L=>N.approveMessage(M,L),(L,F)=>N.checkApproval("message",L,F),L=>N.signMessage(M,L)],C)},y.prototype.processPersonalMessage=function(M,C){const N=this;n([L=>N.approvePersonalMessage(M,L),(L,F)=>N.checkApproval("message",L,F),L=>N.signPersonalMessage(M,L)],C)},y.prototype.processDecryptMessage=function(M,C){const N=this;n([L=>N.approveDecryptMessage(M,L),(L,F)=>N.checkApproval("decryptMessage",L,F),L=>N.decryptMessage(M,L)],C)},y.prototype.processEncryptionPublicKey=function(M,C){const N=this;n([L=>N.approveEncryptionPublicKey(M,L),(L,F)=>N.checkApproval("encryptionPublicKey",L,F),L=>N.encryptionPublicKey(M,L)],C)},y.prototype.processTypedMessage=function(M,C){const N=this;n([L=>N.approveTypedMessage(M,L),(L,F)=>N.checkApproval("message",L,F),L=>N.signTypedMessage(M,L)],C)},y.prototype.autoApprove=function(M,C){C(null,!0)},y.prototype.checkApproval=function(M,C,N){N(C?null:new Error("User denied "+M+" signature."))},y.prototype.parityPostTransaction=function(M,C){const N=this,L="0x"+N._parityRequestCount.toString(16);N._parityRequestCount++,N.emitPayload({method:"eth_sendTransaction",params:[M]},function(F,V){if(F)return void(N._parityRequests[L]={error:F});const H=V.result;N._parityRequests[L]=H}),C(null,L)},y.prototype.parityPostSign=function(M,C,N){const L=this,F="0x"+L._parityRequestCount.toString(16);L._parityRequestCount++,L.emitPayload({method:"eth_sign",params:[M,C]},function(V,H){if(V)return void(L._parityRequests[F]={error:V});const z=H.result;L._parityRequests[F]=z}),N(null,F)},y.prototype.parityCheckRequest=function(M,C){const N=this._parityRequests[M]||null;return N?N.error?C(N.error):void C(null,N):C(null,null)},y.prototype.recoverPersonalSignature=function(M,C){let N;try{N=f.recoverPersonalSignature(M)}catch(L){return C(L)}C(null,N)},y.prototype.validateTransaction=function(M,C){if(M.from===void 0)return C(new Error("Undefined address - from address required to sign transaction."));this.validateSender(M.from,function(N,L){return N?C(N):L?void C():C(new Error(`Unknown address - unable to sign transaction for this address: "${M.from}"`))})},y.prototype.validateMessage=function(M,C){if(M.from===void 0)return C(new Error("Undefined address - from address required to sign message."));this.validateSender(M.from,function(N,L){return N?C(N):L?void C():C(new Error(`Unknown address - unable to sign message for this address: "${M.from}"`))})},y.prototype.validatePersonalMessage=function(M,C){return M.from===void 0?C(new Error("Undefined address - from address required to sign personal message.")):M.data===void 0?C(new Error("Undefined message - message required to sign personal message.")):k(M.data)?void this.validateSender(M.from,function(N,L){return N?C(N):L?void C():C(new Error(`Unknown address - unable to sign message for this address: "${M.from}"`))}):C(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},y.prototype.validateDecryptMessage=function(M,C){return M.from===void 0?C(new Error("Undefined address - from address required to decrypt message.")):M.data===void 0?C(new Error("Undefined message - message required to decrypt message.")):k(M.data)?void this.validateSender(M.from,function(N,L){return N?C(N):L?void C():C(new Error(`Unknown address - unable to decrypt message for this address: "${M.from}"`))}):C(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},y.prototype.validateEncryptionPublicKey=function(M,C){this.validateSender(M,function(N,L){return N?C(N):L?void C():C(new Error(`Unknown address - unable to obtain encryption public key for this address: "${M}"`))})},y.prototype.validateTypedMessage=function(M,C){return M.from===void 0?C(new Error("Undefined address - from address required to sign typed data.")):M.data===void 0?C(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(M.from,function(N,L){return N?C(N):L?void C():C(new Error(`Unknown address - unable to sign message for this address: "${M.from}"`))})},y.prototype.validateSender=function(M,C){if(!M)return C(null,!1);this.getAccounts(function(N,L){if(N)return C(N);const F=L.map(_).indexOf(M.toLowerCase())!==-1;C(null,F)})},y.prototype.finalizeAndSubmitTx=function(M,C){const N=this;N.nonceLock.take(function(){n([N.fillInTxExtras.bind(N,M),N.signTransaction.bind(N),N.publishTransaction.bind(N)],function(L,F){if(N.nonceLock.leave(),L)return C(L);C(null,F)})})},y.prototype.finalizeTx=function(M,C){const N=this;N.nonceLock.take(function(){n([N.fillInTxExtras.bind(N,M),N.signTransaction.bind(N)],function(L,F){if(N.nonceLock.leave(),L)return C(L);C(null,{raw:F,tx:M})})})},y.prototype.publishTransaction=function(M,C){this.emitPayload({method:"eth_sendRawTransaction",params:[M]},function(N,L){if(N)return C(N);C(null,L.result)})},y.prototype.estimateGas=function(M,C){v(this.engine,M,C)},y.prototype.getGasPrice=function(M){this.emitPayload({method:"eth_gasPrice",params:[]},function(C,N){if(C)return M(C);M(null,N.result)})},y.prototype.fillInTxExtras=function(M,C){const N=this,L=M.from,F={};M.gasPrice===void 0&&(F.gasPrice=N.getGasPrice.bind(N)),M.nonce===void 0&&(F.nonce=N.emitPayload.bind(N,{method:"eth_getTransactionCount",params:[L,"pending"]})),M.gas===void 0&&(F.gas=N.estimateGas.bind(N,function(V){return{from:V.from,to:V.to,value:V.value,data:V.data,gas:V.gas,gasPrice:V.gasPrice,nonce:V.nonce}}(M))),c(F,function(V,H){if(V)return C(V);const z={};H.gasPrice&&(z.gasPrice=H.gasPrice),H.nonce&&(z.nonce=H.nonce.result),H.gas&&(z.gas=H.gas),C(null,s(M,z))})}},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(h,v){if(v=(0,p.default)(v||c.default),!(0,n.default)(h))return v(new Error("First argument to waterfall must be an array of functions"));if(!h.length)return v();var b=0;function y(E){var S=(0,s.default)(h[b++]);E.push((0,f.default)(_)),S.apply(null,E)}function _(E){if(E||b===h.length)return v.apply(null,arguments);y((0,a.default)(arguments,1))}y([])};var n=u(t(147)),c=u(t(38)),p=u(t(64)),a=u(t(48)),f=u(t(66)),s=u(t(23));function u(h){return h&&h.__esModule?h:{default:h}}o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(a,f){(0,c.default)(n.default,a,f)};var n=p(t(139)),c=p(t(356));function p(a){return a&&a.__esModule?a:{default:a}}o.exports=e.default},function(o,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(s,u,h){h=h||n.default;var v=(0,c.default)(u)?[]:{};s(u,function(b,y,_){(0,a.default)(b)(function(E,S){arguments.length>2&&(S=(0,p.default)(arguments,1)),v[y]=S,_(E)})},function(b){h(b,v)})};var n=f(t(38)),c=f(t(47)),p=f(t(48)),a=f(t(23));function f(s){return s&&s.__esModule?s:{default:s}}o.exports=e.default},function(o,e,t){const n=t(36),c=t(358);function p(u){const h=new Error("Expect argument to be non-empty array");if(typeof u!="object"||!u.length)throw h;const v=u.map(function(_){return _.type==="bytes"?n.toBuffer(_.value):_.value}),b=u.map(function(_){return _.type}),y=u.map(function(_){if(!_.name)throw h;return _.type+" "+_.name});return c.soliditySHA3(["bytes32","bytes32"],[c.soliditySHA3(new Array(u.length).fill("string"),y),c.soliditySHA3(b,v)])}function a(u,h){const v=n.toBuffer(h),b=n.fromRpcSig(v);return n.ecrecover(u,b.v,b.r,b.s)}function f(u){const h=n.toBuffer(u.data);return a(n.hashPersonalMessage(h),u.sig)}function s(u,h){for(var v=""+u;v.length<h;)v="0"+v;return v}o.exports={concatSig:function(u,h,v){const b=n.fromSigned(h),y=n.fromSigned(v),_=n.bufferToInt(u),E=s(n.toUnsigned(b).toString("hex"),64),S=s(n.toUnsigned(y).toString("hex"),64),k=n.stripHexPrefix(n.intToHex(_));return n.addHexPrefix(E.concat(S,k)).toString("hex")},normalize:function(u){if(u){if(typeof u=="number"){const v=n.toBuffer(u);u=n.bufferToHex(v)}if(typeof u!="string"){var h="eth-sig-util.normalize() requires hex string or integer input.";throw new Error(h+=" received "+typeof u+": "+u)}return n.addHexPrefix(u.toLowerCase())}},personalSign:function(u,h){var v=n.toBuffer(h.data),b=n.hashPersonalMessage(v),y=n.ecsign(b,u);return n.bufferToHex(this.concatSig(y.v,y.r,y.s))},recoverPersonalSignature:function(u){const h=f(u),v=n.publicToAddress(h);return n.bufferToHex(v)},extractPublicKey:function(u){return"0x"+f(u).toString("hex")},typedSignatureHash:function(u){const h=p(u);return n.bufferToHex(h)},signTypedData:function(u,h){const v=p(h.data),b=n.ecsign(v,u);return n.bufferToHex(this.concatSig(b.v,b.r,b.s))},recoverTypedSignature:function(u){const h=a(p(u.data),u.sig),v=n.publicToAddress(h);return n.bufferToHex(v)}}},function(o,e,t){o.exports=t(359)},function(o,e,t){(function(n){const c=t(360),p=t(9);var a=function(){};function f(M){return M.startsWith("int[")?"int256"+M.slice(3):M==="int"?"int256":M.startsWith("uint[")?"uint256"+M.slice(4):M==="uint"?"uint256":M.startsWith("fixed[")?"fixed128x128"+M.slice(5):M==="fixed"?"fixed128x128":M.startsWith("ufixed[")?"ufixed128x128"+M.slice(6):M==="ufixed"?"ufixed128x128":M}function s(M){return parseInt(/^\D+(\d+)$/.exec(M)[1],10)}function u(M){var C=/^\D+(\d+)x(\d+)$/.exec(M);return[parseInt(C[1],10),parseInt(C[2],10)]}function h(M){var C=M.match(/(.*)\[(.*?)\]$/);return C?C[2]===""?"dynamic":parseInt(C[2],10):null}function v(M){var C=typeof M;if(C==="string")return c.isHexPrefixed(M)?new p(c.stripHexPrefix(M),16):new p(M,10);if(C==="number")return new p(M);if(M.toArray)return M;throw new Error("Argument is not a number")}function b(M){var C=/^(\w+)\((.*)\)$/.exec(M);if(C.length!==3)throw new Error("Invalid method signature");var N=/^(.+)\):\((.+)$/.exec(C[2]);if(N!==null&&N.length===3)return{method:C[1],args:N[1].split(","),retargs:N[2].split(",")};var L=C[2].split(",");return L.length===1&&L[0]===""&&(L=[]),{method:C[1],args:L}}function y(M,C){var N,L,F,V;if(M==="address")return y("uint160",v(C));if(M==="bool")return y("uint8",C?1:0);if(M==="string")return y("bytes",n.from(C,"utf8"));if(k(M)){if(C.length===void 0)throw new Error("Not an array?");if((N=h(M))!=="dynamic"&&N!==0&&C.length>N)throw new Error("Elements exceed array size: "+N);for(V in F=[],M=M.slice(0,M.lastIndexOf("[")),typeof C=="string"&&(C=JSON.parse(C)),C)F.push(y(M,C[V]));if(N==="dynamic"){var H=y("uint256",C.length);F.unshift(H)}return n.concat(F)}if(M==="bytes")return C=n.from(C),F=n.concat([y("uint256",C.length),C]),C.length%32!=0&&(F=n.concat([F,c.zeros(32-C.length%32)])),F;if(M.startsWith("bytes")){if((N=s(M))<1||N>32)throw new Error("Invalid bytes<N> width: "+N);return c.setLengthRight(C,32)}if(M.startsWith("uint")){if((N=s(M))%8||N<8||N>256)throw new Error("Invalid uint<N> width: "+N);if((L=v(C)).bitLength()>N)throw new Error("Supplied uint exceeds width: "+N+" vs "+L.bitLength());if(L<0)throw new Error("Supplied uint is negative");return L.toArrayLike(n,"be",32)}if(M.startsWith("int")){if((N=s(M))%8||N<8||N>256)throw new Error("Invalid int<N> width: "+N);if((L=v(C)).bitLength()>N)throw new Error("Supplied int exceeds width: "+N+" vs "+L.bitLength());return L.toTwos(256).toArrayLike(n,"be",32)}if(M.startsWith("ufixed")){if(N=u(M),(L=v(C))<0)throw new Error("Supplied ufixed is negative");return y("uint256",L.mul(new p(2).pow(new p(N[1]))))}if(M.startsWith("fixed"))return N=u(M),y("int256",v(C).mul(new p(2).pow(new p(N[1]))));throw new Error("Unsupported or invalid type: "+M)}function _(M,C,N){var L,F,V,H;if(typeof M=="string"&&(M=E(M)),M.name==="address")return _(M.rawType,C,N).toArrayLike(n,"be",20).toString("hex");if(M.name==="bool")return _(M.rawType,C,N).toString()===new p(1).toString();if(M.name==="string"){var z=_(M.rawType,C,N);return n.from(z,"utf8").toString()}if(M.isArray){for(V=[],L=M.size,M.size==="dynamic"&&(N=_("uint256",C,N).toNumber(),L=_("uint256",C,N).toNumber(),N+=32),H=0;H<L;H++){var R=_(M.subArray,C,N);V.push(R),N+=M.subArray.memoryUsage}return V}if(M.name==="bytes")return N=_("uint256",C,N).toNumber(),L=_("uint256",C,N).toNumber(),C.slice(N+32,N+32+L);if(M.name.startsWith("bytes"))return C.slice(N,N+M.size);if(M.name.startsWith("uint")){if((F=new p(C.slice(N,N+32),16,"be")).bitLength()>M.size)throw new Error("Decoded int exceeds width: "+M.size+" vs "+F.bitLength());return F}if(M.name.startsWith("int")){if((F=new p(C.slice(N,N+32),16,"be").fromTwos(256)).bitLength()>M.size)throw new Error("Decoded uint exceeds width: "+M.size+" vs "+F.bitLength());return F}if(M.name.startsWith("ufixed")){if(L=new p(2).pow(new p(M.size[1])),!(F=_("uint256",C,N)).mod(L).isZero())throw new Error("Decimals not supported yet");return F.div(L)}if(M.name.startsWith("fixed")){if(L=new p(2).pow(new p(M.size[1])),!(F=_("int256",C,N)).mod(L).isZero())throw new Error("Decimals not supported yet");return F.div(L)}throw new Error("Unsupported or invalid type: "+M.name)}function E(M){var C,N,L;if(k(M)){C=h(M);var F=M.slice(0,M.lastIndexOf("["));return F=E(F),N={isArray:!0,name:M,size:C,memoryUsage:C==="dynamic"?32:F.memoryUsage*C,subArray:F}}switch(M){case"address":L="uint160";break;case"bool":L="uint8";break;case"string":L="bytes"}if(N={rawType:L,name:M,memoryUsage:32},M.startsWith("bytes")&&M!=="bytes"||M.startsWith("uint")||M.startsWith("int")?N.size=s(M):(M.startsWith("ufixed")||M.startsWith("fixed"))&&(N.size=u(M)),M.startsWith("bytes")&&M!=="bytes"&&(N.size<1||N.size>32))throw new Error("Invalid bytes<N> width: "+N.size);if((M.startsWith("uint")||M.startsWith("int"))&&(N.size%8||N.size<8||N.size>256))throw new Error("Invalid int/uint<N> width: "+N.size);return N}function S(M){return M==="string"||M==="bytes"||h(M)==="dynamic"}function k(M){return M.lastIndexOf("]")===M.length-1}function O(M,C){return M.startsWith("address")||M.startsWith("bytes")?"0x"+C.toString("hex"):C.toString()}a.eventID=function(M,C){var N=M+"("+C.map(f).join(",")+")";return c.keccak256(n.from(N))},a.methodID=function(M,C){return a.eventID(M,C).slice(0,4)},a.rawEncode=function(M,C){var N=[],L=[],F=0;M.forEach(function(R){if(k(R)){var l=h(R);F+=l!=="dynamic"?32*l:32}else F+=32});for(var V=0;V<M.length;V++){var H=f(M[V]),z=y(H,C[V]);S(H)?(N.push(y("uint256",F)),L.push(z),F+=z.length):N.push(z)}return n.concat(N.concat(L))},a.rawDecode=function(M,C){var N=[];C=n.from(C);for(var L=0,F=0;F<M.length;F++){var V=E(f(M[F])),H=_(V,C,L);L+=V.memoryUsage,N.push(H)}return N},a.simpleEncode=function(M){var C=Array.prototype.slice.call(arguments).slice(1),N=b(M);if(C.length!==N.args.length)throw new Error("Argument count mismatch");return n.concat([a.methodID(N.method,N.args),a.rawEncode(N.args,C)])},a.simpleDecode=function(M,C){var N=b(M);if(!N.retargs)throw new Error("No return values in method");return a.rawDecode(N.retargs,C)},a.stringify=function(M,C){var N=[];for(var L in M){var F=M[L],V=C[L];V=/^[^\[]+\[.*\]$/.test(F)?V.map(function(H){return O(F,H)}).join(", "):O(F,V),N.push(V)}return N},a.solidityHexValue=function(M,C,N){var L,F;if(k(M)){var V=M.replace(/\[.*?\]/,"");if(!k(V)){var H=h(M);if(H!=="dynamic"&&H!==0&&C.length>H)throw new Error("Elements exceed array size: "+H)}var z=C.map(function(x){return a.solidityHexValue(V,x,256)});return n.concat(z)}if(M==="bytes")return C;if(M==="string")return n.from(C,"utf8");if(M==="bool"){N=N||8;var R=Array(N/4).join("0");return n.from(C?R+"1":R+"0","hex")}if(M==="address"){var l=20;return N&&(l=N/8),c.setLengthLeft(C,l)}if(M.startsWith("bytes")){if((L=s(M))<1||L>32)throw new Error("Invalid bytes<N> width: "+L);return c.setLengthRight(C,L)}if(M.startsWith("uint")){if((L=s(M))%8||L<8||L>256)throw new Error("Invalid uint<N> width: "+L);if((F=v(C)).bitLength()>L)throw new Error("Supplied uint exceeds width: "+L+" vs "+F.bitLength());return N=N||L,F.toArrayLike(n,"be",N/8)}if(M.startsWith("int")){if((L=s(M))%8||L<8||L>256)throw new Error("Invalid int<N> width: "+L);if((F=v(C)).bitLength()>L)throw new Error("Supplied int exceeds width: "+L+" vs "+F.bitLength());return N=N||L,F.toTwos(L).toArrayLike(n,"be",N/8)}throw new Error("Unsupported or invalid type: "+M)},a.solidityPack=function(M,C){if(M.length!==C.length)throw new Error("Number of types are not matching the values");for(var N=[],L=0;L<M.length;L++){var F=f(M[L]),V=C[L];N.push(a.solidityHexValue(F,V,null))}return n.concat(N)},a.soliditySHA3=function(M,C){return c.keccak256(a.solidityPack(M,C))},a.soliditySHA256=function(M,C){return c.sha256(a.solidityPack(M,C))},a.solidityRIPEMD160=function(M,C){return c.ripemd160(a.solidityPack(M,C),!0)},a.fromSerpent=function(M){for(var C,N=[],L=0;L<M.length;L++){var F=M[L];if(F==="s")N.push("bytes");else if(F==="b"){for(var V="bytes",H=L+1;H<M.length&&(C=M[H])>="0"&&C<="9";)V+=M[H]-"0",H++;L=H-1,N.push(V)}else if(F==="i")N.push("int256");else{if(F!=="a")throw new Error("Unsupported or invalid type: "+F);N.push("int256[]")}}return N},a.toSerpent=function(M){for(var C=[],N=0;N<M.length;N++){var L=M[N];if(L==="bytes")C.push("s");else if(L.startsWith("bytes"))C.push("b"+s(L));else if(L==="int256")C.push("i");else{if(L!=="int256[]")throw new Error("Unsupported or invalid type: "+L);C.push("a")}}return C.join("")},o.exports=a}).call(this,t(2).Buffer)},function(o,e,t){var n=this&&this.__createBinding||(Object.create?function(u,h,v,b){b===void 0&&(b=v),Object.defineProperty(u,b,{enumerable:!0,get:function(){return h[v]}})}:function(u,h,v,b){b===void 0&&(b=v),u[b]=h[v]}),c=this&&this.__exportStar||function(u,h){for(var v in u)v==="default"||h.hasOwnProperty(v)||n(h,u,v)};Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=e.rlp=e.BN=void 0;var p=t(74);e.secp256k1=p;var a=t(32),f=t(9);e.BN=f;var s=t(46);e.rlp=s,Object.assign(e,a),c(t(363),e),c(t(364),e),c(t(75),e),c(t(365),e),c(t(40),e),c(t(366),e)},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0});var c=t(9),p=new(t(58)).ec("secp256k1"),a=p.curve;e.privateKeyExport=function(s,u){u===void 0&&(u=!0);var h=new c(s);if(h.ucmp(a.n)>=0)throw new Error("couldn't export to DER format");var v=p.g.mul(h);return f(v.getX(),v.getY(),u)},e.privateKeyModInverse=function(s){var u=new c(s);if(u.ucmp(a.n)>=0||u.isZero())throw new Error("private key range is invalid");return u.invm(a.n).toArrayLike(n,"be",32)},e.signatureImport=function(s){var u=new c(s.r);u.ucmp(a.n)>=0&&(u=new c(0));var h=new c(s.s);return h.ucmp(a.n)>=0&&(h=new c(0)),n.concat([u.toArrayLike(n,"be",32),h.toArrayLike(n,"be",32)])},e.ecdhUnsafe=function(s,u,h){h===void 0&&(h=!0);var v=p.keyFromPublic(s),b=new c(u);if(b.ucmp(a.n)>=0||b.isZero())throw new Error("scalar was invalid (zero or overflow)");var y=v.pub.mul(b);return f(y.getX(),y.getY(),h)};var f=function(s,u,h){var v;return h?((v=n.alloc(33))[0]=u.isOdd()?3:2,s.toArrayLike(n,"be",32).copy(v,1)):((v=n.alloc(65))[0]=4,s.toArrayLike(n,"be",32).copy(v,1),u.toArrayLike(n,"be",32).copy(v,33)),v}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0});var c=n.from([48,129,211,2,1,1,4,32,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,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,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,0,0,0,0,0,0,0,0,0]),p=n.from([48,130,1,19,2,1,1,4,32,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,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e.privateKeyExport=function(a,f,s){s===void 0&&(s=!0);var u=n.from(s?c:p);return a.copy(u,s?8:9),f.copy(u,s?181:214),u},e.privateKeyImport=function(a){var f=a.length,s=0;if(f<s+1||a[s]!==48||f<(s+=1)+1||!(128&a[s]))return null;var u=127&a[s];if(u<1||u>2||f<(s+=1)+u)return null;var h=a[s+u-1]|(u>1?a[s+u-2]<<8:0);return f<(s+=u)+h||f<s+3||a[s]!==2||a[s+1]!==1||a[s+2]!==1||f<(s+=3)+2||a[s]!==4||a[s+1]>32||f<s+2+a[s+1]?null:a.slice(s+2,s+2+a[s+1])},e.signatureImportLax=function(a){var f=n.alloc(32,0),s=n.alloc(32,0),u=a.length,h=0;if(a[h++]!==48)return null;var v=a[h++];if(128&v&&(h+=v-128)>u||a[h++]!==2)return null;var b=a[h++];if(128&b){if(h+(v=b-128)>u)return null;for(;v>0&&a[h]===0;h+=1,v-=1);for(b=0;v>0;h+=1,v-=1)b=(b<<8)+a[h]}if(b>u-h)return null;var y=h;if(h+=b,a[h++]!==2)return null;var _=a[h++];if(128&_){if(h+(v=_-128)>u)return null;for(;v>0&&a[h]===0;h+=1,v-=1);for(_=0;v>0;h+=1,v-=1)_=(_<<8)+a[h]}if(_>u-h)return null;var E=h;for(h+=_;b>0&&a[y]===0;b-=1,y+=1);if(b>32)return null;var S=a.slice(y,y+b);for(S.copy(f,32-S.length);_>0&&a[E]===0;_-=1,E+=1);if(_>32)return null;var k=a.slice(E,E+_);return k.copy(s,32-k.length),{r:f,s}}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=void 0;var c=t(9);e.MAX_INTEGER=new c("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new c("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=n.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=n.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=n.from(e.KECCAK256_RLP_S,"hex")}).call(this,t(2).Buffer)},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.importPublic=e.privateToPublic=e.privateToAddress=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.isPrecompiled=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isZeroAddress=e.isValidAddress=e.zeroAddress=void 0;var c=t(61),p=t(32),a=t(74),f=t(9),s=t(40),u=t(75);e.zeroAddress=function(){var h=s.zeros(20);return s.bufferToHex(h)},e.isValidAddress=function(h){return/^0x[0-9a-fA-F]{40}$/.test(h)},e.isZeroAddress=function(h){return e.zeroAddress()===s.addHexPrefix(h)},e.toChecksumAddress=function(h,v){h=p.stripHexPrefix(h).toLowerCase();for(var b=v!==void 0?v.toString()+"0x":"",y=u.keccak(b+h).toString("hex"),_="0x",E=0;E<h.length;E++)parseInt(y[E],16)>=8?_+=h[E].toUpperCase():_+=h[E];return _},e.isValidChecksumAddress=function(h,v){return e.isValidAddress(h)&&e.toChecksumAddress(h,v)===h},e.generateAddress=function(h,v){h=s.toBuffer(h);var b=new f(v);return b.isZero()?u.rlphash([h,null]).slice(-20):u.rlphash([h,n.from(b.toArray())]).slice(-20)},e.generateAddress2=function(h,v,b){var y=s.toBuffer(h),_=s.toBuffer(v),E=s.toBuffer(b);return c(y.length===20),c(_.length===32),u.keccak256(n.concat([n.from("ff","hex"),y,_,u.keccak256(E)])).slice(-20)},e.isPrecompiled=function(h){var v=s.unpad(h);return v.length===1&&v[0]>=1&&v[0]<=8},e.isValidPrivate=function(h){return a.privateKeyVerify(h)},e.isValidPublic=function(h,v){return v===void 0&&(v=!1),h.length===64?a.publicKeyVerify(n.concat([n.from([4]),h])):!!v&&a.publicKeyVerify(h)},e.pubToAddress=function(h,v){return v===void 0&&(v=!1),h=s.toBuffer(h),v&&h.length!==64&&(h=a.publicKeyConvert(h,!1).slice(1)),c(h.length===64),u.keccak(h).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToAddress=function(h){return e.publicToAddress(e.privateToPublic(h))},e.privateToPublic=function(h){return h=s.toBuffer(h),a.publicKeyCreate(h,!1).slice(1)},e.importPublic=function(h){return(h=s.toBuffer(h)).length!==64&&(h=a.publicKeyConvert(h,!1).slice(1)),h}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var c=t(74),p=t(9),a=t(40),f=t(75);function s(h,v){return v?h-(2*v+35):h-27}function u(h){return h===0||h===1}e.ecsign=function(h,v,b){var y=c.sign(h,v),_=y.recovery;return{r:y.signature.slice(0,32),s:y.signature.slice(32,64),v:b?_+(2*b+35):_+27}},e.ecrecover=function(h,v,b,y,_){var E=n.concat([a.setLength(b,32),a.setLength(y,32)],64),S=s(v,_);if(!u(S))throw new Error("Invalid signature v value");var k=c.recover(h,E,S);return c.publicKeyConvert(k,!1).slice(1)},e.toRpcSig=function(h,v,b,y){if(!u(s(h,y)))throw new Error("Invalid signature v value");return a.bufferToHex(n.concat([a.setLengthLeft(v,32),a.setLengthLeft(b,32),a.toBuffer(h)]))},e.fromRpcSig=function(h){var v=a.toBuffer(h);if(v.length!==65)throw new Error("Invalid signature length");var b=v[64];return b<27&&(b+=27),{v:b,r:v.slice(0,32),s:v.slice(32,64)}},e.isValidSignature=function(h,v,b,y,_){y===void 0&&(y=!0);var E=new p("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),S=new p("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(v.length!==32||b.length!==32||!u(s(h,_)))return!1;var k=new p(v),O=new p(b);return!(k.isZero()||k.gt(S)||O.isZero()||O.gt(S))&&(!y||O.cmp(E)!==1)},e.hashPersonalMessage=function(h){var v=n.from(`Ethereum Signed Message:
`+h.length.toString(),"utf-8");return f.keccak(n.concat([v,h]))}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;var c=t(61),p=t(32),a=t(46),f=t(40);e.defineProperties=function(s,u,h){if(s.raw=[],s._fields=[],s.toJSON=function(b){if(b===void 0&&(b=!1),b){var y={};return s._fields.forEach(function(_){y[_]="0x"+s[_].toString("hex")}),y}return f.baToJSON(s.raw)},s.serialize=function(){return a.encode(s.raw)},u.forEach(function(b,y){function _(){return s.raw[y]}function E(S){(S=f.toBuffer(S)).toString("hex")!=="00"||b.allowZero||(S=n.allocUnsafe(0)),b.allowLess&&b.length?(S=f.stripZeros(S),c(b.length>=S.length,"The field "+b.name+" must not have more "+b.length+" bytes")):b.allowZero&&S.length===0||!b.length||c(b.length===S.length,"The field "+b.name+" must have byte length of "+b.length),s.raw[y]=S}s._fields.push(b.name),Object.defineProperty(s,b.name,{enumerable:!0,configurable:!0,get:_,set:E}),b.default&&(s[b.name]=b.default),b.alias&&Object.defineProperty(s,b.alias,{enumerable:!1,configurable:!0,set:E,get:_})}),h)if(typeof h=="string"&&(h=n.from(p.stripHexPrefix(h),"hex")),n.isBuffer(h)&&(h=a.decode(h)),Array.isArray(h)){if(h.length>s._fields.length)throw new Error("wrong number of fields in data");h.forEach(function(b,y){s[s._fields[y]]=f.toBuffer(b)})}else{if(typeof h!="object")throw new Error("invalid data");var v=Object.keys(h);u.forEach(function(b){v.indexOf(b.name)!==-1&&(s[b.name]=h[b.name]),v.indexOf(b.alias)!==-1&&(s[b.alias]=h[b.alias])})}}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){(function(c){var p=function(a){setTimeout(a,0)};n!==void 0&&n&&typeof n.nextTick=="function"&&(p=n.nextTick),o.exports=function(a){var f={capacity:a||1,current:0,queue:[],firstHere:!1,take:function(){if(f.firstHere===!1){f.current++,f.firstHere=!0;var s=1}else s=0;var u={n:1};typeof arguments[0]=="function"?u.task=arguments[0]:u.n=arguments[0],arguments.length>=2&&(typeof arguments[1]=="function"?u.task=arguments[1]:u.n=arguments[1]);var h=u.task;if(u.task=function(){h(f.leave)},f.current+u.n-s>f.capacity)return s===1&&(f.current--,f.firstHere=!1),f.queue.push(u);f.current+=u.n-s,u.task(f.leave),s===1&&(f.firstHere=!1)},leave:function(s){if(s=s||1,f.current-=s,f.queue.length){var u=f.queue[0];u.n+f.current>f.capacity||(f.queue.shift(),f.current+=u.n,p(u.task))}else if(f.current<0)throw new Error("leave called too many times.")},available:function(s){return s=s||1,f.current+s<=f.capacity}};return f}})()}).call(this,t(5))},function(o,e,t){const n=t(67);o.exports=function(c,p,a){c.sendAsync(n({method:"eth_estimateGas",params:[p]}),function(f,s){if(f)return f.message==="no contract code at given address"?a(null,"0xcf08"):a(f);a(null,s.result)})}},function(o,e,t){(function(n){const c=t(21).inherits,p=t(370),a=t(36),f=t(49),s=t(149).blockTagForPayload;function u(h){this.nonceCache={}}o.exports=u,c(u,f),u.prototype.handleRequest=function(h,v,b){const y=this;switch(h.method){case"eth_getTransactionCount":var _=s(h),E=h.params[0].toLowerCase(),S=y.nonceCache[E];return void(_==="pending"?S?b(null,S):v(function(k,O,M){if(k)return M();y.nonceCache[E]===void 0&&(y.nonceCache[E]=O),M()}):v());case"eth_sendRawTransaction":return void v(function(k,O,M){if(k)return M();var C=h.params[0],N=(a.stripHexPrefix(C),n.from(a.stripHexPrefix(C),"hex"),new p(n.from(a.stripHexPrefix(C),"hex"))),L="0x"+N.getSenderAddress().toString("hex").toLowerCase(),F=a.bufferToInt(N.nonce),V=(++F).toString(16);V.length%2&&(V="0"+V),V="0x"+V,y.nonceCache[L]=V,M()});case"evm_revert":return y.nonceCache={},void v();default:return void v()}}}).call(this,t(2).Buffer)},function(o,e,t){(function(n){var c=t(36),p=t(371),a=c.BN,f=new a("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=function(){function u(h){(function(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")})(this,u),h=h||{};var v=[{name:"nonce",length:32,allowLess:!0,default:new n([])},{name:"gasPrice",length:32,allowLess:!0,default:new n([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new n([])},{name:"to",allowZero:!0,length:20,default:new n([])},{name:"value",length:32,allowLess:!0,default:new n([])},{name:"data",alias:"input",allowZero:!0,default:new n([])},{name:"v",allowZero:!0,default:new n([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new n([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new n([])}];c.defineProperties(this,v,h),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var b=c.bufferToInt(this.v),y=Math.floor((b-35)/2);y<0&&(y=0),this._chainId=y||h.chainId||0,this._homestead=!0}return u.prototype.toCreationAddress=function(){return this.to.toString("hex")===""},u.prototype.hash=function(h){h===void 0&&(h=!0);var v=void 0;if(h)v=this.raw;else if(this._chainId>0){var b=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,v=this.raw,this.raw=b}else v=this.raw.slice(0,6);return c.rlphash(v)},u.prototype.getChainId=function(){return this._chainId},u.prototype.getSenderAddress=function(){if(this._from)return this._from;var h=this.getSenderPublicKey();return this._from=c.publicToAddress(h),this._from},u.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},u.prototype.verifySignature=function(){var h=this.hash(!1);if(this._homestead&&new a(this.s).cmp(f)===1)return!1;try{var v=c.bufferToInt(this.v);this._chainId>0&&(v-=2*this._chainId+8),this._senderPubKey=c.ecrecover(h,v,this.r,this.s)}catch{return!1}return!!this._senderPubKey},u.prototype.sign=function(h){var v=this.hash(!1),b=c.ecsign(v,h);this._chainId>0&&(b.v+=2*this._chainId+8),Object.assign(this,b)},u.prototype.getDataFee=function(){for(var h=this.raw[5],v=new a(0),b=0;b<h.length;b++)h[b]===0?v.iaddn(p.txDataZeroGas.v):v.iaddn(p.txDataNonZeroGas.v);return v},u.prototype.getBaseFee=function(){var h=this.getDataFee().iaddn(p.txGas.v);return this._homestead&&this.toCreationAddress()&&h.iaddn(p.txCreation.v),h},u.prototype.getUpfrontCost=function(){return new a(this.gasLimit).imul(new a(this.gasPrice)).iadd(new a(this.value))},u.prototype.validate=function(h){var v=[];return this.verifySignature()||v.push("Invalid Signature"),this.getBaseFee().cmp(new a(this.gasLimit))>0&&v.push(["gas limit is too low. Need at least "+this.getBaseFee()]),h===void 0||h===!1?v.length===0:v.join(" ")},u}();o.exports=s}).call(this,t(2).Buffer)},function(o){o.exports=JSON.parse(`{"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation's data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation's data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn't exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"ommerReward":{"v":"625000000000000000","d":"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},"niblingReward":{"v":"156250000000000000","d":"the amount a miner gets for inculding a uncle"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}`)},function(o,e,t){const n=t(68),c=t(373);o.exports=class extends n{constructor(){super(({blockTracker:p,provider:a,engine:f})=>{const{events:s,middleware:u}=c({blockTracker:p,provider:a});return s.on("notification",h=>f.emit("data",null,h)),u})}}},function(o,e,t){const n=t(69).default,c=t(156),{createAsyncMiddleware:p}=t(152),a=t(151),{unsafeRandomBytes:f,incrementHexInt:s}=t(39),u=t(73);function h(v){return{hash:v.hash,parentHash:v.parentHash,sha3Uncles:v.sha3Uncles,miner:v.miner,stateRoot:v.stateRoot,transactionsRoot:v.transactionsRoot,receiptsRoot:v.receiptsRoot,logsBloom:v.logsBloom,difficulty:v.difficulty,number:v.number,gasLimit:v.gasLimit,gasUsed:v.gasUsed,nonce:v.nonce,mixHash:v.mixHash,timestamp:v.timestamp,extraData:v.extraData}}o.exports=function({blockTracker:v,provider:b}){const y={},_=a({blockTracker:v,provider:b});let E=!1;const S=new n,k=c({eth_subscribe:p(async function(M,C){if(E)throw new Error("SubscriptionManager - attempting to use after destroying");const N=M.params[0],L=f(16);let F;switch(N){case"newHeads":F=function({subId:z}){const R={type:N,destroy:async()=>{v.removeListener("sync",R.update)},update:async({oldBlock:l,newBlock:x})=>{const d=x,m=s(l);(await u({provider:b,fromBlock:m,toBlock:d})).map(h).forEach(g=>{O(z,g)})}};return v.on("sync",R.update),R}({subId:L});break;case"logs":const V=M.params[1],H=await _.newLogFilter(V);F=function({subId:z,filter:R}){return R.on("update",l=>O(z,l)),{type:N,destroy:async()=>await _.uninstallFilter(R.idHex)}}({subId:L,filter:H});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${N}"`)}return y[L]=F,void(C.result=L)}),eth_unsubscribe:p(async function(M,C){if(E)throw new Error("SubscriptionManager - attempting to use after destroying");const N=M.params[0],L=y[N];if(!L)return void(C.result=!1);delete y[N],await L.destroy(),C.result=!0})});return k.destroy=function(){S.removeAllListeners();for(const M in y)y[M].destroy(),delete y[M];E=!0},{events:S,middleware:k};function O(M,C){S.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:M,result:C}})}}},function(o,e,t){t.r(e);var n={};t.r(n),t.d(n,"generateKey",function(){return y}),t.d(n,"verifyHmac",function(){return _}),t.d(n,"encrypt",function(){return E}),t.d(n,"decrypt",function(){return S});var c=t(1),p=t(162),a=class{constructor(){this._eventEmitters=[]}subscribe(k){this._eventEmitters.push(k)}unsubscribe(k){this._eventEmitters=this._eventEmitters.filter(O=>O.event!==k)}trigger(k){let O,M=[];O=Object(c.isJsonRpcRequest)(k)?k.method:Object(c.isJsonRpcResponseSuccess)(k)||Object(c.isJsonRpcResponseError)(k)?"response:"+k.id:Object(c.isInternalEvent)(k)?k.event:"",O&&(M=this._eventEmitters.filter(C=>C.event===O)),M&&M.length||Object(c.isReservedEvent)(O)||Object(c.isInternalEvent)(O)||(M=this._eventEmitters.filter(C=>C.event==="call_request")),M.forEach(C=>{if(Object(c.isJsonRpcResponseError)(k)){const N=new Error(k.error.message);C.callback(N,null)}else C.callback(null,k)})}},f=class{constructor(k="walletconnect"){this.storageId=k}getSession(){let k=null;const O=Object(c.getLocal)(this.storageId);return O&&Object(c.isWalletConnectSession)(O)&&(k=O),k}setSession(k){return Object(c.setLocal)(this.storageId,k),k}removeSession(){Object(c.removeLocal)(this.storageId)}};const s="abcdefghijklmnopqrstuvwxyz0123456789".split("").map(k=>`https://${k}.bridge.walletconnect.org`);function u(){return s[Math.floor(Math.random()*s.length)]}var h=class{constructor(k){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new a,this._clientMeta=Object(c.getClientMeta)()||k.connectorOpts.clientMeta||null,this._cryptoLib=k.cryptoLib,this._sessionStorage=k.sessionStorage||new f(k.connectorOpts.storageId),this._qrcodeModal=k.connectorOpts.qrcodeModal,this._qrcodeModalOptions=k.connectorOpts.qrcodeModalOptions,this._signingMethods=[...c.signingMethods,...k.connectorOpts.signingMethods||[]],!k.connectorOpts.bridge&&!k.connectorOpts.uri&&!k.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var O;k.connectorOpts.bridge&&(this.bridge=function(C){return function(N){return function(L){let F=L.indexOf("//")>-1?L.split("/")[2]:L.split("/")[0];return F=F.split(":")[0],F=F.split("?")[0],F}(N).split(".").slice(-2).join(".")}(C)==="walletconnect.org"}(O=k.connectorOpts.bridge)?u():O),k.connectorOpts.uri&&(this.uri=k.connectorOpts.uri);const M=k.connectorOpts.session||this._getStorageSession();M&&(this.session=M),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=k.transport||new p.a({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),k.connectorOpts.uri&&this._subscribeToSessionRequest(),k.pushServerOpts&&this._registerPushServer(k.pushServerOpts)}set bridge(k){k&&(this._bridge=k)}get bridge(){return this._bridge}set key(k){if(!k)return;const O=Object(c.convertHexToArrayBuffer)(k);this._key=O}get key(){return this._key?Object(c.convertArrayBufferToHex)(this._key,!0):""}set clientId(k){k&&(this._clientId=k)}get clientId(){let k=this._clientId;return k||(k=this._clientId=Object(c.uuid)()),this._clientId}set peerId(k){k&&(this._peerId=k)}get peerId(){return this._peerId}set clientMeta(k){}get clientMeta(){let k=this._clientMeta;return k||(k=this._clientMeta=Object(c.getClientMeta)()),k}set peerMeta(k){this._peerMeta=k}get peerMeta(){return this._peerMeta}set handshakeTopic(k){k&&(this._handshakeTopic=k)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(k){k&&(this._handshakeId=k)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(k){if(!k)return;const{handshakeTopic:O,bridge:M,key:C}=this._parseUri(k);this.handshakeTopic=O,this.bridge=M,this.key=C}set chainId(k){this._chainId=k}get chainId(){return this._chainId}set networkId(k){this._networkId=k}get networkId(){return this._networkId}set accounts(k){this._accounts=k}get accounts(){return this._accounts}set rpcUrl(k){this._rpcUrl=k}get rpcUrl(){return this._rpcUrl}set connected(k){}get connected(){return this._connected}set pending(k){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(k){k&&(this._connected=k.connected,this.accounts=k.accounts,this.chainId=k.chainId,this.bridge=k.bridge,this.key=k.key,this.clientId=k.clientId,this.clientMeta=k.clientMeta,this.peerId=k.peerId,this.peerMeta=k.peerMeta,this.handshakeId=k.handshakeId,this.handshakeTopic=k.handshakeTopic)}on(k,O){const M={event:k,callback:O};this._eventManager.subscribe(M)}off(k){this._eventManager.unsubscribe(k)}async createInstantRequest(k){this._key=await this._generateKey();const O=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(k)}]});this.handshakeId=O.id,this.handshakeTopic=Object(c.uuid)(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error("User close QRCode Modal")});const M=()=>{this.killSession()};try{const C=await this._sendCallRequest(O);return C&&M(),C}catch(C){throw M(),C}}async connect(k){if(!this._qrcodeModal)throw new Error("QRCode Modal not provided");return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(k),new Promise(async(O,M)=>{this.on("modal_closed",()=>M(new Error("User close QRCode Modal"))),this.on("connect",(C,N)=>{if(C)return M(C);O(N.params[0])})}))}async createSession(k){if(this._connected)throw new Error("Session currently connected");if(this.pending)return;this._key=await this._generateKey();const O=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:k&&k.chainId?k.chainId:null}]});this.handshakeId=O.id,this.handshakeTopic=Object(c.uuid)(),this._sendSessionRequest(O,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(k){if(this._connected)throw new Error("Session currently connected");this.chainId=k.chainId,this.accounts=k.accounts,this.networkId=k.networkId||0,this.rpcUrl=k.rpcUrl||"";const O={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},M={id:this.handshakeId,jsonrpc:"2.0",result:O};this._sendResponse(M),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(k){if(this._connected)throw new Error("Session currently connected");const O=k&&k.message?k.message:"Session Rejected",M=this._formatResponse({id:this.handshakeId,error:{message:O}});this._sendResponse(M),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:O}]}),this._removeStorageSession()}updateSession(k){if(!this._connected)throw new Error("Session currently disconnected");this.chainId=k.chainId,this.accounts=k.accounts,this.networkId=k.networkId||0,this.rpcUrl=k.rpcUrl||"";const O={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},M=this._formatRequest({method:"wc_sessionUpdate",params:[O]});this._sendSessionRequest(M,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(k){const O=k?k.message:"Session Disconnected",M=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(M),this._handleSessionDisconnect(O)}async sendTransaction(k){if(!this._connected)throw new Error("Session currently disconnected");const O=Object(c.parseTransactionData)(k),M=this._formatRequest({method:"eth_sendTransaction",params:[O]});return await this._sendCallRequest(M)}async signTransaction(k){if(!this._connected)throw new Error("Session currently disconnected");const O=Object(c.parseTransactionData)(k),M=this._formatRequest({method:"eth_signTransaction",params:[O]});return await this._sendCallRequest(M)}async signMessage(k){if(!this._connected)throw new Error("Session currently disconnected");const O=this._formatRequest({method:"eth_sign",params:k});return await this._sendCallRequest(O)}async signPersonalMessage(k){if(!this._connected)throw new Error("Session currently disconnected");k=Object(c.parsePersonalSign)(k);const O=this._formatRequest({method:"personal_sign",params:k});return await this._sendCallRequest(O)}async signTypedData(k){if(!this._connected)throw new Error("Session currently disconnected");const O=this._formatRequest({method:"eth_signTypedData",params:k});return await this._sendCallRequest(O)}async updateChain(k){if(!this._connected)throw new Error("Session currently disconnected");const O=this._formatRequest({method:"wallet_updateChain",params:[k]});return await this._sendCallRequest(O)}unsafeSend(k,O){return this._sendRequest(k,O),this._eventManager.trigger({event:"call_request_sent",params:[{request:k,options:O}]}),new Promise((M,C)=>{this._subscribeToResponse(k.id,(N,L)=>{if(N)C(N);else{if(!L)throw new Error("Missing JSON RPC response");M(L)}})})}async sendCustomRequest(k,O){if(!this._connected)throw new Error("Session currently disconnected");switch(k.method){case"eth_accounts":return this.accounts;case"eth_chainId":return Object(c.convertNumberToHex)(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":k.params&&(k.params[0]=Object(c.parseTransactionData)(k.params[0]));break;case"personal_sign":k.params&&(k.params=Object(c.parsePersonalSign)(k.params))}const M=this._formatRequest(k);return await this._sendCallRequest(M,O)}approveRequest(k){if(!Object(c.isJsonRpcResponseSuccess)(k))throw new Error('JSON-RPC success response must include "result" field');{const O=this._formatResponse(k);this._sendResponse(O)}}rejectRequest(k){if(!Object(c.isJsonRpcResponseError)(k))throw new Error('JSON-RPC error response must include "error" field');{const O=this._formatResponse(k);this._sendResponse(O)}}transportClose(){this._transport.close()}async _sendRequest(k,O){const M=this._formatRequest(k),C=await this._encrypt(M),N=(O==null?void 0:O.topic)!==void 0?O.topic:this.peerId,L=JSON.stringify(C),F=(O==null?void 0:O.forcePushNotification)!==void 0?!O.forcePushNotification:Object(c.isSilentPayload)(M);this._transport.send(L,N,F)}async _sendResponse(k){const O=await this._encrypt(k),M=this.peerId,C=JSON.stringify(O);this._transport.send(C,M,!0)}async _sendSessionRequest(k,O,M){this._sendRequest(k,M),this._subscribeToSessionResponse(k.id,O)}_sendCallRequest(k,O){return this._sendRequest(k,O),this._eventManager.trigger({event:"call_request_sent",params:[{request:k,options:O}]}),this._subscribeToCallResponse(k.id)}_formatRequest(k){if(k.method===void 0)throw new Error('JSON RPC request must have valid "method" value');return{id:k.id===void 0?Object(c.payloadId)():k.id,jsonrpc:"2.0",method:k.method,params:k.params===void 0?[]:k.params}}_formatResponse(k){if(k.id===void 0)throw new Error('JSON RPC request must have valid "id" value');const O={id:k.id,jsonrpc:"2.0"};if(Object(c.isJsonRpcResponseError)(k)){const M=Object(c.formatRpcError)(k.error);return Object.assign(Object.assign(Object.assign({},O),k),{error:M})}if(Object(c.isJsonRpcResponseSuccess)(k))return Object.assign(Object.assign({},O),k);throw new Error("JSON RPC response format is invalid")}_handleSessionDisconnect(k){const O=k||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),Object(c.removeLocal)(c.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:O}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(k,O){O&&O.approved?(this._connected?(O.chainId&&(this.chainId=O.chainId),O.accounts&&(this.accounts=O.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,O.chainId&&(this.chainId=O.chainId),O.accounts&&(this.accounts=O.accounts),O.peerId&&!this.peerId&&(this.peerId=O.peerId),O.peerMeta&&!this.peerMeta&&(this.peerMeta=O.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(k)}async _handleIncomingMessages(k){if(![this.clientId,this.handshakeTopic].includes(k.topic))return;let O;try{O=JSON.parse(k.payload)}catch{return}const M=await this._decrypt(O);M&&this._eventManager.trigger(M)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(k,O){this.on("response:"+k,O)}_subscribeToSessionResponse(k,O){this._subscribeToResponse(k,(M,C)=>{M?this._handleSessionResponse(M.message):Object(c.isJsonRpcResponseSuccess)(C)?this._handleSessionResponse(O,C.result):C.error&&C.error.message?this._handleSessionResponse(C.error.message):this._handleSessionResponse(O)})}_subscribeToCallResponse(k){return new Promise((O,M)=>{this._subscribeToResponse(k,(C,N)=>{C?M(C):Object(c.isJsonRpcResponseSuccess)(N)?O(N.result):N.error&&N.error.message?M(new Error(N.error.message)):M(new Error("JSON RPC response format is invalid"))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(k,O)=>{const{request:M}=O.params[0];if(Object(c.isMobile)()&&this._signingMethods.includes(M.method)){const C=Object(c.getLocal)(c.mobileLinkChoiceKey);C&&(window.location.href=C.href)}}),this.on("wc_sessionRequest",(k,O)=>{k&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:k.toString()}]}),this.handshakeId=O.id,this.peerId=O.params[0].peerId,this.peerMeta=O.params[0].peerMeta;const M=Object.assign(Object.assign({},O),{method:"session_request"});this._eventManager.trigger(M)}),this.on("wc_sessionUpdate",(k,O)=>{k&&this._handleSessionResponse(k.message),this._handleSessionResponse("Session disconnected",O.params[0])})}_initTransport(){this._transport.on("message",k=>this._handleIncomingMessages(k)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){return`${this.protocol}:${this.handshakeTopic}@${this.version}?bridge=${encodeURIComponent(this.bridge)}&key=${this.key}`}_parseUri(k){const O=Object(c.parseWalletConnectUri)(k);if(O.protocol===this.protocol){if(!O.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const M=O.handshakeTopic;if(!O.bridge)throw Error("Invalid or missing bridge url parameter value");const C=decodeURIComponent(O.bridge);if(!O.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:M,bridge:C,key:O.key}}throw new Error("URI format is invalid")}async _generateKey(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(k){const O=this._key;return this._cryptoLib&&O?await this._cryptoLib.encrypt(k,O):null}async _decrypt(k){const O=this._key;return this._cryptoLib&&O?await this._cryptoLib.decrypt(k,O):null}_getStorageSession(){let k=null;return this._sessionStorage&&(k=this._sessionStorage.getSession()),k}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(k){if(!k.url||typeof k.url!="string")throw Error("Invalid or missing pushServerOpts.url parameter value");if(!k.type||typeof k.type!="string")throw Error("Invalid or missing pushServerOpts.type parameter value");if(!k.token||typeof k.token!="string")throw Error("Invalid or missing pushServerOpts.token parameter value");const O={bridge:this.bridge,topic:this.clientId,type:k.type,token:k.token,peerName:"",language:k.language||""};this.on("connect",async(M,C)=>{if(M)throw M;if(k.peerMeta){const N=C.params[0].peerMeta.name;O.peerName=N}try{if(!(await(await fetch(k.url+"/new",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(O)})).json()).success)throw Error("Failed to register in Push Server")}catch{throw Error("Failed to register in Push Server")}})}},v=t(33),b=t(0);async function y(k){const O=(k||256)/8,M=v.randomBytes(O);return Object(c.convertBufferToArrayBuffer)(b.b(M))}async function _(k,O){const M=b.n(k.data),C=b.n(k.iv),N=b.n(k.hmac),L=b.c(N,!1),F=b.j(M,C),V=await v.hmacSha256Sign(O,F),H=b.c(V,!1);return b.x(L)===b.x(H)}async function E(k,O,M){const C=b.f(Object(c.convertArrayBufferToBuffer)(O)),N=M||await y(128),L=b.f(Object(c.convertArrayBufferToBuffer)(N)),F=b.c(L,!1),V=JSON.stringify(k),H=b.z(V),z=await v.aesCbcEncrypt(L,C,H),R=b.c(z,!1),l=b.j(z,L),x=await v.hmacSha256Sign(C,l);return{data:R,hmac:b.c(x,!1),iv:F}}async function S(k,O){const M=b.f(Object(c.convertArrayBufferToBuffer)(O));if(!M)throw new Error("Missing key: required for decryption");if(!await _(k,M))return null;const C=b.n(k.data),N=b.n(k.iv),L=await v.aesCbcDecrypt(N,M,C),F=b.e(L);let V;try{V=JSON.parse(F)}catch{return null}return V}e.default=class extends h{constructor(k,O){super({cryptoLib:n,connectorOpts:k,pushServerOpts:O})}}},function(o,e,t){t.r(e);function n(s,u,h,v){return new(h||(h=Promise))(function(b,y){function _(k){try{S(v.next(k))}catch(O){y(O)}}function E(k){try{S(v.throw(k))}catch(O){y(O)}}function S(k){var O;k.done?b(k.value):(O=k.value,O instanceof h?O:new h(function(M){M(O)})).then(_,E)}S((v=v.apply(s,u||[])).next())})}function c(s,u){var h,v,b,y,_={label:0,sent:function(){if(1&b[0])throw b[1];return b[1]},trys:[],ops:[]};return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(S){return function(k){return function(O){if(h)throw new TypeError("Generator is already executing.");for(;_;)try{if(h=1,v&&(b=2&O[0]?v.return:O[0]?v.throw||((b=v.return)&&b.call(v),0):v.next)&&!(b=b.call(v,O[1])).done)return b;switch(v=0,b&&(O=[2&O[0],b.value]),O[0]){case 0:case 1:b=O;break;case 4:return _.label++,{value:O[1],done:!1};case 5:_.label++,v=O[1],O=[0];continue;case 7:O=_.ops.pop(),_.trys.pop();continue;default:if(b=_.trys,!((b=b.length>0&&b[b.length-1])||O[0]!==6&&O[0]!==2)){_=0;continue}if(O[0]===3&&(!b||O[1]>b[0]&&O[1]<b[3])){_.label=O[1];break}if(O[0]===6&&_.label<b[1]){_.label=b[1],b=O;break}if(b&&_.label<b[2]){_.label=b[2],_.ops.push(O);break}b[2]&&_.ops.pop(),_.trys.pop();continue}O=u.call(s,_)}catch(M){O=[6,M],v=0}finally{h=b=0}if(5&O[0])throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}([S,k])}}}var p=function(){function s(u){if(this._maxConcurrency=u,this._queue=[],u<=0)throw new Error("semaphore must be initialized to a positive value");this._value=u}return s.prototype.acquire=function(){var u=this,h=this.isLocked(),v=new Promise(function(b){return u._queue.push(b)});return h||this._dispatch(),v},s.prototype.runExclusive=function(u){return n(this,void 0,void 0,function(){var h,v,b;return c(this,function(y){switch(y.label){case 0:return[4,this.acquire()];case 1:h=y.sent(),v=h[0],b=h[1],y.label=2;case 2:return y.trys.push([2,,4,5]),[4,u(v)];case 3:return[2,y.sent()];case 4:return b(),[7];case 5:return[2]}})})},s.prototype.isLocked=function(){return this._value<=0},s.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 u=this._currentReleaser;this._currentReleaser=void 0,u()}},s.prototype._dispatch=function(){var u=this,h=this._queue.shift();if(h){var v=!1;this._currentReleaser=function(){v||(v=!0,u._value++,u._dispatch())},h([this._value--,this._currentReleaser])}},s}(),a=function(){function s(){this._semaphore=new p(1)}return s.prototype.acquire=function(){return n(this,void 0,void 0,function(){var u;return c(this,function(h){switch(h.label){case 0:return[4,this._semaphore.acquire()];case 1:return u=h.sent(),[2,u[1]]}})})},s.prototype.runExclusive=function(u){return this._semaphore.runExclusive(function(){return u()})},s.prototype.isLocked=function(){return this._semaphore.isLocked()},s.prototype.release=function(){this._semaphore.release()},s}();function f(s,u,h){var v=this;return h===void 0&&(h=new Error("timeout")),{acquire:function(){return new Promise(function(b,y){return n(v,void 0,void 0,function(){var _,E;return c(this,function(S){switch(S.label){case 0:return _=!1,setTimeout(function(){_=!0,y(h)},u),[4,s.acquire()];case 1:return E=S.sent(),_?(Array.isArray(E)?E[1]:E)():b(E),[2]}})})})},runExclusive:function(b){return n(this,void 0,void 0,function(){var y,_;return c(this,function(E){switch(E.label){case 0:y=function(){},E.label=1;case 1:return E.trys.push([1,,7,8]),[4,this.acquire()];case 2:return _=E.sent(),Array.isArray(_)?(y=_[1],[4,b(_[0])]):[3,4];case 3:return[2,E.sent()];case 4:return y=_,[4,b()];case 5:return[2,E.sent()];case 6:return[3,8];case 7:return y(),[7];case 8:return[2]}})})},release:function(){s.release()},isLocked:function(){return s.isLocked()}}}t.d(e,"Mutex",function(){return a}),t.d(e,"Semaphore",function(){return p}),t.d(e,"withTimeout",function(){return f})},function(o,e,t){t.r(e);var n,c,p,a,f,s,u,h={},v=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function y(X,Q){for(var re in Q)X[re]=Q[re];return X}function _(X){var Q=X.parentNode;Q&&Q.removeChild(X)}function E(X,Q,re){var ue,xe=arguments,Me={};for(ue in Q)ue!=="key"&&ue!=="ref"&&(Me[ue]=Q[ue]);if(arguments.length>3)for(re=[re],ue=3;ue<arguments.length;ue++)re.push(xe[ue]);if(re!=null&&(Me.children=re),typeof X=="function"&&X.defaultProps!=null)for(ue in X.defaultProps)Me[ue]===void 0&&(Me[ue]=X.defaultProps[ue]);return S(X,Me,Q&&Q.key,Q&&Q.ref,null)}function S(X,Q,re,ue,xe){var Me={type:X,props:Q,key:re,ref:ue,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:xe};return xe==null&&(Me.__v=Me),n.vnode&&n.vnode(Me),Me}function k(){return{}}function O(X){return X.children}function M(X,Q){this.props=X,this.context=Q}function C(X,Q){if(Q==null)return X.__?C(X.__,X.__.__k.indexOf(X)+1):null;for(var re;Q<X.__k.length;Q++)if((re=X.__k[Q])!=null&&re.__e!=null)return re.__e;return typeof X.type=="function"?C(X):null}function N(X){var Q,re;if((X=X.__)!=null&&X.__c!=null){for(X.__e=X.__c.base=null,Q=0;Q<X.__k.length;Q++)if((re=X.__k[Q])!=null&&re.__e!=null){X.__e=X.__c.base=re.__e;break}return N(X)}}function L(X){(!X.__d&&(X.__d=!0)&&c.push(X)&&!p++||f!==n.debounceRendering)&&((f=n.debounceRendering)||a)(F)}function F(){for(var X;p=c.length;)X=c.sort(function(Q,re){return Q.__v.__b-re.__v.__b}),c=[],X.some(function(Q){var re,ue,xe,Me,ze,$e,it;Q.__d&&($e=(ze=(re=Q).__v).__e,(it=re.__P)&&(ue=[],(xe=y({},ze)).__v=xe,Me=x(it,ze,xe,re.__n,it.ownerSVGElement!==void 0,null,ue,$e==null?C(ze):$e),d(ue,ze),Me!=$e&&N(ze)))})}function V(X,Q,re,ue,xe,Me,ze,$e,it){var Ne,ve,st,dt,vt,mt,_t,at=re&&re.__k||v,xt=at.length;if($e==h&&($e=Me!=null?Me[0]:xt?C(re,0):null),Ne=0,Q.__k=H(Q.__k,function(ut){if(ut!=null){if(ut.__=Q,ut.__b=Q.__b+1,(st=at[Ne])===null||st&&ut.key==st.key&&ut.type===st.type)at[Ne]=void 0;else for(ve=0;ve<xt;ve++){if((st=at[ve])&&ut.key==st.key&&ut.type===st.type){at[ve]=void 0;break}st=null}if(dt=x(X,ut,st=st||h,ue,xe,Me,ze,$e,it),(ve=ut.ref)&&st.ref!=ve&&(_t||(_t=[]),st.ref&&_t.push(st.ref,null,ut),_t.push(ve,ut.__c||dt,ut)),dt!=null){var Ot;if(mt==null&&(mt=dt),ut.__d!==void 0)Ot=ut.__d,ut.__d=void 0;else if(Me==st||dt!=$e||dt.parentNode==null){e:if($e==null||$e.parentNode!==X)X.appendChild(dt),Ot=null;else{for(vt=$e,ve=0;(vt=vt.nextSibling)&&ve<xt;ve+=2)if(vt==dt)break e;X.insertBefore(dt,$e),Ot=$e}Q.type=="option"&&(X.value="")}$e=Ot!==void 0?Ot:dt.nextSibling,typeof Q.type=="function"&&(Q.__d=$e)}else $e&&st.__e==$e&&$e.parentNode!=X&&($e=C(st))}return Ne++,ut}),Q.__e=mt,Me!=null&&typeof Q.type!="function")for(Ne=Me.length;Ne--;)Me[Ne]!=null&&_(Me[Ne]);for(Ne=xt;Ne--;)at[Ne]!=null&&w(at[Ne],at[Ne]);if(_t)for(Ne=0;Ne<_t.length;Ne++)g(_t[Ne],_t[++Ne],_t[++Ne])}function H(X,Q,re){if(re==null&&(re=[]),X==null||typeof X=="boolean")Q&&re.push(Q(null));else if(Array.isArray(X))for(var ue=0;ue<X.length;ue++)H(X[ue],Q,re);else re.push(Q?Q(typeof X=="string"||typeof X=="number"?S(null,X,null,null,X):X.__e!=null||X.__c!=null?S(X.type,X.props,X.key,null,X.__v):X):X);return re}function z(X,Q,re){Q[0]==="-"?X.setProperty(Q,re):X[Q]=typeof re=="number"&&b.test(Q)===!1?re+"px":re==null?"":re}function R(X,Q,re,ue,xe){var Me,ze,$e,it,Ne;if(xe?Q==="className"&&(Q="class"):Q==="class"&&(Q="className"),Q==="style")if(Me=X.style,typeof re=="string")Me.cssText=re;else{if(typeof ue=="string"&&(Me.cssText="",ue=null),ue)for(it in ue)re&&it in re||z(Me,it,"");if(re)for(Ne in re)ue&&re[Ne]===ue[Ne]||z(Me,Ne,re[Ne])}else Q[0]==="o"&&Q[1]==="n"?(ze=Q!==(Q=Q.replace(/Capture$/,"")),$e=Q.toLowerCase(),Q=($e in X?$e:Q).slice(2),re?(ue||X.addEventListener(Q,l,ze),(X.l||(X.l={}))[Q]=re):X.removeEventListener(Q,l,ze)):Q!=="list"&&Q!=="tagName"&&Q!=="form"&&Q!=="type"&&Q!=="size"&&!xe&&Q in X?X[Q]=re==null?"":re:typeof re!="function"&&Q!=="dangerouslySetInnerHTML"&&(Q!==(Q=Q.replace(/^xlink:?/,""))?re==null||re===!1?X.removeAttributeNS("http://www.w3.org/1999/xlink",Q.toLowerCase()):X.setAttributeNS("http://www.w3.org/1999/xlink",Q.toLowerCase(),re):re==null||re===!1&&!/^ar/.test(Q)?X.removeAttribute(Q):X.setAttribute(Q,re))}function l(X){this.l[X.type](n.event?n.event(X):X)}function x(X,Q,re,ue,xe,Me,ze,$e,it){var Ne,ve,st,dt,vt,mt,_t,at,xt,ut,Ot=Q.type;if(Q.constructor!==void 0)return null;(Ne=n.__b)&&Ne(Q);try{e:if(typeof Ot=="function"){if(at=Q.props,xt=(Ne=Ot.contextType)&&ue[Ne.__c],ut=Ne?xt?xt.props.value:Ne.__:ue,re.__c?_t=(ve=Q.__c=re.__c).__=ve.__E:("prototype"in Ot&&Ot.prototype.render?Q.__c=ve=new Ot(at,ut):(Q.__c=ve=new M(at,ut),ve.constructor=Ot,ve.render=A),xt&&xt.sub(ve),ve.props=at,ve.state||(ve.state={}),ve.context=ut,ve.__n=ue,st=ve.__d=!0,ve.__h=[]),ve.__s==null&&(ve.__s=ve.state),Ot.getDerivedStateFromProps!=null&&(ve.__s==ve.state&&(ve.__s=y({},ve.__s)),y(ve.__s,Ot.getDerivedStateFromProps(at,ve.__s))),dt=ve.props,vt=ve.state,st)Ot.getDerivedStateFromProps==null&&ve.componentWillMount!=null&&ve.componentWillMount(),ve.componentDidMount!=null&&ve.__h.push(ve.componentDidMount);else{if(Ot.getDerivedStateFromProps==null&&at!==dt&&ve.componentWillReceiveProps!=null&&ve.componentWillReceiveProps(at,ut),!ve.__e&&ve.shouldComponentUpdate!=null&&ve.shouldComponentUpdate(at,ve.__s,ut)===!1||Q.__v===re.__v&&!ve.__){for(ve.props=at,ve.state=ve.__s,Q.__v!==re.__v&&(ve.__d=!1),ve.__v=Q,Q.__e=re.__e,Q.__k=re.__k,ve.__h.length&&ze.push(ve),Ne=0;Ne<Q.__k.length;Ne++)Q.__k[Ne]&&(Q.__k[Ne].__=Q);break e}ve.componentWillUpdate!=null&&ve.componentWillUpdate(at,ve.__s,ut),ve.componentDidUpdate!=null&&ve.__h.push(function(){ve.componentDidUpdate(dt,vt,mt)})}ve.context=ut,ve.props=at,ve.state=ve.__s,(Ne=n.__r)&&Ne(Q),ve.__d=!1,ve.__v=Q,ve.__P=X,Ne=ve.render(ve.props,ve.state,ve.context),Q.__k=Ne!=null&&Ne.type==O&&Ne.key==null?Ne.props.children:Array.isArray(Ne)?Ne:[Ne],ve.getChildContext!=null&&(ue=y(y({},ue),ve.getChildContext())),st||ve.getSnapshotBeforeUpdate==null||(mt=ve.getSnapshotBeforeUpdate(dt,vt)),V(X,Q,re,ue,xe,Me,ze,$e,it),ve.base=Q.__e,ve.__h.length&&ze.push(ve),_t&&(ve.__E=ve.__=null),ve.__e=!1}else Me==null&&Q.__v===re.__v?(Q.__k=re.__k,Q.__e=re.__e):Q.__e=m(re.__e,Q,re,ue,xe,Me,ze,it);(Ne=n.diffed)&&Ne(Q)}catch(Pt){Q.__v=null,n.__e(Pt,Q,re)}return Q.__e}function d(X,Q){n.__c&&n.__c(Q,X),X.some(function(re){try{X=re.__h,re.__h=[],X.some(function(ue){ue.call(re)})}catch(ue){n.__e(ue,re.__v)}})}function m(X,Q,re,ue,xe,Me,ze,$e){var it,Ne,ve,st,dt,vt=re.props,mt=Q.props;if(xe=Q.type==="svg"||xe,Me!=null){for(it=0;it<Me.length;it++)if((Ne=Me[it])!=null&&((Q.type===null?Ne.nodeType===3:Ne.localName===Q.type)||X==Ne)){X=Ne,Me[it]=null;break}}if(X==null){if(Q.type===null)return document.createTextNode(mt);X=xe?document.createElementNS("http://www.w3.org/2000/svg",Q.type):document.createElement(Q.type,mt.is&&{is:mt.is}),Me=null,$e=!1}if(Q.type===null)vt!==mt&&X.data!=mt&&(X.data=mt);else{if(Me!=null&&(Me=v.slice.call(X.childNodes)),ve=(vt=re.props||h).dangerouslySetInnerHTML,st=mt.dangerouslySetInnerHTML,!$e){if(vt===h)for(vt={},dt=0;dt<X.attributes.length;dt++)vt[X.attributes[dt].name]=X.attributes[dt].value;(st||ve)&&(st&&ve&&st.__html==ve.__html||(X.innerHTML=st&&st.__html||""))}(function(_t,at,xt,ut,Ot){var Pt;for(Pt in xt)Pt==="children"||Pt==="key"||Pt in at||R(_t,Pt,null,xt[Pt],ut);for(Pt in at)Ot&&typeof at[Pt]!="function"||Pt==="children"||Pt==="key"||Pt==="value"||Pt==="checked"||xt[Pt]===at[Pt]||R(_t,Pt,at[Pt],xt[Pt],ut)})(X,mt,vt,xe,$e),st?Q.__k=[]:(Q.__k=Q.props.children,V(X,Q,re,ue,Q.type!=="foreignObject"&&xe,Me,ze,h,$e)),$e||("value"in mt&&(it=mt.value)!==void 0&&it!==X.value&&R(X,"value",it,vt.value,!1),"checked"in mt&&(it=mt.checked)!==void 0&&it!==X.checked&&R(X,"checked",it,vt.checked,!1))}return X}function g(X,Q,re){try{typeof X=="function"?X(Q):X.current=Q}catch(ue){n.__e(ue,re)}}function w(X,Q,re){var ue,xe,Me;if(n.unmount&&n.unmount(X),(ue=X.ref)&&(ue.current&&ue.current!==X.__e||g(ue,null,Q)),re||typeof X.type=="function"||(re=(xe=X.__e)!=null),X.__e=X.__d=void 0,(ue=X.__c)!=null){if(ue.componentWillUnmount)try{ue.componentWillUnmount()}catch(ze){n.__e(ze,Q)}ue.base=ue.__P=null}if(ue=X.__k)for(Me=0;Me<ue.length;Me++)ue[Me]&&w(ue[Me],Q,re);xe!=null&&_(xe)}function A(X,Q,re){return this.constructor(X,re)}function P(X,Q,re){var ue,xe,Me;n.__&&n.__(X,Q),xe=(ue=re===s)?null:re&&re.__k||Q.__k,X=E(O,null,[X]),Me=[],x(Q,(ue?Q:re||Q).__k=X,xe||h,h,Q.ownerSVGElement!==void 0,re&&!ue?[re]:xe?null:v.slice.call(Q.childNodes),Me,re||h,ue),d(Me,X)}function T(X,Q){P(X,Q,s)}function q(X,Q){var re,ue;for(ue in Q=y(y({},X.props),Q),arguments.length>2&&(Q.children=v.slice.call(arguments,2)),re={},Q)ue!=="key"&&ue!=="ref"&&(re[ue]=Q[ue]);return S(X.type,re,Q.key||X.key,Q.ref||X.ref,null)}function Z(X){var Q={},re={__c:"__cC"+u++,__:X,Consumer:function(ue,xe){return ue.children(xe)},Provider:function(ue){var xe,Me=this;return this.getChildContext||(xe=[],this.getChildContext=function(){return Q[re.__c]=Me,Q},this.shouldComponentUpdate=function(ze){Me.props.value!==ze.value&&xe.some(function($e){$e.context=ze.value,L($e)})},this.sub=function(ze){xe.push(ze);var $e=ze.componentWillUnmount;ze.componentWillUnmount=function(){xe.splice(xe.indexOf(ze),1),$e&&$e.call(ze)}}),ue.children}};return re.Consumer.contextType=re,re.Provider.__=re,re}n={__e:function(X,Q){for(var re,ue;Q=Q.__;)if((re=Q.__c)&&!re.__)try{if(re.constructor&&re.constructor.getDerivedStateFromError!=null&&(ue=!0,re.setState(re.constructor.getDerivedStateFromError(X))),re.componentDidCatch!=null&&(ue=!0,re.componentDidCatch(X)),ue)return L(re.__E=re)}catch(xe){X=xe}throw X}},M.prototype.setState=function(X,Q){var re;re=this.__s!==this.state?this.__s:this.__s=y({},this.state),typeof X=="function"&&(X=X(re,this.props)),X&&y(re,X),X!=null&&this.__v&&(Q&&this.__h.push(Q),L(this))},M.prototype.forceUpdate=function(X){this.__v&&(this.__e=!0,X&&this.__h.push(X),L(this))},M.prototype.render=O,c=[],p=0,a=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=h,u=0;var I,$,K,j=0,D=[],B=n.__r,U=n.diffed,J=n.__c,G=n.unmount;function W(X,Q){n.__h&&n.__h($,X,j||Q),j=0;var re=$.__H||($.__H={__:[],__h:[]});return X>=re.__.length&&re.__.push({}),re.__[X]}function Y(X){return j=1,ee(Oe,X)}function ee(X,Q,re){var ue=W(I++,2);return ue.__c||(ue.__c=$,ue.__=[re?re(Q):Oe(void 0,Q),function(xe){var Me=X(ue.__[0],xe);ue.__[0]!==Me&&(ue.__[0]=Me,ue.__c.setState({}))}]),ue.__}function te(X,Q){var re=W(I++,3);!n.__s&&pe(re.__H,Q)&&(re.__=X,re.__H=Q,$.__H.__h.push(re))}function oe(X,Q){var re=W(I++,4);!n.__s&&pe(re.__H,Q)&&(re.__=X,re.__H=Q,$.__h.push(re))}function fe(X){return j=5,ce(function(){return{current:X}},[])}function ne(X,Q,re){j=6,oe(function(){typeof X=="function"?X(Q()):X&&(X.current=Q())},re==null?re:re.concat(X))}function ce(X,Q){var re=W(I++,7);return pe(re.__H,Q)?(re.__H=Q,re.__h=X,re.__=X()):re.__}function se(X,Q){return j=8,ce(function(){return X},Q)}function ae(X){var Q=$.context[X.__c],re=W(I++,9);return re.__c=X,Q?(re.__==null&&(re.__=!0,Q.sub($)),Q.props.value):X.__}function he(X,Q){n.useDebugValue&&n.useDebugValue(Q?Q(X):X)}function me(X){var Q=W(I++,10),re=Y();return Q.__=X,$.componentDidCatch||($.componentDidCatch=function(ue){Q.__&&Q.__(ue),re[1](ue)}),[re[0],function(){re[1](void 0)}]}function le(){D.some(function(X){if(X.__P)try{X.__H.__h.forEach(ye),X.__H.__h.forEach(Se),X.__H.__h=[]}catch(Q){return X.__H.__h=[],n.__e(Q,X.__v),!0}}),D=[]}function ye(X){X.t&&X.t()}function Se(X){var Q=X.__();typeof Q=="function"&&(X.t=Q)}function pe(X,Q){return!X||Q.some(function(re,ue){return re!==X[ue]})}function Oe(X,Q){return typeof Q=="function"?Q(X):Q}function Le(X,Q){for(var re in Q)X[re]=Q[re];return X}function _e(X,Q){for(var re in X)if(re!=="__source"&&!(re in Q))return!0;for(var ue in Q)if(ue!=="__source"&&X[ue]!==Q[ue])return!0;return!1}n.__r=function(X){B&&B(X),I=0,($=X.__c).__H&&($.__H.__h.forEach(ye),$.__H.__h.forEach(Se),$.__H.__h=[])},n.diffed=function(X){U&&U(X);var Q=X.__c;if(Q){var re=Q.__H;re&&re.__h.length&&(D.push(Q)!==1&&K===n.requestAnimationFrame||((K=n.requestAnimationFrame)||function(ue){var xe,Me=function(){clearTimeout(ze),cancelAnimationFrame(xe),setTimeout(ue)},ze=setTimeout(Me,100);typeof window!="undefined"&&(xe=requestAnimationFrame(Me))})(le))}},n.__c=function(X,Q){Q.some(function(re){try{re.__h.forEach(ye),re.__h=re.__h.filter(function(ue){return!ue.__||Se(ue)})}catch(ue){Q.some(function(xe){xe.__h&&(xe.__h=[])}),Q=[],n.__e(ue,re.__v)}}),J&&J(X,Q)},n.unmount=function(X){G&&G(X);var Q=X.__c;if(Q){var re=Q.__H;if(re)try{re.__.forEach(function(ue){return ue.t&&ue.t()})}catch(ue){n.__e(ue,Q.__v)}}},t.d(e,"version",function(){return rt}),t.d(e,"Children",function(){return de}),t.d(e,"render",function(){return He}),t.d(e,"hydrate",function(){return tt}),t.d(e,"unmountComponentAtNode",function(){return Qe}),t.d(e,"createPortal",function(){return Ge}),t.d(e,"createFactory",function(){return Ye}),t.d(e,"cloneElement",function(){return Xe}),t.d(e,"isValidElement",function(){return Ae}),t.d(e,"findDOMNode",function(){return Ce}),t.d(e,"PureComponent",function(){return Fe}),t.d(e,"memo",function(){return qe}),t.d(e,"forwardRef",function(){return je}),t.d(e,"unstable_batchedUpdates",function(){return Ke}),t.d(e,"Suspense",function(){return ge}),t.d(e,"SuspenseList",function(){return we}),t.d(e,"lazy",function(){return De}),t.d(e,"useState",function(){return Y}),t.d(e,"useReducer",function(){return ee}),t.d(e,"useEffect",function(){return te}),t.d(e,"useLayoutEffect",function(){return oe}),t.d(e,"useRef",function(){return fe}),t.d(e,"useImperativeHandle",function(){return ne}),t.d(e,"useMemo",function(){return ce}),t.d(e,"useCallback",function(){return se}),t.d(e,"useContext",function(){return ae}),t.d(e,"useDebugValue",function(){return he}),t.d(e,"useErrorBoundary",function(){return me}),t.d(e,"createElement",function(){return E}),t.d(e,"createContext",function(){return Z}),t.d(e,"createRef",function(){return k}),t.d(e,"Fragment",function(){return O}),t.d(e,"Component",function(){return M});var Fe=function(X){var Q,re;function ue(xe){var Me;return(Me=X.call(this,xe)||this).isPureReactComponent=!0,Me}return re=X,(Q=ue).prototype=Object.create(re.prototype),Q.prototype.constructor=Q,Q.__proto__=re,ue.prototype.shouldComponentUpdate=function(xe,Me){return _e(this.props,xe)||_e(this.state,Me)},ue}(M);function qe(X,Q){function re(xe){var Me=this.props.ref,ze=Me==xe.ref;return!ze&&Me&&(Me.call?Me(null):Me.current=null),Q?!Q(this.props,xe)||!ze:_e(this.props,xe)}function ue(xe){return this.shouldComponentUpdate=re,E(X,Le({},xe))}return ue.prototype.isReactComponent=!0,ue.displayName="Memo("+(X.displayName||X.name)+")",ue.t=!0,ue}var Ee=n.__b;function je(X){function Q(re){var ue=Le({},re);return delete ue.ref,X(ue,re.ref)}return Q.prototype.isReactComponent=Q.t=!0,Q.displayName="ForwardRef("+(X.displayName||X.name)+")",Q}n.__b=function(X){X.type&&X.type.t&&X.ref&&(X.props.ref=X.ref,X.ref=null),Ee&&Ee(X)};var ie=function(X,Q){return X?H(X).reduce(function(re,ue,xe){return re.concat(Q(ue,xe))},[]):null},de={map:ie,forEach:ie,count:function(X){return X?H(X).length:0},only:function(X){if((X=H(X)).length!==1)throw new Error("Children.only() expects only one child.");return X[0]},toArray:H},ke=n.__e;function Be(X){return X&&((X=Le({},X)).__c=null,X.__k=X.__k&&X.__k.map(Be)),X}function ge(){this.__u=0,this.o=null,this.__b=null}function Ue(X){var Q=X.__.__c;return Q&&Q.u&&Q.u(X)}function De(X){var Q,re,ue;function xe(Me){if(Q||(Q=X()).then(function(ze){re=ze.default||ze},function(ze){ue=ze}),ue)throw ue;if(!re)throw Q;return E(re,Me)}return xe.displayName="Lazy",xe.t=!0,xe}function we(){this.i=null,this.l=null}n.__e=function(X,Q,re){if(X.then){for(var ue,xe=Q;xe=xe.__;)if((ue=xe.__c)&&ue.__c)return ue.__c(X,Q.__c)}ke(X,Q,re)},(ge.prototype=new M).__c=function(X,Q){var re=this;re.o==null&&(re.o=[]),re.o.push(Q);var ue=Ue(re.__v),xe=!1,Me=function(){xe||(xe=!0,ue?ue(ze):ze())};Q.__c=Q.componentWillUnmount,Q.componentWillUnmount=function(){Me(),Q.__c&&Q.__c()};var ze=function(){var $e;if(!--re.__u)for(re.__v.__k[0]=re.state.u,re.setState({u:re.__b=null});$e=re.o.pop();)$e.forceUpdate()};re.__u++||re.setState({u:re.__b=re.__v.__k[0]}),X.then(Me,Me)},ge.prototype.render=function(X,Q){return this.__b&&(this.__v.__k[0]=Be(this.__b),this.__b=null),[E(M,null,Q.u?null:X.children),Q.u&&X.fallback]};var Ve=function(X,Q,re){if(++re[1]===re[0]&&X.l.delete(Q),X.props.revealOrder&&(X.props.revealOrder[0]!=="t"||!X.l.size))for(re=X.i;re;){for(;re.length>3;)re.pop()();if(re[1]<re[0])break;X.i=re=re[2]}};(we.prototype=new M).u=function(X){var Q=this,re=Ue(Q.__v),ue=Q.l.get(X);return ue[0]++,function(xe){var Me=function(){Q.props.revealOrder?(ue.push(xe),Ve(Q,X,ue)):xe()};re?re(Me):Me()}},we.prototype.render=function(X){this.i=null,this.l=new Map;var Q=H(X.children);X.revealOrder&&X.revealOrder[0]==="b"&&Q.reverse();for(var re=Q.length;re--;)this.l.set(Q[re],this.i=[1,0,this.i]);return X.children},we.prototype.componentDidUpdate=we.prototype.componentDidMount=function(){var X=this;X.l.forEach(function(Q,re){Ve(X,re,Q)})};var et=function(){function X(){}var Q=X.prototype;return Q.getChildContext=function(){return this.props.context},Q.render=function(re){return re.children},X}();function Ie(X){var Q=this,re=X.container,ue=E(et,{context:Q.context},X.vnode);return Q.s&&Q.s!==re&&(Q.v.parentNode&&Q.s.removeChild(Q.v),w(Q.h),Q.p=!1),X.vnode?Q.p?(re.__k=Q.__k,P(ue,re),Q.__k=re.__k):(Q.v=document.createTextNode(""),T("",re),re.appendChild(Q.v),Q.p=!0,Q.s=re,P(ue,re,Q.v),Q.__k=Q.v.__k):Q.p&&(Q.v.parentNode&&Q.s.removeChild(Q.v),w(Q.h)),Q.h=ue,Q.componentWillUnmount=function(){Q.v.parentNode&&Q.s.removeChild(Q.v),w(Q.h)},null}function Ge(X,Q){return E(Ie,{vnode:X,container:Q})}var Je=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;M.prototype.isReactComponent={};var Re=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103;function He(X,Q,re){if(Q.__k==null)for(;Q.firstChild;)Q.removeChild(Q.firstChild);return P(X,Q),typeof re=="function"&&re(),X?X.__c:null}function tt(X,Q,re){return T(X,Q),typeof re=="function"&&re(),X?X.__c:null}var Te=n.event;function We(X,Q){X["UNSAFE_"+Q]&&!X[Q]&&Object.defineProperty(X,Q,{configurable:!1,get:function(){return this["UNSAFE_"+Q]},set:function(re){this["UNSAFE_"+Q]=re}})}n.event=function(X){Te&&(X=Te(X)),X.persist=function(){};var Q=!1,re=!1,ue=X.stopPropagation;X.stopPropagation=function(){ue.call(X),Q=!0};var xe=X.preventDefault;return X.preventDefault=function(){xe.call(X),re=!0},X.isPropagationStopped=function(){return Q},X.isDefaultPrevented=function(){return re},X.nativeEvent=X};var Ze={configurable:!0,get:function(){return this.class}},Pe=n.vnode;n.vnode=function(X){X.$$typeof=Re;var Q=X.type,re=X.props;if(Q){if(re.class!=re.className&&(Ze.enumerable="className"in re,re.className!=null&&(re.class=re.className),Object.defineProperty(re,"className",Ze)),typeof Q!="function"){var ue,xe,Me;for(Me in re.defaultValue&&re.value!==void 0&&(re.value||re.value===0||(re.value=re.defaultValue),delete re.defaultValue),Array.isArray(re.value)&&re.multiple&&Q==="select"&&(H(re.children).forEach(function(ze){re.value.indexOf(ze.props.value)!=-1&&(ze.props.selected=!0)}),delete re.value),re)if(ue=Je.test(Me))break;if(ue)for(Me in xe=X.props={},re)xe[Je.test(Me)?Me.replace(/[A-Z0-9]/,"-$&").toLowerCase():Me]=re[Me]}(function(ze){var $e=X.type,it=X.props;if(it&&typeof $e=="string"){var Ne={};for(var ve in it)/^on(Ani|Tra|Tou)/.test(ve)&&(it[ve.toLowerCase()]=it[ve],delete it[ve]),Ne[ve.toLowerCase()]=ve;if(Ne.ondoubleclick&&(it.ondblclick=it[Ne.ondoubleclick],delete it[Ne.ondoubleclick]),Ne.onbeforeinput&&(it.onbeforeinput=it[Ne.onbeforeinput],delete it[Ne.onbeforeinput]),Ne.onchange&&($e==="textarea"||$e.toLowerCase()==="input"&&!/^fil|che|ra/i.test(it.type))){var st=Ne.oninput||"oninput";it[st]||(it[st]=it[Ne.onchange],delete it[Ne.onchange])}}})(),typeof Q=="function"&&!Q.m&&Q.prototype&&(We(Q.prototype,"componentWillMount"),We(Q.prototype,"componentWillReceiveProps"),We(Q.prototype,"componentWillUpdate"),Q.m=!0)}Pe&&Pe(X)};var rt="16.8.0";function Ye(X){return E.bind(null,X)}function Ae(X){return!!X&&X.$$typeof===Re}function Xe(X){return Ae(X)?q.apply(null,arguments):X}function Qe(X){return!!X.__k&&(P(null,X),!0)}function Ce(X){return X&&(X.base||X.nodeType===1&&X)||null}var Ke=function(X,Q){return X(Q)};e.default={useState:Y,useReducer:ee,useEffect:te,useLayoutEffect:oe,useRef:fe,useImperativeHandle:ne,useMemo:ce,useCallback:se,useContext:ae,useDebugValue:he,version:"16.8.0",Children:de,render:He,hydrate:He,unmountComponentAtNode:Qe,createPortal:Ge,createElement:E,createContext:Z,createFactory:Ye,cloneElement:Xe,createRef:k,Fragment:O,isValidElement:Ae,findDOMNode:Ce,Component:M,PureComponent:Fe,memo:qe,forwardRef:je,unstable_batchedUpdates:Ke,Suspense:ge,SuspenseList:we,lazy:De}}])})})(pl);var Fm=d0(pl.exports);function Dm({mustBeMetaMask:i=!1,silent:r=!1,timeout:o=3e3}={}){t();let e=!1;return new Promise(n=>{window.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},o));function c(){if(e)return;e=!0,window.removeEventListener("ethereum#initialized",c);const{ethereum:p}=window;p&&(!i||p.isMetaMask)?n(p):(!r&&console.error("@metamask/detect-provider:",i&&p?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),n(null))}});function t(){if(typeof i!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof r!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof o!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}var zm=Dm;const Ha=h0("waveportal",{state:()=>({account:null,balance:null,network:{chainId:null},loading:!1}),getters:{ethereum(){return window.ethereum},provider(i){return new cf(ethereum)},isConnected:i=>!!i.account},actions:{async initialize(){const i=await this.ethereum.request({method:"eth_chainId"});this.network.chainId=i,this.ethereum.on("chainChanged",()=>{window.location.reload()})},async connectWallet(i){i=="metamask"?await this.useMetamask():await this.useWalletConnect()},async useMetamask(){const i=await zm();if(i&&i==this.ethereum){const r=await this.ethereum.request({method:"eth_requestAccounts"}),o=await this.ethereum.request({method:"eth_chainId"});this.provider.getSigner(r[0]),this.account=r[0],this.network.chainId=o,this.ethereum.on("accountsChanged",e=>{this.account=e[0]}),this.ethereum.on("networkChanged",e=>{this.account=e[0]})}else alert("Metamask is not installed")},async useWalletConnect(){const i=new Fm({infuraId:"62f3555371db4581aba56bbe1a7b063d"});await i.enable();const e=await(await new cf(i).getSigner()).getAddress();this.account=e,this.network.chainId=await i.request({method:"eth_chainId"}),i.on("disconnect",(t,n)=>{this.account=null,this.network.chainId=null}),i.on("accountsChanged",t=>{t.length>0&&(this.account=t[0])}),i.on("chainChanged",t=>{this.network.chainId=t})},outAccount(){alert("You should use Metamask or walletConnect unlink your account")},reload(){window.location.reload()}}}),Hm=Bt("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),Wm=Bt("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),Km=[Hm,Wm],Zs={__name:"ALoading",props:{isLarge:{type:Boolean,required:!1,default:!1}},setup(i){const r=i;return(o,e)=>(Vt(),tn("svg",{class:To([r.isLarge?"w-8 h-8":"w-4 h-4","inline ml-1 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300"]),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Km,2))}};var $m="https://keylab.cc/testConnect/wallet.svg",Vm="https://keylab.cc/testConnect/metamask.png",Gm="https://keylab.cc/testConnect/walletconnect.svg";function Or(i,r,...o){if(i in r){let t=r[i];return typeof t=="function"?t(...o):t}let e=new Error(`Tried to handle "${i}" but there is no handler defined. Only defined handlers are: ${Object.keys(r).map(t=>`"${t}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Or),e}var Ao=(i=>(i[i.None=0]="None",i[i.RenderStrategy=1]="RenderStrategy",i[i.Static=2]="Static",i))(Ao||{}),wn=(i=>(i[i.Unmount=0]="Unmount",i[i.Hidden=1]="Hidden",i))(wn||{});function gr({visible:i=!0,features:r=0,ourProps:o,theirProps:e,...t}){var n;let c=Jm(e,o),p=Object.assign(t,{props:c});if(i||r&2&&c.static)return ys(p);if(r&1){let a=(n=c.unmount)==null||n?0:1;return Or(a,{[0](){return null},[1](){return ys({...t,props:{...c,hidden:!0,style:{display:"none"}}})}})}return ys(p)}function ys({props:i,attrs:r,slots:o,slot:e,name:t}){var n;let{as:c,...p}=vl(i,["unmount","static"]),a=(n=o.default)==null?void 0:n.call(o,e),f={};if(c==="template"){if(a=bl(a),Object.keys(p).length>0||Object.keys(r).length>0){let[s,...u]=a!=null?a:[];if(!Zm(s)||u.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${t} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(p).concat(Object.keys(r)).sort((h,v)=>h.localeCompare(v)).map(h=>` - ${h}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(`
`)].join(`
`));return nn(s,Object.assign({},p,f))}return Array.isArray(a)&&a.length===1?a[0]:a}return Xt(c,Object.assign({},p,f),a)}function bl(i){return i.flatMap(r=>r.type===rr?bl(r.children):[r])}function Jm(...i){if(i.length===0)return{};if(i.length===1)return i[0];let r={},o={};for(let e of i)for(let t in e)t.startsWith("on")&&typeof e[t]=="function"?(o[t]!=null||(o[t]=[]),o[t].push(e[t])):r[t]=e[t];if(r.disabled||r["aria-disabled"])return Object.assign(r,Object.fromEntries(Object.keys(o).map(e=>[e,void 0])));for(let e in o)Object.assign(r,{[e](t,...n){let c=o[e];for(let p of c){if(t!=null&&t.defaultPrevented)return;p(t,...n)}}});return r}function vl(i,r=[]){let o=Object.assign({},i);for(let e of r)e in o&&delete o[e];return o}function Zm(i){return i==null?!1:typeof i.type=="string"||typeof i.type=="object"||typeof i.type=="function"}let Ym=0;function Xm(){return++Ym}function Hn(){return Xm()}var yl=(i=>(i.Space=" ",i.Enter="Enter",i.Escape="Escape",i.Backspace="Backspace",i.Delete="Delete",i.ArrowLeft="ArrowLeft",i.ArrowUp="ArrowUp",i.ArrowRight="ArrowRight",i.ArrowDown="ArrowDown",i.Home="Home",i.End="End",i.PageUp="PageUp",i.PageDown="PageDown",i.Tab="Tab",i))(yl||{});function un(i){var r;return i==null||i.value==null?null:(r=i.value.$el)!=null?r:i.value}let wl=Symbol("Context");var Dn=(i=>(i[i.Open=0]="Open",i[i.Closed=1]="Closed",i))(Dn||{});function Qm(){return Wa()!==null}function Wa(){return ir(wl,null)}function eg(i){Kr(wl,i)}function gi(i){if(typeof window=="undefined")return null;if(i instanceof Node)return i.ownerDocument;if(i!=null&&i.hasOwnProperty("value")){let r=un(i);if(r)return r.ownerDocument}return document}let Ys=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(i=>`${i}:not([tabindex='-1'])`).join(",");var Hi=(i=>(i[i.First=1]="First",i[i.Previous=2]="Previous",i[i.Next=4]="Next",i[i.Last=8]="Last",i[i.WrapAround=16]="WrapAround",i[i.NoScroll=32]="NoScroll",i))(Hi||{}),_l=(i=>(i[i.Error=0]="Error",i[i.Overflow=1]="Overflow",i[i.Success=2]="Success",i[i.Underflow=3]="Underflow",i))(_l||{}),tg=(i=>(i[i.Previous=-1]="Previous",i[i.Next=1]="Next",i))(tg||{});function rg(i=document.body){return i==null?[]:Array.from(i.querySelectorAll(Ys))}var xl=(i=>(i[i.Strict=0]="Strict",i[i.Loose=1]="Loose",i))(xl||{});function ng(i,r=0){var o;return i===((o=gi(i))==null?void 0:o.body)?!1:Or(r,{[0](){return i.matches(Ys)},[1](){let e=i;for(;e!==null;){if(e.matches(Ys))return!0;e=e.parentElement}return!1}})}function Ni(i){i==null||i.focus({preventScroll:!0})}let ig=["textarea","input"].join(",");function og(i){var r,o;return(o=(r=i==null?void 0:i.matches)==null?void 0:r.call(i,ig))!=null?o:!1}function sg(i,r=o=>o){return i.slice().sort((o,e)=>{let t=r(o),n=r(e);if(t===null||n===null)return 0;let c=t.compareDocumentPosition(n);return c&Node.DOCUMENT_POSITION_FOLLOWING?-1:c&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Xs(i,r,o=!0){var e;let t=(e=Array.isArray(i)?i.length>0?i[0].ownerDocument:document:i==null?void 0:i.ownerDocument)!=null?e:document,n=Array.isArray(i)?o?sg(i):i:rg(i),c=t.activeElement,p=(()=>{if(r&5)return 1;if(r&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(r&1)return 0;if(r&2)return Math.max(0,n.indexOf(c))-1;if(r&4)return Math.max(0,n.indexOf(c))+1;if(r&8)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=r&32?{preventScroll:!0}:{},s=0,u=n.length,h;do{if(s>=u||s+u<=0)return 0;let v=a+s;if(r&16)v=(v+u)%u;else{if(v<0)return 3;if(v>=u)return 1}h=n[v],h==null||h.focus(f),s+=p}while(h!==t.activeElement);return h.hasAttribute("tabindex")||h.setAttribute("tabindex","0"),r&6&&og(h)&&h.select(),2}function Qs(i,r,o){typeof window!="undefined"&&$r(e=>{window.addEventListener(i,r,o),e(()=>window.removeEventListener(i,r,o))})}function ag(i,r,o=It(()=>!0)){function e(t,n){if(!o.value||t.defaultPrevented)return;let c=n(t);if(c===null||!c.ownerDocument.documentElement.contains(c))return;let p=function a(f){return typeof f=="function"?a(f()):Array.isArray(f)||f instanceof Set?f:[f]}(i);for(let a of p){if(a===null)continue;let f=a instanceof HTMLElement?a:un(a);if(f!=null&&f.contains(c))return}return!ng(c,xl.Loose)&&c.tabIndex!==-1&&t.preventDefault(),r(t,c)}Qs("click",t=>e(t,n=>n.target),!0),Qs("blur",t=>e(t,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}var Ro=(i=>(i[i.None=1]="None",i[i.Focusable=2]="Focusable",i[i.Hidden=4]="Hidden",i))(Ro||{});let ea=pr({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(i,{slots:r,attrs:o}){return()=>{let{features:e,...t}=i,n={"aria-hidden":(e&2)===2?!0:void 0,style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(e&4)===4&&(e&2)!==2&&{display:"none"}}};return gr({ourProps:n,theirProps:t,slot:{},attrs:o,slots:r,name:"Hidden"})}}});var ta=(i=>(i[i.Forwards=0]="Forwards",i[i.Backwards=1]="Backwards",i))(ta||{});function ug(){let i=kt(0);return Qs("keydown",r=>{r.key==="Tab"&&(i.value=r.shiftKey?1:0)}),i}function Ml(i,r,o,e){typeof window!="undefined"&&$r(t=>{i=i!=null?i:window,i.addEventListener(r,o,e),t(()=>i.removeEventListener(r,o,e))})}var El=(i=>(i[i.None=1]="None",i[i.InitialFocus=2]="InitialFocus",i[i.TabLock=4]="TabLock",i[i.FocusLock=8]="FocusLock",i[i.RestoreFocus=16]="RestoreFocus",i[i.All=30]="All",i))(El||{});let xi=Object.assign(pr({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null},features:{type:Number,default:30},containers:{type:Object,default:kt(new Set)}},inheritAttrs:!1,setup(i,{attrs:r,slots:o,expose:e}){let t=kt(null);e({el:t,$el:t});let n=It(()=>gi(t));fg({ownerDocument:n},It(()=>Boolean(i.features&16)));let c=cg({ownerDocument:n,container:t,initialFocus:It(()=>i.initialFocus)},It(()=>Boolean(i.features&2)));lg({ownerDocument:n,container:t,containers:i.containers,previousActiveElement:c},It(()=>Boolean(i.features&8)));let p=ug();function a(){let f=un(t);!f||Or(p.value,{[ta.Forwards]:()=>Xs(f,Hi.First),[ta.Backwards]:()=>Xs(f,Hi.Last)})}return()=>{let f={},s={ref:t},{features:u,initialFocus:h,containers:v,...b}=i;return Xt(rr,[Boolean(u&4)&&Xt(ea,{as:"button",type:"button",onFocus:a,features:Ro.Focusable}),gr({ourProps:s,theirProps:{...r,...b},slot:f,attrs:r,slots:o,name:"FocusTrap"}),Boolean(u&4)&&Xt(ea,{as:"button",type:"button",onFocus:a,features:Ro.Focusable})])}}}),{features:El});function fg({ownerDocument:i},r){let o=kt(null),e={value:!1};Qt(()=>{En(r,(t,n)=>{var c;t!==n&&(!r.value||(e.value=!0,o.value||(o.value=(c=i.value)==null?void 0:c.activeElement)))},{immediate:!0}),En(r,(t,n,c)=>{t!==n&&(!r.value||c(()=>{e.value!==!1&&(e.value=!1,Ni(o.value),o.value=null)}))},{immediate:!0})})}function cg({ownerDocument:i,container:r,initialFocus:o},e){let t=kt(null);return Qt(()=>{En([r,o,e],(n,c)=>{if(n.every((a,f)=>(c==null?void 0:c[f])===a)||!e.value)return;let p=un(r);!p||requestAnimationFrame(()=>{var a,f;let s=un(o),u=(a=i.value)==null?void 0:a.activeElement;if(s){if(s===u){t.value=u;return}}else if(p.contains(u)){t.value=u;return}s?Ni(s):Xs(p,Hi.First|Hi.NoScroll)===_l.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),t.value=(f=i.value)==null?void 0:f.activeElement})},{immediate:!0,flush:"post"})}),t}function lg({ownerDocument:i,container:r,containers:o,previousActiveElement:e},t){var n;Ml((n=i.value)==null?void 0:n.defaultView,"focus",c=>{if(!t.value)return;let p=new Set(o==null?void 0:o.value);p.add(r);let a=e.value;if(!a)return;let f=c.target;f&&f instanceof HTMLElement?hg(p,f)?(e.value=f,Ni(f)):(c.preventDefault(),c.stopPropagation(),Ni(a)):Ni(e.value)},!0)}function hg(i,r){var o;for(let e of i)if((o=e.value)!=null&&o.contains(r))return!0;return!1}let lf="body > *",$n=new Set,gn=new Map;function hf(i){i.setAttribute("aria-hidden","true"),i.inert=!0}function df(i){let r=gn.get(i);!r||(r["aria-hidden"]===null?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden",r["aria-hidden"]),i.inert=r.inert)}function dg(i,r=kt(!0)){$r(o=>{if(!r.value||!i.value)return;let e=i.value,t=gi(e);if(t){$n.add(e);for(let n of gn.keys())n.contains(e)&&(df(n),gn.delete(n));t.querySelectorAll(lf).forEach(n=>{if(n instanceof HTMLElement){for(let c of $n)if(n.contains(c))return;$n.size===1&&(gn.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),hf(n))}}),o(()=>{if($n.delete(e),$n.size>0)t.querySelectorAll(lf).forEach(n=>{if(n instanceof HTMLElement&&!gn.has(n)){for(let c of $n)if(n.contains(c))return;gn.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),hf(n)}});else for(let n of gn.keys())df(n),gn.delete(n)})}})}let Sl=Symbol("ForcePortalRootContext");function pg(){return ir(Sl,!1)}let ra=pr({name:"ForcePortalRoot",props:{as:{type:[Object,String],default:"template"},force:{type:Boolean,default:!1}},setup(i,{slots:r,attrs:o}){return Kr(Sl,i.force),()=>{let{force:e,...t}=i;return gr({theirProps:t,ourProps:{},slot:{},slots:r,attrs:o,name:"ForcePortalRoot"})}}});function mg(i){let r=gi(i);if(!r){if(i===null)return null;throw new Error(`[Headless UI]: Cannot find ownerDocument for contextElement: ${i}`)}let o=r.getElementById("headlessui-portal-root");if(o)return o;let e=r.createElement("div");return e.setAttribute("id","headlessui-portal-root"),r.body.appendChild(e)}let kl=pr({name:"Portal",props:{as:{type:[Object,String],default:"div"}},setup(i,{slots:r,attrs:o}){let e=kt(null),t=It(()=>gi(e)),n=pg(),c=ir(Al,null),p=kt(n===!0||c==null?mg(e.value):c.resolveTarget());return $r(()=>{n||c!=null&&(p.value=c.resolveTarget())}),cn(()=>{var a,f;let s=(a=t.value)==null?void 0:a.getElementById("headlessui-portal-root");!s||p.value===s&&p.value.children.length<=0&&((f=p.value.parentElement)==null||f.removeChild(p.value))}),()=>{if(p.value===null)return null;let a={ref:e,"data-headlessui-portal":""};return Xt(xd,{to:p.value},gr({ourProps:a,theirProps:i,slot:{},attrs:o,slots:r,name:"Portal"}))}}}),Al=Symbol("PortalGroupContext"),gg=pr({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup(i,{attrs:r,slots:o}){let e=Wi({resolveTarget(){return i.target}});return Kr(Al,e),()=>{let{target:t,...n}=i;return gr({theirProps:n,ourProps:{},slot:{},attrs:r,slots:o,name:"PortalGroup"})}}}),Rl=Symbol("StackContext");var na=(i=>(i[i.Add=0]="Add",i[i.Remove=1]="Remove",i))(na||{});function bg(){return ir(Rl,()=>{})}function vg({type:i,element:r,onUpdate:o}){let e=bg();function t(...n){o==null||o(...n),e(...n)}Qt(()=>{t(0,i,r),cn(()=>{t(1,i,r)})}),Kr(Rl,t)}let Tl=Symbol("DescriptionContext");function yg(){let i=ir(Tl,null);if(i===null)throw new Error("Missing parent");return i}function wg({slot:i=kt({}),name:r="Description",props:o={}}={}){let e=kt([]);function t(n){return e.value.push(n),()=>{let c=e.value.indexOf(n);c!==-1&&e.value.splice(c,1)}}return Kr(Tl,{register:t,slot:i,name:r,props:o}),It(()=>e.value.length>0?e.value.join(" "):void 0)}let o2=pr({name:"Description",props:{as:{type:[Object,String],default:"p"}},setup(i,{attrs:r,slots:o}){let e=yg(),t=`headlessui-description-${Hn()}`;return Qt(()=>cn(e.register(t))),()=>{let{name:n="Description",slot:c=kt({}),props:p={}}=e,a=i,f={...Object.entries(p).reduce((s,[u,h])=>Object.assign(s,{[u]:ar(h)}),{}),id:t};return gr({ourProps:f,theirProps:a,slot:c.value,attrs:r,slots:o,name:n})}}});var _g=(i=>(i[i.Open=0]="Open",i[i.Closed=1]="Closed",i))(_g||{});let ia=Symbol("DialogContext");function Gi(i){let r=ir(ia,null);if(r===null){let o=new Error(`<${i} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,Gi),o}return r}let io="DC8F892D-2EBD-447C-A4C8-A03058436FF4",xg=pr({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:[Boolean,String],default:io},initialFocus:{type:Object,default:null}},emits:{close:i=>!0},setup(i,{emit:r,attrs:o,slots:e,expose:t}){var n;let c=kt(!1);Qt(()=>{c.value=!0});let p=kt(0),a=Wa(),f=It(()=>i.open===io&&a!==null?Or(a.value,{[Dn.Open]:!0,[Dn.Closed]:!1}):i.open),s=kt(new Set),u=kt(null),h=kt(null),v=It(()=>gi(u));if(t({el:u,$el:u}),!(i.open!==io||a!==null))throw new Error("You forgot to provide an `open` prop to the `Dialog`.");if(typeof f.value!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${f.value===io?void 0:i.open}`);let b=It(()=>c.value&&f.value?0:1),y=It(()=>b.value===0),_=It(()=>p.value>1),E=ir(ia,null)!==null,S=It(()=>_.value?"parent":"leaf");dg(u,It(()=>_.value?y.value:!1)),vg({type:"Dialog",element:u,onUpdate:(N,L,F)=>{if(L==="Dialog")return Or(N,{[na.Add](){s.value.add(F),p.value+=1},[na.Remove](){s.value.delete(F),p.value-=1}})}});let k=wg({name:"DialogDescription",slot:It(()=>({open:f.value}))}),O=`headlessui-dialog-${Hn()}`,M=kt(null),C={titleId:M,panelRef:kt(null),dialogState:b,setTitleId(N){M.value!==N&&(M.value=N)},close(){r("close",!1)}};return Kr(ia,C),ag(()=>{var N,L,F;return[...Array.from((L=(N=v.value)==null?void 0:N.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?L:[]).filter(V=>!(!(V instanceof HTMLElement)||V.contains(un(h))||C.panelRef.value&&V.contains(C.panelRef.value))),(F=C.panelRef.value)!=null?F:u.value]},(N,L)=>{C.close(),_a(()=>L==null?void 0:L.focus())},It(()=>b.value===0&&!_.value)),Ml((n=v.value)==null?void 0:n.defaultView,"keydown",N=>{N.defaultPrevented||N.key===yl.Escape&&b.value===0&&(_.value||(N.preventDefault(),N.stopPropagation(),C.close()))}),$r(N=>{var L;if(b.value!==0||E)return;let F=v.value;if(!F)return;let V=F==null?void 0:F.documentElement,H=(L=F.defaultView)!=null?L:window,z=V.style.overflow,R=V.style.paddingRight,l=H.innerWidth-V.clientWidth;if(V.style.overflow="hidden",l>0){let x=V.clientWidth-V.offsetWidth,d=l-x;V.style.paddingRight=`${d}px`}N(()=>{V.style.overflow=z,V.style.paddingRight=R})}),$r(N=>{if(b.value!==0)return;let L=un(u);if(!L)return;let F=new IntersectionObserver(V=>{for(let H of V)H.boundingClientRect.x===0&&H.boundingClientRect.y===0&&H.boundingClientRect.width===0&&H.boundingClientRect.height===0&&C.close()});F.observe(L),N(()=>F.disconnect())}),()=>{let N={...o,ref:u,id:O,role:"dialog","aria-modal":b.value===0?!0:void 0,"aria-labelledby":M.value,"aria-describedby":k.value},{open:L,initialFocus:F,...V}=i,H={open:b.value===0};return Xt(ra,{force:!0},()=>[Xt(kl,()=>Xt(gg,{target:u.value},()=>Xt(ra,{force:!1},()=>Xt(xi,{initialFocus:F,containers:s,features:y.value?Or(S.value,{parent:xi.features.RestoreFocus,leaf:xi.features.All&~xi.features.FocusLock}):xi.features.None},()=>gr({ourProps:N,theirProps:V,slot:H,attrs:o,slots:e,visible:b.value===0,features:Ao.RenderStrategy|Ao.Static,name:"Dialog"}))))),Xt(ea,{features:Ro.Hidden,ref:h})])}}});pr({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"}},setup(i,{attrs:r,slots:o}){let e=Gi("DialogOverlay"),t=`headlessui-dialog-overlay-${Hn()}`;function n(c){c.target===c.currentTarget&&(c.preventDefault(),c.stopPropagation(),e.close())}return()=>gr({ourProps:{id:t,"aria-hidden":!0,onClick:n},theirProps:i,slot:{open:e.dialogState.value===0},attrs:r,slots:o,name:"DialogOverlay"})}});pr({name:"DialogBackdrop",props:{as:{type:[Object,String],default:"div"}},inheritAttrs:!1,setup(i,{attrs:r,slots:o,expose:e}){let t=Gi("DialogBackdrop"),n=`headlessui-dialog-backdrop-${Hn()}`,c=kt(null);return e({el:c,$el:c}),Qt(()=>{if(t.panelRef.value===null)throw new Error("A <DialogBackdrop /> component is being used, but a <DialogPanel /> component is missing.")}),()=>{let p=i,a={id:n,ref:c,"aria-hidden":!0};return Xt(ra,{force:!0},()=>Xt(kl,()=>gr({ourProps:a,theirProps:{...r,...p},slot:{open:t.dialogState.value===0},attrs:r,slots:o,name:"DialogBackdrop"})))}}});let Mg=pr({name:"DialogPanel",props:{as:{type:[Object,String],default:"div"}},setup(i,{attrs:r,slots:o,expose:e}){let t=Gi("DialogPanel"),n=`headlessui-dialog-panel-${Hn()}`;e({el:t.panelRef,$el:t.panelRef});function c(p){p.stopPropagation()}return()=>{let p={id:n,ref:t.panelRef,onClick:c};return gr({ourProps:p,theirProps:i,slot:{open:t.dialogState.value===0},attrs:r,slots:o,name:"DialogPanel"})}}}),Eg=pr({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"}},setup(i,{attrs:r,slots:o}){let e=Gi("DialogTitle"),t=`headlessui-dialog-title-${Hn()}`;return Qt(()=>{e.setTitleId(t),cn(()=>e.setTitleId(null))}),()=>gr({ourProps:{id:t},theirProps:i,slot:{open:e.dialogState.value===0},attrs:r,slots:o,name:"DialogTitle"})}});function Sg(i){let r={called:!1};return(...o)=>{if(!r.called)return r.called=!0,i(...o)}}function Pl(){let i=[],r=[],o={enqueue(e){r.push(e)},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);o.add(()=>cancelAnimationFrame(t))},nextFrame(...e){o.requestAnimationFrame(()=>{o.requestAnimationFrame(...e)})},setTimeout(...e){let t=setTimeout(...e);o.add(()=>clearTimeout(t))},add(e){i.push(e)},dispose(){for(let e of i.splice(0))e()},async workQueue(){for(let e of r.splice(0))await e()}};return o}function ws(i,...r){i&&r.length>0&&i.classList.add(...r)}function oo(i,...r){i&&r.length>0&&i.classList.remove(...r)}var oa=(i=>(i.Finished="finished",i.Cancelled="cancelled",i))(oa||{});function kg(i,r){let o=Pl();if(!i)return o.dispose;let{transitionDuration:e,transitionDelay:t}=getComputedStyle(i),[n,c]=[e,t].map(p=>{let[a=0]=p.split(",").filter(Boolean).map(f=>f.includes("ms")?parseFloat(f):parseFloat(f)*1e3).sort((f,s)=>s-f);return a});return n!==0?o.setTimeout(()=>r("finished"),n+c):r("finished"),o.add(()=>r("cancelled")),o.dispose}function pf(i,r,o,e,t,n){let c=Pl(),p=n!==void 0?Sg(n):()=>{};return oo(i,...t),ws(i,...r,...o),c.nextFrame(()=>{oo(i,...o),ws(i,...e),c.add(kg(i,a=>(oo(i,...e,...r),ws(i,...t),p(a))))}),c.add(()=>oo(i,...r,...o,...e,...t)),c.add(()=>p("cancelled")),c.dispose}function Pn(i=""){return i.split(" ").filter(r=>r.trim().length>1)}let Ka=Symbol("TransitionContext");var Ag=(i=>(i.Visible="visible",i.Hidden="hidden",i))(Ag||{});function Rg(){return ir(Ka,null)!==null}function Tg(){let i=ir(Ka,null);if(i===null)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return i}function Pg(){let i=ir($a,null);if(i===null)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return i}let $a=Symbol("NestingContext");function Zo(i){return"children"in i?Zo(i.children):i.value.filter(({state:r})=>r==="visible").length>0}function Cl(i){let r=kt([]),o=kt(!1);Qt(()=>o.value=!0),cn(()=>o.value=!1);function e(n,c=wn.Hidden){let p=r.value.findIndex(({id:a})=>a===n);p!==-1&&(Or(c,{[wn.Unmount](){r.value.splice(p,1)},[wn.Hidden](){r.value[p].state="hidden"}}),!Zo(r)&&o.value&&(i==null||i()))}function t(n){let c=r.value.find(({id:p})=>p===n);return c?c.state!=="visible"&&(c.state="visible"):r.value.push({id:n,state:"visible"}),()=>e(n,wn.Unmount)}return{children:r,register:t,unregister:e}}let Il=Ao.RenderStrategy,sa=pr({props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(i,{emit:r,attrs:o,slots:e,expose:t}){if(!Rg()&&Qm())return()=>Xt(Ol,{...i,onBeforeEnter:()=>r("beforeEnter"),onAfterEnter:()=>r("afterEnter"),onBeforeLeave:()=>r("beforeLeave"),onAfterLeave:()=>r("afterLeave")},e);let n=kt(null),c=kt("visible"),p=It(()=>i.unmount?wn.Unmount:wn.Hidden);t({el:n,$el:n});let{show:a,appear:f}=Tg(),{register:s,unregister:u}=Pg(),h={value:!0},v=Hn(),b={value:!1},y=Cl(()=>{b.value||(c.value="hidden",u(v),r("afterLeave"))});Qt(()=>{let L=s(v);cn(L)}),$r(()=>{if(p.value===wn.Hidden&&!!v){if(a&&c.value!=="visible"){c.value="visible";return}Or(c.value,{hidden:()=>u(v),visible:()=>s(v)})}});let _=Pn(i.enter),E=Pn(i.enterFrom),S=Pn(i.enterTo),k=Pn(i.entered),O=Pn(i.leave),M=Pn(i.leaveFrom),C=Pn(i.leaveTo);Qt(()=>{$r(()=>{if(c.value==="visible"){let L=un(n);if(L instanceof Comment&&L.data==="")throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}})});function N(L){let F=h.value&&!f.value,V=un(n);!V||!(V instanceof HTMLElement)||F||(b.value=!0,a.value&&r("beforeEnter"),a.value||r("beforeLeave"),L(a.value?pf(V,_,E,S,k,H=>{b.value=!1,H===oa.Finished&&r("afterEnter")}):pf(V,O,M,C,k,H=>{b.value=!1,H===oa.Finished&&(Zo(y)||(c.value="hidden",u(v),r("afterLeave")))})))}return Qt(()=>{En([a],(L,F,V)=>{N(V),h.value=!1},{immediate:!0})}),Kr($a,y),eg(It(()=>Or(c.value,{visible:Dn.Open,hidden:Dn.Closed}))),()=>{let{appear:L,show:F,enter:V,enterFrom:H,enterTo:z,entered:R,leave:l,leaveFrom:x,leaveTo:d,...m}=i;return gr({theirProps:m,ourProps:{ref:n},slot:{},slots:e,attrs:o,features:Il,visible:c.value==="visible",name:"TransitionChild"})}}}),Cg=sa,Ol=pr({inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(i,{emit:r,attrs:o,slots:e}){let t=Wa(),n=It(()=>i.show===null&&t!==null?Or(t.value,{[Dn.Open]:!0,[Dn.Closed]:!1}):i.show);$r(()=>{if(![!0,!1].includes(n.value))throw new Error('A <Transition /> is used but it is missing a `:show="true | false"` prop.')});let c=kt(n.value?"visible":"hidden"),p=Cl(()=>{c.value="hidden"}),a=kt(!0),f={show:n,appear:It(()=>i.appear||!a.value)};return Qt(()=>{$r(()=>{a.value=!1,n.value?c.value="visible":Zo(p)||(c.value="hidden")})}),Kr($a,p),Kr(Ka,f),()=>{let s=vl(i,["show","appear","unmount","onBeforeEnter","onBeforeLeave","onAfterEnter","onAfterLeave"]),u={unmount:i.unmount};return gr({ourProps:{...u,as:"template"},theirProps:{},slot:{},slots:{...e,default:()=>[Xt(Cg,{onBeforeEnter:()=>r("beforeEnter"),onAfterEnter:()=>r("afterEnter"),onBeforeLeave:()=>r("beforeLeave"),onAfterLeave:()=>r("afterLeave"),...o,...u,...s},e.default)]},attrs:{},features:Il,visible:c.value==="visible",name:"Transition"})}}});function Ig(i,r){return Vt(),jn("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[Tt("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])}const Og=Bt("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),Ng={class:"fixed z-10 inset-0 overflow-y-auto"},Bg={class:"flex items-center justify-center w-full min-h-full p-4 text-center sm:p-0"},Lg={key:0,class:"flex justify-between items-center"},jg={__name:"AModal",props:{title:{type:String,required:!1},open:{type:Boolean,required:!1},hide:{type:Boolean,required:!1,default:!1}},emits:["close"],setup(i,{emit:r}){const o=i;return(e,t)=>(Vt(),jn(ar(Ol),{as:"template",show:o.open},{default:bn(()=>[Tt(ar(xg),{as:"div",class:"relative z-10 overflow-visible",onClose:t[1]||(t[1]=n=>e.$emit("close"))},{default:bn(()=>[Tt(ar(sa),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:bn(()=>[Og]),_:1}),Bt("div",Ng,[Bt("div",Bg,[Tt(ar(sa),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:bn(()=>[Tt(ar(Mg),{class:"relative bg-[#222124] rounded-lg px-4 py-4 md:py-8 text-left overflow-visible shadow-xl transform transition-all w-full md:w-1/4"},{default:bn(()=>[Bt("div",null,[i.hide?uo("",!0):(Vt(),tn("div",Lg,[Tt(ar(Eg),{as:"h3",class:"text-lg leading-6 font-medium text-white"},{default:bn(()=>[Ki(gf(o.title),1)]),_:1}),Tt(ar(Ig),{onClick:t[0]||(t[0]=n=>e.$emit("close")),class:"w-5 h-5 text-gray-300 hover:text-white cursor-pointer"})])),rd(e.$slots,"default")])]),_:3})]),_:3})])])]),_:3})]),_:3},8,["show"]))}},Ug={class:"flex flex-col space-y-2"},qg=Bt("img",{src:$m,width:"20",height:"auto",alt:"wallet",class:"inline-flex mr-1 pb-1"},null,-1),Fg=Ki(" Connect Wallet "),Dg=[qg,Fg],zg={class:"flex flex-col space-y-3 pt-5"},Hg={class:"text-white"},Wg=Ki("Metamask "),Kg=Bt("img",{src:Vm,alt:"MetaMask Logo",height:"auto",width:"25"},null,-1),$g={class:"text-white"},Vg=Ki("WalletConnect "),Gg=Bt("img",{src:Gm,alt:"WalletConnect Logo",height:"auto",width:"25"},null,-1),Jg={__name:"AConnectWallet",setup(i){const r=Ha(),o=kt(!1),e=kt({metamask:!1,walletconnect:!1});async function t(n){e.value[n]=!0,await r.connectWallet(n),e.value[n]=!1,o.value=!1}return(n,c)=>(Vt(),tn("div",null,[Bt("div",Ug,[ar(r).isConnected?uo("",!0):(Vt(),tn("button",{key:0,onClick:c[0]||(c[0]=p=>{o.value=!0}),class:"wave-button bg-white rounded font-semibold h-10 transition ease-in-out delay-150 hover:scale-105"},Dg))]),Tt(jg,{title:"Connect a wallet",open:o.value,onClose:c[3]||(c[3]=p=>o.value=!1)},{default:bn(()=>[Bt("div",zg,[Bt("div",{onClick:c[1]||(c[1]=p=>t("metamask")),class:"flex justify-between items-center rounded bg-light border border-[#40444f] hover:border-gray-500 cursor-pointer p-3"},[Bt("span",Hg,[Wg,e.value.metamask?(Vt(),jn(Zs,{key:0})):uo("",!0)]),Kg]),Bt("div",{onClick:c[2]||(c[2]=p=>t("walletconnect")),class:"flex justify-between items-center rounded bg-light border border-[#40444f] hover:border-gray-500 cursor-pointer p-3"},[Bt("span",$g,[Vg,e.value.walletconnect?(Vt(),jn(Zs,{key:0})):uo("",!0)]),Gg])])]),_:1},8,["open"])]))}},Zg={class:"w-9/12 md:w-3/5 mx-auto"},Yg=Bt("div",{class:"flex flex-col items-center justify-between"},[Bt("h1",{class:"font-serif text-white font-semibold text-3xl md:text-5xl pt-8 md:pt-10"}," THALER DAO LOGIN ")],-1),Xg={class:"w-full mx-auto"},Qg={key:1,class:"text-white text-center mt-[20px]"},e2={__name:"AWaveIntro",setup(i){const r=Ha();return(o,e)=>(Vt(),tn("div",Zg,[Yg,Bt("div",Xg,[ar(r).isConnected?(Vt(),tn("div",Qg,[Bt("div",null,gf(ar(r).account),1),Bt("div",{class:"hover:border-b-2 mt-[20px] w-[80px] mx-auto cursor-pointer border-white",onClick:e[0]||(e[0]=t=>ar(r).outAccount())},"LOGOUT")])):(Vt(),jn(Jg,{key:0}))])]))}},t2={class:"waveportal w-full h-full"},r2={key:0,class:"flex justify-center items-center h-full"},n2={key:1},i2={__name:"App",setup(i){const r=kt(!0);return Ha().initialize(),Qt(()=>r.value=!1),(e,t)=>(Vt(),tn("div",t2,[r.value?(Vt(),tn("div",r2,[Tt(Zs,{"is-large":""})])):(Vt(),tn("div",n2,[Tt(e2)]))]))}};i0(i2).use(a0()).mount("#app");