authorization-signer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -0
- package/package.json +27 -0
- package/snap.manifest.json +28 -0
package/dist/bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var t={543(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",c=16,u=32,f=64,l=128,h=256,d=1/0,p=9007199254740991,y=NaN,g=4294967295,m=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",u],["partialRight",f],["rearg",h]],b="[object Arguments]",w="[object Array]",v="[object Boolean]",x="[object Date]",E="[object Error]",A="[object Function]",I="[object GeneratorFunction]",B="[object Map]",_="[object Number]",k="[object Object]",P="[object Promise]",S="[object RegExp]",O="[object Set]",R="[object String]",U="[object Symbol]",C="[object WeakMap]",L="[object ArrayBuffer]",N="[object DataView]",T="[object Float32Array]",F="[object Float64Array]",K="[object Int8Array]",$="[object Int16Array]",D="[object Int32Array]",H="[object Uint8Array]",j="[object Uint8ClampedArray]",z="[object Uint16Array]",G="[object Uint32Array]",V=/\b__p \+= '';/g,M=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,Y=RegExp(W.source),J=RegExp(Z.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nt=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ot=RegExp(it.source),st=/^\s+/,at=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,ft=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,bt=/^\[object .+?Constructor\]$/,wt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,xt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Et=/($^)/,At=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",Bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",_t="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",Pt="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rt="['’]",Ut="["+It+"]",Ct="["+Ot+"]",Lt="["+Bt+"]",Nt="\\d+",Tt="["+_t+"]",Ft="["+kt+"]",Kt="[^"+It+Ot+Nt+_t+kt+Pt+"]",$t="\\ud83c[\\udffb-\\udfff]",Dt="[^"+It+"]",Ht="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",zt="["+Pt+"]",Gt="\\u200d",Vt="(?:"+Ft+"|"+Kt+")",Mt="(?:"+zt+"|"+Kt+")",qt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Zt="(?:"+Lt+"|"+$t+")"+"?",Yt="["+St+"]?",Jt=Yt+Zt+("(?:"+Gt+"(?:"+[Dt,Ht,jt].join("|")+")"+Yt+Zt+")*"),Xt="(?:"+[Tt,Ht,jt].join("|")+")"+Jt,Qt="(?:"+[Dt+Lt+"?",Lt,Ht,jt,Ut].join("|")+")",te=RegExp(Rt,"g"),ee=RegExp(Lt,"g"),ne=RegExp($t+"(?="+$t+")|"+Qt+Jt,"g"),re=RegExp([zt+"?"+Ft+"+"+qt+"(?="+[Ct,zt,"$"].join("|")+")",Mt+"+"+Wt+"(?="+[Ct,zt+Vt,"$"].join("|")+")",zt+"?"+Vt+"+"+qt,zt+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nt,Xt].join("|"),"g"),ie=RegExp("["+Gt+It+Bt+St+"]"),oe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ae=-1,ce={};ce[T]=ce[F]=ce[K]=ce[$]=ce[D]=ce[H]=ce[j]=ce[z]=ce[G]=!0,ce[b]=ce[w]=ce[L]=ce[v]=ce[N]=ce[x]=ce[E]=ce[A]=ce[B]=ce[_]=ce[k]=ce[S]=ce[O]=ce[R]=ce[C]=!1;var ue={};ue[b]=ue[w]=ue[L]=ue[N]=ue[v]=ue[x]=ue[T]=ue[F]=ue[K]=ue[$]=ue[D]=ue[B]=ue[_]=ue[k]=ue[S]=ue[O]=ue[R]=ue[U]=ue[H]=ue[j]=ue[z]=ue[G]=!0,ue[E]=ue[A]=ue[C]=!1;var fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,he=parseInt,de="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis,pe="object"==typeof self&&self&&self.Object===Object&&self,ye=de||pe||Function("return this")(),ge=e&&!e.nodeType&&e,me=ge&&t&&!t.nodeType&&t,be=me&&me.exports===ge,we=be&&de.process,ve=function(){try{var t=me&&me.require&&me.require("util").types;return t||we&&we.binding&&we.binding("util")}catch(t){}}(),xe=ve&&ve.isArrayBuffer,Ee=ve&&ve.isDate,Ae=ve&&ve.isMap,Ie=ve&&ve.isRegExp,Be=ve&&ve.isSet,_e=ve&&ve.isTypedArray;function ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Pe(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}function Se(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Oe(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Re(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ue(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Ce(t,e){return!!(null==t?0:t.length)&&ze(t,e,0)>-1}function Le(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ne(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Te(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Fe(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ke(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function $e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var De=qe("length");function He(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function je(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function ze(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):je(t,Ve,n)}function Ge(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Ve(t){return t!=t}function Me(t,e){var n=null==t?0:t.length;return n?Ye(t,e)/n:y}function qe(t){return function(e){return null==e?i:e[t]}}function We(t){return function(e){return null==t?i:t[e]}}function Ze(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function Ye(t,e){for(var n,r=-1,o=t.length;++r<o;){var s=e(t[r]);s!==i&&(n=n===i?s:n+s)}return n}function Je(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Xe(t){return t?t.slice(0,gn(t)+1).replace(st,""):t}function Qe(t){return function(e){return t(e)}}function tn(t,e){return Ne(e,function(e){return t[e]})}function en(t,e){return t.has(e)}function nn(t,e){for(var n=-1,r=t.length;++n<r&&ze(e,t[n],0)>-1;);return n}function rn(t,e){for(var n=t.length;n--&&ze(e,t[n],0)>-1;);return n}var on=We({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),sn=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(t){return"\\"+fe[t]}function cn(t){return ie.test(t)}function un(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function fn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n];s!==e&&s!==a||(t[n]=a,o[i++]=n)}return o}function hn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function dn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}function pn(t){return cn(t)?function(t){var e=ne.lastIndex=0;for(;ne.test(t);)++e;return e}(t):De(t)}function yn(t){return cn(t)?function(t){return t.match(ne)||[]}(t):function(t){return t.split("")}(t)}function gn(t){for(var e=t.length;e--&&at.test(t.charAt(e)););return e}var mn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"});var bn=function t(e){var n,r=(e=null==e?ye:bn.defaults(ye.Object(),e,bn.pick(ye,se))).Array,at=e.Date,It=e.Error,Bt=e.Function,_t=e.Math,kt=e.Object,Pt=e.RegExp,St=e.String,Ot=e.TypeError,Rt=r.prototype,Ut=Bt.prototype,Ct=kt.prototype,Lt=e["__core-js_shared__"],Nt=Ut.toString,Tt=Ct.hasOwnProperty,Ft=0,Kt=(n=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",$t=Ct.toString,Dt=Nt.call(kt),Ht=ye._,jt=Pt("^"+Nt.call(Tt).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=be?e.Buffer:i,Gt=e.Symbol,Vt=e.Uint8Array,Mt=zt?zt.allocUnsafe:i,qt=fn(kt.getPrototypeOf,kt),Wt=kt.create,Zt=Ct.propertyIsEnumerable,Yt=Rt.splice,Jt=Gt?Gt.isConcatSpreadable:i,Xt=Gt?Gt.iterator:i,Qt=Gt?Gt.toStringTag:i,ne=function(){try{var t=ho(kt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ie=e.clearTimeout!==ye.clearTimeout&&e.clearTimeout,fe=at&&at.now!==ye.Date.now&&at.now,de=e.setTimeout!==ye.setTimeout&&e.setTimeout,pe=_t.ceil,ge=_t.floor,me=kt.getOwnPropertySymbols,we=zt?zt.isBuffer:i,ve=e.isFinite,De=Rt.join,We=fn(kt.keys,kt),wn=_t.max,vn=_t.min,xn=at.now,En=e.parseInt,An=_t.random,In=Rt.reverse,Bn=ho(e,"DataView"),_n=ho(e,"Map"),kn=ho(e,"Promise"),Pn=ho(e,"Set"),Sn=ho(e,"WeakMap"),On=ho(kt,"create"),Rn=Sn&&new Sn,Un={},Cn=$o(Bn),Ln=$o(_n),Nn=$o(kn),Tn=$o(Pn),Fn=$o(Sn),Kn=Gt?Gt.prototype:i,$n=Kn?Kn.valueOf:i,Dn=Kn?Kn.toString:i;function Hn(t){if(na(t)&&!Vs(t)&&!(t instanceof Vn)){if(t instanceof Gn)return t;if(Tt.call(t,"__wrapped__"))return Do(t)}return new Gn(t)}var jn=function(){function t(){}return function(e){if(!ea(e))return{};if(Wt)return Wt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Mn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Zn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Wn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new qn(t);this.size=e.size}function Jn(t,e){var n=Vs(t),r=!n&&Gs(t),i=!n&&!r&&Zs(t),o=!n&&!r&&!i&&fa(t),s=n||r||i||o,a=s?Je(t.length,St):[],c=a.length;for(var u in t)!e&&!Tt.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||vo(u,c))||a.push(u);return a}function Xn(t){var e=t.length;return e?t[Zr(0,e-1)]:i}function Qn(t,e){return To(Oi(t),cr(e,0,t.length))}function tr(t){return To(Oi(t))}function er(t,e,n){(n!==i&&!Hs(t[e],n)||n===i&&!(e in t))&&sr(t,e,n)}function nr(t,e,n){var r=t[e];Tt.call(t,e)&&Hs(r,n)&&(n!==i||e in t)||sr(t,e,n)}function rr(t,e){for(var n=t.length;n--;)if(Hs(t[n][0],e))return n;return-1}function ir(t,e,n,r){return dr(t,function(t,i,o){e(r,t,n(t),o)}),r}function or(t,e){return t&&Ri(e,Ua(e),t)}function sr(t,e,n){"__proto__"==e&&ne?ne(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(t,e){for(var n=-1,o=e.length,s=r(o),a=null==t;++n<o;)s[n]=a?i:ka(t,e[n]);return s}function cr(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ur(t,e,n,r,o,s){var a,c=1&e,u=2&e,f=4&e;if(n&&(a=o?n(t,r,o,s):n(t)),a!==i)return a;if(!ea(t))return t;var l=Vs(t);if(l){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Tt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!c)return Oi(t,a)}else{var h=go(t),d=h==A||h==I;if(Zs(t))return Ii(t,c);if(h==k||h==b||d&&!o){if(a=u||d?{}:bo(t),!c)return u?function(t,e){return Ri(t,yo(t),e)}(t,function(t,e){return t&&Ri(e,Ca(e),t)}(a,t)):function(t,e){return Ri(t,po(t),e)}(t,or(a,t))}else{if(!ue[h])return o?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case L:return Bi(t);case v:case x:return new r(+t);case N:return function(t,e){var n=e?Bi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case F:case K:case $:case D:case H:case j:case z:case G:return _i(t,n);case B:return new r;case _:case R:return new r(t);case S:return function(t){var e=new t.constructor(t.source,yt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new r;case U:return i=t,$n?kt($n.call(i)):{}}var i}(t,h,c)}}s||(s=new Yn);var p=s.get(t);if(p)return p;s.set(t,a),aa(t)?t.forEach(function(r){a.add(ur(r,e,n,r,t,s))}):ra(t)&&t.forEach(function(r,i){a.set(i,ur(r,e,n,i,t,s))});var y=l?i:(f?u?oo:io:u?Ca:Ua)(t);return Se(y||t,function(r,i){y&&(r=t[i=r]),nr(a,i,ur(r,e,n,i,t,s))}),a}function fr(t,e,n){var r=n.length;if(null==t)return!r;for(t=kt(t);r--;){var o=n[r],s=e[o],a=t[o];if(a===i&&!(o in t)||!s(a))return!1}return!0}function lr(t,e,n){if("function"!=typeof t)throw new Ot(o);return Uo(function(){t.apply(i,n)},e)}function hr(t,e,n,r){var i=-1,o=Ce,s=!0,a=t.length,c=[],u=e.length;if(!a)return c;n&&(e=Ne(e,Qe(n))),r?(o=Le,s=!1):e.length>=200&&(o=en,s=!1,e=new Zn(e));t:for(;++i<a;){var f=t[i],l=null==n?f:n(f);if(f=r||0!==f?f:0,s&&l==l){for(var h=u;h--;)if(e[h]===l)continue t;c.push(f)}else o(e,l,r)||c.push(f)}return c}Hn.templateSettings={escape:X,evaluate:Q,interpolate:tt,variable:"",imports:{_:Hn}},Hn.prototype=zn.prototype,Hn.prototype.constructor=Hn,Gn.prototype=jn(zn.prototype),Gn.prototype.constructor=Gn,Vn.prototype=jn(zn.prototype),Vn.prototype.constructor=Vn,Mn.prototype.clear=function(){this.__data__=On?On(null):{},this.size=0},Mn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Mn.prototype.get=function(t){var e=this.__data__;if(On){var n=e[t];return n===s?i:n}return Tt.call(e,t)?e[t]:i},Mn.prototype.has=function(t){var e=this.__data__;return On?e[t]!==i:Tt.call(e,t)},Mn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=On&&e===i?s:e,this},qn.prototype.clear=function(){this.__data__=[],this.size=0},qn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,!0)},qn.prototype.get=function(t){var e=this.__data__,n=rr(e,t);return n<0?i:e[n][1]},qn.prototype.has=function(t){return rr(this.__data__,t)>-1},qn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new Mn,map:new(_n||qn),string:new Mn}},Wn.prototype.delete=function(t){var e=fo(this,t).delete(t);return this.size-=e?1:0,e},Wn.prototype.get=function(t){return fo(this,t).get(t)},Wn.prototype.has=function(t){return fo(this,t).has(t)},Wn.prototype.set=function(t,e){var n=fo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Zn.prototype.add=Zn.prototype.push=function(t){return this.__data__.set(t,s),this},Zn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new qn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!_n||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(t,e),this.size=n.size,this};var dr=Li(xr),pr=Li(Er,!0);function yr(t,e){var n=!0;return dr(t,function(t,r,i){return n=!!e(t,r,i)}),n}function gr(t,e,n){for(var r=-1,o=t.length;++r<o;){var s=t[r],a=e(s);if(null!=a&&(c===i?a==a&&!ua(a):n(a,c)))var c=a,u=s}return u}function mr(t,e){var n=[];return dr(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function br(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=wo),i||(i=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?br(a,e-1,n,r,i):Te(i,a):r||(i[i.length]=a)}return i}var wr=Ni(),vr=Ni(!0);function xr(t,e){return t&&wr(t,e,Ua)}function Er(t,e){return t&&vr(t,e,Ua)}function Ar(t,e){return Ue(e,function(e){return Xs(t[e])})}function Ir(t,e){for(var n=0,r=(e=vi(e,t)).length;null!=t&&n<r;)t=t[Ko(e[n++])];return n&&n==r?t:i}function Br(t,e,n){var r=e(t);return Vs(t)?r:Te(r,n(t))}function _r(t){return null==t?t===i?"[object Undefined]":"[object Null]":Qt&&Qt in kt(t)?function(t){var e=Tt.call(t,Qt),n=t[Qt];try{t[Qt]=i;var r=!0}catch(t){}var o=$t.call(t);r&&(e?t[Qt]=n:delete t[Qt]);return o}(t):function(t){return $t.call(t)}(t)}function kr(t,e){return t>e}function Pr(t,e){return null!=t&&Tt.call(t,e)}function Sr(t,e){return null!=t&&e in kt(t)}function Or(t,e,n){for(var o=n?Le:Ce,s=t[0].length,a=t.length,c=a,u=r(a),f=1/0,l=[];c--;){var h=t[c];c&&e&&(h=Ne(h,Qe(e))),f=vn(h.length,f),u[c]=!n&&(e||s>=120&&h.length>=120)?new Zn(c&&h):i}h=t[0];var d=-1,p=u[0];t:for(;++d<s&&l.length<f;){var y=h[d],g=e?e(y):y;if(y=n||0!==y?y:0,!(p?en(p,g):o(l,g,n))){for(c=a;--c;){var m=u[c];if(!(m?en(m,g):o(t[c],g,n)))continue t}p&&p.push(g),l.push(y)}}return l}function Rr(t,e,n){var r=null==(t=So(t,e=vi(e,t)))?t:t[Ko(Jo(e))];return null==r?i:ke(r,t,n)}function Ur(t){return na(t)&&_r(t)==b}function Cr(t,e,n,r,o){return t===e||(null==t||null==e||!na(t)&&!na(e)?t!=t&&e!=e:function(t,e,n,r,o,s){var a=Vs(t),c=Vs(e),u=a?w:go(t),f=c?w:go(e),l=(u=u==b?k:u)==k,h=(f=f==b?k:f)==k,d=u==f;if(d&&Zs(t)){if(!Zs(e))return!1;a=!0,l=!1}if(d&&!l)return s||(s=new Yn),a||fa(t)?no(t,e,n,r,o,s):function(t,e,n,r,i,o,s){switch(n){case N:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case L:return!(t.byteLength!=e.byteLength||!o(new Vt(t),new Vt(e)));case v:case x:case _:return Hs(+t,+e);case E:return t.name==e.name&&t.message==e.message;case S:case R:return t==e+"";case B:var a=un;case O:var c=1&r;if(a||(a=hn),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var f=no(a(t),a(e),r,i,o,s);return s.delete(t),f;case U:if($n)return $n.call(t)==$n.call(e)}return!1}(t,e,u,n,r,o,s);if(!(1&n)){var p=l&&Tt.call(t,"__wrapped__"),y=h&&Tt.call(e,"__wrapped__");if(p||y){var g=p?t.value():t,m=y?e.value():e;return s||(s=new Yn),o(g,m,n,r,s)}}if(!d)return!1;return s||(s=new Yn),function(t,e,n,r,o,s){var a=1&n,c=io(t),u=c.length,f=io(e),l=f.length;if(u!=l&&!a)return!1;var h=u;for(;h--;){var d=c[h];if(!(a?d in e:Tt.call(e,d)))return!1}var p=s.get(t),y=s.get(e);if(p&&y)return p==e&&y==t;var g=!0;s.set(t,e),s.set(e,t);var m=a;for(;++h<u;){var b=t[d=c[h]],w=e[d];if(r)var v=a?r(w,b,d,e,t,s):r(b,w,d,t,e,s);if(!(v===i?b===w||o(b,w,n,r,s):v)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var x=t.constructor,E=e.constructor;x==E||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof E&&E instanceof E||(g=!1)}return s.delete(t),s.delete(e),g}(t,e,n,r,o,s)}(t,e,n,r,Cr,o))}function Lr(t,e,n,r){var o=n.length,s=o,a=!r;if(null==t)return!s;for(t=kt(t);o--;){var c=n[o];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<s;){var u=(c=n[o])[0],f=t[u],l=c[1];if(a&&c[2]){if(f===i&&!(u in t))return!1}else{var h=new Yn;if(r)var d=r(f,l,u,t,e,h);if(!(d===i?Cr(l,f,3,r,h):d))return!1}}return!0}function Nr(t){return!(!ea(t)||(e=t,Kt&&Kt in e))&&(Xs(t)?jt:bt).test($o(t));var e}function Tr(t){return"function"==typeof t?t:null==t?ic:"object"==typeof t?Vs(t)?jr(t[0],t[1]):Hr(t):dc(t)}function Fr(t){if(!Bo(t))return We(t);var e=[];for(var n in kt(t))Tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Kr(t){if(!ea(t))return function(t){var e=[];if(null!=t)for(var n in kt(t))e.push(n);return e}(t);var e=Bo(t),n=[];for(var r in t)("constructor"!=r||!e&&Tt.call(t,r))&&n.push(r);return n}function $r(t,e){return t<e}function Dr(t,e){var n=-1,i=qs(t)?r(t.length):[];return dr(t,function(t,r,o){i[++n]=e(t,r,o)}),i}function Hr(t){var e=lo(t);return 1==e.length&&e[0][2]?ko(e[0][0],e[0][1]):function(n){return n===t||Lr(n,t,e)}}function jr(t,e){return Eo(t)&&_o(e)?ko(Ko(t),e):function(n){var r=ka(n,t);return r===i&&r===e?Pa(n,t):Cr(e,r,3)}}function zr(t,e,n,r,o){t!==e&&wr(e,function(s,a){if(o||(o=new Yn),ea(s))!function(t,e,n,r,o,s,a){var c=Oo(t,n),u=Oo(e,n),f=a.get(u);if(f)return void er(t,n,f);var l=s?s(c,u,n+"",t,e,a):i,h=l===i;if(h){var d=Vs(u),p=!d&&Zs(u),y=!d&&!p&&fa(u);l=u,d||p||y?Vs(c)?l=c:Ws(c)?l=Oi(c):p?(h=!1,l=Ii(u,!0)):y?(h=!1,l=_i(u,!0)):l=[]:oa(u)||Gs(u)?(l=c,Gs(c)?l=ba(c):ea(c)&&!Xs(c)||(l=bo(u))):h=!1}h&&(a.set(u,l),o(l,u,r,s,a),a.delete(u));er(t,n,l)}(t,e,a,n,zr,r,o);else{var c=r?r(Oo(t,a),s,a+"",t,e,o):i;c===i&&(c=s),er(t,a,c)}},Ca)}function Gr(t,e){var n=t.length;if(n)return vo(e+=e<0?n:0,n)?t[e]:i}function Vr(t,e,n){e=e.length?Ne(e,function(t){return Vs(t)?function(e){return Ir(e,1===t.length?t[0]:t)}:t}):[ic];var r=-1;e=Ne(e,Qe(uo()));var i=Dr(t,function(t,n,i){var o=Ne(e,function(e){return e(t)});return{criteria:o,index:++r,value:t}});return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,function(t,e){return function(t,e,n){var r=-1,i=t.criteria,o=e.criteria,s=i.length,a=n.length;for(;++r<s;){var c=ki(i[r],o[r]);if(c)return r>=a?c:c*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)})}function Mr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=Ir(t,s);n(a,s)&&ti(o,vi(s,t),a)}return o}function qr(t,e,n,r){var i=r?Ge:ze,o=-1,s=e.length,a=t;for(t===e&&(e=Oi(e)),n&&(a=Ne(t,Qe(n)));++o<s;)for(var c=0,u=e[o],f=n?n(u):u;(c=i(a,f,c,r))>-1;)a!==t&&Yt.call(a,c,1),Yt.call(t,c,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;vo(i)?Yt.call(t,i,1):hi(t,i)}}return t}function Zr(t,e){return t+ge(An()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>p)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Jr(t,e){return Co(Po(t,e,ic),t+"")}function Xr(t){return Xn(Ha(t))}function Qr(t,e){var n=Ha(t);return To(n,cr(e,0,n.length))}function ti(t,e,n,r){if(!ea(t))return t;for(var o=-1,s=(e=vi(e,t)).length,a=s-1,c=t;null!=c&&++o<s;){var u=Ko(e[o]),f=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var l=c[u];(f=r?r(l,u,c):i)===i&&(f=ea(l)?l:vo(e[o+1])?[]:{})}nr(c,u,f),c=c[u]}return t}var ei=Rn?function(t,e){return Rn.set(t,e),t}:ic,ni=ne?function(t,e){return ne(t,"toString",{configurable:!0,enumerable:!1,value:ec(e),writable:!0})}:ic;function ri(t){return To(Ha(t))}function ii(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var s=r(o);++i<o;)s[i]=t[i+e];return s}function oi(t,e){var n;return dr(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function si(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=t[o];null!==s&&!ua(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return ai(t,e,ic,n)}function ai(t,e,n,r){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=n(e))!=e,c=null===e,u=ua(e),f=e===i;o<s;){var l=ge((o+s)/2),h=n(t[l]),d=h!==i,p=null===h,y=h==h,g=ua(h);if(a)var m=r||y;else m=f?y&&(r||d):c?y&&d&&(r||!p):u?y&&d&&!p&&(r||!g):!p&&!g&&(r?h<=e:h<e);m?o=l+1:s=l}return vn(s,4294967294)}function ci(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Hs(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function ui(t){return"number"==typeof t?t:ua(t)?y:+t}function fi(t){if("string"==typeof t)return t;if(Vs(t))return Ne(t,fi)+"";if(ua(t))return Dn?Dn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function li(t,e,n){var r=-1,i=Ce,o=t.length,s=!0,a=[],c=a;if(n)s=!1,i=Le;else if(o>=200){var u=e?null:Yi(t);if(u)return hn(u);s=!1,i=en,c=new Zn}else c=e?[]:a;t:for(;++r<o;){var f=t[r],l=e?e(f):f;if(f=n||0!==f?f:0,s&&l==l){for(var h=c.length;h--;)if(c[h]===l)continue t;e&&c.push(l),a.push(f)}else i(c,l,n)||(c!==a&&c.push(l),a.push(f))}return a}function hi(t,e){var n=-1,r=(e=vi(e,t)).length;if(!r)return!0;for(;++n<r;){var i=Ko(e[n]);if("__proto__"===i&&!Tt.call(t,"__proto__"))return!1;if(("constructor"===i||"prototype"===i)&&n<r-1)return!1}var o=So(t,e);return null==o||delete o[Ko(Jo(e))]}function di(t,e,n,r){return ti(t,e,n(Ir(t,e)),r)}function pi(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ii(t,r?0:o,r?o+1:i):ii(t,r?o+1:0,r?i:o)}function yi(t,e){var n=t;return n instanceof Vn&&(n=n.value()),Fe(e,function(t,e){return e.func.apply(e.thisArg,Te([t],e.args))},n)}function gi(t,e,n){var i=t.length;if(i<2)return i?li(t[0]):[];for(var o=-1,s=r(i);++o<i;)for(var a=t[o],c=-1;++c<i;)c!=o&&(s[o]=hr(s[o]||a,t[c],e,n));return li(br(s,1),e,n)}function mi(t,e,n){for(var r=-1,o=t.length,s=e.length,a={};++r<o;){var c=r<s?e[r]:i;n(a,t[r],c)}return a}function bi(t){return Ws(t)?t:[]}function wi(t){return"function"==typeof t?t:ic}function vi(t,e){return Vs(t)?t:Eo(t,e)?[t]:Fo(wa(t))}var xi=Jr;function Ei(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ii(t,e,n)}var Ai=ie||function(t){return ye.clearTimeout(t)};function Ii(t,e){if(e)return t.slice();var n=t.length,r=Mt?Mt(n):new t.constructor(n);return t.copy(r),r}function Bi(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function _i(t,e){var n=e?Bi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ki(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,s=ua(t),a=e!==i,c=null===e,u=e==e,f=ua(e);if(!c&&!f&&!s&&t>e||s&&a&&u&&!c&&!f||r&&a&&u||!n&&u||!o)return 1;if(!r&&!s&&!f&&t<e||f&&n&&o&&!r&&!s||c&&n&&o||!a&&o||!u)return-1}return 0}function Pi(t,e,n,i){for(var o=-1,s=t.length,a=n.length,c=-1,u=e.length,f=wn(s-a,0),l=r(u+f),h=!i;++c<u;)l[c]=e[c];for(;++o<a;)(h||o<s)&&(l[n[o]]=t[o]);for(;f--;)l[c++]=t[o++];return l}function Si(t,e,n,i){for(var o=-1,s=t.length,a=-1,c=n.length,u=-1,f=e.length,l=wn(s-c,0),h=r(l+f),d=!i;++o<l;)h[o]=t[o];for(var p=o;++u<f;)h[p+u]=e[u];for(;++a<c;)(d||o<s)&&(h[p+n[a]]=t[o++]);return h}function Oi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ri(t,e,n,r){var o=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var c=e[s],u=r?r(n[c],t[c],c,n,t):i;u===i&&(u=t[c]),o?sr(n,c,u):nr(n,c,u)}return n}function Ui(t,e){return function(n,r){var i=Vs(n)?Pe:ir,o=e?e():{};return i(n,t,uo(r,2),o)}}function Ci(t){return Jr(function(e,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=t.length>3&&"function"==typeof s?(o--,s):i,a&&xo(n[0],n[1],a)&&(s=o<3?i:s,o=1),e=kt(e);++r<o;){var c=n[r];c&&t(e,c,r,s)}return e})}function Li(t,e){return function(n,r){if(null==n)return n;if(!qs(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=kt(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function Ni(t){return function(e,n,r){for(var i=-1,o=kt(e),s=r(e),a=s.length;a--;){var c=s[t?a:++i];if(!1===n(o[c],c,o))break}return e}}function Ti(t){return function(e){var n=cn(e=wa(e))?yn(e):i,r=n?n[0]:e.charAt(0),o=n?Ei(n,1).join(""):e.slice(1);return r[t]()+o}}function Fi(t){return function(e){return Fe(Xa(Ga(e).replace(te,"")),t,"")}}function Ki(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=jn(t.prototype),r=t.apply(n,e);return ea(r)?r:n}}function $i(t){return function(e,n,r){var o=kt(e);if(!qs(e)){var s=uo(n,3);e=Ua(e),n=function(t){return s(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[s?e[a]:a]:i}}function Di(t){return ro(function(e){var n=e.length,r=n,s=Gn.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new Ot(o);if(s&&!c&&"wrapper"==ao(a))var c=new Gn([],!0)}for(r=c?r:n;++r<n;){var u=ao(a=e[r]),f="wrapper"==u?so(a):i;c=f&&Ao(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?c[ao(f[0])].apply(c,f[3]):1==a.length&&Ao(a)?c[u]():c.thru(a)}return function(){var t=arguments,r=t[0];if(c&&1==t.length&&Vs(r))return c.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}})}function Hi(t,e,n,o,s,a,c,u,f,h){var d=e&l,p=1&e,y=2&e,g=24&e,m=512&e,b=y?i:Ki(t);return function l(){for(var w=arguments.length,v=r(w),x=w;x--;)v[x]=arguments[x];if(g)var E=co(l),A=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(v,E);if(o&&(v=Pi(v,o,s,g)),a&&(v=Si(v,a,c,g)),w-=A,g&&w<h){var I=ln(v,E);return Wi(t,e,Hi,l.placeholder,n,v,I,u,f,h-w)}var B=p?n:this,_=y?B[t]:t;return w=v.length,u?v=function(t,e){var n=t.length,r=vn(e.length,n),o=Oi(t);for(;r--;){var s=e[r];t[r]=vo(s,n)?o[s]:i}return t}(v,u):m&&w>1&&v.reverse(),d&&f<w&&(v.length=f),this&&this!==ye&&this instanceof l&&(_=b||Ki(_)),_.apply(B,v)}}function ji(t,e){return function(n,r){return function(t,e,n,r){return xr(t,function(t,i,o){e(r,n(t),i,o)}),r}(n,t,e(r),{})}}function zi(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=fi(n),r=fi(r)):(n=ui(n),r=ui(r)),o=t(n,r)}return o}}function Gi(t){return ro(function(e){return e=Ne(e,Qe(uo())),Jr(function(n){var r=this;return t(e,function(t){return ke(t,r,n)})})})}function Vi(t,e){var n=(e=e===i?" ":fi(e)).length;if(n<2)return n?Yr(e,t):e;var r=Yr(e,pe(t/pn(e)));return cn(e)?Ei(yn(r),0,t).join(""):r.slice(0,t)}function Mi(t){return function(e,n,o){return o&&"number"!=typeof o&&xo(e,n,o)&&(n=o=i),e=pa(e),n===i?(n=e,e=0):n=pa(n),function(t,e,n,i){for(var o=-1,s=wn(pe((e-t)/(n||1)),0),a=r(s);s--;)a[i?s:++o]=t,t+=n;return a}(e,n,o=o===i?e<n?1:-1:pa(o),t)}}function qi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ma(e),n=ma(n)),t(e,n)}}function Wi(t,e,n,r,o,s,a,c,l,h){var d=8&e;e|=d?u:f,4&(e&=~(d?f:u))||(e&=-4);var p=[t,e,o,d?s:i,d?a:i,d?i:s,d?i:a,c,l,h],y=n.apply(i,p);return Ao(t)&&Ro(y,p),y.placeholder=r,Lo(y,t,e)}function Zi(t){var e=_t[t];return function(t,n){if(t=ma(t),(n=null==n?0:vn(ya(n),292))&&ve(t)){var r=(wa(t)+"e").split("e");return+((r=(wa(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Yi=Pn&&1/hn(new Pn([,-0]))[1]==d?function(t){return new Pn(t)}:uc;function Ji(t){return function(e){var n=go(e);return n==B?un(e):n==O?dn(e):function(t,e){return Ne(e,function(e){return[e,t[e]]})}(e,t(e))}}function Xi(t,e,n,s,d,p,y,g){var m=2&e;if(!m&&"function"!=typeof t)throw new Ot(o);var b=s?s.length:0;if(b||(e&=-97,s=d=i),y=y===i?y:wn(ya(y),0),g=g===i?g:ya(g),b-=d?d.length:0,e&f){var w=s,v=d;s=d=i}var x=m?i:so(t),E=[t,e,n,s,d,w,v,p,y,g];if(x&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,s=r==l&&8==n||r==l&&n==h&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!s)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var c=e[3];if(c){var u=t[3];t[3]=u?Pi(u,c,e[4]):c,t[4]=u?ln(t[3],a):e[4]}(c=e[5])&&(u=t[5],t[5]=u?Si(u,c,e[6]):c,t[6]=u?ln(t[5],a):e[6]);(c=e[7])&&(t[7]=c);r&l&&(t[8]=null==t[8]?e[8]:vn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(E,x),t=E[0],e=E[1],n=E[2],s=E[3],d=E[4],!(g=E[9]=E[9]===i?m?0:t.length:wn(E[9]-b,0))&&24&e&&(e&=-25),e&&1!=e)A=8==e||e==c?function(t,e,n){var o=Ki(t);return function s(){for(var a=arguments.length,c=r(a),u=a,f=co(s);u--;)c[u]=arguments[u];var l=a<3&&c[0]!==f&&c[a-1]!==f?[]:ln(c,f);return(a-=l.length)<n?Wi(t,e,Hi,s.placeholder,i,c,l,i,i,n-a):ke(this&&this!==ye&&this instanceof s?o:t,this,c)}}(t,e,g):e!=u&&33!=e||d.length?Hi.apply(i,E):function(t,e,n,i){var o=1&e,s=Ki(t);return function e(){for(var a=-1,c=arguments.length,u=-1,f=i.length,l=r(f+c),h=this&&this!==ye&&this instanceof e?s:t;++u<f;)l[u]=i[u];for(;c--;)l[u++]=arguments[++a];return ke(h,o?n:this,l)}}(t,e,n,s);else var A=function(t,e,n){var r=1&e,i=Ki(t);return function e(){return(this&&this!==ye&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Lo((x?ei:Ro)(A,E),t,e)}function Qi(t,e,n,r){return t===i||Hs(t,Ct[n])&&!Tt.call(r,n)?e:t}function to(t,e,n,r,o,s){return ea(t)&&ea(e)&&(s.set(e,t),zr(t,e,i,to,s),s.delete(e)),t}function eo(t){return oa(t)?i:t}function no(t,e,n,r,o,s){var a=1&n,c=t.length,u=e.length;if(c!=u&&!(a&&u>c))return!1;var f=s.get(t),l=s.get(e);if(f&&l)return f==e&&l==t;var h=-1,d=!0,p=2&n?new Zn:i;for(s.set(t,e),s.set(e,t);++h<c;){var y=t[h],g=e[h];if(r)var m=a?r(g,y,h,e,t,s):r(y,g,h,t,e,s);if(m!==i){if(m)continue;d=!1;break}if(p){if(!$e(e,function(t,e){if(!en(p,e)&&(y===t||o(y,t,n,r,s)))return p.push(e)})){d=!1;break}}else if(y!==g&&!o(y,g,n,r,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function ro(t){return Co(Po(t,i,Mo),t+"")}function io(t){return Br(t,Ua,po)}function oo(t){return Br(t,Ca,yo)}var so=Rn?function(t){return Rn.get(t)}:uc;function ao(t){for(var e=t.name+"",n=Un[e],r=Tt.call(Un,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function co(t){return(Tt.call(Hn,"placeholder")?Hn:t).placeholder}function uo(){var t=Hn.iteratee||oc;return t=t===oc?Tr:t,arguments.length?t(arguments[0],arguments[1]):t}function fo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function lo(t){for(var e=Ua(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_o(i)]}return e}function ho(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Nr(n)?n:i}var po=me?function(t){return null==t?[]:(t=kt(t),Ue(me(t),function(e){return Zt.call(t,e)}))}:gc,yo=me?function(t){for(var e=[];t;)Te(e,po(t)),t=qt(t);return e}:gc,go=_r;function mo(t,e,n){for(var r=-1,i=(e=vi(e,t)).length,o=!1;++r<i;){var s=Ko(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&ta(i)&&vo(s,i)&&(Vs(t)||Gs(t))}function bo(t){return"function"!=typeof t.constructor||Bo(t)?{}:jn(qt(t))}function wo(t){return Vs(t)||Gs(t)||!!(Jt&&t&&t[Jt])}function vo(t,e){var n=typeof t;return!!(e=e??p)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function xo(t,e,n){if(!ea(n))return!1;var r=typeof e;return!!("number"==r?qs(n)&&vo(e,n.length):"string"==r&&e in n)&&Hs(n[e],t)}function Eo(t,e){if(Vs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ua(t))||(nt.test(t)||!et.test(t)||null!=e&&t in kt(e))}function Ao(t){var e=ao(t),n=Hn[e];if("function"!=typeof n||!(e in Vn.prototype))return!1;if(t===n)return!0;var r=so(n);return!!r&&t===r[0]}(Bn&&go(new Bn(new ArrayBuffer(1)))!=N||_n&&go(new _n)!=B||kn&&go(kn.resolve())!=P||Pn&&go(new Pn)!=O||Sn&&go(new Sn)!=C)&&(go=function(t){var e=_r(t),n=e==k?t.constructor:i,r=n?$o(n):"";if(r)switch(r){case Cn:return N;case Ln:return B;case Nn:return P;case Tn:return O;case Fn:return C}return e});var Io=Lt?Xs:mc;function Bo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ct)}function _o(t){return t==t&&!ea(t)}function ko(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==i||t in kt(n)))}}function Po(t,e,n){return e=wn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,s=wn(i.length-e,0),a=r(s);++o<s;)a[o]=i[e+o];o=-1;for(var c=r(e+1);++o<e;)c[o]=i[o];return c[e]=n(a),ke(t,this,c)}}function So(t,e){return e.length<2?t:Ir(t,ii(e,0,-1))}function Oo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ro=No(ei),Uo=de||function(t,e){return ye.setTimeout(t,e)},Co=No(ni);function Lo(t,e,n){var r=e+"";return Co(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ct,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Se(m,function(n){var r="_."+n[0];e&n[1]&&!Ce(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(ft):[]}(r),n)))}function No(t){var e=0,n=0;return function(){var r=xn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function To(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var s=Zr(n,o),a=t[s];t[s]=t[n],t[n]=a}return t.length=e,t}var Fo=function(t){var e=Ns(t,function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(rt,function(t,n,r,i){e.push(r?i.replace(dt,"$1"):n||t)}),e});function Ko(t){if("string"==typeof t||ua(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function $o(t){if(null!=t){try{return Nt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Do(t){if(t instanceof Vn)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=Oi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Ho=Jr(function(t,e){return Ws(t)?hr(t,br(e,1,Ws,!0)):[]}),jo=Jr(function(t,e){var n=Jo(e);return Ws(n)&&(n=i),Ws(t)?hr(t,br(e,1,Ws,!0),uo(n,2)):[]}),zo=Jr(function(t,e){var n=Jo(e);return Ws(n)&&(n=i),Ws(t)?hr(t,br(e,1,Ws,!0),i,n):[]});function Go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ya(n);return i<0&&(i=wn(r+i,0)),je(t,uo(e,3),i)}function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=ya(n),o=n<0?wn(r+o,0):vn(o,r-1)),je(t,uo(e,3),o,!0)}function Mo(t){return(null==t?0:t.length)?br(t,1):[]}function qo(t){return t&&t.length?t[0]:i}var Wo=Jr(function(t){var e=Ne(t,bi);return e.length&&e[0]===t[0]?Or(e):[]}),Zo=Jr(function(t){var e=Jo(t),n=Ne(t,bi);return e===Jo(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Or(n,uo(e,2)):[]}),Yo=Jr(function(t){var e=Jo(t),n=Ne(t,bi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Or(n,i,e):[]});function Jo(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Xo=Jr(Qo);function Qo(t,e){return t&&t.length&&e&&e.length?qr(t,e):t}var ts=ro(function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Wr(t,Ne(e,function(t){return vo(t,n)?+t:t}).sort(ki)),r});function es(t){return null==t?t:In.call(t)}var ns=Jr(function(t){return li(br(t,1,Ws,!0))}),rs=Jr(function(t){var e=Jo(t);return Ws(e)&&(e=i),li(br(t,1,Ws,!0),uo(e,2))}),is=Jr(function(t){var e=Jo(t);return e="function"==typeof e?e:i,li(br(t,1,Ws,!0),i,e)});function os(t){if(!t||!t.length)return[];var e=0;return t=Ue(t,function(t){if(Ws(t))return e=wn(t.length,e),!0}),Je(e,function(e){return Ne(t,qe(e))})}function ss(t,e){if(!t||!t.length)return[];var n=os(t);return null==e?n:Ne(n,function(t){return ke(e,i,t)})}var as=Jr(function(t,e){return Ws(t)?hr(t,e):[]}),cs=Jr(function(t){return gi(Ue(t,Ws))}),us=Jr(function(t){var e=Jo(t);return Ws(e)&&(e=i),gi(Ue(t,Ws),uo(e,2))}),fs=Jr(function(t){var e=Jo(t);return e="function"==typeof e?e:i,gi(Ue(t,Ws),i,e)}),ls=Jr(os);var hs=Jr(function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ss(t,n)});function ds(t){var e=Hn(t);return e.__chain__=!0,e}function ps(t,e){return e(t)}var ys=ro(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return ar(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Vn&&vo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ps,args:[o],thisArg:i}),new Gn(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(i),t})):this.thru(o)});var gs=Ui(function(t,e,n){Tt.call(t,n)?++t[n]:sr(t,n,1)});var ms=$i(Go),bs=$i(Vo);function ws(t,e){return(Vs(t)?Se:dr)(t,uo(e,3))}function vs(t,e){return(Vs(t)?Oe:pr)(t,uo(e,3))}var xs=Ui(function(t,e,n){Tt.call(t,n)?t[n].push(e):sr(t,n,[e])});var Es=Jr(function(t,e,n){var i=-1,o="function"==typeof e,s=qs(t)?r(t.length):[];return dr(t,function(t){s[++i]=o?ke(e,t,n):Rr(t,e,n)}),s}),As=Ui(function(t,e,n){sr(t,n,e)});function Is(t,e){return(Vs(t)?Ne:Dr)(t,uo(e,3))}var Bs=Ui(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var _s=Jr(function(t,e){if(null==t)return[];var n=e.length;return n>1&&xo(t,e[0],e[1])?e=[]:n>2&&xo(e[0],e[1],e[2])&&(e=[e[0]]),Vr(t,br(e,1),[])}),ks=fe||function(){return ye.Date.now()};function Ps(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Xi(t,l,i,i,i,i,e)}function Ss(t,e){var n;if("function"!=typeof e)throw new Ot(o);return t=ya(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Os=Jr(function(t,e,n){var r=1;if(n.length){var i=ln(n,co(Os));r|=u}return Xi(t,r,e,n,i)}),Rs=Jr(function(t,e,n){var r=3;if(n.length){var i=ln(n,co(Rs));r|=u}return Xi(e,r,t,n,i)});function Us(t,e,n){var r,s,a,c,u,f,l=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Ot(o);function y(e){var n=r,o=s;return r=s=i,l=e,c=t.apply(o,n)}function g(t){var n=t-f;return f===i||n>=e||n<0||d&&t-l>=a}function m(){var t=ks();if(g(t))return b(t);u=Uo(m,function(t){var n=e-(t-f);return d?vn(n,a-(t-l)):n}(t))}function b(t){return u=i,p&&r?y(t):(r=s=i,c)}function w(){var t=ks(),n=g(t);if(r=arguments,s=this,f=t,n){if(u===i)return function(t){return l=t,u=Uo(m,e),h?y(t):c}(f);if(d)return Ai(u),u=Uo(m,e),y(f)}return u===i&&(u=Uo(m,e)),c}return e=ma(e)||0,ea(n)&&(h=!!n.leading,a=(d="maxWait"in n)?wn(ma(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),w.cancel=function(){u!==i&&Ai(u),l=0,r=f=s=u=i},w.flush=function(){return u===i?c:b(ks())},w}var Cs=Jr(function(t,e){return lr(t,1,e)}),Ls=Jr(function(t,e,n){return lr(t,ma(e)||0,n)});function Ns(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ot(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ns.Cache||Wn),n}function Ts(t){if("function"!=typeof t)throw new Ot(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ns.Cache=Wn;var Fs=xi(function(t,e){var n=(e=1==e.length&&Vs(e[0])?Ne(e[0],Qe(uo())):Ne(br(e,1),Qe(uo()))).length;return Jr(function(r){for(var i=-1,o=vn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ke(t,this,r)})}),Ks=Jr(function(t,e){var n=ln(e,co(Ks));return Xi(t,u,i,e,n)}),$s=Jr(function(t,e){var n=ln(e,co($s));return Xi(t,f,i,e,n)}),Ds=ro(function(t,e){return Xi(t,h,i,i,i,e)});function Hs(t,e){return t===e||t!=t&&e!=e}var js=qi(kr),zs=qi(function(t,e){return t>=e}),Gs=Ur(function(){return arguments}())?Ur:function(t){return na(t)&&Tt.call(t,"callee")&&!Zt.call(t,"callee")},Vs=r.isArray,Ms=xe?Qe(xe):function(t){return na(t)&&_r(t)==L};function qs(t){return null!=t&&ta(t.length)&&!Xs(t)}function Ws(t){return na(t)&&qs(t)}var Zs=we||mc,Ys=Ee?Qe(Ee):function(t){return na(t)&&_r(t)==x};function Js(t){if(!na(t))return!1;var e=_r(t);return e==E||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Xs(t){if(!ea(t))return!1;var e=_r(t);return e==A||e==I||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qs(t){return"number"==typeof t&&t==ya(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=p}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function na(t){return null!=t&&"object"==typeof t}var ra=Ae?Qe(Ae):function(t){return na(t)&&go(t)==B};function ia(t){return"number"==typeof t||na(t)&&_r(t)==_}function oa(t){if(!na(t)||_r(t)!=k)return!1;var e=qt(t);if(null===e)return!0;var n=Tt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Nt.call(n)==Dt}var sa=Ie?Qe(Ie):function(t){return na(t)&&_r(t)==S};var aa=Be?Qe(Be):function(t){return na(t)&&go(t)==O};function ca(t){return"string"==typeof t||!Vs(t)&&na(t)&&_r(t)==R}function ua(t){return"symbol"==typeof t||na(t)&&_r(t)==U}var fa=_e?Qe(_e):function(t){return na(t)&&ta(t.length)&&!!ce[_r(t)]};var la=qi($r),ha=qi(function(t,e){return t<=e});function da(t){if(!t)return[];if(qs(t))return ca(t)?yn(t):Oi(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=go(t);return(e==B?un:e==O?hn:Ha)(t)}function pa(t){return t?(t=ma(t))===d||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ya(t){var e=pa(t),n=e%1;return e==e?n?e-n:e:0}function ga(t){return t?cr(ya(t),0,g):0}function ma(t){if("number"==typeof t)return t;if(ua(t))return y;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Xe(t);var n=mt.test(t);return n||wt.test(t)?he(t.slice(2),n?2:8):gt.test(t)?y:+t}function ba(t){return Ri(t,Ca(t))}function wa(t){return null==t?"":fi(t)}var va=Ci(function(t,e){if(Bo(e)||qs(e))Ri(e,Ua(e),t);else for(var n in e)Tt.call(e,n)&&nr(t,n,e[n])}),xa=Ci(function(t,e){Ri(e,Ca(e),t)}),Ea=Ci(function(t,e,n,r){Ri(e,Ca(e),t,r)}),Aa=Ci(function(t,e,n,r){Ri(e,Ua(e),t,r)}),Ia=ro(ar);var Ba=Jr(function(t,e){t=kt(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&xo(e[0],e[1],o)&&(r=1);++n<r;)for(var s=e[n],a=Ca(s),c=-1,u=a.length;++c<u;){var f=a[c],l=t[f];(l===i||Hs(l,Ct[f])&&!Tt.call(t,f))&&(t[f]=s[f])}return t}),_a=Jr(function(t){return t.push(i,to),ke(Na,i,t)});function ka(t,e,n){var r=null==t?i:Ir(t,e);return r===i?n:r}function Pa(t,e){return null!=t&&mo(t,e,Sr)}var Sa=ji(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=$t.call(e)),t[e]=n},ec(ic)),Oa=ji(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=$t.call(e)),Tt.call(t,e)?t[e].push(n):t[e]=[n]},uo),Ra=Jr(Rr);function Ua(t){return qs(t)?Jn(t):Fr(t)}function Ca(t){return qs(t)?Jn(t,!0):Kr(t)}var La=Ci(function(t,e,n){zr(t,e,n)}),Na=Ci(function(t,e,n,r){zr(t,e,n,r)}),Ta=ro(function(t,e){var n={};if(null==t)return n;var r=!1;e=Ne(e,function(e){return e=vi(e,t),r||(r=e.length>1),e}),Ri(t,oo(t),n),r&&(n=ur(n,7,eo));for(var i=e.length;i--;)hi(n,e[i]);return n});var Fa=ro(function(t,e){return null==t?{}:function(t,e){return Mr(t,e,function(e,n){return Pa(t,n)})}(t,e)});function Ka(t,e){if(null==t)return{};var n=Ne(oo(t),function(t){return[t]});return e=uo(e),Mr(t,n,function(t,n){return e(t,n[0])})}var $a=Ji(Ua),Da=Ji(Ca);function Ha(t){return null==t?[]:tn(t,Ua(t))}var ja=Fi(function(t,e,n){return e=e.toLowerCase(),t+(n?za(e):e)});function za(t){return Ja(wa(t).toLowerCase())}function Ga(t){return(t=wa(t))&&t.replace(xt,on).replace(ee,"")}var Va=Fi(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Ma=Fi(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),qa=Ti("toLowerCase");var Wa=Fi(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var Za=Fi(function(t,e,n){return t+(n?" ":"")+Ja(e)});var Ya=Fi(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Ja=Ti("toUpperCase");function Xa(t,e,n){return t=wa(t),(e=n?i:e)===i?function(t){return oe.test(t)}(t)?function(t){return t.match(re)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var Qa=Jr(function(t,e){try{return ke(t,i,e)}catch(t){return Js(t)?t:new It(t)}}),tc=ro(function(t,e){return Se(e,function(e){e=Ko(e),sr(t,e,Os(t[e],t))}),t});function ec(t){return function(){return t}}var nc=Di(),rc=Di(!0);function ic(t){return t}function oc(t){return Tr("function"==typeof t?t:ur(t,1))}var sc=Jr(function(t,e){return function(n){return Rr(n,t,e)}}),ac=Jr(function(t,e){return function(n){return Rr(t,n,e)}});function cc(t,e,n){var r=Ua(e),i=Ar(e,r);null!=n||ea(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Ar(e,Ua(e)));var o=!(ea(n)&&"chain"in n&&!n.chain),s=Xs(t);return Se(i,function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Oi(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Te([this.value()],arguments))})}),t}function uc(){}var fc=Gi(Ne),lc=Gi(Re),hc=Gi($e);function dc(t){return Eo(t)?qe(Ko(t)):function(t){return function(e){return Ir(e,t)}}(t)}var pc=Mi(),yc=Mi(!0);function gc(){return[]}function mc(){return!1}var bc=zi(function(t,e){return t+e},0),wc=Zi("ceil"),vc=zi(function(t,e){return t/e},1),xc=Zi("floor");var Ec,Ac=zi(function(t,e){return t*e},1),Ic=Zi("round"),Bc=zi(function(t,e){return t-e},0);return Hn.after=function(t,e){if("function"!=typeof e)throw new Ot(o);return t=ya(t),function(){if(--t<1)return e.apply(this,arguments)}},Hn.ary=Ps,Hn.assign=va,Hn.assignIn=xa,Hn.assignInWith=Ea,Hn.assignWith=Aa,Hn.at=Ia,Hn.before=Ss,Hn.bind=Os,Hn.bindAll=tc,Hn.bindKey=Rs,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Vs(t)?t:[t]},Hn.chain=ds,Hn.chunk=function(t,e,n){e=(n?xo(t,e,n):e===i)?1:wn(ya(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var s=0,a=0,c=r(pe(o/e));s<o;)c[a++]=ii(t,s,s+=e);return c},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Te(Vs(n)?Oi(n):[n],br(e,1))},Hn.cond=function(t){var e=null==t?0:t.length,n=uo();return t=e?Ne(t,function(t){if("function"!=typeof t[1])throw new Ot(o);return[n(t[0]),t[1]]}):[],Jr(function(n){for(var r=-1;++r<e;){var i=t[r];if(ke(i[0],this,n))return ke(i[1],this,n)}})},Hn.conforms=function(t){return function(t){var e=Ua(t);return function(n){return fr(n,t,e)}}(ur(t,1))},Hn.constant=ec,Hn.countBy=gs,Hn.create=function(t,e){var n=jn(t);return null==e?n:or(n,e)},Hn.curry=function t(e,n,r){var o=Xi(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Hn.curryRight=function t(e,n,r){var o=Xi(e,c,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Hn.debounce=Us,Hn.defaults=Ba,Hn.defaultsDeep=_a,Hn.defer=Cs,Hn.delay=Ls,Hn.difference=Ho,Hn.differenceBy=jo,Hn.differenceWith=zo,Hn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ii(t,(e=n||e===i?1:ya(e))<0?0:e,r):[]},Hn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ii(t,0,(e=r-(e=n||e===i?1:ya(e)))<0?0:e):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?pi(t,uo(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?pi(t,uo(e,3),!0):[]},Hn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&xo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ya(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:ya(r))<0&&(r+=o),r=n>r?0:ga(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Hn.filter=function(t,e){return(Vs(t)?Ue:mr)(t,uo(e,3))},Hn.flatMap=function(t,e){return br(Is(t,e),1)},Hn.flatMapDeep=function(t,e){return br(Is(t,e),d)},Hn.flatMapDepth=function(t,e,n){return n=n===i?1:ya(n),br(Is(t,e),n)},Hn.flatten=Mo,Hn.flattenDeep=function(t){return(null==t?0:t.length)?br(t,d):[]},Hn.flattenDepth=function(t,e){return(null==t?0:t.length)?br(t,e=e===i?1:ya(e)):[]},Hn.flip=function(t){return Xi(t,512)},Hn.flow=nc,Hn.flowRight=rc,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];sr(r,i[0],i[1])}return r},Hn.functions=function(t){return null==t?[]:Ar(t,Ua(t))},Hn.functionsIn=function(t){return null==t?[]:Ar(t,Ca(t))},Hn.groupBy=xs,Hn.initial=function(t){return(null==t?0:t.length)?ii(t,0,-1):[]},Hn.intersection=Wo,Hn.intersectionBy=Zo,Hn.intersectionWith=Yo,Hn.invert=Sa,Hn.invertBy=Oa,Hn.invokeMap=Es,Hn.iteratee=oc,Hn.keyBy=As,Hn.keys=Ua,Hn.keysIn=Ca,Hn.map=Is,Hn.mapKeys=function(t,e){var n={};return e=uo(e,3),xr(t,function(t,r,i){sr(n,e(t,r,i),t)}),n},Hn.mapValues=function(t,e){var n={};return e=uo(e,3),xr(t,function(t,r,i){sr(n,r,e(t,r,i))}),n},Hn.matches=function(t){return Hr(ur(t,1))},Hn.matchesProperty=function(t,e){return jr(t,ur(e,1))},Hn.memoize=Ns,Hn.merge=La,Hn.mergeWith=Na,Hn.method=sc,Hn.methodOf=ac,Hn.mixin=cc,Hn.negate=Ts,Hn.nthArg=function(t){return t=ya(t),Jr(function(e){return Gr(e,t)})},Hn.omit=Ta,Hn.omitBy=function(t,e){return Ka(t,Ts(uo(e)))},Hn.once=function(t){return Ss(2,t)},Hn.orderBy=function(t,e,n,r){return null==t?[]:(Vs(e)||(e=null==e?[]:[e]),Vs(n=r?i:n)||(n=null==n?[]:[n]),Vr(t,e,n))},Hn.over=fc,Hn.overArgs=Fs,Hn.overEvery=lc,Hn.overSome=hc,Hn.partial=Ks,Hn.partialRight=$s,Hn.partition=Bs,Hn.pick=Fa,Hn.pickBy=Ka,Hn.property=dc,Hn.propertyOf=function(t){return function(e){return null==t?i:Ir(t,e)}},Hn.pull=Xo,Hn.pullAll=Qo,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?qr(t,e,uo(n,2)):t},Hn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?qr(t,e,i,n):t},Hn.pullAt=ts,Hn.range=pc,Hn.rangeRight=yc,Hn.rearg=Ds,Hn.reject=function(t,e){return(Vs(t)?Ue:mr)(t,Ts(uo(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=uo(e,3);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Wr(t,i),n},Hn.rest=function(t,e){if("function"!=typeof t)throw new Ot(o);return Jr(t,e=e===i?e:ya(e))},Hn.reverse=es,Hn.sampleSize=function(t,e,n){return e=(n?xo(t,e,n):e===i)?1:ya(e),(Vs(t)?Qn:Qr)(t,e)},Hn.set=function(t,e,n){return null==t?t:ti(t,e,n)},Hn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:ti(t,e,n,r)},Hn.shuffle=function(t){return(Vs(t)?tr:ri)(t)},Hn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&xo(t,e,n)?(e=0,n=r):(e=null==e?0:ya(e),n=n===i?r:ya(n)),ii(t,e,n)):[]},Hn.sortBy=_s,Hn.sortedUniq=function(t){return t&&t.length?ci(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?ci(t,uo(e,2)):[]},Hn.split=function(t,e,n){return n&&"number"!=typeof n&&xo(t,e,n)&&(e=n=i),(n=n===i?g:n>>>0)?(t=wa(t))&&("string"==typeof e||null!=e&&!sa(e))&&!(e=fi(e))&&cn(t)?Ei(yn(t),0,n):t.split(e,n):[]},Hn.spread=function(t,e){if("function"!=typeof t)throw new Ot(o);return e=null==e?0:wn(ya(e),0),Jr(function(n){var r=n[e],i=Ei(n,0,e);return r&&Te(i,r),ke(t,this,i)})},Hn.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Hn.take=function(t,e,n){return t&&t.length?ii(t,0,(e=n||e===i?1:ya(e))<0?0:e):[]},Hn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ii(t,(e=r-(e=n||e===i?1:ya(e)))<0?0:e,r):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?pi(t,uo(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?pi(t,uo(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Ot(o);return ea(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Us(t,e,{leading:r,maxWait:e,trailing:i})},Hn.thru=ps,Hn.toArray=da,Hn.toPairs=$a,Hn.toPairsIn=Da,Hn.toPath=function(t){return Vs(t)?Ne(t,Ko):ua(t)?[t]:Oi(Fo(wa(t)))},Hn.toPlainObject=ba,Hn.transform=function(t,e,n){var r=Vs(t),i=r||Zs(t)||fa(t);if(e=uo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:ea(t)&&Xs(o)?jn(qt(t)):{}}return(i?Se:xr)(t,function(t,r,i){return e(n,t,r,i)}),n},Hn.unary=function(t){return Ps(t,1)},Hn.union=ns,Hn.unionBy=rs,Hn.unionWith=is,Hn.uniq=function(t){return t&&t.length?li(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?li(t,uo(e,2)):[]},Hn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?li(t,i,e):[]},Hn.unset=function(t,e){return null==t||hi(t,e)},Hn.unzip=os,Hn.unzipWith=ss,Hn.update=function(t,e,n){return null==t?t:di(t,e,wi(n))},Hn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:di(t,e,wi(n),r)},Hn.values=Ha,Hn.valuesIn=function(t){return null==t?[]:tn(t,Ca(t))},Hn.without=as,Hn.words=Xa,Hn.wrap=function(t,e){return Ks(wi(e),t)},Hn.xor=cs,Hn.xorBy=us,Hn.xorWith=fs,Hn.zip=ls,Hn.zipObject=function(t,e){return mi(t||[],e||[],nr)},Hn.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Hn.zipWith=hs,Hn.entries=$a,Hn.entriesIn=Da,Hn.extend=xa,Hn.extendWith=Ea,cc(Hn,Hn),Hn.add=bc,Hn.attempt=Qa,Hn.camelCase=ja,Hn.capitalize=za,Hn.ceil=wc,Hn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=ma(n))==n?n:0),e!==i&&(e=(e=ma(e))==e?e:0),cr(ma(t),e,n)},Hn.clone=function(t){return ur(t,4)},Hn.cloneDeep=function(t){return ur(t,5)},Hn.cloneDeepWith=function(t,e){return ur(t,5,e="function"==typeof e?e:i)},Hn.cloneWith=function(t,e){return ur(t,4,e="function"==typeof e?e:i)},Hn.conformsTo=function(t,e){return null==e||fr(t,e,Ua(e))},Hn.deburr=Ga,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=vc,Hn.endsWith=function(t,e,n){t=wa(t),e=fi(e);var r=t.length,o=n=n===i?r:cr(ya(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Hn.eq=Hs,Hn.escape=function(t){return(t=wa(t))&&J.test(t)?t.replace(Z,sn):t},Hn.escapeRegExp=function(t){return(t=wa(t))&&ot.test(t)?t.replace(it,"\\$&"):t},Hn.every=function(t,e,n){var r=Vs(t)?Re:yr;return n&&xo(t,e,n)&&(e=i),r(t,uo(e,3))},Hn.find=ms,Hn.findIndex=Go,Hn.findKey=function(t,e){return He(t,uo(e,3),xr)},Hn.findLast=bs,Hn.findLastIndex=Vo,Hn.findLastKey=function(t,e){return He(t,uo(e,3),Er)},Hn.floor=xc,Hn.forEach=ws,Hn.forEachRight=vs,Hn.forIn=function(t,e){return null==t?t:wr(t,uo(e,3),Ca)},Hn.forInRight=function(t,e){return null==t?t:vr(t,uo(e,3),Ca)},Hn.forOwn=function(t,e){return t&&xr(t,uo(e,3))},Hn.forOwnRight=function(t,e){return t&&Er(t,uo(e,3))},Hn.get=ka,Hn.gt=js,Hn.gte=zs,Hn.has=function(t,e){return null!=t&&mo(t,e,Pr)},Hn.hasIn=Pa,Hn.head=qo,Hn.identity=ic,Hn.includes=function(t,e,n,r){t=qs(t)?t:Ha(t),n=n&&!r?ya(n):0;var i=t.length;return n<0&&(n=wn(i+n,0)),ca(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&ze(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ya(n);return i<0&&(i=wn(r+i,0)),ze(t,e,i)},Hn.inRange=function(t,e,n){return e=pa(e),n===i?(n=e,e=0):n=pa(n),function(t,e,n){return t>=vn(e,n)&&t<wn(e,n)}(t=ma(t),e,n)},Hn.invoke=Ra,Hn.isArguments=Gs,Hn.isArray=Vs,Hn.isArrayBuffer=Ms,Hn.isArrayLike=qs,Hn.isArrayLikeObject=Ws,Hn.isBoolean=function(t){return!0===t||!1===t||na(t)&&_r(t)==v},Hn.isBuffer=Zs,Hn.isDate=Ys,Hn.isElement=function(t){return na(t)&&1===t.nodeType&&!oa(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(qs(t)&&(Vs(t)||"string"==typeof t||"function"==typeof t.splice||Zs(t)||fa(t)||Gs(t)))return!t.length;var e=go(t);if(e==B||e==O)return!t.size;if(Bo(t))return!Fr(t).length;for(var n in t)if(Tt.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return Cr(t,e)},Hn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?Cr(t,e,i,n):!!r},Hn.isError=Js,Hn.isFinite=function(t){return"number"==typeof t&&ve(t)},Hn.isFunction=Xs,Hn.isInteger=Qs,Hn.isLength=ta,Hn.isMap=ra,Hn.isMatch=function(t,e){return t===e||Lr(t,e,lo(e))},Hn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Lr(t,e,lo(e),n)},Hn.isNaN=function(t){return ia(t)&&t!=+t},Hn.isNative=function(t){if(Io(t))throw new It("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nr(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=ia,Hn.isObject=ea,Hn.isObjectLike=na,Hn.isPlainObject=oa,Hn.isRegExp=sa,Hn.isSafeInteger=function(t){return Qs(t)&&t>=-9007199254740991&&t<=p},Hn.isSet=aa,Hn.isString=ca,Hn.isSymbol=ua,Hn.isTypedArray=fa,Hn.isUndefined=function(t){return t===i},Hn.isWeakMap=function(t){return na(t)&&go(t)==C},Hn.isWeakSet=function(t){return na(t)&&"[object WeakSet]"==_r(t)},Hn.join=function(t,e){return null==t?"":De.call(t,e)},Hn.kebabCase=Va,Hn.last=Jo,Hn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=ya(n))<0?wn(r+o,0):vn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):je(t,Ve,o,!0)},Hn.lowerCase=Ma,Hn.lowerFirst=qa,Hn.lt=la,Hn.lte=ha,Hn.max=function(t){return t&&t.length?gr(t,ic,kr):i},Hn.maxBy=function(t,e){return t&&t.length?gr(t,uo(e,2),kr):i},Hn.mean=function(t){return Me(t,ic)},Hn.meanBy=function(t,e){return Me(t,uo(e,2))},Hn.min=function(t){return t&&t.length?gr(t,ic,$r):i},Hn.minBy=function(t,e){return t&&t.length?gr(t,uo(e,2),$r):i},Hn.stubArray=gc,Hn.stubFalse=mc,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Ac,Hn.nth=function(t,e){return t&&t.length?Gr(t,ya(e)):i},Hn.noConflict=function(){return ye._===this&&(ye._=Ht),this},Hn.noop=uc,Hn.now=ks,Hn.pad=function(t,e,n){t=wa(t);var r=(e=ya(e))?pn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Vi(ge(i),n)+t+Vi(pe(i),n)},Hn.padEnd=function(t,e,n){t=wa(t);var r=(e=ya(e))?pn(t):0;return e&&r<e?t+Vi(e-r,n):t},Hn.padStart=function(t,e,n){t=wa(t);var r=(e=ya(e))?pn(t):0;return e&&r<e?Vi(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),En(wa(t).replace(st,""),e||0)},Hn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&xo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=pa(t),e===i?(e=t,t=0):e=pa(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=An();return vn(t+o*(e-t+le("1e-"+((o+"").length-1))),e)}return Zr(t,e)},Hn.reduce=function(t,e,n){var r=Vs(t)?Fe:Ze,i=arguments.length<3;return r(t,uo(e,4),n,i,dr)},Hn.reduceRight=function(t,e,n){var r=Vs(t)?Ke:Ze,i=arguments.length<3;return r(t,uo(e,4),n,i,pr)},Hn.repeat=function(t,e,n){return e=(n?xo(t,e,n):e===i)?1:ya(e),Yr(wa(t),e)},Hn.replace=function(){var t=arguments,e=wa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(t,e,n){var r=-1,o=(e=vi(e,t)).length;for(o||(o=1,t=i);++r<o;){var s=null==t?i:t[Ko(e[r])];s===i&&(r=o,s=n),t=Xs(s)?s.call(t):s}return t},Hn.round=Ic,Hn.runInContext=t,Hn.sample=function(t){return(Vs(t)?Xn:Xr)(t)},Hn.size=function(t){if(null==t)return 0;if(qs(t))return ca(t)?pn(t):t.length;var e=go(t);return e==B||e==O?t.size:Fr(t).length},Hn.snakeCase=Wa,Hn.some=function(t,e,n){var r=Vs(t)?$e:oi;return n&&xo(t,e,n)&&(e=i),r(t,uo(e,3))},Hn.sortedIndex=function(t,e){return si(t,e)},Hn.sortedIndexBy=function(t,e,n){return ai(t,e,uo(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=si(t,e);if(r<n&&Hs(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return si(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ai(t,e,uo(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=si(t,e,!0)-1;if(Hs(t[n],e))return n}return-1},Hn.startCase=Za,Hn.startsWith=function(t,e,n){return t=wa(t),n=null==n?0:cr(ya(n),0,t.length),e=fi(e),t.slice(n,n+e.length)==e},Hn.subtract=Bc,Hn.sum=function(t){return t&&t.length?Ye(t,ic):0},Hn.sumBy=function(t,e){return t&&t.length?Ye(t,uo(e,2)):0},Hn.template=function(t,e,n){var r=Hn.templateSettings;n&&xo(t,e,n)&&(e=i),t=wa(t),e=Aa({},e,r,Qi);var o=Aa({},e.imports,r.imports,Qi),s=Ua(o),a=tn(o,s);Se(s,function(t){if(ht.test(t))throw new It("Invalid `imports` option passed into `_.template`")});var c,u,f=0,l=e.interpolate||Et,h="__p += '",d=Pt((e.escape||Et).source+"|"+l.source+"|"+(l===tt?pt:Et).source+"|"+(e.evaluate||Et).source+"|$","g"),p="//# sourceURL="+(Tt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ae+"]")+"\n";t.replace(d,function(e,n,r,i,o,s){return r||(r=i),h+=t.slice(f,s).replace(At,an),n&&(c=!0,h+="' +\n__e("+n+") +\n'"),o&&(u=!0,h+="';\n"+o+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=s+e.length,e}),h+="';\n";var y=Tt.call(e,"variable")&&e.variable;if(y){if(ht.test(y))throw new It("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(u?h.replace(V,""):h).replace(M,"$1").replace(q,"$1;"),h="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(c?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Qa(function(){return Bt(s,p+"return "+h).apply(i,a)});if(g.source=h,Js(g))throw g;return g},Hn.times=function(t,e){if((t=ya(t))<1||t>p)return[];var n=g,r=vn(t,g);e=uo(e),t-=g;for(var i=Je(r,e);++n<t;)e(n);return i},Hn.toFinite=pa,Hn.toInteger=ya,Hn.toLength=ga,Hn.toLower=function(t){return wa(t).toLowerCase()},Hn.toNumber=ma,Hn.toSafeInteger=function(t){return t?cr(ya(t),-9007199254740991,p):0===t?t:0},Hn.toString=wa,Hn.toUpper=function(t){return wa(t).toUpperCase()},Hn.trim=function(t,e,n){if((t=wa(t))&&(n||e===i))return Xe(t);if(!t||!(e=fi(e)))return t;var r=yn(t),o=yn(e);return Ei(r,nn(r,o),rn(r,o)+1).join("")},Hn.trimEnd=function(t,e,n){if((t=wa(t))&&(n||e===i))return t.slice(0,gn(t)+1);if(!t||!(e=fi(e)))return t;var r=yn(t);return Ei(r,0,rn(r,yn(e))+1).join("")},Hn.trimStart=function(t,e,n){if((t=wa(t))&&(n||e===i))return t.replace(st,"");if(!t||!(e=fi(e)))return t;var r=yn(t);return Ei(r,nn(r,yn(e))).join("")},Hn.truncate=function(t,e){var n=30,r="...";if(ea(e)){var o="separator"in e?e.separator:o;n="length"in e?ya(e.length):n,r="omission"in e?fi(e.omission):r}var s=(t=wa(t)).length;if(cn(t)){var a=yn(t);s=a.length}if(n>=s)return t;var c=n-pn(r);if(c<1)return r;var u=a?Ei(a,0,c).join(""):t.slice(0,c);if(o===i)return u+r;if(a&&(c+=u.length-c),sa(o)){if(t.slice(c).search(o)){var f,l=u;for(o.global||(o=Pt(o.source,wa(yt.exec(o))+"g")),o.lastIndex=0;f=o.exec(l);)var h=f.index;u=u.slice(0,h===i?c:h)}}else if(t.indexOf(fi(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},Hn.unescape=function(t){return(t=wa(t))&&Y.test(t)?t.replace(W,mn):t},Hn.uniqueId=function(t){var e=++Ft;return wa(t)+e},Hn.upperCase=Ya,Hn.upperFirst=Ja,Hn.each=ws,Hn.eachRight=vs,Hn.first=qo,cc(Hn,(Ec={},xr(Hn,function(t,e){Tt.call(Hn.prototype,e)||(Ec[e]=t)}),Ec),{chain:!1}),Hn.VERSION="4.18.1",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Hn[t].placeholder=Hn}),Se(["drop","take"],function(t,e){Vn.prototype[t]=function(n){n=n===i?1:wn(ya(n),0);var r=this.__filtered__&&!e?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=vn(n,r.__takeCount__):r.__views__.push({size:vn(n,g),type:t+(r.__dir__<0?"Right":"")}),r},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Se(["filter","map","takeWhile"],function(t,e){var n=e+1,r=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:uo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Se(["head","last"],function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}}),Se(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(ic)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Jr(function(t,e){return"function"==typeof t?new Vn(this):this.map(function(n){return Rr(n,t,e)})}),Vn.prototype.reject=function(t){return this.filter(Ts(uo(t)))},Vn.prototype.slice=function(t,e){t=ya(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=ya(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(g)},xr(Vn.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Hn[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);o&&(Hn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,c=e instanceof Vn,u=a[0],f=c||Vs(e),l=function(t){var e=o.apply(Hn,Te([t],a));return r&&h?e[0]:e};f&&n&&"function"==typeof u&&1!=u.length&&(c=f=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,y=c&&!d;if(!s&&f){e=y?e:new Vn(this);var g=t.apply(e,a);return g.__actions__.push({func:ps,args:[l],thisArg:i}),new Gn(g,h)}return p&&y?t.apply(this,a):(g=this.thru(l),p?r?g.value()[0]:g.value():g)})}),Se(["pop","push","shift","sort","splice","unshift"],function(t){var e=Rt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Vs(i)?i:[],t)}return this[n](function(n){return e.apply(Vs(n)?n:[],t)})}}),xr(Vn.prototype,function(t,e){var n=Hn[e];if(n){var r=n.name+"";Tt.call(Un,r)||(Un[r]=[]),Un[r].push({name:e,func:n})}}),Un[Hi(i,2).name]=[{name:"wrapper",func:i}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Oi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Oi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Oi(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Vs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=vn(e,t+s);break;case"takeRight":t=wn(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=r?a:s-1,f=this.__iteratees__,l=f.length,h=0,d=vn(c,this.__takeCount__);if(!n||!r&&i==c&&d==c)return yi(t,this.__actions__);var p=[];t:for(;c--&&h<d;){for(var y=-1,g=t[u+=e];++y<l;){var m=f[y],b=m.iteratee,w=m.type,v=b(g);if(2==w)g=v;else if(!v){if(1==w)continue t;break t}}p[h++]=g}return p},Hn.prototype.at=ys,Hn.prototype.chain=function(){return ds(this)},Hn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===i&&(this.__values__=da(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Hn.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Do(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:ps,args:[es],thisArg:i}),new Gn(e,this.__chain__)}return this.thru(es)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return yi(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,Xt&&(Hn.prototype[Xt]=function(){return this}),Hn}();ye._=bn,(r=function(){return bn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)}};const e={};function n(r){const i=e[r];if(void 0!==i)return i.exports;const o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.cw=t=>{var e;return()=>{if(t){var n=t;t=0,e={exports:{}},n.call(e.exports,e,e.exports)}return e.exports}},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);let r={};(()=>{"use strict";n.r(r),n.d(r,{onRpcRequest:()=>by});var t=n.cw(function(t,e){e.nl=e.x2=void 0;const n=i(),r=u(),o=f(),s=l(),a=h(),c=d();function p(t){if("string"!=typeof t)throw new TypeError("Invalid mnemonic type: "+typeof t);return t.normalize("NFKD")}function y(t){const e=p(t),n=e.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:n}}function g(t){n.default.bytes(t,16,20,24,28,32)}const m=t=>{const e=8-t.length/4;return new Uint8Array([(0,o.sha256)(t)[0]>>e<<e])};function b(t){if(!Array.isArray(t)||2048!==t.length||"string"!=typeof t[0])throw new Error("Worlist: expected array of 2048 strings");return t.forEach(t=>{if("string"!=typeof t)throw new Error(`Wordlist: non-string element: ${t}`)}),c.utils.chain(c.utils.checksum(1,m),c.utils.radix2(11,!0),c.utils.alphabet(t))}function w(t,e){let n;if("string"==typeof t){const{words:r}=y(t);n=b(e).decode(r)}else n=b(e).decode(Array.from(new Uint16Array(t.buffer)).map(t=>e[t]));return g(n),n}function v(t,e){g(t);const n=b(e).encode(t).map(t=>e.indexOf(t));return new Uint8Array(new Uint16Array(n).buffer)}e.x2=w;const x=t=>p(`mnemonic${t}`);function E(t,e){let n;return n="string"==typeof t?(new TextEncoder).encode(y(t).nfkd):(new TextEncoder).encode(Array.from(new Uint16Array(t.buffer)).map(t=>e[t]).join(" ")),n}e.nl=function(t,e,n=""){const i=E(t,e);return(0,r.pbkdf2Async)(s.sha512,i,x(n),{c:2048,dkLen:64})}}),e=n.cw(function(t,e){e.p=void 0,e.p="abandon\nability\nable\nabout\nabove\nabsent\nabsorb\nabstract\nabsurd\nabuse\naccess\naccident\naccount\naccuse\nachieve\nacid\nacoustic\nacquire\nacross\nact\naction\nactor\nactress\nactual\nadapt\nadd\naddict\naddress\nadjust\nadmit\nadult\nadvance\nadvice\naerobic\naffair\nafford\nafraid\nagain\nage\nagent\nagree\nahead\naim\nair\nairport\naisle\nalarm\nalbum\nalcohol\nalert\nalien\nall\nalley\nallow\nalmost\nalone\nalpha\nalready\nalso\nalter\nalways\namateur\namazing\namong\namount\namused\nanalyst\nanchor\nancient\nanger\nangle\nangry\nanimal\nankle\nannounce\nannual\nanother\nanswer\nantenna\nantique\nanxiety\nany\napart\napology\nappear\napple\napprove\napril\narch\narctic\narea\narena\nargue\narm\narmed\narmor\narmy\naround\narrange\narrest\narrive\narrow\nart\nartefact\nartist\nartwork\nask\naspect\nassault\nasset\nassist\nassume\nasthma\nathlete\natom\nattack\nattend\nattitude\nattract\nauction\naudit\naugust\naunt\nauthor\nauto\nautumn\naverage\navocado\navoid\nawake\naware\naway\nawesome\nawful\nawkward\naxis\nbaby\nbachelor\nbacon\nbadge\nbag\nbalance\nbalcony\nball\nbamboo\nbanana\nbanner\nbar\nbarely\nbargain\nbarrel\nbase\nbasic\nbasket\nbattle\nbeach\nbean\nbeauty\nbecause\nbecome\nbeef\nbefore\nbegin\nbehave\nbehind\nbelieve\nbelow\nbelt\nbench\nbenefit\nbest\nbetray\nbetter\nbetween\nbeyond\nbicycle\nbid\nbike\nbind\nbiology\nbird\nbirth\nbitter\nblack\nblade\nblame\nblanket\nblast\nbleak\nbless\nblind\nblood\nblossom\nblouse\nblue\nblur\nblush\nboard\nboat\nbody\nboil\nbomb\nbone\nbonus\nbook\nboost\nborder\nboring\nborrow\nboss\nbottom\nbounce\nbox\nboy\nbracket\nbrain\nbrand\nbrass\nbrave\nbread\nbreeze\nbrick\nbridge\nbrief\nbright\nbring\nbrisk\nbroccoli\nbroken\nbronze\nbroom\nbrother\nbrown\nbrush\nbubble\nbuddy\nbudget\nbuffalo\nbuild\nbulb\nbulk\nbullet\nbundle\nbunker\nburden\nburger\nburst\nbus\nbusiness\nbusy\nbutter\nbuyer\nbuzz\ncabbage\ncabin\ncable\ncactus\ncage\ncake\ncall\ncalm\ncamera\ncamp\ncan\ncanal\ncancel\ncandy\ncannon\ncanoe\ncanvas\ncanyon\ncapable\ncapital\ncaptain\ncar\ncarbon\ncard\ncargo\ncarpet\ncarry\ncart\ncase\ncash\ncasino\ncastle\ncasual\ncat\ncatalog\ncatch\ncategory\ncattle\ncaught\ncause\ncaution\ncave\nceiling\ncelery\ncement\ncensus\ncentury\ncereal\ncertain\nchair\nchalk\nchampion\nchange\nchaos\nchapter\ncharge\nchase\nchat\ncheap\ncheck\ncheese\nchef\ncherry\nchest\nchicken\nchief\nchild\nchimney\nchoice\nchoose\nchronic\nchuckle\nchunk\nchurn\ncigar\ncinnamon\ncircle\ncitizen\ncity\ncivil\nclaim\nclap\nclarify\nclaw\nclay\nclean\nclerk\nclever\nclick\nclient\ncliff\nclimb\nclinic\nclip\nclock\nclog\nclose\ncloth\ncloud\nclown\nclub\nclump\ncluster\nclutch\ncoach\ncoast\ncoconut\ncode\ncoffee\ncoil\ncoin\ncollect\ncolor\ncolumn\ncombine\ncome\ncomfort\ncomic\ncommon\ncompany\nconcert\nconduct\nconfirm\ncongress\nconnect\nconsider\ncontrol\nconvince\ncook\ncool\ncopper\ncopy\ncoral\ncore\ncorn\ncorrect\ncost\ncotton\ncouch\ncountry\ncouple\ncourse\ncousin\ncover\ncoyote\ncrack\ncradle\ncraft\ncram\ncrane\ncrash\ncrater\ncrawl\ncrazy\ncream\ncredit\ncreek\ncrew\ncricket\ncrime\ncrisp\ncritic\ncrop\ncross\ncrouch\ncrowd\ncrucial\ncruel\ncruise\ncrumble\ncrunch\ncrush\ncry\ncrystal\ncube\nculture\ncup\ncupboard\ncurious\ncurrent\ncurtain\ncurve\ncushion\ncustom\ncute\ncycle\ndad\ndamage\ndamp\ndance\ndanger\ndaring\ndash\ndaughter\ndawn\nday\ndeal\ndebate\ndebris\ndecade\ndecember\ndecide\ndecline\ndecorate\ndecrease\ndeer\ndefense\ndefine\ndefy\ndegree\ndelay\ndeliver\ndemand\ndemise\ndenial\ndentist\ndeny\ndepart\ndepend\ndeposit\ndepth\ndeputy\nderive\ndescribe\ndesert\ndesign\ndesk\ndespair\ndestroy\ndetail\ndetect\ndevelop\ndevice\ndevote\ndiagram\ndial\ndiamond\ndiary\ndice\ndiesel\ndiet\ndiffer\ndigital\ndignity\ndilemma\ndinner\ndinosaur\ndirect\ndirt\ndisagree\ndiscover\ndisease\ndish\ndismiss\ndisorder\ndisplay\ndistance\ndivert\ndivide\ndivorce\ndizzy\ndoctor\ndocument\ndog\ndoll\ndolphin\ndomain\ndonate\ndonkey\ndonor\ndoor\ndose\ndouble\ndove\ndraft\ndragon\ndrama\ndrastic\ndraw\ndream\ndress\ndrift\ndrill\ndrink\ndrip\ndrive\ndrop\ndrum\ndry\nduck\ndumb\ndune\nduring\ndust\ndutch\nduty\ndwarf\ndynamic\neager\neagle\nearly\nearn\nearth\neasily\neast\neasy\necho\necology\neconomy\nedge\nedit\neducate\neffort\negg\neight\neither\nelbow\nelder\nelectric\nelegant\nelement\nelephant\nelevator\nelite\nelse\nembark\nembody\nembrace\nemerge\nemotion\nemploy\nempower\nempty\nenable\nenact\nend\nendless\nendorse\nenemy\nenergy\nenforce\nengage\nengine\nenhance\nenjoy\nenlist\nenough\nenrich\nenroll\nensure\nenter\nentire\nentry\nenvelope\nepisode\nequal\nequip\nera\nerase\nerode\nerosion\nerror\nerupt\nescape\nessay\nessence\nestate\neternal\nethics\nevidence\nevil\nevoke\nevolve\nexact\nexample\nexcess\nexchange\nexcite\nexclude\nexcuse\nexecute\nexercise\nexhaust\nexhibit\nexile\nexist\nexit\nexotic\nexpand\nexpect\nexpire\nexplain\nexpose\nexpress\nextend\nextra\neye\neyebrow\nfabric\nface\nfaculty\nfade\nfaint\nfaith\nfall\nfalse\nfame\nfamily\nfamous\nfan\nfancy\nfantasy\nfarm\nfashion\nfat\nfatal\nfather\nfatigue\nfault\nfavorite\nfeature\nfebruary\nfederal\nfee\nfeed\nfeel\nfemale\nfence\nfestival\nfetch\nfever\nfew\nfiber\nfiction\nfield\nfigure\nfile\nfilm\nfilter\nfinal\nfind\nfine\nfinger\nfinish\nfire\nfirm\nfirst\nfiscal\nfish\nfit\nfitness\nfix\nflag\nflame\nflash\nflat\nflavor\nflee\nflight\nflip\nfloat\nflock\nfloor\nflower\nfluid\nflush\nfly\nfoam\nfocus\nfog\nfoil\nfold\nfollow\nfood\nfoot\nforce\nforest\nforget\nfork\nfortune\nforum\nforward\nfossil\nfoster\nfound\nfox\nfragile\nframe\nfrequent\nfresh\nfriend\nfringe\nfrog\nfront\nfrost\nfrown\nfrozen\nfruit\nfuel\nfun\nfunny\nfurnace\nfury\nfuture\ngadget\ngain\ngalaxy\ngallery\ngame\ngap\ngarage\ngarbage\ngarden\ngarlic\ngarment\ngas\ngasp\ngate\ngather\ngauge\ngaze\ngeneral\ngenius\ngenre\ngentle\ngenuine\ngesture\nghost\ngiant\ngift\ngiggle\nginger\ngiraffe\ngirl\ngive\nglad\nglance\nglare\nglass\nglide\nglimpse\nglobe\ngloom\nglory\nglove\nglow\nglue\ngoat\ngoddess\ngold\ngood\ngoose\ngorilla\ngospel\ngossip\ngovern\ngown\ngrab\ngrace\ngrain\ngrant\ngrape\ngrass\ngravity\ngreat\ngreen\ngrid\ngrief\ngrit\ngrocery\ngroup\ngrow\ngrunt\nguard\nguess\nguide\nguilt\nguitar\ngun\ngym\nhabit\nhair\nhalf\nhammer\nhamster\nhand\nhappy\nharbor\nhard\nharsh\nharvest\nhat\nhave\nhawk\nhazard\nhead\nhealth\nheart\nheavy\nhedgehog\nheight\nhello\nhelmet\nhelp\nhen\nhero\nhidden\nhigh\nhill\nhint\nhip\nhire\nhistory\nhobby\nhockey\nhold\nhole\nholiday\nhollow\nhome\nhoney\nhood\nhope\nhorn\nhorror\nhorse\nhospital\nhost\nhotel\nhour\nhover\nhub\nhuge\nhuman\nhumble\nhumor\nhundred\nhungry\nhunt\nhurdle\nhurry\nhurt\nhusband\nhybrid\nice\nicon\nidea\nidentify\nidle\nignore\nill\nillegal\nillness\nimage\nimitate\nimmense\nimmune\nimpact\nimpose\nimprove\nimpulse\ninch\ninclude\nincome\nincrease\nindex\nindicate\nindoor\nindustry\ninfant\ninflict\ninform\ninhale\ninherit\ninitial\ninject\ninjury\ninmate\ninner\ninnocent\ninput\ninquiry\ninsane\ninsect\ninside\ninspire\ninstall\nintact\ninterest\ninto\ninvest\ninvite\ninvolve\niron\nisland\nisolate\nissue\nitem\nivory\njacket\njaguar\njar\njazz\njealous\njeans\njelly\njewel\njob\njoin\njoke\njourney\njoy\njudge\njuice\njump\njungle\njunior\njunk\njust\nkangaroo\nkeen\nkeep\nketchup\nkey\nkick\nkid\nkidney\nkind\nkingdom\nkiss\nkit\nkitchen\nkite\nkitten\nkiwi\nknee\nknife\nknock\nknow\nlab\nlabel\nlabor\nladder\nlady\nlake\nlamp\nlanguage\nlaptop\nlarge\nlater\nlatin\nlaugh\nlaundry\nlava\nlaw\nlawn\nlawsuit\nlayer\nlazy\nleader\nleaf\nlearn\nleave\nlecture\nleft\nleg\nlegal\nlegend\nleisure\nlemon\nlend\nlength\nlens\nleopard\nlesson\nletter\nlevel\nliar\nliberty\nlibrary\nlicense\nlife\nlift\nlight\nlike\nlimb\nlimit\nlink\nlion\nliquid\nlist\nlittle\nlive\nlizard\nload\nloan\nlobster\nlocal\nlock\nlogic\nlonely\nlong\nloop\nlottery\nloud\nlounge\nlove\nloyal\nlucky\nluggage\nlumber\nlunar\nlunch\nluxury\nlyrics\nmachine\nmad\nmagic\nmagnet\nmaid\nmail\nmain\nmajor\nmake\nmammal\nman\nmanage\nmandate\nmango\nmansion\nmanual\nmaple\nmarble\nmarch\nmargin\nmarine\nmarket\nmarriage\nmask\nmass\nmaster\nmatch\nmaterial\nmath\nmatrix\nmatter\nmaximum\nmaze\nmeadow\nmean\nmeasure\nmeat\nmechanic\nmedal\nmedia\nmelody\nmelt\nmember\nmemory\nmention\nmenu\nmercy\nmerge\nmerit\nmerry\nmesh\nmessage\nmetal\nmethod\nmiddle\nmidnight\nmilk\nmillion\nmimic\nmind\nminimum\nminor\nminute\nmiracle\nmirror\nmisery\nmiss\nmistake\nmix\nmixed\nmixture\nmobile\nmodel\nmodify\nmom\nmoment\nmonitor\nmonkey\nmonster\nmonth\nmoon\nmoral\nmore\nmorning\nmosquito\nmother\nmotion\nmotor\nmountain\nmouse\nmove\nmovie\nmuch\nmuffin\nmule\nmultiply\nmuscle\nmuseum\nmushroom\nmusic\nmust\nmutual\nmyself\nmystery\nmyth\nnaive\nname\nnapkin\nnarrow\nnasty\nnation\nnature\nnear\nneck\nneed\nnegative\nneglect\nneither\nnephew\nnerve\nnest\nnet\nnetwork\nneutral\nnever\nnews\nnext\nnice\nnight\nnoble\nnoise\nnominee\nnoodle\nnormal\nnorth\nnose\nnotable\nnote\nnothing\nnotice\nnovel\nnow\nnuclear\nnumber\nnurse\nnut\noak\nobey\nobject\noblige\nobscure\nobserve\nobtain\nobvious\noccur\nocean\noctober\nodor\noff\noffer\noffice\noften\noil\nokay\nold\nolive\nolympic\nomit\nonce\none\nonion\nonline\nonly\nopen\nopera\nopinion\noppose\noption\norange\norbit\norchard\norder\nordinary\norgan\norient\noriginal\norphan\nostrich\nother\noutdoor\nouter\noutput\noutside\noval\noven\nover\nown\nowner\noxygen\noyster\nozone\npact\npaddle\npage\npair\npalace\npalm\npanda\npanel\npanic\npanther\npaper\nparade\nparent\npark\nparrot\nparty\npass\npatch\npath\npatient\npatrol\npattern\npause\npave\npayment\npeace\npeanut\npear\npeasant\npelican\npen\npenalty\npencil\npeople\npepper\nperfect\npermit\nperson\npet\nphone\nphoto\nphrase\nphysical\npiano\npicnic\npicture\npiece\npig\npigeon\npill\npilot\npink\npioneer\npipe\npistol\npitch\npizza\nplace\nplanet\nplastic\nplate\nplay\nplease\npledge\npluck\nplug\nplunge\npoem\npoet\npoint\npolar\npole\npolice\npond\npony\npool\npopular\nportion\nposition\npossible\npost\npotato\npottery\npoverty\npowder\npower\npractice\npraise\npredict\nprefer\nprepare\npresent\npretty\nprevent\nprice\npride\nprimary\nprint\npriority\nprison\nprivate\nprize\nproblem\nprocess\nproduce\nprofit\nprogram\nproject\npromote\nproof\nproperty\nprosper\nprotect\nproud\nprovide\npublic\npudding\npull\npulp\npulse\npumpkin\npunch\npupil\npuppy\npurchase\npurity\npurpose\npurse\npush\nput\npuzzle\npyramid\nquality\nquantum\nquarter\nquestion\nquick\nquit\nquiz\nquote\nrabbit\nraccoon\nrace\nrack\nradar\nradio\nrail\nrain\nraise\nrally\nramp\nranch\nrandom\nrange\nrapid\nrare\nrate\nrather\nraven\nraw\nrazor\nready\nreal\nreason\nrebel\nrebuild\nrecall\nreceive\nrecipe\nrecord\nrecycle\nreduce\nreflect\nreform\nrefuse\nregion\nregret\nregular\nreject\nrelax\nrelease\nrelief\nrely\nremain\nremember\nremind\nremove\nrender\nrenew\nrent\nreopen\nrepair\nrepeat\nreplace\nreport\nrequire\nrescue\nresemble\nresist\nresource\nresponse\nresult\nretire\nretreat\nreturn\nreunion\nreveal\nreview\nreward\nrhythm\nrib\nribbon\nrice\nrich\nride\nridge\nrifle\nright\nrigid\nring\nriot\nripple\nrisk\nritual\nrival\nriver\nroad\nroast\nrobot\nrobust\nrocket\nromance\nroof\nrookie\nroom\nrose\nrotate\nrough\nround\nroute\nroyal\nrubber\nrude\nrug\nrule\nrun\nrunway\nrural\nsad\nsaddle\nsadness\nsafe\nsail\nsalad\nsalmon\nsalon\nsalt\nsalute\nsame\nsample\nsand\nsatisfy\nsatoshi\nsauce\nsausage\nsave\nsay\nscale\nscan\nscare\nscatter\nscene\nscheme\nschool\nscience\nscissors\nscorpion\nscout\nscrap\nscreen\nscript\nscrub\nsea\nsearch\nseason\nseat\nsecond\nsecret\nsection\nsecurity\nseed\nseek\nsegment\nselect\nsell\nseminar\nsenior\nsense\nsentence\nseries\nservice\nsession\nsettle\nsetup\nseven\nshadow\nshaft\nshallow\nshare\nshed\nshell\nsheriff\nshield\nshift\nshine\nship\nshiver\nshock\nshoe\nshoot\nshop\nshort\nshoulder\nshove\nshrimp\nshrug\nshuffle\nshy\nsibling\nsick\nside\nsiege\nsight\nsign\nsilent\nsilk\nsilly\nsilver\nsimilar\nsimple\nsince\nsing\nsiren\nsister\nsituate\nsix\nsize\nskate\nsketch\nski\nskill\nskin\nskirt\nskull\nslab\nslam\nsleep\nslender\nslice\nslide\nslight\nslim\nslogan\nslot\nslow\nslush\nsmall\nsmart\nsmile\nsmoke\nsmooth\nsnack\nsnake\nsnap\nsniff\nsnow\nsoap\nsoccer\nsocial\nsock\nsoda\nsoft\nsolar\nsoldier\nsolid\nsolution\nsolve\nsomeone\nsong\nsoon\nsorry\nsort\nsoul\nsound\nsoup\nsource\nsouth\nspace\nspare\nspatial\nspawn\nspeak\nspecial\nspeed\nspell\nspend\nsphere\nspice\nspider\nspike\nspin\nspirit\nsplit\nspoil\nsponsor\nspoon\nsport\nspot\nspray\nspread\nspring\nspy\nsquare\nsqueeze\nsquirrel\nstable\nstadium\nstaff\nstage\nstairs\nstamp\nstand\nstart\nstate\nstay\nsteak\nsteel\nstem\nstep\nstereo\nstick\nstill\nsting\nstock\nstomach\nstone\nstool\nstory\nstove\nstrategy\nstreet\nstrike\nstrong\nstruggle\nstudent\nstuff\nstumble\nstyle\nsubject\nsubmit\nsubway\nsuccess\nsuch\nsudden\nsuffer\nsugar\nsuggest\nsuit\nsummer\nsun\nsunny\nsunset\nsuper\nsupply\nsupreme\nsure\nsurface\nsurge\nsurprise\nsurround\nsurvey\nsuspect\nsustain\nswallow\nswamp\nswap\nswarm\nswear\nsweet\nswift\nswim\nswing\nswitch\nsword\nsymbol\nsymptom\nsyrup\nsystem\ntable\ntackle\ntag\ntail\ntalent\ntalk\ntank\ntape\ntarget\ntask\ntaste\ntattoo\ntaxi\nteach\nteam\ntell\nten\ntenant\ntennis\ntent\nterm\ntest\ntext\nthank\nthat\ntheme\nthen\ntheory\nthere\nthey\nthing\nthis\nthought\nthree\nthrive\nthrow\nthumb\nthunder\nticket\ntide\ntiger\ntilt\ntimber\ntime\ntiny\ntip\ntired\ntissue\ntitle\ntoast\ntobacco\ntoday\ntoddler\ntoe\ntogether\ntoilet\ntoken\ntomato\ntomorrow\ntone\ntongue\ntonight\ntool\ntooth\ntop\ntopic\ntopple\ntorch\ntornado\ntortoise\ntoss\ntotal\ntourist\ntoward\ntower\ntown\ntoy\ntrack\ntrade\ntraffic\ntragic\ntrain\ntransfer\ntrap\ntrash\ntravel\ntray\ntreat\ntree\ntrend\ntrial\ntribe\ntrick\ntrigger\ntrim\ntrip\ntrophy\ntrouble\ntruck\ntrue\ntruly\ntrumpet\ntrust\ntruth\ntry\ntube\ntuition\ntumble\ntuna\ntunnel\nturkey\nturn\nturtle\ntwelve\ntwenty\ntwice\ntwin\ntwist\ntwo\ntype\ntypical\nugly\numbrella\nunable\nunaware\nuncle\nuncover\nunder\nundo\nunfair\nunfold\nunhappy\nuniform\nunique\nunit\nuniverse\nunknown\nunlock\nuntil\nunusual\nunveil\nupdate\nupgrade\nuphold\nupon\nupper\nupset\nurban\nurge\nusage\nuse\nused\nuseful\nuseless\nusual\nutility\nvacant\nvacuum\nvague\nvalid\nvalley\nvalve\nvan\nvanish\nvapor\nvarious\nvast\nvault\nvehicle\nvelvet\nvendor\nventure\nvenue\nverb\nverify\nversion\nvery\nvessel\nveteran\nviable\nvibrant\nvicious\nvictory\nvideo\nview\nvillage\nvintage\nviolin\nvirtual\nvirus\nvisa\nvisit\nvisual\nvital\nvivid\nvocal\nvoice\nvoid\nvolcano\nvolume\nvote\nvoyage\nwage\nwagon\nwait\nwalk\nwall\nwalnut\nwant\nwarfare\nwarm\nwarrior\nwash\nwasp\nwaste\nwater\nwave\nway\nwealth\nweapon\nwear\nweasel\nweather\nweb\nwedding\nweekend\nweird\nwelcome\nwest\nwet\nwhale\nwhat\nwheat\nwheel\nwhen\nwhere\nwhip\nwhisper\nwide\nwidth\nwife\nwild\nwill\nwin\nwindow\nwine\nwing\nwink\nwinner\nwinter\nwire\nwisdom\nwise\nwish\nwitness\nwolf\nwoman\nwonder\nwood\nwool\nword\nwork\nworld\nworry\nworth\nwrap\nwreck\nwrestle\nwrist\nwrite\nwrong\nyard\nyear\nyellow\nyou\nyoung\nyouth\nzebra\nzero\nzone\nzoo".split("\n")}),i=n.cw(function(t,e){function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function r(t){if("boolean"!=typeof t)throw new Error(`Expected boolean, not ${t}`)}function i(t,...e){if(!((n=t)instanceof Uint8Array||null!=n&&"object"==typeof n&&"Uint8Array"===n.constructor.name))throw new Error("Expected Uint8Array");var n;if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function o(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(t.outputLen),n(t.blockLen)}function s(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function a(t,e){i(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}e.output=e.exists=e.hash=e.bytes=e.number=void 0,e.number=n,e.bytes=i,e.hash=o,e.exists=s,e.output=a;const c={number:n,bool:r,bytes:i,hash:o,exists:s,output:a};e.default=c}),o=n.cw(function(t,e){e.SHA2=void 0;const n=i(),r=h();class o extends r.Hash{constructor(t,e,n,i){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,r.createView)(this.buffer)}update(t){(0,n.exists)(this);const{view:e,buffer:i,blockLen:o}=this,s=(t=(0,r.toBytes)(t)).length;for(let n=0;n<s;){const a=Math.min(o-this.pos,s-n);if(a===o){const e=(0,r.createView)(t);for(;o<=s-n;n+=o)this.process(e,n);continue}i.set(t.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,n.exists)(this),(0,n.output)(t,this),this.finished=!0;const{buffer:e,view:i,blockLen:o,isLE:s}=this;let{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(i,0),a=0);for(let t=a;t<o;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),c=r?4:0,u=r?0:4;t.setUint32(e+c,s,r),t.setUint32(e+u,a,r)}(i,o-8,BigInt(8*this.length),s),this.process(i,0);const c=(0,r.createView)(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=u/4,l=this.get();if(f>l.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<f;t++)c.setUint32(4*t,l[t],s)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:i,destroyed:o,pos:s}=this;return t.length=r,t.pos=s,t.finished=i,t.destroyed=o,r%e&&t.buffer.set(n),t}}e.SHA2=o}),s=n.cw(function(t,e){const n=BigInt(2**32-1),r=BigInt(32);function i(t,e=!1){return e?{h:Number(t&n),l:Number(t>>r&n)}:{h:0|Number(t>>r&n),l:0|Number(t&n)}}function o(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let o=0;o<t.length;o++){const{h:s,l:a}=i(t[o],e);[n[o],r[o]]=[s,a]}return[n,r]}const s=(t,e)=>BigInt(t>>>0)<<r|BigInt(e>>>0);const a=(t,e,n)=>t>>>n;const c=(t,e,n)=>t<<32-n|e>>>n;const u=(t,e,n)=>t>>>n|e<<32-n;const f=(t,e,n)=>t<<32-n|e>>>n;const l=(t,e,n)=>t<<64-n|e>>>n-32;const h=(t,e,n)=>t>>>n-32|e<<64-n;const d=(t,e)=>e;const p=(t,e)=>t;const y=(t,e,n)=>t<<n|e>>>32-n;const g=(t,e,n)=>e<<n|t>>>32-n;const m=(t,e,n)=>e<<n-32|t>>>64-n;const b=(t,e,n)=>t<<n-32|e>>>64-n;function w(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:0|i}}const v=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0);const x=(t,e,n,r)=>e+n+r+(t/2**32|0)|0;const E=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0);const A=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0;const I=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0);const B=(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0;const _={fromBig:i,split:o,toBig:s,shrSH:a,shrSL:c,rotrSH:u,rotrSL:f,rotrBH:l,rotrBL:h,rotr32H:d,rotr32L:p,rotlSH:y,rotlSL:g,rotlBH:m,rotlBL:b,add:w,add3L:v,add3H:x,add4L:E,add4H:A,add5H:B,add5L:I};e.default=_}),a=n.cw(function(t,e){e.crypto=void 0,e.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0}),c=n.cw(function(t,e){e.hmac=void 0;const n=i(),r=h();class o extends r.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,n.hash)(t);const i=(0,r.toBytes)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(i.length>o?t.create().update(i).digest():i);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),s.fill(0)}update(t){return(0,n.exists)(this),this.iHash.update(t),this}digestInto(t){(0,n.exists)(this),(0,n.bytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=r,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.hmac=(t,e,n)=>new o(t,e).update(n).digest(),e.hmac.create=(t,e)=>new o(t,e)}),u=n.cw(function(t,e){e.pbkdf2Async=e.pbkdf2=void 0;const n=i(),r=c(),o=h();function s(t,e,i,s){(0,n.hash)(t);const a=(0,o.checkOpts)({dkLen:32,asyncTick:10},s),{c,dkLen:u,asyncTick:f}=a;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(f),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=(0,o.toBytes)(e),h=(0,o.toBytes)(i),d=new Uint8Array(u),p=r.hmac.create(t,l),y=p._cloneInto().update(h);return{c,dkLen:u,asyncTick:f,DK:d,PRF:p,PRFSalt:y}}function a(t,e,n,r,i){return t.destroy(),e.destroy(),r&&r.destroy(),i.fill(0),n}e.pbkdf2=function(t,e,n,r){const{c:i,dkLen:c,DK:u,PRF:f,PRFSalt:l}=s(t,e,n,r);let h;const d=new Uint8Array(4),p=(0,o.createView)(d),y=new Uint8Array(f.outputLen);for(let t=1,e=0;e<c;t++,e+=f.outputLen){const n=u.subarray(e,e+f.outputLen);p.setInt32(0,t,!1),(h=l._cloneInto(h)).update(d).digestInto(y),n.set(y.subarray(0,n.length));for(let t=1;t<i;t++){f._cloneInto(h).update(y).digestInto(y);for(let t=0;t<n.length;t++)n[t]^=y[t]}}return a(f,l,u,h,y)},e.pbkdf2Async=async function(t,e,n,r){const{c:i,dkLen:c,asyncTick:u,DK:f,PRF:l,PRFSalt:h}=s(t,e,n,r);let d;const p=new Uint8Array(4),y=(0,o.createView)(p),g=new Uint8Array(l.outputLen);for(let t=1,e=0;e<c;t++,e+=l.outputLen){const n=f.subarray(e,e+l.outputLen);y.setInt32(0,t,!1),(d=h._cloneInto(d)).update(p).digestInto(g),n.set(g.subarray(0,n.length)),await(0,o.asyncLoop)(i-1,u,()=>{l._cloneInto(d).update(g).digestInto(g);for(let t=0;t<n.length;t++)n[t]^=g[t]})}return a(l,h,f,d,g)}}),f=n.cw(function(t,e){e.sha256=void 0;const n=o(),r=h(),i=(t,e,n)=>t&e^~t&n,s=(t,e,n)=>t&e^t&n^e&n,a=new Uint32Array([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]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class f extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:t,B:e,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[t,e,n,r,i,o,s,a]}set(t,e,n,r,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let n=0;n<16;n++,e+=4)u[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=u[t-15],n=u[t-2],i=(0,r.rotr)(e,7)^(0,r.rotr)(e,18)^e>>>3,o=(0,r.rotr)(n,17)^(0,r.rotr)(n,19)^n>>>10;u[t]=o+u[t-7]+i+u[t-16]|0}let{A:n,B:o,C:c,D:f,E:l,F:h,G:d,H:p}=this;for(let t=0;t<64;t++){const e=p+((0,r.rotr)(l,6)^(0,r.rotr)(l,11)^(0,r.rotr)(l,25))+i(l,h,d)+a[t]+u[t]|0,y=((0,r.rotr)(n,2)^(0,r.rotr)(n,13)^(0,r.rotr)(n,22))+s(n,o,c)|0;p=d,d=h,h=l,l=f+e|0,f=c,c=o,o=n,n=e+y|0}n=n+this.A|0,o=o+this.B|0,c=c+this.C|0,f=f+this.D|0,l=l+this.E|0,h=h+this.F|0,d=d+this.G|0,p=p+this.H|0,this.set(n,o,c,f,l,h,d,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends f{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}e.sha256=(0,r.wrapConstructor)(()=>new f),(0,r.wrapConstructor)(()=>new l)}),l=n.cw(function(t,e){e.sha512=void 0;const n=o(),r=s(),i=h(),[a,c]=r.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),u=new Uint32Array(80),f=new Uint32Array(80);class l extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:n,Bl:r,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:f,Fl:l,Gh:h,Gl:d,Hh:p,Hl:y}=this;return[t,e,n,r,i,o,s,a,c,u,f,l,h,d,p,y]}set(t,e,n,r,i,o,s,a,c,u,f,l,h,d,p,y){this.Ah=0|t,this.Al=0|e,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|f,this.Fl=0|l,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|y}process(t,e){for(let n=0;n<16;n++,e+=4)u[n]=t.getUint32(e),f[n]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|u[t-15],n=0|f[t-15],i=r.default.rotrSH(e,n,1)^r.default.rotrSH(e,n,8)^r.default.shrSH(e,n,7),o=r.default.rotrSL(e,n,1)^r.default.rotrSL(e,n,8)^r.default.shrSL(e,n,7),s=0|u[t-2],a=0|f[t-2],c=r.default.rotrSH(s,a,19)^r.default.rotrBH(s,a,61)^r.default.shrSH(s,a,6),l=r.default.rotrSL(s,a,19)^r.default.rotrBL(s,a,61)^r.default.shrSL(s,a,6),h=r.default.add4L(o,l,f[t-7],f[t-16]),d=r.default.add4H(h,i,c,u[t-7],u[t-16]);u[t]=0|d,f[t]=0|h}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:l,Cl:h,Dh:d,Dl:p,Eh:y,El:g,Fh:m,Fl:b,Gh:w,Gl:v,Hh:x,Hl:E}=this;for(let t=0;t<80;t++){const e=r.default.rotrSH(y,g,14)^r.default.rotrSH(y,g,18)^r.default.rotrBH(y,g,41),A=r.default.rotrSL(y,g,14)^r.default.rotrSL(y,g,18)^r.default.rotrBL(y,g,41),I=y&m^~y&w,B=g&b^~g&v,_=r.default.add5L(E,A,B,c[t],f[t]),k=r.default.add5H(_,x,e,I,a[t],u[t]),P=0|_,S=r.default.rotrSH(n,i,28)^r.default.rotrBH(n,i,34)^r.default.rotrBH(n,i,39),O=r.default.rotrSL(n,i,28)^r.default.rotrBL(n,i,34)^r.default.rotrBL(n,i,39),R=n&o^n&l^o&l,U=i&s^i&h^s&h;x=0|w,E=0|v,w=0|m,v=0|b,m=0|y,b=0|g,({h:y,l:g}=r.default.add(0|d,0|p,0|k,0|P)),d=0|l,p=0|h,l=0|o,h=0|s,o=0|n,s=0|i;const C=r.default.add3L(P,O,U);n=r.default.add3H(C,k,S,R),i=0|C}({h:n,l:i}=r.default.add(0|this.Ah,0|this.Al,0|n,0|i)),({h:o,l:s}=r.default.add(0|this.Bh,0|this.Bl,0|o,0|s)),({h:l,l:h}=r.default.add(0|this.Ch,0|this.Cl,0|l,0|h)),({h:d,l:p}=r.default.add(0|this.Dh,0|this.Dl,0|d,0|p)),({h:y,l:g}=r.default.add(0|this.Eh,0|this.El,0|y,0|g)),({h:m,l:b}=r.default.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:w,l:v}=r.default.add(0|this.Gh,0|this.Gl,0|w,0|v)),({h:x,l:E}=r.default.add(0|this.Hh,0|this.Hl,0|x,0|E)),this.set(n,i,o,s,l,h,d,p,y,g,m,b,w,v,x,E)}roundClean(){u.fill(0),f.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class d extends l{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class p extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class y extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}e.sha512=(0,i.wrapConstructor)(()=>new l),(0,i.wrapConstructor)(()=>new d),(0,i.wrapConstructor)(()=>new p),(0,i.wrapConstructor)(()=>new y)}),h=n.cw(function(t,e){e.randomBytes=e.wrapConstructor=e.checkOpts=e.Hash=e.toBytes=e.asyncLoop=e.dY=e.qv=e.rotr=e.createView=void 0;const n=a();function r(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}e.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.rotr=(t,e)=>t<<32-e|t>>>e,e.qv=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!e.qv)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const o=48,s=57,c=65,u=70,f=97,l=102;function h(t){return t>=o&&t<=s?t-o:t>=c&&t<=u?t-(c-10):t>=f&&t<=l?t-(f-10):void 0}function d(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}function p(t){if("string"==typeof t&&(t=d(t)),!r(t))throw new Error("expected Uint8Array, got "+typeof t);return t}e.dY=async()=>{},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);const t=Date.now()-i;t>=0&&t<n||(await(0,e.dY)(),i+=t)}},e.toBytes=p;e.Hash=class{clone(){return this._cloneInto()}};const y={}.toString;e.checkOpts=function(t,e){if(void 0!==e&&"[object Object]"!==y.call(e))throw new Error("Options should be object or undefined");return Object.assign(t,e)},e.wrapConstructor=function(t){const e=e=>t().update(p(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e},e.randomBytes=function(t=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}}),d=n.cw(function(t,e){function n(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function r(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function i(...t){const e=t=>t,n=(t,e)=>n=>t(e(n));return{encode:t.map(t=>t.encode).reduceRight(n,e),decode:t.map(t=>t.decode).reduce(n,e)}}function o(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("alphabet.encode input should be an array of numbers");return e.map(e=>{if(n(e),e<0||e>=t.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${t.length})`);return t[e]})},decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("alphabet.decode input should be array of strings");return e.map(e=>{if("string"!=typeof e)throw new Error(`alphabet.decode: not string element=${e}`);const n=t.indexOf(e);if(-1===n)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return n})}}}function s(t=""){if("string"!=typeof t)throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("join.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw new Error(`join.encode: non-string input=${t}`);return e.join(t)},decode:e=>{if("string"!=typeof e)throw new Error("join.decode input should be string");return e.split(t)}}}function a(t,e="="){if(n(t),"string"!=typeof e)throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let t of n)if("string"!=typeof t)throw new Error(`padding.encode: non-string input=${t}`);for(;n.length*t%8;)n.push(e);return n},decode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let t of n)if("string"!=typeof t)throw new Error(`padding.decode: non-string input=${t}`);let r=n.length;if(r*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if(!((r-1)*t%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function c(t){if("function"!=typeof t)throw new Error("normalize fn should be function");return{encode:t=>t,decode:e=>t(e)}}function u(t,e,r){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let i=0;const o=[],s=Array.from(t);for(s.forEach(t=>{if(n(t),t<0||t>=e)throw new Error(`Wrong integer: ${t}`)});;){let t=0,n=!0;for(let o=i;o<s.length;o++){const a=s[o],c=e*t+a;if(!Number.isSafeInteger(c)||e*t/e!==t||c-a!==e*t)throw new Error("convertRadix: carry overflow");t=c%r;const u=Math.floor(c/r);if(s[o]=u,!Number.isSafeInteger(u)||u*r+t!==c)throw new Error("convertRadix: carry overflow");n&&(u?n=!1:i=o)}if(o.push(t),n)break}for(let e=0;e<t.length-1&&0===t[e];e++)o.push(0);return o.reverse()}e.Af=e.Ar=e.uh=e.As=e.rg=e.ic=e.tw=e.r0=e.K3=e.RG=e.xn=e.utils=void 0;const f=(t,e)=>e?f(e,t%e):t,l=(t,e)=>t+(e-f(t,e));function h(t,e,r,i){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(l(e,r)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${l(e,r)}`);let o=0,s=0;const a=2**r-1,c=[];for(const i of t){if(n(i),i>=2**e)throw new Error(`convertRadix2: invalid data word=${i} from=${e}`);if(o=o<<e|i,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=r;s-=r)c.push((o>>s-r&a)>>>0);o&=2**s-1}if(o=o<<r-s&a,!i&&s>=e)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&c.push(o>>>0),c}function d(t){return n(t),{encode:e=>{if(!r(e))throw new Error("radix.encode input should be Uint8Array");return u(Array.from(e),256,t)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(u(e,t,256))}}}function p(t,e=!1){if(n(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,t)>32||l(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!r(n))throw new Error("radix2.encode input should be Uint8Array");return h(Array.from(n),8,t,!e)},decode:n=>{if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(h(n,t,8,e))}}}function y(t){if("function"!=typeof t)throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch(t){}}}function g(t,e){if(n(t),"function"!=typeof e)throw new Error("checksum fn should be function");return{encode(n){if(!r(n))throw new Error("checksum.encode: input should be Uint8Array");const i=e(n).slice(0,t),o=new Uint8Array(n.length+t);return o.set(n),o.set(i,n.length),o},decode(n){if(!r(n))throw new Error("checksum.decode: input should be Uint8Array");const i=n.slice(0,-t),o=e(i).slice(0,t),s=n.slice(-t);for(let e=0;e<t;e++)if(o[e]!==s[e])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:o,chain:i,checksum:g,convertRadix:u,convertRadix2:h,radix:d,radix2:p,join:s,padding:a},e.xn=i(p(4),o("0123456789ABCDEF"),s("")),e.RG=i(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),a(5),s("")),i(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s("")),i(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),a(5),s("")),i(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s("")),i(p(5),o("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),s(""),c(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.K3=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a(6),s("")),i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s("")),e.r0=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(6),s("")),i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(""));const m=t=>i(d(58),o(t),s(""));e.tw=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b=[0,2,3,5,6,7,9,10,11];e.ic={encode(t){let n="";for(let r=0;r<t.length;r+=8){const i=t.subarray(r,r+8);n+=e.tw.encode(i).padStart(b[i.length],"1")}return n},decode(t){let n=[];for(let r=0;r<t.length;r+=11){const i=t.slice(r,r+11),o=b.indexOf(i.length),s=e.tw.decode(i);for(let t=0;t<s.length-o;t++)if(0!==s[t])throw new Error("base58xmr: wrong padding");n=n.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(n)}};e.rg=t=>i(g(4,e=>t(t(e))),e.tw),e.rg;const w=i(o("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),v=[996825010,642813549,513874426,1027748829,705979059];function x(t){const e=t>>25;let n=(33554431&t)<<5;for(let t=0;t<v.length;t++)1==(e>>t&1)&&(n^=v[t]);return n}function E(t,e,n=1){const r=t.length;let i=1;for(let e=0;e<r;e++){const n=t.charCodeAt(e);if(n<33||n>126)throw new Error(`Invalid prefix (${t})`);i=x(i)^n>>5}i=x(i);for(let e=0;e<r;e++)i=x(i)^31&t.charCodeAt(e);for(let t of e)i=x(i)^t;for(let t=0;t<6;t++)i=x(i);return i^=n,w.encode(h([i%2**30],30,5,!1))}function A(t){const e="bech32"===t?1:734539939,n=p(5),r=n.decode,i=n.encode,o=y(r);function s(t,n,r=90){if("string"!=typeof t)throw new Error("bech32.encode prefix should be string, not "+typeof t);if(n instanceof Uint8Array&&(n=Array.from(n)),!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof n);if(0===t.length)throw new TypeError(`Invalid prefix length ${t.length}`);const i=t.length+7+n.length;if(!1!==r&&i>r)throw new TypeError(`Length ${i} exceeds limit ${r}`);const o=t.toLowerCase(),s=E(o,n,e);return`${o}1${w.encode(n)}${s}`}function a(t,n=90){if("string"!=typeof t)throw new Error("bech32.decode input should be string, not "+typeof t);if(t.length<8||!1!==n&&t.length>n)throw new TypeError(`Wrong string length: ${t.length} (${t}). Expected (8..${n})`);const r=t.toLowerCase();if(t!==r&&t!==t.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=r.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=r.slice(0,i),s=r.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=w.decode(s).slice(0,-6),c=E(o,a,e);if(!s.endsWith(c))throw new Error(`Invalid checksum in ${t}: expected "${c}"`);return{prefix:o,words:a}}return{encode:s,decode:a,encodeFromBytes:function(t,e){return s(t,i(e))},decodeToBytes:function(t){const{prefix:e,words:n}=a(t,!1);return{prefix:e,words:n,bytes:r(n)}},decodeUnsafe:y(a),fromWords:r,fromWordsUnsafe:o,toWords:i}}A("bech32"),A("bech32m"),e.As={encode:t=>(new TextDecoder).decode(t),decode:t=>(new TextEncoder).encode(t)},e.uh=i(p(4),o("0123456789abcdef"),s(""),c(t=>{if("string"!=typeof t||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()}));const I={utf8:e.As,hex:e.uh,base16:e.xn,base32:e.RG,base64:e.K3,base64url:e.r0,base58:e.tw,base58xmr:e.ic},B="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.Ar=(t,e)=>{if("string"!=typeof t||!I.hasOwnProperty(t))throw new TypeError(B);if(!r(e))throw new TypeError("bytesToString() expects Uint8Array");return I[t].encode(e)},e.Ar;e.Af=(t,e)=>{if(!I.hasOwnProperty(t))throw new TypeError(B);if("string"!=typeof e)throw new TypeError("stringToBytes() expects string");return I[t].decode(e)},e.Af}),p={};n.r(p),n.d(p,{OG:()=>Vn,My:()=>Tn,Ph:()=>$n,lX:()=>Dn,Id:()=>Gn,fg:()=>Wn,qj:()=>zn,aT:()=>Kn,lq:()=>Hn,z:()=>jn,Q5:()=>Yn});var y={};n.r(y),n.d(y,{compressPublicKey:()=>ld,compressedPublicKeyLength:()=>yd,curve:()=>rd,decompressPublicKey:()=>hd,deriveUnhardenedKeys:()=>ad,getPublicKey:()=>ud,isValidPrivateKey:()=>sd,masterNodeGenerationSpec:()=>pd,name:()=>id,privateKeyLength:()=>dd,publicAdd:()=>fd,publicKeyLength:()=>cd,secret:()=>od});var g={};n.r(g),n.d(g,{bytesToNumberLE:()=>Ad,compressPublicKey:()=>kd,compressedPublicKeyLength:()=>Rd,curve:()=>gd,decompressPublicKey:()=>Pd,deriveUnhardenedKeys:()=>xd,getPublicKey:()=>Bd,isValidPrivateKey:()=>vd,masterNodeGenerationSpec:()=>Od,multiplyWithBase:()=>Id,name:()=>md,privateKeyLength:()=>Sd,publicAdd:()=>_d,publicKeyLength:()=>Ed,secret:()=>bd});var m={};n.r(m),n.d(m,{compressPublicKey:()=>rp,compressedPublicKeyLength:()=>ap,curve:()=>Zd,decompressPublicKey:()=>ip,deriveUnhardenedKeys:()=>Xd,getPublicKey:()=>ep,isValidPrivateKey:()=>tp,masterNodeGenerationSpec:()=>sp,name:()=>Yd,privateKeyLength:()=>op,publicAdd:()=>np,publicKeyLength:()=>Qd,secret:()=>Jd});var b={};n.r(b),n.d(b,{deriveChildKey:()=>Op,privateKeyToEthAddress:()=>Pp,publicKeyToEthAddress:()=>Sp});var w={};n.r(w),n.d(w,{bip39MnemonicToMultipath:()=>Lp,createBip39KeyFromSeed:()=>Tp,deriveChildKey:()=>Np,entropyToCip3MasterNode:()=>Fp});var v={};n.r(v),n.d(v,{add:()=>Gp,bigIntToBytes:()=>Dp,bytesToBigInt:()=>$p,deriveChainCode:()=>Jp,deriveChildKey:()=>ty,derivePrivateKey:()=>Wp,derivePublicKey:()=>Qp,getKeyExtension:()=>Vp,mod2Pow256:()=>zp,padEnd32Bytes:()=>Hp,toReversed:()=>Kp,trunc28Mul8:()=>jp});var x={};n.r(x),n.d(x,{deriveChildKey:()=>ey});class E extends TypeError{constructor(t,e){let n;const{message:r,explanation:i,...o}=t,{path:s}=t,a=0===s.length?r:`At path: ${s.join(".")} -- ${r}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...e()])}}function A(t){return"object"==typeof t&&null!==t}function I(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function B(t,e,n,r){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:o}=e,{type:s}=n,{refinement:a,message:c=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${I(r)}\``}=t;return{value:r,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:c}}function*_(t,e,n,r){(function(t){return A(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=B(i,e,n,r);t&&(yield t)}}function*k(t,e,n={}){const{path:r=[],branch:i=[t],coerce:o=!1,mask:s=!1}=n,a={path:r,branch:i};if(o&&(t=e.coercer(t,a),s&&"type"!==e.type&&A(e.schema)&&A(t)&&!Array.isArray(t)))for(const n in t)void 0===e.schema[n]&&delete t[n];let c="valid";for(const r of e.validator(t,a))r.explanation=n.message,c="not_valid",yield[r,void 0];for(let[u,f,l]of e.entries(t,a)){const e=k(f,l,{path:void 0===u?r:[...r,u],branch:void 0===u?i:[...i,f],coerce:o,mask:s,message:n.message});for(const n of e)n[0]?(c=null===n[0].refinement||void 0===n[0].refinement?"not_valid":"not_refined",yield[n[0],void 0]):o&&(f=n[1],void 0===u?t=f:t instanceof Map?t.set(u,f):t instanceof Set?t.add(f):A(t)&&(void 0!==f||u in t)&&(t[u]=f))}if("not_valid"!==c)for(const r of e.refiner(t,a))r.explanation=n.message,c="not_refined",yield[r,void 0];"valid"===c&&(yield[void 0,t])}class P{constructor(t){const{type:e,schema:n,validator:r,refiner:i,coercer:o=t=>t,entries:s=function*(){}}=t;this.type=e,this.schema=n,this.entries=s,this.coercer=o,this.validator=r?(t,e)=>_(r(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>_(i(t,e),e,this,t):()=>[];for(const e of Object.getOwnPropertySymbols(t))Object.defineProperty(this,e,Object.getOwnPropertyDescriptor(t,e))}assert(t,e){return R(t,this,e)}create(t,e){return function(t,e,n){const r=C(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}(t,this,e)}is(t){return U(t,this)}mask(t,e){return function(t,e,n){const r=C(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(t,this,e)}validate(t,e={}){return C(t,this,e)}}const S="EXACT_OPTIONAL";class O extends P{constructor(t){super({...t,type:`exact optional ${t.type}`}),this.brand=S}static isExactOptional(t){return A(t)&&"brand"in t&&t.brand===S}}function R(t,e,n){const r=C(t,e,{message:n});if(r[0])throw r[0]}function U(t,e){return!C(t,e)[0]}function C(t,e,n={}){const r=k(t,e,n),i=function(t){const{done:e,value:n}=t.next();return e?void 0:n}(r);if(i[0]){return[new E(i[0],function*(){for(const t of r)t[0]&&(yield t[0])}),void 0]}return[void 0,i[1]]}const L="***",N=Symbol.for("superstruct.sensitive");function T(t,e){const n={...t};for(const t of e)t in n&&(n[t]=L);return n}function F(t,e,n){function*r(t){for(const r of t){if(!A(e)){yield r;continue}const t=r.branch.indexOf(e);if(-1===t){yield r;continue}const i=[...r.branch];i[t]=T(e,n);for(let e=t-1;e>=0;e--){const t=i[e];if(!A(t))break;const n=r.branch[e+1],o=i[e+1];if(Array.isArray(t)){const r=t.indexOf(n);if(-1===r)break;const s=[...t];s[r]=o,i[e]=s}else if(t instanceof Map){let r,s=!1;for(const[e,i]of t)if(i===n){r=e,s=!0;break}if(!s)break;const a=new Map(t);a.set(r,o),i[e]=a}else{const r=Object.keys(t).find(e=>t[e]===n);if(void 0===r)break;i[e]={...t,[r]:o}}}yield{...r,branch:i}}}return new P({...t,validator:(e,n)=>r(t.validator(e,n)),refiner:(e,n)=>r(t.refiner(e,n)),*entries(r,i){for(const o of t.entries(r,i)){const[t,r,i]=o;yield[t,r,F(i,e,n)]}}})}function K(t,e){const n=Object.keys(e).filter(t=>{return void 0!==e[t]&&(n=e[t],Object.prototype.hasOwnProperty.call(n,N));var n});return 0===n.length?t:new P({...t,*entries(e,r){const i=r.branch[r.branch.length-1]??e;for(const o of t.entries(e,r)){const[t,e,r]=o;yield[t,e,F(r,i,n)]}}})}function $(t){return new P({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${I(t)}`})}function D(){return q("boolean",t=>"boolean"==typeof t)}function H(){return q("never",()=>!1)}function j(t){const e=t?Object.keys(t):[],n=H(),r=new P({type:"object",schema:t??null,*entries(r){if(t&&A(r)){const i=new Set(Object.keys(r));for(const n of e){i.delete(n);const e=t[n];O.isExactOptional(e)&&!Object.prototype.hasOwnProperty.call(r,n)||(yield[n,r[n],t[n]])}for(const t of i)yield[t,r[t],n]}},validator:t=>A(t)||`Expected an object, but received: ${I(t)}`,coercer:t=>A(t)?{...t}:t});return t?K(r,t):r}function z(t){return new P({...t,validator:(e,n)=>void 0===e||t.validator(e,n),refiner:(e,n)=>void 0===e||t.refiner(e,n)})}function G(){return q("string",t=>"string"==typeof t||`Expected a string, but received: ${I(t)}`)}function V(t){const e=t.map(t=>t.type).join(" | ");return new P({type:"union",schema:null,coercer(e){for(const n of t){const[t,r]=n.validate(e,{coerce:!0});if(!t)return r}return e},validator(n,r){const i=[];for(const e of t){const[...t]=k(n,e,r),[o]=t;if(!o?.[0])return[];for(const[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${I(n)}`,...i]}})}function M(...t){const e="type"===t[0]?.type,n=t.map(({schema:t})=>t),r=Object.assign({},...n);return e?function(t){const e=Object.keys(t);return K(new P({type:"type",schema:t,*entries(n){if(A(n))for(const r of e)O.isExactOptional(t[r])&&!Object.prototype.hasOwnProperty.call(n,r)||(yield[r,n[r],t[r]])},validator:t=>A(t)||`Expected an object, but received: ${I(t)}`,coercer:t=>A(t)?{...t}:t}),t)}(r):j(r)}function q(t,e){return new P({type:t,schema:null,validator:e})}function W(t,e){return Z(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function Z(t,e,n){return new P({...t,*refiner(r,i){yield*t.refiner(r,i);const o=_(n(r,i),i,t,r);for(const t of o)yield{...t,refinement:e}}})}const Y=BigInt(2**32-1),J=BigInt(32);function X(t,e=!1){return e?{h:Number(t&Y),l:Number(t>>J&Y)}:{h:0|Number(t>>J&Y),l:0|Number(t&Y)}}function Q(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let o=0;o<n;o++){const{h:n,l:s}=X(t[o],e);[r[o],i[o]]=[n,s]}return[r,i]}const tt=(t,e,n)=>t>>>n,et=(t,e,n)=>t<<32-n|e>>>n,nt=(t,e,n)=>t>>>n|e<<32-n,rt=(t,e,n)=>t<<32-n|e>>>n,it=(t,e,n)=>t<<64-n|e>>>n-32,ot=(t,e,n)=>t>>>n-32|e<<64-n,st=(t,e,n)=>t<<n|e>>>32-n,at=(t,e,n)=>e<<n|t>>>32-n,ct=(t,e,n)=>e<<n-32|t>>>64-n,ut=(t,e,n)=>t<<n-32|e>>>64-n;function ft(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:0|i}}const lt=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),ht=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,dt=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),pt=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,yt=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),gt=(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0,mt="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function bt(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function wt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function vt(t,...e){if(!bt(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function xt(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");wt(t.outputLen),wt(t.blockLen)}function Et(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function At(t,e){vt(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function It(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Bt(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function _t(t,e){return t<<32-e|t>>>e}function kt(t,e){return t<<e|t>>>32-e>>>0}const Pt=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function St(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const Ot=Pt?t=>t:function(t){for(let e=0;e<t.length;e++)t[e]=St(t[e]);return t},Rt="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,Ut=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ct(t){if(vt(t),Rt)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=Ut[t[n]];return e}const Lt=48,Nt=57,Tt=65,Ft=70,Kt=97,$t=102;function Dt(t){return t>=Lt&&t<=Nt?t-Lt:t>=Tt&&t<=Ft?t-(Tt-10):t>=Kt&&t<=$t?t-(Kt-10):void 0}function Ht(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(Rt)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,i=0;e<n;e++,i+=2){const n=Dt(t.charCodeAt(i)),o=Dt(t.charCodeAt(i+1));if(void 0===n||void 0===o){const e=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+i)}r[e]=16*n+o}return r}function jt(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function zt(t){return"string"==typeof t&&(t=jt(t)),vt(t),t}function Gt(t){return"string"==typeof t&&(t=jt(t)),vt(t),t}function Vt(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];vt(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const i=t[e];n.set(i,r),r+=i.length}return n}class Mt{}function qt(t){const e=e=>t().update(zt(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Wt(t=32){if(mt&&"function"==typeof mt.getRandomValues)return mt.getRandomValues(new Uint8Array(t));if(mt&&"function"==typeof mt.randomBytes)return Uint8Array.from(mt.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const Zt=BigInt(0),Yt=BigInt(1),Jt=BigInt(2),Xt=BigInt(7),Qt=BigInt(256),te=BigInt(113),ee=[],ne=[],re=[];for(let t=0,e=Yt,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],ee.push(2*(5*r+n)),ne.push((t+1)*(t+2)/2%64);let i=Zt;for(let t=0;t<7;t++)e=(e<<Yt^(e>>Xt)*te)%Qt,e&Jt&&(i^=Yt<<(Yt<<BigInt(t))-Yt);re.push(i)}const ie=Q(re,!0),oe=ie[0],se=ie[1],ae=(t,e,n)=>n>32?ct(t,e,n):st(t,e,n),ce=(t,e,n)=>n>32?ut(t,e,n):at(t,e,n);class ue extends Mt{constructor(t,e,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=r,this.rounds=i,wt(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}clone(){return this._cloneInto()}keccak(){Ot(this.state32),function(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,i=(e+2)%10,o=n[i],s=n[i+1],a=ae(o,s,1)^n[r],c=ce(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=a,t[e+n+1]^=c}let e=t[2],i=t[3];for(let n=0;n<24;n++){const r=ne[n],o=ae(e,i,r),s=ce(e,i,r),a=ee[n];e=t[a],i=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=oe[r],t[1]^=se[r]}It(n)}(this.state32,this.rounds),Ot(this.state32),this.posOut=0,this.pos=0}update(t){Et(this),vt(t=zt(t));const{blockLen:e,state:n}=this,r=t.length;for(let i=0;i<r;){const o=Math.min(e-this.pos,r-i);for(let e=0;e<o;e++)n[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,128&e&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){Et(this,!1),vt(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);t.set(e.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return wt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(At(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,It(this.state)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return t||(t=new ue(e,n,r,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}const fe=(t,e,n)=>qt(()=>new ue(e,t,n)),le=fe(1,136,32);var he=n(543);Error;function de(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)}const pe=(t,e)=>Object.hasOwnProperty.call(t,e);var ye;!function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(ye=ye||(ye={}));function ge(t){return function(t){return function(t){return"object"==typeof t&&null!==t&&"message"in t}(t)&&"string"==typeof t.message?t.message:null==t?"":String(t)}(t).replace(/\.$/u,"")}function me(t,e){return n=t,Boolean("string"==typeof n?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var n}class be extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}function we(t,e,n="Assertion failed",r=be){try{R(t,e)}catch(t){throw me(r,`${n}: ${ge(t)}.`)}}const{memoize:ve}=he,xe=/^(?:0x)?[0-9a-f]+$/iu,Ee=/^0x[0-9a-f]+$/iu,Ae=/^0x[0-9a-f]{40}$/u,Ie=/^0x[0-9a-fA-F]{40}$/u,Be=(W(G(),xe),W(G(),Ee),W(G(),Ae),W(G(),Ie)),_e=t=>"string"==typeof t;function ke(t){return _e(t)&&Ie.test(t)}const Pe=ve(function(t){!function(t,e="Assertion failed.",n=be){if(!t){if(e instanceof Error)throw e;throw me(n,e)}}(ke(t),"Invalid hex address.");const e=function(t){if(t.startsWith("0x")||t.startsWith("0X"))return t.substring(2);return t}(t).toLowerCase(),n=le(e),{length:r}=e,i=new Array(r);for(let t=0;t<r;t++){const r=1&t,o=n[t>>1],s=0===r?o>>4:15&o;i[t]=s>=8?e[t].toUpperCase():e[t]}return`0x${i.join("")}`});const Se=ve(function(t){return!!ke(t)&&Pe(t)===t});ve(function(t){return _e(e=t)&&Ae.test(e)||Se(t);var e});var Oe;function Re(t){return q(JSON.stringify(t),function(t){const e=I(t),n=typeof t;return new P({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?t:null,validator:n=>n===t||`Expected the literal \`${e}\`, but received: ${I(n)}`})}(t).validator)}function Ue(t){return Re(t)}function Ce(t,e,n=[]){return(...r)=>{if(1===r.length&&function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}}(r[0])){const n={...r[0],type:t};return we(n,e,`Invalid ${t} component`),n}const i=n.reduce((t,e,n)=>void 0!==r[n]?{...t,[e]:r[n]}:t,{type:t});return we(i,e,`Invalid ${t} component`),i}}!function(t){t.Copyable="copyable",t.Divider="divider",t.Heading="heading",t.Panel="panel",t.Spinner="spinner",t.Text="text",t.Image="image",t.Row="row",t.Address="address",t.Button="button",t.Input="input",t.Form="form"}(Oe||(Oe={}));const Le=j({type:G()}),Ne=M(Le,j({value:q("unknown",()=>!0)})),Te=M(Ne,j({type:Re(Oe.Address),value:Be}));Ce(Oe.Address,Te,["value"]);var Fe,Ke;!function(t){t.Primary="primary",t.Secondary="secondary"}(Fe||(Fe={})),function(t){t.Button="button",t.Submit="submit"}(Ke||(Ke={}));const $e=M(Ne,j({type:Re(Oe.Button),value:G(),variant:z(V([Ue(Fe.Primary),Ue(Fe.Secondary)])),buttonType:z(V([Ue(Ke.Button),Ue(Ke.Submit)])),name:z(G())})),De=(Ce(Oe.Button,$e,["value","buttonType","name","variant"]),M(Ne,j({type:Re(Oe.Copyable),value:G(),sensitive:z(D())}))),He=(Ce(Oe.Copyable,De,["value","sensitive"]),M(Le,j({type:Re(Oe.Divider)})));Ce(Oe.Divider,He);var je;!function(t){t.Text="text",t.Number="number",t.Password="password"}(je||(je={}));const ze=M(Ne,j({type:Re(Oe.Input),value:z(G()),name:G(),inputType:z(V([Ue(je.Text),Ue(je.Password),Ue(je.Number)])),placeholder:z(G()),label:z(G()),error:z(G())})),Ge=(Ce(Oe.Input,ze,["name","inputType","placeholder","value","label"]),V([ze,$e])),Ve=M(Le,j({type:Re(Oe.Form),children:$(Ge),name:G()})),Me=(Ce(Oe.Form,Ve,["name","children"]),M(Ne,j({type:Re(Oe.Heading),value:G()}))),qe=Ce(Oe.Heading,Me,["value"]);const We=M(Le,j({type:Re(Oe.Image),value:Z(G(),"SVG",t=>!!t.includes("<svg")||"Value is not a valid SVG.")})),Ze=(Ce(Oe.Image,We,["value"]),M(Ne,j({type:Re(Oe.Text),value:G(),markdown:z(D())}))),Ye=Ce(Oe.Text,Ze,["value","markdown"]);var Je;!function(t){t.Default="default",t.Critical="critical",t.Warning="warning"}(Je||(Je={}));const Xe=V([We,Ze,Te]),Qe=M(Ne,j({type:Re(Oe.Row),variant:z(V([Ue(Je.Default),Ue(Je.Critical),Ue(Je.Warning)])),label:G(),value:Xe})),tn=(Ce(Oe.Row,Qe,["label","value","variant"]),M(Le,j({type:Re(Oe.Spinner)}))),en=(Ce(Oe.Spinner,tn),M(Le,j({children:$(function(t){let e;return new P({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator:(n,r)=>(e??(e=t()),e.validator(n,r)),coercer:(n,r)=>(e??(e=t()),e.coercer(n,r)),refiner:(n,r)=>(e??(e=t()),e.refiner(n,r))})}(()=>on))}))),nn=M(en,j({type:Re(Oe.Panel)})),rn=Ce(Oe.Panel,nn,["children"]),on=function(t){const e=t.map(t=>"union"===t.type&&Array.isArray(t.schema)?t.schema:t).flat(1/0),n=e.map(({schema:t})=>t.type.type),r=e.reduce((t,e)=>(t[JSON.parse(e.schema.type.type)]=e,t),{});return new P({type:"union",schema:e,*entries(t,e){if(!de(t)||!pe(t,"type")||"string"!=typeof t.type)return;const{type:n}=t,i=r[n];if(i)for(const n of i.entries(t,e))yield n},coercer(t,e){if(!de(t)||!pe(t,"type")||"string"!=typeof t.type)return t;const{type:n}=t,i=r[n];return i?i.coercer(t,e):t},*refiner(t,e){const n=r[t.type];yield*n.refiner(t,e)},validator(t,e){if(!de(t)||!pe(t,"type")||"string"!=typeof t.type)return`Expected type to be one of: ${n.join(", ")}, but received: undefined`;const{type:i}=t,o=r[i];return o?o.validator(t,e):`Expected type to be one of: ${n.join(", ")}, but received: "${i}"`}})}([De,He,Me,We,nn,tn,Ze,Qe,Te,ze,Ve,$e]);function sn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function an(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function cn(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");sn(t.outputLen),sn(t.blockLen)}function un(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function fn(t,e){an(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const ln="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,hn=t=>t instanceof Uint8Array,dn=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),pn=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),yn=(t,e)=>t<<32-e|t>>>e;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");const gn=async()=>{};async function mn(t,e,n){let r=Date.now();for(let i=0;i<t;i++){n(i);const t=Date.now()-r;t>=0&&t<e||(await gn(),r+=t)}}function bn(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}(t)),!hn(t))throw new Error("expected Uint8Array, got "+typeof t);return t}class wn{clone(){return this._cloneInto()}}const vn={}.toString;function xn(t,e){if(void 0!==e&&"[object Object]"!==vn.call(e))throw new Error("Options should be object or undefined");return Object.assign(t,e)}function En(t){const e=e=>t().update(bn(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function An(t=32){if(ln&&"function"==typeof ln.getRandomValues)return ln.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class In extends wn{constructor(t,e,n,r){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=pn(this.buffer)}update(t){un(this);const{view:e,buffer:n,blockLen:r}=this,i=(t=bn(t)).length;for(let o=0;o<i;){const s=Math.min(r-this.pos,i-o);if(s===r){const e=pn(t);for(;r<=i-o;o+=r)this.process(e,o);continue}n.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){un(this),fn(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:r,isLE:i}=this;let{pos:o}=this;e[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>r-o&&(this.process(n,0),o=0);for(let t=o;t<r;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),c=r?4:0,u=r?0:4;t.setUint32(e+c,s,r),t.setUint32(e+u,a,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const s=pn(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)s.setUint32(4*t,u[t],i)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:i,destroyed:o,pos:s}=this;return t.length=r,t.pos=s,t.finished=i,t.destroyed=o,r%e&&t.buffer.set(n),t}}const Bn=(t,e,n)=>t&e^~t&n,_n=(t,e,n)=>t&e^t&n^e&n,kn=new Uint32Array([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]),Pn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Sn=new Uint32Array(64);class On extends In{constructor(){super(64,32,8,!1),this.A=0|Pn[0],this.B=0|Pn[1],this.C=0|Pn[2],this.D=0|Pn[3],this.E=0|Pn[4],this.F=0|Pn[5],this.G=0|Pn[6],this.H=0|Pn[7]}get(){const{A:t,B:e,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[t,e,n,r,i,o,s,a]}set(t,e,n,r,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let n=0;n<16;n++,e+=4)Sn[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=Sn[t-15],n=Sn[t-2],r=yn(e,7)^yn(e,18)^e>>>3,i=yn(n,17)^yn(n,19)^n>>>10;Sn[t]=i+Sn[t-7]+r+Sn[t-16]|0}let{A:n,B:r,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+(yn(s,6)^yn(s,11)^yn(s,25))+Bn(s,a,c)+kn[t]+Sn[t]|0,f=(yn(n,2)^yn(n,13)^yn(n,22))+_n(n,r,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=r,r=n,n=e+f|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,i,o,s,a,c,u)}roundClean(){Sn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Rn=En(()=>new On),Un=(BigInt(0),BigInt(1)),Cn=BigInt(2),Ln=t=>t instanceof Uint8Array,Nn=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Tn(t){if(!Ln(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=Nn[t[n]];return e}function Fn(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":`0x${t}`)}function Kn(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let e=0;e<n.length;e++){const r=2*e,i=t.slice(r,r+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[e]=o}return n}function $n(t){return Fn(Tn(t))}function Dn(t){if(!Ln(t))throw new Error("Uint8Array expected");return Fn(Tn(Uint8Array.from(t).reverse()))}function Hn(t,e){return Kn(t.toString(16).padStart(2*e,"0"))}function jn(t,e){return Hn(t,e).reverse()}function zn(t,e,n){let r;if("string"==typeof e)try{r=Kn(e)}catch(n){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${n}`)}else{if(!Ln(e))throw new Error(`${t} must be hex string or Uint8Array`);r=Uint8Array.from(e)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(`${t} expected ${n} bytes, got ${i}`);return r}function Gn(...t){const e=new Uint8Array(t.reduce((t,e)=>t+e.length,0));let n=0;return t.forEach(t=>{if(!Ln(t))throw new Error("Uint8Array expected");e.set(t,n),n+=t.length}),e}const Vn=t=>(Cn<<BigInt(t-1))-Un,Mn=t=>new Uint8Array(t),qn=t=>Uint8Array.from(t);function Wn(t,e,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=Mn(t),i=Mn(t),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...t)=>n(i,r,...t),c=(t=Mn())=>{i=a(qn([0]),t),r=a(),0!==t.length&&(i=a(qn([1]),t),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){r=a();const e=r.slice();n.push(e),t+=r.length}return Gn(...n)};return(t,e)=>{let n;for(s(),c(t);!(n=e(u()));)c();return s(),n}}const Zn={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function Yn(t,e,n={}){const r=(e,n,r)=>{const i=Zn[n];if("function"!=typeof i)throw new Error(`Invalid validator "${n}", expected function`);const o=t[e];if(!(r&&void 0===o||i(o,t)))throw new Error(`Invalid param ${String(e)}=${o} (${typeof o}), expected ${n}`)};for(const[t,n]of Object.entries(e))r(t,n,!1);for(const[t,e]of Object.entries(n))r(t,e,!0);return t}const Jn=BigInt(0),Xn=BigInt(1),Qn=BigInt(2),tr=BigInt(3),er=BigInt(4),nr=BigInt(5),rr=BigInt(8);BigInt(9),BigInt(16);function ir(t,e){const n=t%e;return n>=Jn?n:e+n}function or(t,e,n){if(n<=Jn||e<Jn)throw new Error("Expected power/modulo > 0");if(n===Xn)return Jn;let r=Xn;for(;e>Jn;)e&Xn&&(r=r*t%n),t=t*t%n,e>>=Xn;return r}function sr(t,e,n){let r=t;for(;e-- >Jn;)r*=r,r%=n;return r}function ar(t,e){if(t===Jn||e<=Jn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=ir(t,e),r=e,i=Jn,o=Xn,s=Xn,a=Jn;for(;n!==Jn;){const t=r/n,e=r%n,c=i-s*t,u=o-a*t;r=n,n=e,i=s,o=a,s=c,a=u}if(r!==Xn)throw new Error("invert: does not exist");return ir(i,e)}function cr(t){if(t%er===tr){const e=(t+Xn)/er;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}if(t%rr===nr){const e=(t-nr)/rr;return function(t,n){const r=t.mul(n,Qn),i=t.pow(r,e),o=t.mul(n,i),s=t.mul(t.mul(o,Qn),i),a=t.mul(o,t.sub(s,t.ONE));if(!t.eql(t.sqr(a),n))throw new Error("Cannot find square root");return a}}return function(t){const e=(t-Xn)/Qn;let n,r,i;for(n=t-Xn,r=0;n%Qn===Jn;n/=Qn,r++);for(i=Qn;i<t&&or(i,e,t)!==t-Xn;i++);if(1===r){const e=(t+Xn)/er;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}const o=(n+Xn)/Qn;return function(t,s){if(t.pow(s,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let a=r,c=t.pow(t.mul(t.ONE,i),n),u=t.pow(s,o),f=t.pow(s,n);for(;!t.eql(f,t.ONE);){if(t.eql(f,t.ZERO))return t.ZERO;let e=1;for(let n=t.sqr(f);e<a&&!t.eql(n,t.ONE);e++)n=t.sqr(n);const n=t.pow(c,Xn<<BigInt(a-e-1));c=t.sqr(n),u=t.mul(u,n),f=t.mul(f,c),a=e}return u}}(t)}const ur=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function fr(t,e){const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function lr(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function hr(t){const e=lr(t);return e+Math.ceil(e/2)}class dr extends wn{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,cn(t);const n=bn(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?t.create().update(n).digest():n);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){return un(this),this.iHash.update(t),this}digestInto(t){un(this),an(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=r,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const pr=(t,e,n)=>new dr(t,e).update(n).digest();pr.create=(t,e)=>new dr(t,e);const yr=BigInt(0),gr=BigInt(1);function mr(t){return function(t){const e=ur.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});Yn(t,e)}(t.Fp),Yn(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fr(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const{Ph:br,aT:wr}=p,vr={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(t){const{Err:e}=vr;if(t.length<2||2!==t[0])throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(128&r[0])throw new e("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new e("Invalid signature integer: unnecessary leading zero");return{d:br(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=vr,n="string"==typeof t?wr(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||48!=n[0])throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=vr._parseInt(n.subarray(2)),{d:s,l:a}=vr._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=t=>8&Number.parseInt(t[0],16)?"00"+t:t,n=t=>{const e=t.toString(16);return 1&e.length?`0${e}`:e},r=e(n(t.s)),i=e(n(t.r)),o=r.length/2,s=i.length/2,a=n(o),c=n(s);return`30${n(s+o+4)}02${c}${i}02${a}${r}`}},xr=BigInt(0),Er=BigInt(1),Ar=(BigInt(2),BigInt(3));BigInt(4);function Ir(t){const e=function(t){const e=mr(t);Yn(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:n}=e,r=e.toBytes||((t,e,r)=>{const i=e.toAffine();return Gn(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=e.fromBytes||(t=>{const e=t.subarray(1);return{x:n.fromBytes(e.subarray(0,n.BYTES)),y:n.fromBytes(e.subarray(n.BYTES,2*n.BYTES))}});function o(t){const{a:r,b:i}=e,o=n.sqr(t),s=n.mul(o,t);return n.add(n.add(s,n.mul(t,r)),i)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(t){return"bigint"==typeof t&&xr<t&&t<e.n}function a(t){if(!s(t))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(t){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:o}=e;if(n&&"bigint"!=typeof t){if(t instanceof Uint8Array&&(t=Tn(t)),"string"!=typeof t||!n.includes(t.length))throw new Error("Invalid key");t=t.padStart(2*r,"0")}let s;try{s="bigint"==typeof t?t:$n(zn("private key",t,r))}catch(e){throw new Error(`private key must be ${r} bytes, hex or bigint, not ${typeof t}`)}return i&&(s=ir(s,o)),a(s),s}const u=new Map;function f(t){if(!(t instanceof l))throw new Error("ProjectivePoint expected")}class l{constructor(t,e,r){if(this.px=t,this.py=e,this.pz=r,null==t||!n.isValid(t))throw new Error("x required");if(null==e||!n.isValid(e))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required")}static fromAffine(t){const{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw new Error("invalid affine point");if(t instanceof l)throw new Error("projective point not allowed");const i=t=>n.eql(t,n.ZERO);return i(e)&&i(r)?l.ZERO:new l(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=n.invertBatch(t.map(t=>t.pz));return t.map((t,n)=>t.toAffine(e[n])).map(l.fromAffine)}static fromHex(t){const e=l.fromAffine(i(zn("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return l.BASE.multiply(c(t))}_setWindowSize(t){this._WINDOW_SIZE=t,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:t,y:r}=this.toAffine();if(!n.isValid(t)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=n.sqr(r),s=o(t);if(!n.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){f(t);const{px:e,py:r,pz:i}=this,{px:o,py:s,pz:a}=t,c=n.eql(n.mul(e,a),n.mul(o,i)),u=n.eql(n.mul(r,a),n.mul(s,i));return c&&u}negate(){return new l(this.px,n.neg(this.py),this.pz)}double(){const{a:t,b:r}=e,i=n.mul(r,Ar),{px:o,py:s,pz:a}=this;let c=n.ZERO,u=n.ZERO,f=n.ZERO,h=n.mul(o,o),d=n.mul(s,s),p=n.mul(a,a),y=n.mul(o,s);return y=n.add(y,y),f=n.mul(o,a),f=n.add(f,f),c=n.mul(t,f),u=n.mul(i,p),u=n.add(c,u),c=n.sub(d,u),u=n.add(d,u),u=n.mul(c,u),c=n.mul(y,c),f=n.mul(i,f),p=n.mul(t,p),y=n.sub(h,p),y=n.mul(t,y),y=n.add(y,f),f=n.add(h,h),h=n.add(f,h),h=n.add(h,p),h=n.mul(h,y),u=n.add(u,h),p=n.mul(s,a),p=n.add(p,p),h=n.mul(p,y),c=n.sub(c,h),f=n.mul(p,d),f=n.add(f,f),f=n.add(f,f),new l(c,u,f)}add(t){f(t);const{px:r,py:i,pz:o}=this,{px:s,py:a,pz:c}=t;let u=n.ZERO,h=n.ZERO,d=n.ZERO;const p=e.a,y=n.mul(e.b,Ar);let g=n.mul(r,s),m=n.mul(i,a),b=n.mul(o,c),w=n.add(r,i),v=n.add(s,a);w=n.mul(w,v),v=n.add(g,m),w=n.sub(w,v),v=n.add(r,o);let x=n.add(s,c);return v=n.mul(v,x),x=n.add(g,b),v=n.sub(v,x),x=n.add(i,o),u=n.add(a,c),x=n.mul(x,u),u=n.add(m,b),x=n.sub(x,u),d=n.mul(p,v),u=n.mul(y,b),d=n.add(u,d),u=n.sub(m,d),d=n.add(m,d),h=n.mul(u,d),m=n.add(g,g),m=n.add(m,g),b=n.mul(p,b),v=n.mul(y,v),m=n.add(m,b),b=n.sub(g,b),b=n.mul(p,b),v=n.add(v,b),g=n.mul(m,v),h=n.add(h,g),g=n.mul(x,v),u=n.mul(w,u),u=n.sub(u,g),g=n.mul(w,m),d=n.mul(x,d),d=n.add(d,g),new l(u,h,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(l.ZERO)}wNAF(t){return d.wNAFCached(this,u,t,t=>{const e=n.invertBatch(t.map(t=>t.pz));return t.map((t,n)=>t.toAffine(e[n])).map(l.fromAffine)})}multiplyUnsafe(t){const r=l.ZERO;if(t===xr)return r;if(a(t),t===Er)return this;const{endo:i}=e;if(!i)return d.unsafeLadder(this,t);let{k1neg:o,k1:s,k2neg:c,k2:u}=i.splitScalar(t),f=r,h=r,p=this;for(;s>xr||u>xr;)s&Er&&(f=f.add(p)),u&Er&&(h=h.add(p)),p=p.double(),s>>=Er,u>>=Er;return o&&(f=f.negate()),c&&(h=h.negate()),h=new l(n.mul(h.px,i.beta),h.py,h.pz),f.add(h)}multiply(t){a(t);let r,i,o=t;const{endo:s}=e;if(s){const{k1neg:t,k1:e,k2neg:a,k2:c}=s.splitScalar(o);let{p:u,f}=this.wNAF(e),{p:h,f:p}=this.wNAF(c);u=d.constTimeNegate(t,u),h=d.constTimeNegate(a,h),h=new l(n.mul(h.px,s.beta),h.py,h.pz),r=u.add(h),i=f.add(p)}else{const{p:t,f:e}=this.wNAF(o);r=t,i=e}return l.normalizeZ([r,i])[0]}multiplyAndAddUnsafe(t,e,n){const r=l.BASE,i=(t,e)=>e!==xr&&e!==Er&&t.equals(r)?t.multiply(e):t.multiplyUnsafe(e),o=i(this,e).add(i(t,n));return o.is0()?void 0:o}toAffine(t){const{px:e,py:r,pz:i}=this,o=this.is0();null==t&&(t=o?n.ONE:n.inv(i));const s=n.mul(e,t),a=n.mul(r,t),c=n.mul(i,t);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){const{h:t,isTorsionFree:n}=e;if(t===Er)return!0;if(n)return n(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:n}=e;return t===Er?this:n?n(l,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return this.assertValidity(),r(l,this,t)}toHex(t=!0){return Tn(this.toRawBytes(t))}}l.BASE=new l(e.Gx,e.Gy,n.ONE),l.ZERO=new l(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,d=function(t,e){const n=(t,e)=>{const n=e.negate();return t?n:e},r=t=>({windows:Math.ceil(e/t)+1,windowSize:2**(t-1)});return{constTimeNegate:n,unsafeLadder(e,n){let r=t.ZERO,i=e;for(;n>yr;)n&gr&&(r=r.add(i)),i=i.double(),n>>=gr;return r},precomputeWindow(t,e){const{windows:n,windowSize:i}=r(e),o=[];let s=t,a=s;for(let t=0;t<n;t++){a=s,o.push(a);for(let t=1;t<i;t++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,i,o){const{windows:s,windowSize:a}=r(e);let c=t.ZERO,u=t.BASE;const f=BigInt(2**e-1),l=2**e,h=BigInt(e);for(let t=0;t<s;t++){const e=t*a;let r=Number(o&f);o>>=h,r>a&&(r-=l,o+=gr);const s=e,d=e+Math.abs(r)-1,p=t%2!=0,y=r<0;0===r?u=u.add(n(p,i[s])):c=c.add(n(y,i[d]))}return{p:c,f:u}},wNAFCached(t,e,n,r){const i=t._WINDOW_SIZE||1;let o=e.get(t);return o||(o=this.precomputeWindow(t,i),1!==i&&e.set(t,r(o))),this.wNAF(i,o,n)}}}(l,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}function Br(t){const e=function(t){const e=mr(t);return Yn(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:n,n:r}=e,i=n.BYTES+1,o=2*n.BYTES+1;function s(t){return ir(t,r)}function a(t){return ar(t,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:f,isWithinCurveOrder:l}=Ir({...e,toBytes(t,e,r){const i=e.toAffine(),o=n.toBytes(i.x),s=Gn;return r?s(Uint8Array.from([e.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,n.toBytes(i.y))},fromBytes(t){const e=t.length,r=t[0],s=t.subarray(1);if(e!==i||2!==r&&3!==r){if(e===o&&4===r){return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))}}throw new Error(`Point of length ${e} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}{const t=$n(s);if(!(xr<(a=t)&&a<n.ORDER))throw new Error("Point is not on curve");const e=f(t);let i=n.sqrt(e);return!(1&~r)!==((i&Er)===Er)&&(i=n.neg(i)),{x:t,y:i}}var a}}),h=t=>Tn(Hn(t,e.nByteLength));function d(t){return t>r>>Er}const p=(t,e,n)=>$n(t.slice(e,n));class y{constructor(t,e,n){this.r=t,this.s=e,this.recovery=n,this.assertValidity()}static fromCompact(t){const n=e.nByteLength;return t=zn("compactSignature",t,2*n),new y(p(t,0,n),p(t,n,2*n))}static fromDER(t){const{r:e,s:n}=vr.toSig(zn("DER",t));return new y(e,n)}assertValidity(){if(!l(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!l(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(t){return new y(this.r,this.s,t)}recoverPublicKey(t){const{r,s:i,recovery:o}=this,u=w(zn("msgHash",t));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const f=2===o||3===o?r+e.n:r;if(f>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const l=1&o?"03":"02",d=c.fromHex(l+h(f)),p=a(f),y=s(-u*p),g=s(i*p),m=c.BASE.multiplyAndAddUnsafe(d,y,g);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Kn(this.toDERHex())}toDERHex(){return vr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Kn(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const g={isValidPrivateKey(t){try{return u(t),!0}catch(t){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const t=hr(e.n);return function(t,e,n=!1){const r=t.length,i=lr(e),o=hr(e);if(r<16||r<o||r>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=ir(n?$n(t):Dn(t),e-Xn)+Xn;return n?jn(s,i):Hn(s,i)}(e.randomBytes(t),e.n)},precompute:(t=8,e=c.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function m(t){const e=t instanceof Uint8Array,n="string"==typeof t,r=(e||n)&&t.length;return e?r===i||r===o:n?r===2*i||r===2*o:t instanceof c}const b=e.bits2int||function(t){const n=$n(t),r=8*t.length-e.nBitLength;return r>0?n>>BigInt(r):n},w=e.bits2int_modN||function(t){return s(b(t))},v=Vn(e.nBitLength);function x(t){if("bigint"!=typeof t)throw new Error("bigint expected");if(!(xr<=t&&t<v))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Hn(t,e.nByteLength)}function E(t,r,i=A){if(["recovered","canonical"].some(t=>t in i))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:f}=e;let{lowS:h,prehash:p,extraEntropy:g}=i;null==h&&(h=!0),t=zn("msgHash",t),p&&(t=zn("prehashed msgHash",o(t)));const m=w(t),v=u(r),E=[x(v),x(m)];if(null!=g){const t=!0===g?f(n.BYTES):g;E.push(zn("extraEntropy",t))}const I=Gn(...E),B=m;return{seed:I,k2sig:function(t){const e=b(t);if(!l(e))return;const n=a(e),r=c.BASE.multiply(e).toAffine(),i=s(r.x);if(i===xr)return;const o=s(n*s(B+i*v));if(o===xr)return;let u=(r.x===i?0:2)|Number(r.y&Er),f=o;return h&&d(o)&&(f=function(t){return d(t)?s(-t):t}(o),u^=1),new y(i,f,u)}}}const A={lowS:e.lowS,prehash:!1},I={lowS:e.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return c.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,n=!0){if(m(t))throw new Error("first arg must be private key");if(!m(e))throw new Error("second arg must be public key");return c.fromHex(e).multiply(u(t)).toRawBytes(n)},sign:function(t,n,r=A){const{seed:i,k2sig:o}=E(t,n,r),s=e;return Wn(s.hash.outputLen,s.nByteLength,s.hmac)(i,o)},verify:function(t,n,r,i=I){const o=t;if(n=zn("msgHash",n),r=zn("publicKey",r),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:f}=i;let l,h;try{if("string"==typeof o||o instanceof Uint8Array)try{l=y.fromDER(o)}catch(t){if(!(t instanceof vr.Err))throw t;l=y.fromCompact(o)}else{if("object"!=typeof o||"bigint"!=typeof o.r||"bigint"!=typeof o.s)throw new Error("PARSE");{const{r:t,s:e}=o;l=new y(t,e)}}h=c.fromHex(r)}catch(t){if("PARSE"===t.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&l.hasHighS())return!1;f&&(n=e.hash(n));const{r:d,s:p}=l,g=w(n),m=a(p),b=s(g*m),v=s(d*m),x=c.BASE.multiplyAndAddUnsafe(h,b,v)?.toAffine();return!!x&&s(x.x)===d},ProjectivePoint:c,Signature:y,utils:g}}function _r(t){return{hash:t,hmac:(e,...n)=>pr(t,e,function(...t){const e=new Uint8Array(t.reduce((t,e)=>t+e.length,0));let n=0;return t.forEach(t=>{if(!hn(t))throw new Error("Uint8Array expected");e.set(t,n),n+=t.length}),e}(...n)),randomBytes:An}}const kr=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Pr=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Sr=BigInt(1),Or=BigInt(2),Rr=(t,e)=>(t+e/Or)/e;function Ur(t){const e=kr,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,f=u*u*t%e,l=sr(f,n,e)*f%e,h=sr(l,n,e)*f%e,d=sr(h,Or,e)*u%e,p=sr(d,i,e)*d%e,y=sr(p,o,e)*p%e,g=sr(y,a,e)*y%e,m=sr(g,c,e)*g%e,b=sr(m,a,e)*y%e,w=sr(b,n,e)*f%e,v=sr(w,s,e)*p%e,x=sr(v,r,e)*u%e,E=sr(x,Or,e);if(!Cr.eql(Cr.sqr(E),t))throw new Error("Cannot find square root");return E}const Cr=function(t,e,n=!1,r={}){if(t<=Jn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=fr(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=cr(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:Vn(i),ZERO:Jn,ONE:Xn,create:e=>ir(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("Invalid field element: expected bigint, got "+typeof e);return Jn<=e&&e<t},is0:t=>t===Jn,isOdd:t=>(t&Xn)===Xn,neg:e=>ir(-e,t),eql:(t,e)=>t===e,sqr:e=>ir(e*e,t),add:(e,n)=>ir(e+n,t),sub:(e,n)=>ir(e-n,t),mul:(e,n)=>ir(e*n,t),pow:(t,e)=>function(t,e,n){if(n<Jn)throw new Error("Expected power > 0");if(n===Jn)return t.ONE;if(n===Xn)return e;let r=t.ONE,i=e;for(;n>Jn;)n&Xn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Xn;return r}(a,t,e),div:(e,n)=>ir(e*ar(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>ar(e,t),sqrt:r.sqrt||(t=>s(a,t)),invertBatch:t=>function(t,e){const n=new Array(e.length),r=e.reduce((e,r,i)=>t.is0(r)?e:(n[i]=e,t.mul(e,r)),t.ONE),i=t.inv(r);return e.reduceRight((e,r,i)=>t.is0(r)?e:(n[i]=t.mul(e,n[i]),t.mul(e,r)),i),n}(a,t),cmov:(t,e,n)=>n?e:t,toBytes:t=>n?jn(t,o):Hn(t,o),fromBytes:t=>{if(t.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${t.length}`);return n?Dn(t):$n(t)}});return Object.freeze(a)}(kr,void 0,void 0,{sqrt:Ur}),Lr=function(t,e){const n=e=>Br({...t,..._r(e)});return Object.freeze({...n(e),create:n})}({a:BigInt(0),b:BigInt(7),Fp:Cr,n:Pr,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Pr,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Sr*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=Rr(o*t,e),c=Rr(-r*t,e);let u=ir(t-a*n-c*i,e),f=ir(-a*r-c*o,e);const l=u>s,h=f>s;if(l&&(u=e-u),h&&(f=e-f),u>s||f>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:u,k2neg:h,k2:f}}}},Rn);BigInt(0);Lr.ProjectivePoint;function Nr(t,e,n){const r=e.split("|").map(t=>t.trim());for(let n=0;n<r.length;n++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${n}`,i.value=t,i}async function Tr(t){const e=Object.keys(t);return(await Promise.all(e.map(e=>Promise.resolve(t[e])))).reduce((t,n,r)=>(t[e[r]]=n,t),{})}function Fr(t,e,n){for(let r in e){let i=e[r];const o=n?n[r]:null;o&&Nr(i,o,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function Kr(t,e){if(null==t)return"null";if(null==e&&(e=new Set),"object"==typeof t){if(e.has(t))return"[Circular]";e.add(t)}if(Array.isArray(t))return"[ "+t.map(t=>Kr(t,e)).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r<t.length;r++)n+=e[t[r]>>4],n+=e[15&t[r]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return Kr(t.toJSON(),e);switch(typeof t){case"boolean":case"number":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const n=Object.keys(t);return n.sort(),"{ "+n.map(n=>`${Kr(n,e)}: ${Kr(t[n],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function $r(t,e,n){let r,i=t;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${Kr(n)}`);for(const t in n){if("shortMessage"===t)continue;const e=n[t];r.push(t+"="+Kr(e))}}r.push(`code=${e}`),r.push("version=6.17.0"),r.length&&(t+=" ("+r.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":r=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(t);break;default:r=new Error(t)}return Fr(r,{code:e}),n&&Object.assign(r,n),null==r.shortMessage&&Fr(r,{shortMessage:i}),r}function Dr(t,e,n,r){if(!t)throw $r(e,n,r)}function Hr(t,e,n,r){Dr(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}const jr=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){const t=String.fromCharCode(233).normalize("NFD");if(t!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t},[]);function zr(t){Dr(jr.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function Gr(t,e,n){if(null==n&&(n=""),t!==e){let t=n,e="new";n&&(t+=".",e+=" "+n),Dr(!1,`private constructor; use ${t}from* methods`,"UNSUPPORTED_OPERATION",{operation:e})}}function Vr(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.length%2==0&&t.match(/^0x[0-9a-f]*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let r=0;r<e.length;r++)e[r]=parseInt(t.substring(n,n+2),16),n+=2;return e}Hr(!1,"invalid BytesLike value",e||"value",t)}function Mr(t,e){return Vr(t,e,!1)}function qr(t,e){return Vr(t,e,!0)}function Wr(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof e||t.length===2+2*e)&&(!0!==e||t.length%2==0))}function Zr(t){return Wr(t,!0)||t instanceof Uint8Array}const Yr="0123456789abcdef";function Jr(t){const e=Mr(t);let n="0x";for(let t=0;t<e.length;t++){const r=e[t];n+=Yr[(240&r)>>4]+Yr[15&r]}return n}function Xr(t){return"0x"+t.map(t=>Jr(t).substring(2)).join("")}function Qr(t){return Wr(t,!0)?(t.length-2)/2:Mr(t).length}function ti(t,e,n){const r=Mr(t);return null!=n&&n>r.length&&Dr(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Jr(r.slice(e??0,n??r.length))}function ei(t,e,n){const r=Mr(t);Dr(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),Jr(i)}function ni(t,e){return ei(t,e,!0)}const ri=BigInt(0),ii=BigInt(1),oi=9007199254740991;function si(t,e){switch(typeof t){case"bigint":return t;case"number":return Hr(Number.isInteger(t),"underflow",e||"value",t),Hr(t>=-oi&&t<=oi,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){Hr(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}Hr(!1,"invalid BigNumberish value",e||"value",t)}function ai(t,e){const n=si(t,e);return Dr(n>=ri,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const ci="0123456789abcdef";function ui(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=ci[n>>4],e+=ci[15&n];return BigInt(e)}return si(t)}function fi(t,e){switch(typeof t){case"bigint":return Hr(t>=-oi&&t<=oi,"overflow",e||"value",t),Number(t);case"number":return Hr(Number.isInteger(t),"underflow",e||"value",t),Hr(t>=-oi&&t<=oi,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return fi(BigInt(t),e)}catch(n){Hr(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}Hr(!1,"invalid numeric value",e||"value",t)}function li(t,e){const n=ai(t,"value");let r=n.toString(16);if(null==e)r.length%2&&(r="0"+r);else{const i=fi(e,"width");if(0===i&&n===ri)return"0x";for(Dr(2*i>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<2*i;)r="0"+r}return"0x"+r}function hi(t,e){const n=ai(t,"value");if(n===ri){const t=null!=e?fi(e,"width"):0;return new Uint8Array(t)}let r=n.toString(16);if(r.length%2&&(r="0"+r),null!=e){const n=fi(e,"width");for(;r.length<2*n;)r="00"+r;Dr(2*n===r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeArray",fault:"overflow",value:t})}const i=new Uint8Array(r.length/2);for(let t=0;t<i.length;t++){const e=2*t;i[t]=parseInt(r.substring(e,e+2),16)}return i}const di="0x0000000000000000000000000000000000000000000000000000000000000000",pi=BigInt(0),yi=BigInt(1),gi=BigInt(2),mi=BigInt(27),bi=BigInt(28),wi=BigInt(35),vi=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xi=vi/gi,Ei=Symbol.for("nodejs.util.inspect.custom"),Ai={};function Ii(t){return ni(hi(t),32)}class Bi{#t;#e;#n;#r;get r(){return this.#t}set r(t){Hr(32===Qr(t),"invalid r","value",t),this.#t=Jr(t)}get s(){return Hr(parseInt(this.#e.substring(0,3))<8,"non-canonical s; use ._s","s",this.#e),this.#e}set s(t){Hr(32===Qr(t),"invalid s","value",t),this.#e=Jr(t)}get _s(){return this.#e}isValid(){return BigInt(this.#e)<=xi}get v(){return this.#n}set v(t){const e=fi(t,"value");Hr(27===e||28===e,"invalid v","v",t),this.#n=e}get networkV(){return this.#r}get legacyChainId(){const t=this.networkV;return null==t?null:Bi.getChainId(t)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const t=Mr(this.s);return this.yParity&&(t[0]|=128),Jr(t)}get compactSerialized(){return Xr([this.r,this.yParityAndS])}get serialized(){return Xr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(t,e,n,r){Gr(t,Ai,"Signature"),this.#t=e,this.#e=n,this.#n=r,this.#r=null}getCanonical(){if(this.isValid())return this;const t=vi-BigInt(this._s),e=55-this.v,n=new Bi(Ai,this.r,Ii(t),e);return this.networkV&&(n.#r=this.networkV),n}clone(){const t=new Bi(Ai,this.r,this._s,this.v);return this.networkV&&(t.#r=this.networkV),t}toJSON(){const t=this.networkV;return{_type:"signature",networkV:null!=t?t.toString():null,r:this.r,s:this._s,v:this.v}}[Ei](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(t){const e=si(t,"v");return e==mi||e==bi?pi:(Hr(e>=wi,"invalid EIP-155 v","v",t),(e-wi)/gi)}static getChainIdV(t,e){return si(t)*gi+BigInt(35+e-27)}static getNormalizedV(t){const e=si(t);return e===pi||e===mi?27:e===yi||e===bi?28:(Hr(e>=wi,"invalid v","v",t),e&yi?27:28)}static from(t){function e(e,n){Hr(e,n,"signature",t)}if(null==t)return new Bi(Ai,di,di,27);if("string"==typeof t){const n=Mr(t,"signature");if(64===n.length){const t=Jr(n.slice(0,32)),e=n.slice(32,64),r=128&e[0]?28:27;return e[0]&=127,new Bi(Ai,t,Jr(e),r)}if(65===n.length){const t=Jr(n.slice(0,32)),e=Jr(n.slice(32,64)),r=Bi.getNormalizedV(n[64]);return new Bi(Ai,t,e,r)}e(!1,"invalid raw signature length")}if(t instanceof Bi)return t.clone();const n=t.r;e(null!=n,"missing r");const r=Ii(n),i=function(t,n){if(null!=t)return Ii(t);if(null!=n){e(Wr(n,32),"invalid yParityAndS");const t=Mr(n);return t[0]&=127,Jr(t)}e(!1,"missing s")}(t.s,t.yParityAndS),{networkV:o,v:s}=function(t,n,r){if(null!=t){const e=si(t);return{networkV:e>=wi?e:void 0,v:Bi.getNormalizedV(e)}}if(null!=n)return e(Wr(n,32),"invalid yParityAndS"),{v:128&Mr(n)[0]?28:27};if(null!=r){switch(fi(r,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}e(!1,"invalid yParity")}e(!1,"missing v")}(t.v,t.yParityAndS,t.yParity),a=new Bi(Ai,r,i,s);return o&&(a.#r=o),e(null==t.yParity||fi(t.yParity,"sig.yParity")===a.yParity,"yParity mismatch"),e(null==t.yParityAndS||t.yParityAndS===a.yParityAndS,"yParityAndS mismatch"),a}}class _i{#i;constructor(t){Hr(32===Qr(t),"invalid private key","privateKey","[REDACTED]"),this.#i=Jr(t)}get privateKey(){return this.#i}get publicKey(){return _i.computePublicKey(this.#i)}get compressedPublicKey(){return _i.computePublicKey(this.#i,!0)}sign(t){Hr(32===Qr(t),"invalid digest length","digest",t);const e=Lr.sign(qr(t),qr(this.#i),{lowS:!0});return Bi.from({r:li(e.r,32),s:li(e.s,32),v:e.recovery?28:27})}computeSharedSecret(t){const e=_i.computePublicKey(t);return Jr(Lr.getSharedSecret(qr(this.#i),Mr(e),!1))}static computePublicKey(t,e){let n=Mr(t,"key");if(32===n.length){return Jr(Lr.getPublicKey(n,!!e))}if(64===n.length){const t=new Uint8Array(65);t[0]=4,t.set(n,1),n=t}return Jr(Lr.ProjectivePoint.fromHex(n).toRawBytes(e))}static recoverPublicKey(t,e){Hr(32===Qr(t),"invalid digest length","digest",t);const n=Bi.from(e);let r=Lr.Signature.fromCompact(qr(Xr([n.r,n.s])));r=r.addRecoveryBit(n.yParity);const i=r.recoverPublicKey(qr(t));return Hr(null!=i,"invalid signature for digest","signature",e),"0x"+i.toHex(!1)}static addPoints(t,e,n){const r=Lr.ProjectivePoint.fromHex(_i.computePublicKey(t).substring(2)),i=Lr.ProjectivePoint.fromHex(_i.computePublicKey(e).substring(2));return"0x"+r.add(i).toHex(!!n)}}const ki=BigInt(2**32-1),Pi=BigInt(32);function Si(t,e=!1){return e?{h:Number(t&ki),l:Number(t>>Pi&ki)}:{h:0|Number(t>>Pi&ki),l:0|Number(t&ki)}}function Oi(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:o,l:s}=Si(t[i],e);[n[i],r[i]]=[o,s]}return[n,r]}const Ri=(t,e,n)=>t<<n|e>>>32-n,Ui=(t,e,n)=>e<<n|t>>>32-n,Ci=(t,e,n)=>e<<n-32|t>>>64-n,Li=(t,e,n)=>t<<n-32|e>>>64-n;const Ni={fromBig:Si,split:Oi,toBig:(t,e)=>BigInt(t>>>0)<<Pi|BigInt(e>>>0),shrSH:(t,e,n)=>t>>>n,shrSL:(t,e,n)=>t<<32-n|e>>>n,rotrSH:(t,e,n)=>t>>>n|e<<32-n,rotrSL:(t,e,n)=>t<<32-n|e>>>n,rotrBH:(t,e,n)=>t<<64-n|e>>>n-32,rotrBL:(t,e,n)=>t>>>n-32|e<<64-n,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH:Ri,rotlSL:Ui,rotlBH:Ci,rotlBL:Li,add:function(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:0|i}},add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,add5H:(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0,add5L:(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0)};const[Ti,Fi,Ki]=[[],[],[]],$i=BigInt(0),Di=BigInt(1),Hi=BigInt(2),ji=BigInt(7),zi=BigInt(256),Gi=BigInt(113);for(let t=0,e=Di,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],Ti.push(2*(5*r+n)),Fi.push((t+1)*(t+2)/2%64);let i=$i;for(let t=0;t<7;t++)e=(e<<Di^(e>>ji)*Gi)%zi,e&Hi&&(i^=Di<<(Di<<BigInt(t))-Di);Ki.push(i)}const[Vi,Mi]=Oi(Ki,!0),qi=(t,e,n)=>n>32?Ci(t,e,n):Ri(t,e,n),Wi=(t,e,n)=>n>32?Li(t,e,n):Ui(t,e,n);class Zi extends wn{constructor(t,e,n,r=!1,i=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,sn(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=dn(this.state)}keccak(){!function(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,i=(e+2)%10,o=n[i],s=n[i+1],a=qi(o,s,1)^n[r],c=Wi(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=a,t[e+n+1]^=c}let e=t[2],i=t[3];for(let n=0;n<24;n++){const r=Fi[n],o=qi(e,i,r),s=Wi(e,i,r),a=Ti[n];e=t[a],i=t[a+1],t[a]=o,t[a+1]=s}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=Vi[r],t[1]^=Mi[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){un(this);const{blockLen:e,state:n}=this,r=(t=bn(t)).length;for(let i=0;i<r;){const o=Math.min(e-this.pos,r-i);for(let e=0;e<o;e++)n[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,128&e&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){un(this,!1),an(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);t.set(e.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return sn(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(fn(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return t||(t=new Zi(e,n,r,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}const Yi=(t,e,n)=>En(()=>new Zi(e,t,n)),Ji=Yi(1,136,32);let Xi=!1;const Qi=function(t){return Ji(t)};let to=Qi;function eo(t){const e=Mr(t,"data");return Jr(to(e))}eo._=Qi,eo.lock=function(){Xi=!0},eo.register=function(t){if(Xi)throw new TypeError("keccak256 is locked");to=t},Object.freeze(eo);const no=BigInt(0),ro=BigInt(36);function io(t){const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const r=Mr(eo(n));for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&r[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const oo={};for(let t=0;t<10;t++)oo[String(t)]=String(t);for(let t=0;t<26;t++)oo[String.fromCharCode(65+t)]=String(10+t);function so(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map(t=>oo[t]).join("");for(;e.length>=15;){let t=e.substring(0,15);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const ao=function(){const t={};for(let e=0;e<36;e++){t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e)}return t}();function co(t){if(Hr("string"==typeof t,"invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=io(t);return Hr(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Hr(t.substring(2,4)===so(t),"bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=no;for(let n=0;n<t.length;n++)e=e*ro+ao[t[n]];return e}(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return io("0x"+e)}Hr(!1,"invalid address","address",t)}async function uo(t,e){const n=await e;return null!=n&&"0x0000000000000000000000000000000000000000"!==n||(Dr("string"!=typeof t,"unconfigured name","UNCONFIGURED_NAME",{value:t}),Hr(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),co(n)}function fo(t,e){return"string"==typeof t?t.match(/^0x[0-9a-f]{40}$/i)?co(t):(Dr(null!=e,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),uo(t,e.resolveName(t))):(n=t)&&"function"==typeof n.getAddress?uo(t,t.getAddress()):t&&"function"==typeof t.then?uo(t,t):void Hr(!1,"unsupported addressable value","target",t);var n}function lo(t,e,n,r,i){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let r=e+1;r<n.length&&n[r]>>6==2;r++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}Object.freeze({error:function(t,e,n,r,i){Hr(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)},ignore:lo,replace:function(t,e,n,r,i){return"OVERLONG"===t?(Hr("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),lo(t,e,n))}});function ho(t,e){Hr("string"==typeof t,"invalid string value","str",t),null!=e&&(zr(e),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){e++;const i=t.charCodeAt(e);Hr(e<t.length&&56320==(64512&i),"invalid surrogate pair","str",t);const o=65536+((1023&r)<<10)+(1023&i);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(63&o|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return new Uint8Array(n)}function po(t){return"string"==typeof t&&(t=ho(t)),eo(Xr([ho("Ethereum Signed Message:\n"),ho(String(t.length)),t]))}function yo(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function go(t){if(Array.isArray(t)){let e=[];if(t.forEach(function(t){e=e.concat(go(t))}),e.length<=55)return e.unshift(192+e.length),e;const n=yo(e.length);return n.unshift(247+n.length),n.concat(e)}const e=Array.prototype.slice.call(Mr(t,"object"));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=yo(e.length);return n.unshift(183+n.length),n.concat(e)}const mo="0123456789abcdef";function bo(t){let e="0x";for(const n of go(t))e+=mo[n>>4],e+=mo[15&n];return e}function wo(t){return Hr("string"==typeof t.address,"invalid address for hashAuthorization","auth.address",t),eo(Xr(["0x05",bo([null!=t.chainId?hi(t.chainId):"0x",co(t.address),null!=t.nonce?hi(t.nonce):"0x"])]))}function vo(t){return eo(ho(t))}const xo=new Uint8Array(32);xo.fill(0);const Eo=BigInt(-1),Ao=BigInt(0),Io=BigInt(1),Bo=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const _o=li(Io,32),ko=li(Ao,32),Po={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},So=["name","version","chainId","verifyingContract","salt"];function Oo(t){return function(e){return Hr("string"==typeof e,`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Ro={name:Oo("name"),version:Oo("version"),chainId:function(t){const e=si(t,"domain.chainId");return Hr(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):function(t){let e=Jr(Zr(t)?t:hi(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return""===e&&(e="0"),"0x"+e}(e)},verifyingContract:function(t){try{return co(t).toLowerCase()}catch(t){}Hr(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Mr(t,"domain.salt");return Hr(32===e.length,'invalid domain value "salt"',"domain.salt",t),Jr(e)}};function Uo(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=""===e[1],r=parseInt(e[2]);Hr(r%8==0&&0!==r&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const i=function(t,e){const n=ai(t,"value"),r=BigInt(fi(e,"bits"));return n&(ii<<r)-ii}(Bo,n?r-1:r),o=n?(i+Io)*Eo:Ao;return function(e){const r=si(e,"value");return Hr(r>=o&&r<=i,`value out-of-bounds for ${t}`,"value",r),li(n?function(t,e){let n=si(t,"value");const r=BigInt(fi(e,"width")),i=ii<<r-ii;if(n<ri)return n=-n,Dr(n<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),(~n&(ii<<r)-ii)+ii;return Dr(n<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),n}(r,256):r,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return Hr(0!==n&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(e){return Hr(Mr(e).length===n,`invalid length for ${t}`,"value",e),function(t){const e=Mr(t),n=e.length%32;return n?Xr([e,xo.slice(n)]):Jr(e)}(e)}}}switch(t){case"address":return function(t){return ni(co(t),32)};case"bool":return function(t){return t?_o:ko};case"bytes":return function(t){return eo(t)};case"string":return function(t){return vo(t)}}return null}function Co(t,e){return`${t}(${e.map(({name:t,type:e})=>e+" "+t).join(",")})`}function Lo(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}class No{primaryType;#o;get types(){return JSON.parse(this.#o)}#s;#a;constructor(t){this.#s=new Map,this.#a=new Map;const e=new Map,n=new Map,r=new Map,i={};Object.keys(t).forEach(o=>{i[o]=t[o].map(({name:e,type:n})=>{let{base:r,index:i}=Lo(n);return"int"!==r||t.int||(r="int256"),"uint"!==r||t.uint||(r="uint256"),{name:e,type:r+(i||"")}}),e.set(o,new Set),n.set(o,[]),r.set(o,new Set)}),this.#o=JSON.stringify(i);for(const r in i){const o=new Set;for(const s of i[r]){Hr(!o.has(s.name),`duplicate variable name ${JSON.stringify(s.name)} in ${JSON.stringify(r)}`,"types",t),o.add(s.name);const i=Lo(s.type).base;Hr(i!==r,`circular type reference to ${JSON.stringify(i)}`,"types",t);Uo(i)||(Hr(n.has(i),`unknown type ${JSON.stringify(i)}`,"types",t),n.get(i).push(r),e.get(r).add(i))}}const o=Array.from(n.keys()).filter(t=>0===n.get(t).length);Hr(0!==o.length,"missing primary type","types",t),Hr(1===o.length,`ambiguous primary types or unused types: ${o.map(t=>JSON.stringify(t)).join(", ")}`,"types",t),Fr(this,{primaryType:o[0]}),function i(o,s){Hr(!s.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",t),s.add(o);for(const t of e.get(o))if(n.has(t)){i(t,s);for(const e of s)r.get(e).add(t)}s.delete(o)}(this.primaryType,new Set);for(const[t,e]of r){const n=Array.from(e);n.sort(),this.#s.set(t,Co(t,i[t])+n.map(t=>Co(t,i[t])).join(""))}}getEncoder(t){let e=this.#a.get(t);return e||(e=this.#c(t),this.#a.set(t,e)),e}#c(t){{const e=Uo(t);if(e)return e}const e=Lo(t).array;if(e){const t=e.prefix,n=this.getEncoder(t);return r=>{Hr(-1===e.count||e.count===r.length,`array length mismatch; expected length ${e.count}`,"value",r);let i=r.map(n);return this.#s.has(t)&&(i=i.map(eo)),eo(Xr(i))}}const n=this.types[t];if(n){const e=vo(this.#s.get(t));return t=>{const r=n.map(({name:e,type:n})=>{const r=this.getEncoder(n)(t[e]);return this.#s.has(n)?eo(r):r});return r.unshift(e),Xr(r)}}Hr(!1,`unknown type: ${t}`,"type",t)}encodeType(t){const e=this.#s.get(t);return Hr(e,`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return eo(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(Uo(t))return n(t,e);const r=Lo(t).array;if(r)return Hr(-1===r.count||r.count===e.length,`array length mismatch; expected length ${r.count}`,"value",e),e.map(t=>this._visit(r.prefix,t,n));const i=this.types[t];if(i)return i.reduce((t,{name:r,type:i})=>(t[r]=this._visit(i,e[r],n),t),{});Hr(!1,`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new No(t)}static getPrimaryType(t){return No.from(t).primaryType}static hashStruct(t,e,n){return No.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){if(null==t[n])continue;const r=Po[n];Hr(r,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:r})}return e.sort((t,e)=>So.indexOf(t.name)-So.indexOf(e.name)),No.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return Xr(["0x1901",No.hashDomain(t),No.from(e).hash(n)])}static hash(t,e,n){return eo(No.encode(t,e,n))}static async resolveNames(t,e,n,r){t=Object.assign({},t);for(const e in t)null==t[e]&&delete t[e];const i={};t.verifyingContract&&!Wr(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=No.from(e);o.visit(n,(t,e)=>("address"!==t||Wr(e,20)||(i[e]="0x"),e));for(const t in i)i[t]=await r(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),{domain:t,value:n=o.visit(n,(t,e)=>"address"===t&&i[e]?i[e]:e)}}static getPayload(t,e,n){No.hashDomain(t);const r={},i=[];So.forEach(e=>{const n=t[e];null!=n&&(r[e]=Ro[e](n),i.push({name:e,type:Po[e]}))});const o=No.from(e);e=o.types;const s=Object.assign({},e);return Hr(null==s.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",e),s.EIP712Domain=i,o.encode(n),{types:s,domain:r,primaryType:o.primaryType,message:o.visit(n,(t,e)=>{if(t.match(/^bytes(\d*)/))return Jr(Mr(e));if(t.match(/^u?int/))return si(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return Hr("string"==typeof e,"invalid string","value",e),e}Hr(!1,"unsupported type","type",t)})}}}const To="0x0000000000000000000000000000000000000000";function Fo(t,e,n,r){cn(t);const i=xn({dkLen:32,asyncTick:10},r),{c:o,dkLen:s,asyncTick:a}=i;if(sn(o),sn(s),sn(a),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=bn(e),u=bn(n),f=new Uint8Array(s),l=pr.create(t,c),h=l._cloneInto().update(u);return{c:o,dkLen:s,asyncTick:a,DK:f,PRF:l,PRFSalt:h}}function Ko(t,e,n,r,i){return t.destroy(),e.destroy(),r&&r.destroy(),i.fill(0),n}function $o(t,e,n,r){const{c:i,dkLen:o,DK:s,PRF:a,PRFSalt:c}=Fo(t,e,n,r);let u;const f=new Uint8Array(4),l=pn(f),h=new Uint8Array(a.outputLen);for(let t=1,e=0;e<o;t++,e+=a.outputLen){const n=s.subarray(e,e+a.outputLen);l.setInt32(0,t,!1),(u=c._cloneInto(u)).update(f).digestInto(h),n.set(h.subarray(0,n.length));for(let t=1;t<i;t++){a._cloneInto(u).update(h).digestInto(h);for(let t=0;t<n.length;t++)n[t]^=h[t]}}return Ko(a,c,s,u,h)}const[Do,Ho]=Ni.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),jo=new Uint32Array(80),zo=new Uint32Array(80);class Go extends In{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:n,Bl:r,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:f,Fl:l,Gh:h,Gl:d,Hh:p,Hl:y}=this;return[t,e,n,r,i,o,s,a,c,u,f,l,h,d,p,y]}set(t,e,n,r,i,o,s,a,c,u,f,l,h,d,p,y){this.Ah=0|t,this.Al=0|e,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|f,this.Fl=0|l,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|y}process(t,e){for(let n=0;n<16;n++,e+=4)jo[n]=t.getUint32(e),zo[n]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|jo[t-15],n=0|zo[t-15],r=Ni.rotrSH(e,n,1)^Ni.rotrSH(e,n,8)^Ni.shrSH(e,n,7),i=Ni.rotrSL(e,n,1)^Ni.rotrSL(e,n,8)^Ni.shrSL(e,n,7),o=0|jo[t-2],s=0|zo[t-2],a=Ni.rotrSH(o,s,19)^Ni.rotrBH(o,s,61)^Ni.shrSH(o,s,6),c=Ni.rotrSL(o,s,19)^Ni.rotrBL(o,s,61)^Ni.shrSL(o,s,6),u=Ni.add4L(i,c,zo[t-7],zo[t-16]),f=Ni.add4H(u,r,a,jo[t-7],jo[t-16]);jo[t]=0|f,zo[t]=0|u}let{Ah:n,Al:r,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:f,El:l,Fh:h,Fl:d,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let t=0;t<80;t++){const e=Ni.rotrSH(f,l,14)^Ni.rotrSH(f,l,18)^Ni.rotrBH(f,l,41),b=Ni.rotrSL(f,l,14)^Ni.rotrSL(f,l,18)^Ni.rotrBL(f,l,41),w=f&h^~f&p,v=l&d^~l&y,x=Ni.add5L(m,b,v,Ho[t],zo[t]),E=Ni.add5H(x,g,e,w,Do[t],jo[t]),A=0|x,I=Ni.rotrSH(n,r,28)^Ni.rotrBH(n,r,34)^Ni.rotrBH(n,r,39),B=Ni.rotrSL(n,r,28)^Ni.rotrBL(n,r,34)^Ni.rotrBL(n,r,39),_=n&i^n&s^i&s,k=r&o^r&a^o&a;g=0|p,m=0|y,p=0|h,y=0|d,h=0|f,d=0|l,({h:f,l}=Ni.add(0|c,0|u,0|E,0|A)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|n,o=0|r;const P=Ni.add3L(A,B,k);n=Ni.add3H(P,E,I,_),r=0|P}({h:n,l:r}=Ni.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:o}=Ni.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=Ni.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=Ni.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:f,l}=Ni.add(0|this.Eh,0|this.El,0|f,0|l)),({h,l:d}=Ni.add(0|this.Fh,0|this.Fl,0|h,0|d)),({h:p,l:y}=Ni.add(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=Ni.add(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(n,r,i,o,s,a,c,u,f,l,h,d,p,y,g,m)}roundClean(){jo.fill(0),zo.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Vo=En(()=>new Go);const Mo=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof globalThis)return globalThis;throw new Error("unable to locate global object")}(),qo=Mo.crypto||Mo.msCrypto;function Wo(t){switch(t){case"sha256":return Rn.create();case"sha512":return Vo.create()}Hr(!1,"invalid hashing algorithm name","algorithm",t)}const Zo=function(t){return Wo("sha256").update(t).digest()},Yo=function(t){return Wo("sha512").update(t).digest()};let Jo=Zo,Xo=Yo,Qo=!1,ts=!1;function es(t){const e=Mr(t,"data");return Jr(Jo(e))}function ns(t){const e=Mr(t,"data");return Jr(Xo(e))}function rs(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function is(t,e,n){let r=0;for(let i=0;i<n;i++)r=256*r+t[e+i];return r}function os(t,e,n,r){const i=[];for(;n<e+1+r;){const o=ss(t,n);i.push(o.result),Dr((n+=o.consumed)<=e+1+r,"child data too short","BUFFER_OVERRUN",{buffer:t,length:r,offset:e})}return{consumed:1+r,result:i}}function ss(t,e){Dr(0!==t.length,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const n=e=>{Dr(e<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:e})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=is(t,e+1,r);return n(e+1+r+i),os(t,e,e+1+r,r+i)}if(t[e]>=192){const r=t[e]-192;return n(e+1+r),os(t,e,e+1,r)}if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=is(t,e+1,r);n(e+1+r+i);return{consumed:1+r+i,result:Jr(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){const r=t[e]-128;n(e+1+r);return{consumed:1+r,result:Jr(t.slice(e+1,e+1+r))}}return{consumed:1,result:rs(t[e])}}function as(t){const e=Mr(t,"data"),n=ss(e,0);return Hr(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function cs(t,e){return{address:co(t),storageKeys:e.map((t,e)=>(Hr(Wr(t,32),"invalid slot",`storageKeys[${e}]`,t),t.toLowerCase()))}}function us(t){if(Array.isArray(t))return t.map((e,n)=>Array.isArray(e)?(Hr(2===e.length,"invalid slot set",`value[${n}]`,e),cs(e[0],e[1])):(Hr(null!=e&&"object"==typeof e,"invalid address-slot set","value",t),cs(e.address,e.storageKeys)));Hr(null!=t&&"object"==typeof t,"invalid access list","value",t);const e=Object.keys(t).map(e=>{const n=t[e].reduce((t,e)=>(t[e]=!0,t),{});return cs(e,Object.keys(n).sort())});return e.sort((t,e)=>t.address.localeCompare(e.address)),e}function fs(t){let e;return e="string"==typeof t?_i.computePublicKey(t,!1):t.publicKey,co(eo("0x"+e.substring(4)).substring(26))}es._=Zo,es.lock=function(){Qo=!0},es.register=function(t){if(Qo)throw new Error("sha256 is locked");Jo=t},Object.freeze(es),ns._=Yo,ns.lock=function(){ts=!0},ns.register=function(t){if(ts)throw new Error("sha512 is locked");Xo=t},Object.freeze(es);const ls=BigInt(0),hs=BigInt(2),ds=BigInt(27),ps=BigInt(28),ys=BigInt(35),gs=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ms=Symbol.for("nodejs.util.inspect.custom"),bs=131072,ws=128;function vs(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=es(e).substring(4),"0x"+n}function xs(t){return"0x"===t?null:co(t)}function Es(t,e){try{return us(t)}catch(n){Hr(!1,n.message,e,t)}}function As(t,e){try{if(!Array.isArray(t))throw new Error("authorizationList: invalid array");const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!Array.isArray(r))throw new Error(`authorization[${n}]: invalid array`);if(6!==r.length)throw new Error(`authorization[${n}]: wrong length`);if(!r[1])throw new Error(`authorization[${n}]: null address`);e.push({address:xs(r[1]),nonce:Bs(r[2],"nonce"),chainId:Bs(r[0],"chainId"),signature:Bi.from({yParity:Is(r[3],"yParity"),r:ni(r[4],32),s:ni(r[5],32)})})}return e}catch(n){Hr(!1,n.message,e,t)}}function Is(t,e){return"0x"===t?0:fi(t,e)}function Bs(t,e){if("0x"===t)return ls;const n=si(t,e);return Hr(n<=gs,"value exceeds uint size",e,n),n}function _s(t,e){const n=si(t,"value"),r=hi(n);return Hr(r.length<=32,"value too large",`tx.${e}`,n),r}function ks(t){return us(t).map(t=>[t.address,t.storageKeys])}function Ps(t,e){Hr(Array.isArray(t),`invalid ${e}`,"value",t);for(let e=0;e<t.length;e++)Hr(Wr(t[e],32),"invalid ${ param } hash",`value[${e}]`,t[e]);return t}function Ss(t,e){let n;try{if(n=Is(e[0],"yParity"),0!==n&&1!==n)throw new Error("bad yParity")}catch(t){Hr(!1,"invalid yParity","yParity",e[0])}const r=ni(e[1],32),i=ni(e[2],32),o=Bi.from({r,s:i,yParity:n});t.signature=o}class Os{#u;#f;#l;#h;#d;#p;#y;#g;#m;#b;#w;#v;#x;#E;#A;#I;#B;#_;get type(){return this.#u}set type(t){switch(t){case null:this.#u=null;break;case 0:case"legacy":this.#u=0;break;case 1:case"berlin":case"eip-2930":this.#u=1;break;case 2:case"london":case"eip-1559":this.#u=2;break;case 3:case"cancun":case"eip-4844":this.#u=3;break;case 4:case"pectra":case"eip-7702":this.#u=4;break;default:Hr(!1,"unsupported transaction type","type",t)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const t=this.#f;return null==t&&3===this.type?To:t}set to(t){this.#f=null==t?null:co(t)}get nonce(){return this.#h}set nonce(t){this.#h=fi(t,"value")}get gasLimit(){return this.#d}set gasLimit(t){this.#d=si(t)}get gasPrice(){const t=this.#p;return null!=t||0!==this.type&&1!==this.type?t:ls}set gasPrice(t){this.#p=null==t?null:si(t,"gasPrice")}get maxPriorityFeePerGas(){const t=this.#y;return t??(2===this.type||3===this.type?ls:null)}set maxPriorityFeePerGas(t){this.#y=null==t?null:si(t,"maxPriorityFeePerGas")}get maxFeePerGas(){const t=this.#g;return t??(2===this.type||3===this.type?ls:null)}set maxFeePerGas(t){this.#g=null==t?null:si(t,"maxFeePerGas")}get data(){return this.#l}set data(t){this.#l=Jr(t)}get value(){return this.#m}set value(t){this.#m=si(t,"value")}get chainId(){return this.#b}set chainId(t){this.#b=si(t)}get signature(){return this.#w||null}set signature(t){this.#w=null==t?null:Bi.from(t)}isValid(){const t=this.signature;if(t&&!t.isValid())return!1;const e=this.authorizationList;if(e)for(const t of e)if(!t.signature.isValid())return!1;return!0}get accessList(){const t=this.#v||null;return t??(1===this.type||2===this.type||3===this.type?[]:null)}set accessList(t){this.#v=null==t?null:us(t)}get authorizationList(){const t=this.#B||null;return null==t&&4===this.type?[]:t}set authorizationList(t){this.#B=null==t?null:t.map(t=>{return{address:co((e=t).address),nonce:si(null!=e.nonce?e.nonce:0),chainId:si(null!=e.chainId?e.chainId:0),signature:Bi.from(e.signature)};var e})}get maxFeePerBlobGas(){const t=this.#x;return null==t&&3===this.type?ls:t}set maxFeePerBlobGas(t){this.#x=null==t?null:si(t,"maxFeePerBlobGas")}get blobVersionedHashes(){let t=this.#E;return null==t&&3===this.type?[]:t}set blobVersionedHashes(t){if(null!=t){Hr(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let e=0;e<t.length;e++)Hr(Wr(t[e],32),"invalid blobVersionedHash",`value[${e}]`,t[e])}this.#E=t}get blobs(){return null==this.#I?null:this.#I.map(t=>Object.assign({},t))}set blobs(t){if(null==t)return void(this.#I=null);const e=[],n=[];for(let r=0;r<t.length;r++){const i=t[r];if(Zr(i)){Dr(this.#A,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let t=Mr(i);if(Hr(t.length<=bs,"blob is too large",`blobs[${r}]`,i),t.length!==bs){const e=new Uint8Array(bs);e.set(t),t=e}const o=this.#A.blobToKzgCommitment(t),s=Jr(this.#A.computeBlobKzgProof(t,o));e.push({data:Jr(t),commitment:Jr(o),proof:s}),n.push(vs(1,o))}else{const t=Jr(i.data),r=Jr(i.commitment),o=Jr(i.proof);e.push({data:t,commitment:r,proof:o}),n.push(vs(1,r))}}this.#I=e,this.#E=n}get kzg(){return this.#A}set kzg(t){this.#A=null==t?null:function(t){return{blobToKzgCommitment:e=>{if("computeBlobProof"in t){if("blobToKzgCommitment"in t&&"function"==typeof t.blobToKzgCommitment)return Mr(t.blobToKzgCommitment(Jr(e)))}else if("blobToKzgCommitment"in t&&"function"==typeof t.blobToKzgCommitment)return Mr(t.blobToKzgCommitment(e));if("blobToKZGCommitment"in t&&"function"==typeof t.blobToKZGCommitment)return Mr(t.blobToKZGCommitment(Jr(e)));Hr(!1,"unsupported KZG library","kzg",t)},computeBlobKzgProof:(e,n)=>"computeBlobProof"in t&&"function"==typeof t.computeBlobProof?Mr(t.computeBlobProof(Jr(e),Jr(n))):"computeBlobKzgProof"in t&&"function"==typeof t.computeBlobKzgProof?t.computeBlobKzgProof(e,n):"computeBlobKZGProof"in t&&"function"==typeof t.computeBlobKZGProof?Mr(t.computeBlobKZGProof(Jr(e),Jr(n))):void Hr(!1,"unsupported KZG library","kzg",t)}}(t)}get blobWrapperVersion(){return this.#_}set blobWrapperVersion(t){this.#_=t}constructor(){this.#u=null,this.#f=null,this.#h=0,this.#d=ls,this.#p=null,this.#y=null,this.#g=null,this.#l="0x",this.#m=ls,this.#b=ls,this.#w=null,this.#v=null,this.#x=null,this.#E=null,this.#A=null,this.#I=null,this.#B=null,this.#_=null}get hash(){return null==this.signature?null:eo(this.#k(!0,!1))}get unsignedHash(){return eo(this.unsignedSerialized)}get from(){return null==this.signature?null:(t=this.unsignedHash,e=this.signature.getCanonical(),fs(_i.recoverPublicKey(t,e)));var t,e}get fromPublicKey(){return null==this.signature?null:_i.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return null!=this.signature}#k(t,e){Dr(!t||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=t?this.signature:null;switch(this.inferType()){case 0:return function(t,e){const n=[_s(t.nonce,"nonce"),_s(t.gasPrice||0,"gasPrice"),_s(t.gasLimit,"gasLimit"),t.to||"0x",_s(t.value,"value"),t.data];let r=ls;if(t.chainId!=ls)r=si(t.chainId,"tx.chainId"),Hr(!e||null==e.networkV||e.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const e=t.signature.legacyChainId;null!=e&&(r=e)}if(!e)return r!==ls&&(n.push(hi(r)),n.push("0x"),n.push("0x")),bo(n);let i=BigInt(27+e.yParity);return r!==ls?i=Bi.getChainIdV(r,e.v):BigInt(e.v)!==i&&Hr(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(hi(i)),n.push(hi(e.r)),n.push(hi(e._s)),bo(n)}(this,n);case 1:return function(t,e){const n=[_s(t.chainId,"chainId"),_s(t.nonce,"nonce"),_s(t.gasPrice||0,"gasPrice"),_s(t.gasLimit,"gasLimit"),t.to||"0x",_s(t.value,"value"),t.data,ks(t.accessList||[])];return e&&(n.push(_s(e.yParity,"recoveryParam")),n.push(hi(e.r)),n.push(hi(e.s))),Xr(["0x01",bo(n)])}(this,n);case 2:return function(t,e){const n=[_s(t.chainId,"chainId"),_s(t.nonce,"nonce"),_s(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),_s(t.maxFeePerGas||0,"maxFeePerGas"),_s(t.gasLimit,"gasLimit"),t.to||"0x",_s(t.value,"value"),t.data,ks(t.accessList||[])];return e&&(n.push(_s(e.yParity,"yParity")),n.push(hi(e.r)),n.push(hi(e.s))),Xr(["0x02",bo(n)])}(this,n);case 3:return function(t,e,n){const r=[_s(t.chainId,"chainId"),_s(t.nonce,"nonce"),_s(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),_s(t.maxFeePerGas||0,"maxFeePerGas"),_s(t.gasLimit,"gasLimit"),t.to||To,_s(t.value,"value"),t.data,ks(t.accessList||[]),_s(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Ps(t.blobVersionedHashes||[],"blobVersionedHashes")];if(e&&(r.push(_s(e.yParity,"yParity")),r.push(hi(e.r)),r.push(hi(e.s)),n)){if(null!=t.blobWrapperVersion){const e=hi(t.blobWrapperVersion),i=[];for(const{proof:t}of n){const e=Mr(t),n=e.length/ws;for(let t=0;t<e.length;t+=n)i.push(e.subarray(t,t+n))}return Xr(["0x03",bo([r,e,n.map(t=>t.data),n.map(t=>t.commitment),i])])}return Xr(["0x03",bo([r,n.map(t=>t.data),n.map(t=>t.commitment),n.map(t=>t.proof)])])}return Xr(["0x03",bo(r)])}(this,n,e?this.blobs:null);case 4:return function(t,e){const n=[_s(t.chainId,"chainId"),_s(t.nonce,"nonce"),_s(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),_s(t.maxFeePerGas||0,"maxFeePerGas"),_s(t.gasLimit,"gasLimit"),t.to||"0x",_s(t.value,"value"),t.data,ks(t.accessList||[]),(r=t.authorizationList||[],r.map(t=>[_s(t.chainId,"chainId"),t.address,_s(t.nonce,"nonce"),_s(t.signature.yParity,"yParity"),hi(t.signature.r),hi(t.signature._s)]))];var r;return e&&(n.push(_s(e.yParity,"yParity")),n.push(hi(e.r)),n.push(hi(e.s))),Xr(["0x04",bo(n)])}(this,n)}Dr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#k(!0,!0)}get unsignedSerialized(){return this.#k(!1,!1)}inferType(){const t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){const t=null!=this.gasPrice,e=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,n=null!=this.accessList,r=null!=this.#x||this.#E;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&Dr(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Dr(!e||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Dr(0!==this.type||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return null!=this.type?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):e?i.push(2):t?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(r&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return Os.from(this)}toJSON(){const t=t=>null==t?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[ms](){return this.toString()}toString(){const t=[],e=e=>{let n=this[e];"string"==typeof n&&(n=JSON.stringify(n)),t.push(`${e}: ${n}`)};this.type&&e("type"),e("to"),e("data"),e("nonce"),e("gasLimit"),e("value"),null!=this.chainId&&e("chainId"),this.signature&&(e("from"),t.push(`signature: ${this.signature.toString()}`));const n=this.authorizationList;if(n){const e=[];for(const t of n){const n=[];n.push(`address: ${JSON.stringify(t.address)}`),null!=t.nonce&&n.push(`nonce: ${t.nonce}`),null!=t.chainId&&n.push(`chainId: ${t.chainId}`),t.signature&&n.push(`signature: ${t.signature.toString()}`),e.push(`Authorization { ${n.join(", ")} }`)}t.push(`authorizations: [ ${e.join(", ")} ]`)}return`Transaction { ${t.join(", ")} }`}static from(t){if(null==t)return new Os;if("string"==typeof t){const e=Mr(t);if(e[0]>=127)return Os.from(function(t){const e=as(t);Hr(Array.isArray(e)&&(9===e.length||6===e.length),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:Is(e[0],"nonce"),gasPrice:Bs(e[1],"gasPrice"),gasLimit:Bs(e[2],"gasLimit"),to:xs(e[3]),value:Bs(e[4],"value"),data:Jr(e[5]),chainId:ls};if(6===e.length)return n;const r=Bs(e[6],"v"),i=Bs(e[7],"r"),o=Bs(e[8],"s");if(i===ls&&o===ls)n.chainId=r;else{let t=(r-ys)/hs;t<ls&&(t=ls),n.chainId=t,Hr(t!==ls||r===ds||r===ps,"non-canonical legacy v","v",e[6]),n.signature=Bi.from({r:ni(e[7],32),s:ni(e[8],32),v:r})}return n}(e));switch(e[0]){case 1:return Os.from(function(t){const e=as(Mr(t).slice(1));Hr(Array.isArray(e)&&(8===e.length||11===e.length),"invalid field count for transaction type: 1","data",Jr(t));const n={type:1,chainId:Bs(e[0],"chainId"),nonce:Is(e[1],"nonce"),gasPrice:Bs(e[2],"gasPrice"),gasLimit:Bs(e[3],"gasLimit"),to:xs(e[4]),value:Bs(e[5],"value"),data:Jr(e[6]),accessList:Es(e[7],"accessList")};return 8===e.length||Ss(n,e.slice(8)),n}(e));case 2:return Os.from(function(t){const e=as(Mr(t).slice(1));Hr(Array.isArray(e)&&(9===e.length||12===e.length),"invalid field count for transaction type: 2","data",Jr(t));const n={type:2,chainId:Bs(e[0],"chainId"),nonce:Is(e[1],"nonce"),maxPriorityFeePerGas:Bs(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Bs(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Bs(e[4],"gasLimit"),to:xs(e[5]),value:Bs(e[6],"value"),data:Jr(e[7]),accessList:Es(e[8],"accessList")};return 9===e.length||Ss(n,e.slice(9)),n}(e));case 3:return Os.from(function(t){let e=as(Mr(t).slice(1)),n="3",r=null,i=null;if(4===e.length&&Array.isArray(e[0])){n="3 (network format)";const t=e[1],r=e[2],o=e[3];Hr(Array.isArray(t),"invalid network format: blobs not an array","fields[1]",t),Hr(Array.isArray(r),"invalid network format: commitments not an array","fields[2]",r),Hr(Array.isArray(o),"invalid network format: proofs not an array","fields[3]",o),Hr(t.length===r.length,"invalid network format: blobs/commitments length mismatch","fields",e),Hr(t.length===o.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let n=0;n<e[1].length;n++)i.push({data:t[n],commitment:r[n],proof:o[n]});e=e[0]}else if(5===e.length&&Array.isArray(e[0])){n="3 (EIP-7594 network format)",r=fi(e[1]);const t=e[2],o=e[3],s=e[4];Hr(1===r,`unsupported EIP-7594 network format version: ${r}`,"fields[1]",r),Hr(Array.isArray(t),"invalid EIP-7594 network format: blobs not an array","fields[2]",t),Hr(Array.isArray(o),"invalid EIP-7594 network format: commitments not an array","fields[3]",o),Hr(Array.isArray(s),"invalid EIP-7594 network format: proofs not an array","fields[4]",s),Hr(t.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),Hr(t.length*ws===s.length,"invalid network format: blobs/proofs length mismatch","fields",e),i=[];for(let e=0;e<t.length;e++){const n=[];for(let t=0;t<ws;t++)n.push(s[e*ws+t]);i.push({data:t[e],commitment:o[e],proof:Xr(n)})}e=e[0]}Hr(Array.isArray(e)&&(11===e.length||14===e.length),`invalid field count for transaction type: ${n}`,"data",Jr(t));const o={type:3,chainId:Bs(e[0],"chainId"),nonce:Is(e[1],"nonce"),maxPriorityFeePerGas:Bs(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Bs(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Bs(e[4],"gasLimit"),to:xs(e[5]),value:Bs(e[6],"value"),data:Jr(e[7]),accessList:Es(e[8],"accessList"),maxFeePerBlobGas:Bs(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10],blobWrapperVersion:r};i&&(o.blobs=i),Hr(null!=o.to,`invalid address for transaction type: ${n}`,"data",t),Hr(Array.isArray(o.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let e=0;e<o.blobVersionedHashes.length;e++)Hr(Wr(o.blobVersionedHashes[e],32),`invalid blobVersionedHash at index ${e}: must be length 32`,"data",t);return 11===e.length||Ss(o,e.slice(11)),o}(e));case 4:return Os.from(function(t){const e=as(Mr(t).slice(1));Hr(Array.isArray(e)&&(10===e.length||13===e.length),"invalid field count for transaction type: 4","data",Jr(t));const n={type:4,chainId:Bs(e[0],"chainId"),nonce:Is(e[1],"nonce"),maxPriorityFeePerGas:Bs(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Bs(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Bs(e[4],"gasLimit"),to:xs(e[5]),value:Bs(e[6],"value"),data:Jr(e[7]),accessList:Es(e[8],"accessList"),authorizationList:As(e[9],"authorizationList")};return 10===e.length||Ss(n,e.slice(10)),n}(e))}Dr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const e=new Os;return null!=t.type&&(e.type=t.type),null!=t.to&&(e.to=t.to),null!=t.nonce&&(e.nonce=t.nonce),null!=t.gasLimit&&(e.gasLimit=t.gasLimit),null!=t.gasPrice&&(e.gasPrice=t.gasPrice),null!=t.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas),null!=t.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null!=t.maxFeePerBlobGas&&(e.maxFeePerBlobGas=t.maxFeePerBlobGas),null!=t.data&&(e.data=t.data),null!=t.value&&(e.value=t.value),null!=t.chainId&&(e.chainId=t.chainId),null!=t.signature&&(e.signature=Bi.from(t.signature)),null!=t.accessList&&(e.accessList=t.accessList),null!=t.authorizationList&&(e.authorizationList=t.authorizationList),null!=t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes),null!=t.kzg&&(e.kzg=t.kzg),null!=t.blobWrapperVersion&&(e.blobWrapperVersion=t.blobWrapperVersion),null!=t.blobs&&(e.blobs=t.blobs),null!=t.hash&&(Hr(e.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),Hr(e.hash===t.hash,"hash mismatch","tx",t)),null!=t.from&&(Hr(e.isSigned(),"unsigned transaction cannot define '.from'","tx",t),Hr(e.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),e}}BigInt(0);function Rs(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Jr(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const r of n)r in t&&null!=t[r]&&(e[r]=si(t[r],`request.${r}`));const r="type,nonce".split(/,/);for(const n of r)n in t&&null!=t[n]&&(e[n]=fi(t[n],`request.${n}`));return t.accessList&&(e.accessList=us(t.accessList)),t.authorizationList&&(e.authorizationList=t.authorizationList.slice()),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobWrapperVersion"in t&&(e.blobWrapperVersion=t.blobWrapperVersion),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(t=>Zr(t)?Jr(t):Object.assign({},t))),e}Symbol.iterator;Symbol.iterator;function Us(t,e){if(t.provider)return t.provider;Dr(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Cs(t,e){let n=Rs(e);if(null!=n.to&&(n.to=fo(n.to,t)),null!=n.from){const e=n.from;n.from=Promise.all([t.getAddress(),fo(e,t)]).then(([t,e])=>(Hr(t.toLowerCase()===e.toLowerCase(),"transaction from mismatch","tx.from",e),t))}else n.from=t.getAddress();return await Tr(n)}class Ls{provider;constructor(t){Fr(this,{provider:t||null})}async getNonce(t){return Us(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await Cs(this,t)}async populateTransaction(t){const e=Us(this,"populateTransaction"),n=await Cs(this,t);null==n.nonce&&(n.nonce=await this.getNonce("pending")),null==n.gasLimit&&(n.gasLimit=await this.estimateGas(n));const r=await this.provider.getNetwork();if(null!=n.chainId){Hr(si(n.chainId)===r.chainId,"transaction chainId mismatch","tx.chainId",t.chainId)}else n.chainId=r.chainId;const i=null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas;if(null==n.gasPrice||2!==n.type&&!i?0!==n.type&&1!==n.type||!i||Hr(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",t):Hr(!1,"eip-1559 transaction do not support gasPrice","tx",t),2!==n.type&&null!=n.type||null==n.maxFeePerGas||null==n.maxPriorityFeePerGas)if(0===n.type||1===n.type){const t=await e.getFeeData();Dr(null!=t.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==n.gasPrice&&(n.gasPrice=t.gasPrice)}else{const t=await e.getFeeData();if(null==n.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,null!=n.gasPrice){const t=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=t,n.maxPriorityFeePerGas=t}else null==n.maxFeePerGas&&(n.maxFeePerGas=t.maxFeePerGas),null==n.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(Dr(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==n.gasPrice&&(n.gasPrice=t.gasPrice),n.type=0):Dr(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==n.type&&3!==n.type&&4!==n.type||(null==n.maxFeePerGas&&(n.maxFeePerGas=t.maxFeePerGas),null==n.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else n.type=2;return await Tr(n)}async populateAuthorization(t){const e=Object.assign({},t);return null==e.chainId&&(e.chainId=(await Us(this,"getNetwork").getNetwork()).chainId),null==e.nonce&&(e.nonce=await this.getNonce()),e}async estimateGas(t){return Us(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return Us(this,"call").call(await this.populateCall(t))}async resolveName(t){const e=Us(this,"resolveName");return await e.resolveName(t)}async sendTransaction(t){const e=Us(this,"sendTransaction"),n=await this.populateTransaction(t);delete n.from;const r=Os.from(n);return await e.broadcastTransaction(await this.signTransaction(r))}authorize(t){Dr(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class Ns extends Ls{address;constructor(t,e){super(e),Fr(this,{address:t})}async getAddress(){return this.address}connect(t){return new Ns(this.address,t)}#P(t,e){Dr(!1,`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:e})}async signTransaction(t){this.#P("transactions","signTransaction")}async signMessage(t){this.#P("messages","signMessage")}async signTypedData(t,e,n){this.#P("typed-data","signTypedData")}}class Ts extends Ls{address;#S;constructor(t,e){super(e),Hr(t&&"function"==typeof t.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#S=t;Fr(this,{address:fs(this.signingKey.publicKey)})}get signingKey(){return this.#S}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new Ts(this.#S,t)}async signTransaction(t){t=Rs(t);const{to:e,from:n}=await Tr({to:t.to?fo(t.to,this):void 0,from:t.from?fo(t.from,this):void 0});null!=e&&(t.to=e),null!=n&&(t.from=n),null!=t.from&&(Hr(co(t.from)===this.address,"transaction from address mismatch","tx.from",t.from),delete t.from);const r=Os.from(t);return r.signature=this.signingKey.sign(r.unsignedHash),r.serialized}async signMessage(t){return this.signMessageSync(t)}signMessageSync(t){return this.signingKey.sign(po(t)).serialized}authorizeSync(t){Hr("string"==typeof t.address,"invalid address for authorizeSync","auth.address",t);const e=this.signingKey.sign(wo(t));return Object.assign({},{address:co(t.address),nonce:si(t.nonce||0),chainId:si(t.chainId||0)},{signature:e})}async authorize(t){return t=Object.assign({},t,{address:await fo(t.address,this)}),this.authorizeSync(await this.populateAuthorization(t))}async signTypedData(t,e,n){const r=await No.resolveNames(t,e,n,async t=>{Dr(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:t}});const e=await this.provider.resolveName(t);return Dr(null!=e,"unconfigured ENS name","UNCONFIGURED_NAME",{value:t}),e});return this.signingKey.sign(No.hash(r.domain,e,r.value)).serialized}}let Fs=!1;const Ks=function(t,e,n){return function(t,e){const n={sha256:Rn,sha512:Vo}[t];return Hr(null!=n,"invalid hmac algorithm","algorithm",t),pr.create(n,e)}(t,e).update(n).digest()};let $s=Ks;function Ds(t,e,n){const r=Mr(e,"key"),i=Mr(n,"data");return Jr($s(t,r,i))}Ds._=Ks,Ds.lock=function(){Fs=!0},Ds.register=function(t){if(Fs)throw new Error("computeHmac is locked");$s=t},Object.freeze(Ds);const Hs=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),js=Uint8Array.from({length:16},(t,e)=>e),zs=js.map(t=>(9*t+5)%16);let Gs=[js],Vs=[zs];for(let t=0;t<4;t++)for(let e of[Gs,Vs])e.push(e[t].map(t=>Hs[t]));const Ms=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),qs=Gs.map((t,e)=>t.map(t=>Ms[e][t])),Ws=Vs.map((t,e)=>t.map(t=>Ms[e][t])),Zs=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Ys=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),Js=(t,e)=>t<<e|t>>>32-e;function Xs(t,e,n,r){return 0===t?e^n^r:1===t?e&n|~e&r:2===t?(e|~n)^r:3===t?e&r|n&~r:e^(n|~r)}const Qs=new Uint32Array(16);class ta extends In{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:e,h2:n,h3:r,h4:i}=this;return[t,e,n,r,i]}set(t,e,n,r,i){this.h0=0|t,this.h1=0|e,this.h2=0|n,this.h3=0|r,this.h4=0|i}process(t,e){for(let n=0;n<16;n++,e+=4)Qs[n]=t.getUint32(e,!0);let n=0|this.h0,r=n,i=0|this.h1,o=i,s=0|this.h2,a=s,c=0|this.h3,u=c,f=0|this.h4,l=f;for(let t=0;t<5;t++){const e=4-t,h=Zs[t],d=Ys[t],p=Gs[t],y=Vs[t],g=qs[t],m=Ws[t];for(let e=0;e<16;e++){const r=Js(n+Xs(t,i,s,c)+Qs[p[e]]+h,g[e])+f|0;n=f,f=c,c=0|Js(s,10),s=i,i=r}for(let t=0;t<16;t++){const n=Js(r+Xs(e,o,a,u)+Qs[y[t]]+d,m[t])+l|0;r=l,l=u,u=0|Js(a,10),a=o,o=n}}this.set(this.h1+s+u|0,this.h2+c+l|0,this.h3+f+r|0,this.h4+n+o|0,this.h0+i+a|0)}roundClean(){Qs.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const ea=En(()=>new ta);let na=!1;const ra=function(t){return ea(t)};let ia=ra;function oa(t){const e=Mr(t,"data");return Jr(ia(e))}oa._=ra,oa.lock=function(){na=!0},oa.register=function(t){if(na)throw new TypeError("ripemd160 is locked");ia=t},Object.freeze(oa);let sa=!1;const aa=function(t){return new Uint8Array(function(t){Dr(null!=qo,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),Hr(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return qo.getRandomValues(e),e}(t))};let ca=aa;function ua(t){return ca(t)}ua._=aa,ua.lock=function(){sa=!0},ua.register=function(t){if(sa)throw new Error("randomBytes is locked");ca=t},Object.freeze(ua);const fa="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let la=null;function ha(t){if(null==la){la={};for(let t=0;t<58;t++)la[fa[t]]=BigInt(t)}const e=la[t];return Hr(null!=e,"invalid base58 value","letter",t),e}const da=BigInt(0),pa=BigInt(58);const ya=" !#$%&'()*+,-./<=>?@[]^_`{|}~",ga=/^[a-z]*$/i;function ma(t,e){let n=97;return t.reduce((t,r)=>(r===e?n++:r.match(ga)?t.push(String.fromCharCode(n)+r):(n=97,t.push(r)),t),[])}function ba(t){return Hr("0"===t[0],"unsupported auwl data","data",t),function(t,e){for(let n=28;n>=0;n--)t=t.split(ya[n]).join(e.substring(2*n,2*n+2));const n=[],r=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(t,e,r,i)=>{if(r)for(let t=parseInt(r);t>=0;t--)n.push(";");else n.push(e.toLowerCase());return""});if(r)throw new Error(`leftovers: ${JSON.stringify(r)}`);return ma(ma(n,";"),":")}(t.substring(59),t.substring(1,59))}class wa{locale;constructor(t){Fr(this,{locale:t})}split(t){return t.toLowerCase().split(/\s+/g)}join(t){return t.join(" ")}}class va extends wa{#l;#O;constructor(t,e,n){super(t),this.#l=e,this.#O=n,this.#R=null}get _data(){return this.#l}_decodeWords(){return ba(this.#l)}#R;#U(){if(null==this.#R){const t=this._decodeWords();if(vo(t.join("\n")+"\n")!==this.#O)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#R=t}return this.#R}getWord(t){const e=this.#U();return Hr(t>=0&&t<e.length,`invalid word index: ${t}`,"index",t),e[t]}getWordIndex(t){return this.#U().indexOf(t)}}let xa=null;class Ea extends va{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==xa&&(xa=new Ea),xa}}let Aa=!1;const Ia=function(t,e,n,r,i){return function(t,e,n,r,i){const o={sha256:Rn,sha512:Vo}[i];return Hr(null!=o,"invalid pbkdf2 algorithm","algorithm",i),$o(o,t,e,{c:n,dkLen:r})}(t,e,n,r,i)};let Ba=Ia;function _a(t,e,n,r,i){const o=Mr(t,"password"),s=Mr(e,"salt");return Jr(Ba(o,s,n,r,i))}function ka(t){return(1<<t)-1<<8-t&255}function Pa(t){return(1<<t)-1&255}function Sa(t,e){zr("NFKD"),null==e&&(e=Ea.wordlist());const n=e.split(t);Hr(n.length%3==0&&n.length>=12&&n.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const r=new Uint8Array(Math.ceil(11*n.length/8));let i=0;for(let t=0;t<n.length;t++){let o=e.getWordIndex(n[t].normalize("NFKD"));Hr(o>=0,`invalid mnemonic word at index ${t}`,"mnemonic","[ REDACTED ]");for(let t=0;t<11;t++)o&1<<10-t&&(r[i>>3]|=1<<7-i%8),i++}const o=32*n.length/3,s=ka(n.length/3);return Hr((Mr(es(r.slice(0,o/8)))[0]&s)===(r[r.length-1]&s),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),Jr(r.slice(0,o/8))}function Oa(t,e){Hr(t.length%4==0&&t.length>=16&&t.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==e&&(e=Ea.wordlist());const n=[0];let r=11;for(let e=0;e<t.length;e++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=t[e],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=t[e]>>8-r,n.push(t[e]&Pa(8-r)),r+=3);const i=t.length/4,o=parseInt(es(t).substring(2,4),16)&ka(i);return n[n.length-1]<<=i,n[n.length-1]|=o>>8-i,e.join(n.map(t=>e.getWord(t)))}_a._=Ia,_a.lock=function(){Aa=!0},_a.register=function(t){if(Aa)throw new Error("pbkdf2 is locked");Ba=t},Object.freeze(_a);const Ra={};class Ua{phrase;password;wordlist;entropy;constructor(t,e,n,r,i){null==r&&(r=""),null==i&&(i=Ea.wordlist()),Gr(t,Ra,"Mnemonic"),Fr(this,{phrase:n,password:r,wordlist:i,entropy:e})}computeSeed(){const t=ho("mnemonic"+this.password,"NFKD");return _a(ho(this.phrase,"NFKD"),t,2048,64,"sha512")}static fromPhrase(t,e,n){const r=Sa(t,n);return t=Oa(Mr(r),n),new Ua(Ra,r,t,e,n)}static fromEntropy(t,e,n){const r=Mr(t,"entropy"),i=Oa(r,n);return new Ua(Ra,Jr(r),i,e,n)}static entropyToPhrase(t,e){return Oa(Mr(t,"entropy"),e)}static phraseToEntropy(t,e){return Sa(t,e)}static isValidMnemonic(t,e){try{return Sa(t,e),!0}catch(t){}return!1}}var Ca,La,Na,Ta=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)},Fa=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n};const Ka={16:10,24:12,32:14},$a=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Da=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Ha=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],ja=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],za=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Ga=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Va=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Ma=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],qa=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Wa=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Za=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Ya=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ja=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Xa=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Qa=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function tc(t){const e=[];for(let n=0;n<t.length;n+=4)e.push(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]);return e}class ec{get key(){return Ta(this,Ca,"f").slice()}constructor(t){if(Ca.set(this,void 0),La.set(this,void 0),Na.set(this,void 0),!(this instanceof ec))throw Error("AES must be instanitated with `new`");Fa(this,Ca,new Uint8Array(t),"f");const e=Ka[this.key.length];if(null==e)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");Fa(this,Na,[],"f"),Fa(this,La,[],"f");for(let t=0;t<=e;t++)Ta(this,Na,"f").push([0,0,0,0]),Ta(this,La,"f").push([0,0,0,0]);const n=4*(e+1),r=this.key.length/4,i=tc(this.key);let o;for(let t=0;t<r;t++)o=t>>2,Ta(this,Na,"f")[o][t%4]=i[t],Ta(this,La,"f")[e-o][t%4]=i[t];let s,a=0,c=r;for(;c<n;){if(s=i[r-1],i[0]^=Da[s>>16&255]<<24^Da[s>>8&255]<<16^Da[255&s]<<8^Da[s>>24&255]^$a[a]<<24,a+=1,8!=r)for(let t=1;t<r;t++)i[t]^=i[t-1];else{for(let t=1;t<r/2;t++)i[t]^=i[t-1];s=i[r/2-1],i[r/2]^=Da[255&s]^Da[s>>8&255]<<8^Da[s>>16&255]<<16^Da[s>>24&255]<<24;for(let t=r/2+1;t<r;t++)i[t]^=i[t-1]}let t,o,u=0;for(;u<r&&c<n;)t=c>>2,o=c%4,Ta(this,Na,"f")[t][o]=i[u],Ta(this,La,"f")[e-t][o]=i[u++],c++}for(let t=1;t<e;t++)for(let e=0;e<4;e++)s=Ta(this,La,"f")[t][e],Ta(this,La,"f")[t][e]=Ya[s>>24&255]^Ja[s>>16&255]^Xa[s>>8&255]^Qa[255&s]}encrypt(t){if(16!=t.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const e=Ta(this,Na,"f").length-1,n=[0,0,0,0];let r=tc(t);for(let t=0;t<4;t++)r[t]^=Ta(this,Na,"f")[0][t];for(let t=1;t<e;t++){for(let e=0;e<4;e++)n[e]=ja[r[e]>>24&255]^za[r[(e+1)%4]>>16&255]^Ga[r[(e+2)%4]>>8&255]^Va[255&r[(e+3)%4]]^Ta(this,Na,"f")[t][e];r=n.slice()}const i=new Uint8Array(16);let o=0;for(let t=0;t<4;t++)o=Ta(this,Na,"f")[e][t],i[4*t]=255&(Da[r[t]>>24&255]^o>>24),i[4*t+1]=255&(Da[r[(t+1)%4]>>16&255]^o>>16),i[4*t+2]=255&(Da[r[(t+2)%4]>>8&255]^o>>8),i[4*t+3]=255&(Da[255&r[(t+3)%4]]^o);return i}decrypt(t){if(16!=t.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const e=Ta(this,La,"f").length-1,n=[0,0,0,0];let r=tc(t);for(let t=0;t<4;t++)r[t]^=Ta(this,La,"f")[0][t];for(let t=1;t<e;t++){for(let e=0;e<4;e++)n[e]=Ma[r[e]>>24&255]^qa[r[(e+3)%4]>>16&255]^Wa[r[(e+2)%4]>>8&255]^Za[255&r[(e+1)%4]]^Ta(this,La,"f")[t][e];r=n.slice()}const i=new Uint8Array(16);let o=0;for(let t=0;t<4;t++)o=Ta(this,La,"f")[e][t],i[4*t]=255&(Ha[r[t]>>24&255]^o>>24),i[4*t+1]=255&(Ha[r[(t+3)%4]>>16&255]^o>>16),i[4*t+2]=255&(Ha[r[(t+2)%4]>>8&255]^o>>8),i[4*t+3]=255&(Ha[255&r[(t+1)%4]]^o);return i}}Ca=new WeakMap,La=new WeakMap,Na=new WeakMap;class nc{constructor(t,e,n){if(n&&!(this instanceof n))throw new Error(`${t} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new ec(e)},name:{enumerable:!0,value:t}})}}var rc,ic,oc,sc=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},ac=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};class cc extends nc{constructor(t,e){super("CTR",t,cc),rc.set(this,void 0),ic.set(this,void 0),oc.set(this,void 0),sc(this,oc,new Uint8Array(16),"f"),ac(this,oc,"f").fill(0),sc(this,rc,ac(this,oc,"f"),"f"),sc(this,ic,16,"f"),null==e&&(e=1),"number"==typeof e?this.setCounterValue(e):this.setCounterBytes(e)}get counter(){return new Uint8Array(ac(this,oc,"f"))}setCounterValue(t){if(!Number.isInteger(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let e=15;e>=0;--e)ac(this,oc,"f")[e]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(16!==t.length)throw new TypeError("invalid counter initial Uint8Array value length");ac(this,oc,"f").set(t)}increment(){for(let t=15;t>=0;t--){if(255!==ac(this,oc,"f")[t]){ac(this,oc,"f")[t]++;break}ac(this,oc,"f")[t]=0}}encrypt(t){var e,n;const r=new Uint8Array(t);for(let t=0;t<r.length;t++)16===ac(this,ic,"f")&&(sc(this,rc,this.aes.encrypt(ac(this,oc,"f")),"f"),sc(this,ic,0,"f"),this.increment()),r[t]^=ac(this,rc,"f")[sc(this,ic,(n=ac(this,ic,"f"),e=n++,n),"f"),e];return r}decrypt(t){return this.encrypt(t)}}rc=new WeakMap,ic=new WeakMap,oc=new WeakMap;const uc=(t,e)=>t<<e|t>>>32-e;function fc(t,e,n,r,i,o){let s=t[e++]^n[r++],a=t[e++]^n[r++],c=t[e++]^n[r++],u=t[e++]^n[r++],f=t[e++]^n[r++],l=t[e++]^n[r++],h=t[e++]^n[r++],d=t[e++]^n[r++],p=t[e++]^n[r++],y=t[e++]^n[r++],g=t[e++]^n[r++],m=t[e++]^n[r++],b=t[e++]^n[r++],w=t[e++]^n[r++],v=t[e++]^n[r++],x=t[e++]^n[r++],E=s,A=a,I=c,B=u,_=f,k=l,P=h,S=d,O=p,R=y,U=g,C=m,L=b,N=w,T=v,F=x;for(let t=0;t<8;t+=2)_^=uc(E+L|0,7),O^=uc(_+E|0,9),L^=uc(O+_|0,13),E^=uc(L+O|0,18),R^=uc(k+A|0,7),N^=uc(R+k|0,9),A^=uc(N+R|0,13),k^=uc(A+N|0,18),T^=uc(U+P|0,7),I^=uc(T+U|0,9),P^=uc(I+T|0,13),U^=uc(P+I|0,18),B^=uc(F+C|0,7),S^=uc(B+F|0,9),C^=uc(S+B|0,13),F^=uc(C+S|0,18),A^=uc(E+B|0,7),I^=uc(A+E|0,9),B^=uc(I+A|0,13),E^=uc(B+I|0,18),P^=uc(k+_|0,7),S^=uc(P+k|0,9),_^=uc(S+P|0,13),k^=uc(_+S|0,18),C^=uc(U+R|0,7),O^=uc(C+U|0,9),R^=uc(O+C|0,13),U^=uc(R+O|0,18),L^=uc(F+T|0,7),N^=uc(L+F|0,9),T^=uc(N+L|0,13),F^=uc(T+N|0,18);i[o++]=s+E|0,i[o++]=a+A|0,i[o++]=c+I|0,i[o++]=u+B|0,i[o++]=f+_|0,i[o++]=l+k|0,i[o++]=h+P|0,i[o++]=d+S|0,i[o++]=p+O|0,i[o++]=y+R|0,i[o++]=g+U|0,i[o++]=m+C|0,i[o++]=b+L|0,i[o++]=w+N|0,i[o++]=v+T|0,i[o++]=x+F|0}function lc(t,e,n,r,i){let o=r+0,s=r+16*i;for(let r=0;r<16;r++)n[s+r]=t[e+16*(2*i-1)+r];for(let r=0;r<i;r++,o+=16,e+=16)fc(n,s,t,e,n,o),r>0&&(s+=16),fc(n,o,t,e+=16,n,s)}function hc(t,e,n){const r=xn({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:i,r:o,p:s,dkLen:a,asyncTick:c,maxmem:u,onProgress:f}=r;if(sn(i),sn(o),sn(s),sn(a),sn(c),sn(u),void 0!==f&&"function"!=typeof f)throw new Error("progressCb should be function");const l=128*o,h=l/4;if(i<=1||i&i-1||i>=2**(l/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(s<0||s>137438953440/l)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const d=l*(i+s);if(d>u)throw new Error(`Scrypt: parameters too large, ${d} (128 * r * (N + p)) > ${u} (maxmem)`);const p=$o(Rn,t,e,{c:1,dkLen:l*s}),y=dn(p),g=dn(new Uint8Array(l*i)),m=dn(new Uint8Array(l));let b=()=>{};if(f){const t=2*i*s,e=Math.max(Math.floor(t/1e4),1);let n=0;b=()=>{n++,!f||n%e&&n!==t||f(n/t)}}return{N:i,r:o,p:s,dkLen:a,blockSize32:h,V:g,B32:y,B:p,tmp:m,blockMixCb:b,asyncTick:c}}function dc(t,e,n,r,i){const o=$o(Rn,t,n,{c:1,dkLen:e});return n.fill(0),r.fill(0),i.fill(0),o}let pc=!1,yc=!1;const gc=async function(t,e,n,r,i,o,s){return await async function(t,e,n){const{N:r,r:i,p:o,dkLen:s,blockSize32:a,V:c,B32:u,B:f,tmp:l,blockMixCb:h,asyncTick:d}=hc(t,e,n);for(let t=0;t<o;t++){const e=a*t;for(let t=0;t<a;t++)c[t]=u[e+t];let n=0;await mn(r-1,d,()=>{lc(c,n,c,n+=a,i),h()}),lc(c,(r-1)*a,u,e,i),h(),await mn(r,d,()=>{const t=u[e+a-16]%r;for(let n=0;n<a;n++)l[n]=u[e+n]^c[t*a+n];lc(l,0,u,e,i),h()})}return dc(t,s,f,c,l)}(t,e,{N:n,r,p:i,dkLen:o,onProgress:s})},mc=function(t,e,n,r,i,o){return function(t,e,n){const{N:r,r:i,p:o,dkLen:s,blockSize32:a,V:c,B32:u,B:f,tmp:l,blockMixCb:h}=hc(t,e,n);for(let t=0;t<o;t++){const e=a*t;for(let t=0;t<a;t++)c[t]=u[e+t];for(let t=0,e=0;t<r-1;t++)lc(c,e,c,e+=a,i),h();lc(c,(r-1)*a,u,e,i),h();for(let t=0;t<r;t++){const t=u[e+a-16]%r;for(let n=0;n<a;n++)l[n]=u[e+n]^c[t*a+n];lc(l,0,u,e,i),h()}}return dc(t,s,f,c,l)}(t,e,{N:n,r,p:i,dkLen:o})};let bc=gc,wc=mc;async function vc(t,e,n,r,i,o,s){const a=Mr(t,"passwd"),c=Mr(e,"salt");return Jr(await bc(a,c,n,r,i,o,s))}function xc(t,e,n,r,i,o){const s=Mr(t,"passwd"),a=Mr(e,"salt");return Jr(wc(s,a,n,r,i,o))}function Ec(t){const e=Mr(t,"randomBytes");e[6]=15&e[6]|64,e[8]=63&e[8]|128;const n=Jr(e);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join("-")}function Ac(t){return"string"!=typeof t||t.startsWith("0x")||(t="0x"+t),qr(t)}function Ic(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function Bc(t){return"string"==typeof t?ho(t,"NFKC"):qr(t)}function _c(t,e){const n=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);Hr(null!=n,"invalid path","path",e);const r=n[1],i=n[3],o="!"===n[4];let s=t;for(const t of r.toLowerCase().split(".")){if(Array.isArray(s)){if(!t.match(/^[0-9]+$/))break;s=s[parseInt(t)]}else if("object"==typeof s){let e=null;for(const n in s)if(n.toLowerCase()===t){e=s[n];break}s=e}else s=null;if(null==s)break}if(Hr(!o||null!=s,"missing required value","path",r),i&&null!=s){if("int"===i){if("string"==typeof s&&s.match(/^-?[0-9]+$/))return parseInt(s);if(Number.isSafeInteger(s))return s}if("number"===i&&"string"==typeof s&&s.match(/^-?[0-9.]*$/))return parseFloat(s);if("data"===i&&"string"==typeof s)return Ac(s);if("array"===i&&Array.isArray(s))return s;if(i===typeof s)return s;Hr(!1,`wrong type found for ${i} `,"path",r)}return s}vc._=gc,vc.lock=function(){yc=!0},vc.register=function(t){if(yc)throw new Error("scrypt is locked");bc=t},Object.freeze(vc),xc._=mc,xc.lock=function(){pc=!0},xc.register=function(t){if(pc)throw new Error("scryptSync is locked");wc=t},Object.freeze(xc);const kc="m/44'/60'/0'/0/0";function Pc(t){try{const e=JSON.parse(t);if(3===(null!=e.version?parseInt(e.version):0))return!0}catch(t){}return!1}function Sc(t,e){const n=Mr(e),r=_c(t,"crypto.ciphertext:data!");Hr(Jr(eo(Xr([n.slice(16,32),r]))).substring(2)===_c(t,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const i=function(t,e,n){if("aes-128-ctr"===_c(t,"crypto.cipher:string")){const r=_c(t,"crypto.cipherparams.iv:data!");return Jr(new cc(e,r).decrypt(n))}Dr(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(t,n.slice(0,16),r),o=fs(i);if(t.address){let e=t.address.toLowerCase();e.startsWith("0x")||(e="0x"+e),Hr(co(e)===o,"keystore address/privateKey mismatch","address",t.address)}const s={address:o,privateKey:i};if("0.1"===_c(t,"x-ethers.version:string")){const e=n.slice(32,64),r=_c(t,"x-ethers.mnemonicCiphertext:data!"),i=_c(t,"x-ethers.mnemonicCounter:data!"),o=new cc(e,i);s.mnemonic={path:_c(t,"x-ethers.path:string")||kc,locale:_c(t,"x-ethers.locale:string")||"en",entropy:Jr(Mr(o.decrypt(r)))}}return s}function Oc(t){const e=_c(t,"crypto.kdf:string");if(e&&"string"==typeof e){if("scrypt"===e.toLowerCase()){const n=_c(t,"crypto.kdfparams.salt:data!"),r=_c(t,"crypto.kdfparams.n:int!"),i=_c(t,"crypto.kdfparams.r:int!"),o=_c(t,"crypto.kdfparams.p:int!");Hr(r>0&&!(r&r-1),"invalid kdf.N","kdf.N",r),Hr(i>0&&o>0,"invalid kdf","kdf",e);const s=_c(t,"crypto.kdfparams.dklen:int!");return Hr(32===s,"invalid kdf.dklen","kdf.dflen",s),{name:"scrypt",salt:n,N:r,r:i,p:o,dkLen:64}}if("pbkdf2"===e.toLowerCase()){const e=_c(t,"crypto.kdfparams.salt:data!"),n=_c(t,"crypto.kdfparams.prf:string!"),r=n.split("-").pop();Hr("sha256"===r||"sha512"===r,"invalid kdf.pdf","kdf.pdf",n);const i=_c(t,"crypto.kdfparams.c:int!"),o=_c(t,"crypto.kdfparams.dklen:int!");return Hr(32===o,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:e,count:i,dkLen:o,algorithm:r}}}Hr(!1,"unsupported key-derivation function","kdf",e)}function Rc(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}function Uc(t){const e=null!=t.salt?Mr(t.salt,"options.salt"):ua(32);let n=1<<17,r=8,i=1;return t.scrypt&&(t.scrypt.N&&(n=t.scrypt.N),t.scrypt.r&&(r=t.scrypt.r),t.scrypt.p&&(i=t.scrypt.p)),Hr("number"==typeof n&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),"invalid scrypt N parameter","options.N",n),Hr("number"==typeof r&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r),Hr("number"==typeof i&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:e,N:n,r,p:i}}function Cc(t,e,n,r){const i=Mr(n.privateKey,"privateKey"),o=null!=r.iv?Mr(r.iv,"options.iv"):ua(16);Hr(16===o.length,"invalid options.iv length","options.iv",r.iv);const s=null!=r.uuid?Mr(r.uuid,"options.uuid"):ua(16);Hr(16===s.length,"invalid options.uuid length","options.uuid",r.iv);const a=t.slice(0,16),c=t.slice(16,32),u=Mr(new cc(a,o).encrypt(i)),f=eo(Xr([c,u])),l={address:n.address.substring(2).toLowerCase(),id:Ec(s),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Jr(o).substring(2)},ciphertext:Jr(u).substring(2),kdf:"scrypt",kdfparams:{salt:Jr(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:f.substring(2)}};if(n.mnemonic){const e=null!=r.client?r.client:"ethers/6.17.0",i=n.mnemonic.path||kc,o=n.mnemonic.locale||"en",s=t.slice(32,64),a=Mr(n.mnemonic.entropy,"account.mnemonic.entropy"),c=ua(16),u=Mr(new cc(s,c).encrypt(a)),f=new Date,h="UTC--"+(f.getUTCFullYear()+"-"+Ic(f.getUTCMonth()+1,2)+"-"+Ic(f.getUTCDate(),2)+"T"+Ic(f.getUTCHours(),2)+"-"+Ic(f.getUTCMinutes(),2)+"-"+Ic(f.getUTCSeconds(),2)+".0Z")+"--"+l.address;l["x-ethers"]={client:e,gethFilename:h,path:i,locale:o,mnemonicCounter:Jr(c).substring(2),mnemonicCiphertext:Jr(u).substring(2),version:"0.1"}}return JSON.stringify(l)}function Lc(t,e,n){null==n&&(n={});const r=Bc(e),i=Uc(n);return Cc(Mr(xc(r,i.salt,i.N,i.r,i.p,64)),i,t,n)}async function Nc(t,e,n){null==n&&(n={});const r=Bc(e),i=Uc(n);return Cc(Mr(await vc(r,i.salt,i.N,i.r,i.p,64,n.progressCallback)),i,t,n)}const Tc="m/44'/60'/0'/0/0",Fc=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Kc=2147483648,$c=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function Dc(t,e){let n="";for(;t;)n="0123456789abcdef"[t%16]+n,t=Math.trunc(t/16);for(;n.length<2*e;)n="0"+n;return"0x"+n}function Hc(t){const e=Mr(t);return function(t){const e=Mr(t);let n=ui(e),r="";for(;n;)r=fa[Number(n%pa)]+r,n/=pa;for(let t=0;t<e.length&&!e[t];t++)r=fa[0]+r;return r}(Xr([e,ti(es(es(e)),0,4)]))}const jc={};function zc(t,e,n,r){const i=new Uint8Array(37);t&Kc?(Dr(null!=r,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(Mr(r),1)):i.set(Mr(n));for(let e=24;e>=0;e-=8)i[33+(e>>3)]=t>>24-e&255;const o=Mr(Ds("sha512",e,i));return{IL:o.slice(0,32),IR:o.slice(32)}}function Gc(t,e){const n=e.split("/");Hr(n.length>0,"invalid path","path",e),"m"===n[0]&&(Hr(0===t.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${t.depth}`,"path",e),n.shift());let r=t;for(let t=0;t<n.length;t++){const e=n[t];if(e.match(/^[0-9]+'$/)){const n=parseInt(e.substring(0,e.length-1));Hr(n<Kc,"invalid path index",`path[${t}]`,e),r=r.deriveChild(Kc+n)}else if(e.match(/^[0-9]+$/)){const n=parseInt(e);Hr(n<Kc,"invalid path index",`path[${t}]`,e),r=r.deriveChild(n)}else Hr(!1,"invalid path component",`path[${t}]`,e)}return r}class Vc extends Ts{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(t,e,n,r,i,o,s,a,c){super(e,c),Gr(t,jc,"HDNodeWallet"),Fr(this,{publicKey:e.compressedPublicKey});Fr(this,{parentFingerprint:n,fingerprint:ti(oa(es(this.publicKey)),0,4),chainCode:r,path:i,index:o,depth:s}),Fr(this,{mnemonic:a})}connect(t){return new Vc(jc,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}#C(){const t={address:this.address,privateKey:this.privateKey},e=this.mnemonic;return this.path&&e&&"en"===e.wordlist.locale&&""===e.password&&(t.mnemonic={path:this.path,locale:"en",entropy:e.entropy}),t}async encrypt(t,e){return await Nc(this.#C(),t,{progressCallback:e})}encryptSync(t){return Lc(this.#C(),t)}get extendedKey(){return Dr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),Hc(Xr(["0x0488ADE4",Dc(this.depth,1),this.parentFingerprint,Dc(this.index,4),this.chainCode,Xr(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new Mc(jc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){const e=fi(t,"index");Hr(e<=4294967295,"invalid index","index",e);let n=this.path;n&&(n+="/"+(2147483647&e),e&Kc&&(n+="'"));const{IR:r,IL:i}=zc(e,this.chainCode,this.publicKey,this.privateKey),o=new _i(li((ui(i)+BigInt(this.privateKey))%$c,32));return new Vc(jc,o,this.fingerprint,Jr(r),n,e,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return Gc(this,t)}static#L(t,e){Hr(Zr(t),"invalid seed","seed","[REDACTED]");const n=Mr(t,"seed");Hr(n.length>=16&&n.length<=64,"invalid seed","seed","[REDACTED]");const r=Mr(Ds("sha512",Fc,n)),i=new _i(Jr(r.slice(0,32)));return new Vc(jc,i,"0x00000000",Jr(r.slice(32)),"m",0,0,e,null)}static fromExtendedKey(t){const e=hi(function(t){let e=da;for(let n=0;n<t.length;n++)e*=pa,e+=ha(t[n]);return e}(t));Hr(82===e.length||Hc(e.slice(0,78))===t,"invalid extended key","extendedKey","[ REDACTED ]");const n=e[4],r=Jr(e.slice(5,9)),i=parseInt(Jr(e.slice(9,13)).substring(2),16),o=Jr(e.slice(13,45)),s=e.slice(45,78);switch(Jr(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const t=Jr(s);return new Mc(jc,fs(t),t,r,o,null,i,n,null)}case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new Vc(jc,new _i(s.slice(1)),r,o,null,i,n,null,null)}Hr(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t,e,n){null==t&&(t=""),null==e&&(e=Tc),null==n&&(n=Ea.wordlist());const r=Ua.fromEntropy(ua(16),t,n);return Vc.#L(r.computeSeed(),r).derivePath(e)}static fromMnemonic(t,e){return e||(e=Tc),Vc.#L(t.computeSeed(),t).derivePath(e)}static fromPhrase(t,e,n,r){null==e&&(e=""),null==n&&(n=Tc),null==r&&(r=Ea.wordlist());const i=Ua.fromPhrase(t,e,r);return Vc.#L(i.computeSeed(),i).derivePath(n)}static fromSeed(t){return Vc.#L(t,null)}}class Mc extends Ns{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(t,e,n,r,i,o,s,a,c){super(e,c),Gr(t,jc,"HDNodeVoidWallet"),Fr(this,{publicKey:n});Fr(this,{publicKey:n,fingerprint:ti(oa(es(n)),0,4),parentFingerprint:r,chainCode:i,path:o,index:s,depth:a})}connect(t){return new Mc(jc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return Dr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),Hc(Xr(["0x0488B21E",Dc(this.depth,1),this.parentFingerprint,Dc(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(t){const e=fi(t,"index");Hr(e<=4294967295,"invalid index","index",e);let n=this.path;n&&(n+="/"+(2147483647&e),e&Kc&&(n+="'"));const{IR:r,IL:i}=zc(e,this.chainCode,this.publicKey,null),o=_i.addPoints(i,this.publicKey,!0),s=fs(o);return new Mc(jc,s,o,this.fingerprint,Jr(r),n,e,this.depth+1,this.provider)}derivePath(t){return Gc(this,t)}}var qc,Wc,Zc=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},Yc=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};class Jc extends nc{constructor(t,e){if(super("ECC",t,Jc),qc.set(this,void 0),Wc.set(this,void 0),e){if(e.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Zc(this,qc,new Uint8Array(e),"f")}else Zc(this,qc,new Uint8Array(16),"f");Zc(this,Wc,this.iv,"f")}get iv(){return new Uint8Array(Yc(this,qc,"f"))}encrypt(t){if(t.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const e=new Uint8Array(t.length);for(let n=0;n<t.length;n+=16){for(let e=0;e<16;e++)Yc(this,Wc,"f")[e]^=t[n+e];Zc(this,Wc,this.aes.encrypt(Yc(this,Wc,"f")),"f"),e.set(Yc(this,Wc,"f"),n)}return e}decrypt(t){if(t.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const e=new Uint8Array(t.length);for(let n=0;n<t.length;n+=16){const r=this.aes.decrypt(t.subarray(n,n+16));for(let i=0;i<16;i++)e[n+i]=r[i]^Yc(this,Wc,"f")[i],Yc(this,Wc,"f")[i]=t[n+i]}return e}}function Xc(t){try{if(JSON.parse(t).encseed)return!0}catch(t){}return!1}function Qc(t,e){const n=JSON.parse(t),r=Bc(e),i=co(_c(n,"ethaddr:string!")),o=Ac(_c(n,"encseed:string!"));Hr(o&&o.length%16==0,"invalid encseed","json",t);const s=Mr(_a(r,r,2e3,32,"sha256")).slice(0,16),a=o.slice(0,16),c=o.slice(16),u=function(t){if(t.length<16)throw new TypeError("PKCS#7 invalid length");const e=t[t.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const n=t.length-e;for(let r=0;r<e;r++)if(t[n+r]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(t.subarray(0,n))}(Mr(new Jc(s,a).decrypt(c)));let f="";for(let t=0;t<u.length;t++)f+=String.fromCharCode(u[t]);return{address:i,privateKey:vo(f)}}function tu(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}qc=new WeakMap,Wc=new WeakMap;class eu extends Ts{constructor(t,e){"string"!=typeof t||t.startsWith("0x")||(t="0x"+t),super("string"==typeof t?new _i(t):t,e)}connect(t){return new eu(this.signingKey,t)}async encrypt(t,e){const n={address:this.address,privateKey:this.privateKey};return await Nc(n,t,{progressCallback:e})}encryptSync(t){return Lc({address:this.address,privateKey:this.privateKey},t)}static#N(t){if(Hr(t,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in t&&t.mnemonic&&"en"===t.mnemonic.locale){const e=Ua.fromEntropy(t.mnemonic.entropy),n=Vc.fromMnemonic(e,t.mnemonic.path);if(n.address===t.address&&n.privateKey===t.privateKey)return n;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const e=new eu(t.privateKey);return Hr(e.address===t.address,"address/privateKey mismatch","json","[ REDACTED ]"),e}static async fromEncryptedJson(t,e,n){let r=null;return Pc(t)?r=await async function(t,e,n){const r=JSON.parse(t),i=Bc(e),o=Oc(r);if("pbkdf2"===o.name){n&&(n(0),await Rc(0));const{salt:t,count:e,dkLen:s,algorithm:a}=o,c=_a(i,t,e,s,a);return n&&(n(1),await Rc(0)),Sc(r,c)}Dr("scrypt"===o.name,"cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:s,N:a,r:c,p:u,dkLen:f}=o;return Sc(r,await vc(i,s,a,c,u,f,n))}(t,e,n):Xc(t)&&(n&&(n(0),await tu(0)),r=Qc(t,e),n&&(n(1),await tu(0))),eu.#N(r)}static fromEncryptedJsonSync(t,e){let n=null;return Pc(t)?n=function(t,e){const n=JSON.parse(t),r=Bc(e),i=Oc(n);if("pbkdf2"===i.name){const{salt:t,count:e,dkLen:o,algorithm:s}=i;return Sc(n,_a(r,t,e,o,s))}Dr("scrypt"===i.name,"cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:o,N:s,r:a,p:c,dkLen:u}=i;return Sc(n,xc(r,o,s,a,c,u))}(t,e):Xc(t)?n=Qc(t,e):Hr(!1,"invalid JSON wallet","json","[ REDACTED ]"),eu.#N(n)}static createRandom(t){const e=Vc.createRandom();return t?e.connect(t):e}static fromPhrase(t,e){const n=Vc.fromPhrase(t);return e?n.connect(e):n}}function nu(t,e){return n=t,Boolean("string"==typeof n?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var n}class ru extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}function iu(t,e="Assertion failed.",n=ru){if(!t){if(e instanceof Error)throw e;throw nu(n,e)}}const ou=4294967295,su="bip32:44'",au=/^\d+$/u,cu=/^bip32:\d+'?$/u,uu=/^slip10:\d+'?$/u,fu=/^cip3:\d+'?$/u,lu=/^bip39:([a-z]+){1}( [a-z]+){11,23}$/u,hu=2147483648;const du=W(G(),/^(?:0x)?[0-9a-f]+$/iu);W(G(),/^0x[0-9a-f]+$/iu),W(G(),/^0x[0-9a-f]{40}$/u),W(G(),/^0x[0-9a-fA-F]{40}$/u);function pu(t){iu(function(t){return U(t,du)}(t),"Value must be a hexadecimal string.")}function yu(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`}function gu(t){return t.startsWith("0x")||t.startsWith("0X")?t.substring(2):t}const mu=48,bu=58,wu=87;const vu=function(){const t=[];return()=>{if(0===t.length)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}();function xu(t){return t instanceof Uint8Array}function Eu(t){iu(xu(t),"Value must be a Uint8Array.")}function Au(t){if(Eu(t),0===t.length)return"0x";const e=vu(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return yu(n.join(""))}function Iu(t){Eu(t);const e=Au(t);return BigInt(e)}function Bu(t){if("0x"===t?.toLowerCase?.())return new Uint8Array;pu(t);const e=gu(t).toLowerCase(),n=e.length%2==0?e:`0${e}`,r=new Uint8Array(n.length/2);for(let t=0;t<r.length;t++){const e=n.charCodeAt(2*t),i=n.charCodeAt(2*t+1),o=e-(e<bu?mu:wu),s=i-(i<bu?mu:wu);r[t]=16*o+s}return r}function _u(t){return iu("string"==typeof t,"Value must be a string."),(new TextEncoder).encode(t)}function ku(t){if("bigint"==typeof t)return function(t){return iu("bigint"==typeof t,"Value must be a bigint."),iu(t>=BigInt(0),"Value must be a non-negative bigint."),Bu(t.toString(16))}(t);if("number"==typeof t)return function(t){return iu("number"==typeof t,"Value must be a number."),iu(t>=0,"Value must be a non-negative number."),iu(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead."),Bu(t.toString(16))}(t);if("string"==typeof t)return t.startsWith("0x")?Bu(t):_u(t);if(xu(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}function Pu(t){const e=new Array(t.length);let n=0;for(let r=0;r<t.length;r++){const i=ku(t[r]);e[r]=i,n+=i.length}const r=new Uint8Array(n);for(let t=0,n=0;t<e.length;t++)r.set(e[t],n),n+=e[t].length;return r}function Su(t){if("undefined"!=typeof Buffer&&t instanceof Buffer){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Ou(t,e,n){return t&e^~t&n}function Ru(t,e,n){return t&e^t&n^e&n}class Uu extends Mt{constructor(t,e,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(t),this.view=Bt(this.buffer)}update(t){Et(this),vt(t=zt(t));const{view:e,buffer:n,blockLen:r}=this,i=t.length;for(let o=0;o<i;){const s=Math.min(r-this.pos,i-o);if(s===r){const e=Bt(t);for(;r<=i-o;o+=r)this.process(e,o);continue}n.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Et(this),At(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:r,isLE:i}=this;let{pos:o}=this;e[o++]=128,It(this.buffer.subarray(o)),this.padOffset>r-o&&(this.process(n,0),o=0);for(let t=o;t<r;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),c=r?4:0,u=r?0:4;t.setUint32(e+c,s,r),t.setUint32(e+u,a,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const s=Bt(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)s.setUint32(4*t,u[t],i)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:i,destroyed:o,pos:s}=this;return t.destroyed=o,t.finished=i,t.length=r,t.pos=s,r%e&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const Cu=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Lu=(Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]));const Nu=Uint32Array.from([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]),Tu=new Uint32Array(64);class Fu extends Uu{constructor(t=32){super(64,t,8,!1),this.A=0|Cu[0],this.B=0|Cu[1],this.C=0|Cu[2],this.D=0|Cu[3],this.E=0|Cu[4],this.F=0|Cu[5],this.G=0|Cu[6],this.H=0|Cu[7]}get(){const{A:t,B:e,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[t,e,n,r,i,o,s,a]}set(t,e,n,r,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let n=0;n<16;n++,e+=4)Tu[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=Tu[t-15],n=Tu[t-2],r=_t(e,7)^_t(e,18)^e>>>3,i=_t(n,17)^_t(n,19)^n>>>10;Tu[t]=i+Tu[t-7]+r+Tu[t-16]|0}let{A:n,B:r,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+(_t(s,6)^_t(s,11)^_t(s,25))+Ou(s,a,c)+Nu[t]+Tu[t]|0,f=(_t(n,2)^_t(n,13)^_t(n,22))+Ru(n,r,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=r,r=n,n=e+f|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,r,i,o,s,a,c,u)}roundClean(){It(Tu)}destroy(){this.set(0,0,0,0,0,0,0,0),It(this.buffer)}}const Ku=Q(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),$u=Ku[0],Du=Ku[1],Hu=new Uint32Array(80),ju=new Uint32Array(80);class zu extends Uu{constructor(t=64){super(128,t,16,!1),this.Ah=0|Lu[0],this.Al=0|Lu[1],this.Bh=0|Lu[2],this.Bl=0|Lu[3],this.Ch=0|Lu[4],this.Cl=0|Lu[5],this.Dh=0|Lu[6],this.Dl=0|Lu[7],this.Eh=0|Lu[8],this.El=0|Lu[9],this.Fh=0|Lu[10],this.Fl=0|Lu[11],this.Gh=0|Lu[12],this.Gl=0|Lu[13],this.Hh=0|Lu[14],this.Hl=0|Lu[15]}get(){const{Ah:t,Al:e,Bh:n,Bl:r,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:f,Fl:l,Gh:h,Gl:d,Hh:p,Hl:y}=this;return[t,e,n,r,i,o,s,a,c,u,f,l,h,d,p,y]}set(t,e,n,r,i,o,s,a,c,u,f,l,h,d,p,y){this.Ah=0|t,this.Al=0|e,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|f,this.Fl=0|l,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|y}process(t,e){for(let n=0;n<16;n++,e+=4)Hu[n]=t.getUint32(e),ju[n]=t.getUint32(e+=4);for(let t=16;t<80;t++){const e=0|Hu[t-15],n=0|ju[t-15],r=nt(e,n,1)^nt(e,n,8)^tt(e,0,7),i=rt(e,n,1)^rt(e,n,8)^et(e,n,7),o=0|Hu[t-2],s=0|ju[t-2],a=nt(o,s,19)^it(o,s,61)^tt(o,0,6),c=rt(o,s,19)^ot(o,s,61)^et(o,s,6),u=dt(i,c,ju[t-7],ju[t-16]),f=pt(u,r,a,Hu[t-7],Hu[t-16]);Hu[t]=0|f,ju[t]=0|u}let{Ah:n,Al:r,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:f,El:l,Fh:h,Fl:d,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let t=0;t<80;t++){const e=nt(f,l,14)^nt(f,l,18)^it(f,l,41),b=rt(f,l,14)^rt(f,l,18)^ot(f,l,41),w=f&h^~f&p,v=yt(m,b,l&d^~l&y,Du[t],ju[t]),x=gt(v,g,e,w,$u[t],Hu[t]),E=0|v,A=nt(n,r,28)^it(n,r,34)^it(n,r,39),I=rt(n,r,28)^ot(n,r,34)^ot(n,r,39),B=n&i^n&s^i&s,_=r&o^r&a^o&a;g=0|p,m=0|y,p=0|h,y=0|d,h=0|f,d=0|l,({h:f,l}=ft(0|c,0|u,0|x,0|E)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|n,o=0|r;const k=lt(E,I,_);n=ht(k,x,A,B),r=0|k}({h:n,l:r}=ft(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:o}=ft(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=ft(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=ft(0|this.Dh,0|this.Dl,0|c,0|u)),({h:f,l}=ft(0|this.Eh,0|this.El,0|f,0|l)),({h,l:d}=ft(0|this.Fh,0|this.Fl,0|h,0|d)),({h:p,l:y}=ft(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=ft(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(n,r,i,o,s,a,c,u,f,l,h,d,p,y,g,m)}roundClean(){It(Hu,ju)}destroy(){It(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);const Gu=qt(()=>new Fu),Vu=qt(()=>new zu);class Mu extends Mt{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,xt(t);const n=zt(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?t.create().update(n).digest():n);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),It(i)}update(t){return Et(this),this.iHash.update(t),this}digestInto(t){Et(this),vt(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=r,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const qu=(t,e,n)=>new Mu(t,e).update(n).digest();qu.create=(t,e)=>new Mu(t,e);const Wu=BigInt(0),Zu=BigInt(1);function Yu(t,e=""){if("boolean"!=typeof t){throw new Error((e&&`"${e}"`)+"expected boolean, got type="+typeof t)}return t}function Ju(t,e,n=""){const r=bt(t),i=t?.length,o=void 0!==e;if(!r||o&&i!==e){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(o?` of length ${e}`:"")+", got "+(r?`length=${i}`:"type="+typeof t))}return t}function Xu(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function Qu(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?Wu:BigInt("0x"+t)}function tf(t){return Qu(Ct(t))}function ef(t){return vt(t),Qu(Ct(Uint8Array.from(t).reverse()))}function nf(t,e){return Ht(t.toString(16).padStart(2*e,"0"))}function rf(t,e){return nf(t,e).reverse()}function of(t,e,n){let r;if("string"==typeof e)try{r=Ht(e)}catch(e){throw new Error(t+" must be hex string or Uint8Array, cause: "+e)}else{if(!bt(e))throw new Error(t+" must be hex string or Uint8Array");r=Uint8Array.from(e)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function sf(t){return Uint8Array.from(t)}const af=t=>"bigint"==typeof t&&Wu<=t;function cf(t,e,n,r){if(!function(t,e,n){return af(t)&&af(e)&&af(n)&&e<=t&&t<n}(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function uf(t){let e;for(e=0;t>Wu;t>>=Zu,e+=1);return e}const ff=t=>(Zu<<BigInt(t))-Zu;function lf(t,e,n={}){if(!t||"object"!=typeof t)throw new Error("expected valid options object");function r(e,n,r){const i=t[e];if(r&&void 0===i)return;const o=typeof i;if(o!==n||null===i)throw new Error(`param "${e}" is invalid: expected ${n}, got ${o}`)}Object.entries(e).forEach(([t,e])=>r(t,e,!1)),Object.entries(n).forEach(([t,e])=>r(t,e,!0))}const hf=()=>{throw new Error("not implemented")};function df(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(void 0!==i)return i;const o=t(n,...r);return e.set(n,o),o}}const pf=BigInt(0),yf=BigInt(1),gf=BigInt(2),mf=BigInt(3),bf=BigInt(4),wf=BigInt(5),vf=BigInt(7),xf=BigInt(8),Ef=BigInt(9),Af=BigInt(16);function If(t,e){const n=t%e;return n>=pf?n:e+n}function Bf(t,e,n){let r=t;for(;e-- >pf;)r*=r,r%=n;return r}function _f(t,e){if(t===pf)throw new Error("invert: expected non-zero number");if(e<=pf)throw new Error("invert: expected positive modulus, got "+e);let n=If(t,e),r=e,i=pf,o=yf,s=yf,a=pf;for(;n!==pf;){const t=r/n,e=r%n,c=i-s*t,u=o-a*t;r=n,n=e,i=s,o=a,s=c,a=u}if(r!==yf)throw new Error("invert: does not exist");return If(i,e)}function kf(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function Pf(t,e){const n=(t.ORDER+yf)/bf,r=t.pow(e,n);return kf(t,r,e),r}function Sf(t,e){const n=(t.ORDER-wf)/xf,r=t.mul(e,gf),i=t.pow(r,n),o=t.mul(e,i),s=t.mul(t.mul(o,gf),i),a=t.mul(o,t.sub(s,t.ONE));return kf(t,a,e),a}function Of(t){if(t<mf)throw new Error("sqrt is not defined for small field");let e=t-yf,n=0;for(;e%gf===pf;)e/=gf,n++;let r=gf;const i=Kf(t);for(;1===Tf(i,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return Pf;let o=i.pow(r,e);const s=(e+yf)/gf;return function(t,r){if(t.is0(r))return r;if(1!==Tf(t,r))throw new Error("Cannot find square root");let i=n,a=t.mul(t.ONE,o),c=t.pow(r,e),u=t.pow(r,s);for(;!t.eql(c,t.ONE);){if(t.is0(c))return t.ZERO;let e=1,n=t.sqr(c);for(;!t.eql(n,t.ONE);)if(e++,n=t.sqr(n),e===i)throw new Error("Cannot find square root");const r=yf<<BigInt(i-e-1),o=t.pow(a,r);i=e,a=t.sqr(o),c=t.mul(c,a),u=t.mul(u,o)}return u}}function Rf(t){return t%bf===mf?Pf:t%xf===wf?Sf:t%Af===Ef?function(t){const e=Kf(t),n=Of(t),r=n(e,e.neg(e.ONE)),i=n(e,r),o=n(e,e.neg(r)),s=(t+vf)/Af;return(t,e)=>{let n=t.pow(e,s),a=t.mul(n,r);const c=t.mul(n,i),u=t.mul(n,o),f=t.eql(t.sqr(a),e),l=t.eql(t.sqr(c),e);n=t.cmov(n,a,f),a=t.cmov(u,c,l);const h=t.eql(t.sqr(a),e),d=t.cmov(n,a,h);return kf(t,d,e),d}}(t):Of(t)}const Uf=(t,e)=>(If(t,e)&yf)===yf,Cf=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Lf(t,e,n){if(n<pf)throw new Error("invalid exponent, negatives unsupported");if(n===pf)return t.ONE;if(n===yf)return e;let r=t.ONE,i=e;for(;n>pf;)n&yf&&(r=t.mul(r,i)),i=t.sqr(i),n>>=yf;return r}function Nf(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((e,n,i)=>t.is0(n)?e:(r[i]=e,t.mul(e,n)),t.ONE),o=t.inv(i);return e.reduceRight((e,n,i)=>t.is0(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n)),o),r}function Tf(t,e){const n=(t.ORDER-yf)/gf,r=t.pow(e,n),i=t.eql(r,t.ONE),o=t.eql(r,t.ZERO),s=t.eql(r,t.neg(t.ONE));if(!i&&!o&&!s)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function Ff(t,e){void 0!==e&&wt(e);const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Kf(t,e,n=!1,r={}){if(t<=pf)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,o,s,a=!1;if("object"==typeof e&&null!=e){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const t=e;t.BITS&&(i=t.BITS),t.sqrt&&(o=t.sqrt),"boolean"==typeof t.isLE&&(n=t.isLE),"boolean"==typeof t.modFromBytes&&(a=t.modFromBytes),s=t.allowedLengths}else"number"==typeof e&&(i=e),r.sqrt&&(o=r.sqrt);const{nBitLength:c,nByteLength:u}=Ff(t,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const l=Object.freeze({ORDER:t,isLE:n,BITS:c,BYTES:u,MASK:ff(c),ZERO:pf,ONE:yf,allowedLengths:s,create:e=>If(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return pf<=e&&e<t},is0:t=>t===pf,isValidNot0:t=>!l.is0(t)&&l.isValid(t),isOdd:t=>(t&yf)===yf,neg:e=>If(-e,t),eql:(t,e)=>t===e,sqr:e=>If(e*e,t),add:(e,n)=>If(e+n,t),sub:(e,n)=>If(e-n,t),mul:(e,n)=>If(e*n,t),pow:(t,e)=>Lf(l,t,e),div:(e,n)=>If(e*_f(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>_f(e,t),sqrt:o||(e=>(f||(f=Rf(t)),f(l,e))),toBytes:t=>n?rf(t,u):nf(t,u),fromBytes:(e,r=!0)=>{if(s){if(!s.includes(e.length)||e.length>u)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);const t=new Uint8Array(u);t.set(e,n?0:t.length-e.length),e=t}if(e.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+e.length);let i=n?ef(e):tf(e);if(a&&(i=If(i,t)),!r&&!l.isValid(i))throw new Error("invalid field element: outside of range 0..ORDER");return i},invertBatch:t=>Nf(l,t),cmov:(t,e,n)=>n?e:t});return Object.freeze(l)}function $f(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Df(t){const e=$f(t);return e+Math.ceil(e/2)}const Hf=BigInt(0),jf=BigInt(1);function zf(t,e){const n=e.negate();return t?n:e}function Gf(t,e){const n=Nf(t.Fp,e.map(t=>t.Z));return e.map((e,r)=>t.fromAffine(e.toAffine(n[r])))}function Vf(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Mf(t,e){Vf(t,e);const n=2**t;return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1),mask:ff(t),maxNumber:n,shiftBy:BigInt(t)}}function qf(t,e,n){const{windowSize:r,mask:i,maxNumber:o,shiftBy:s}=n;let a=Number(t&i),c=t>>s;a>r&&(a-=o,c+=jf);const u=e*r;return{nextN:c,offset:u+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:e%2!=0,offsetF:u}}function Wf(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)})}function Zf(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)})}const Yf=new WeakMap,Jf=new WeakMap;function Xf(t){return Jf.get(t)||1}function Qf(t){if(t!==Hf)throw new Error("invalid wNAF")}class tl{constructor(t,e){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=e}_unsafeLadder(t,e,n=this.ZERO){let r=t;for(;e>Hf;)e&jf&&(n=n.add(r)),r=r.double(),e>>=jf;return n}precomputeWindow(t,e){const{windows:n,windowSize:r}=Mf(e,this.bits),i=[];let o=t,s=o;for(let t=0;t<n;t++){s=o,i.push(s);for(let t=1;t<r;t++)s=s.add(o),i.push(s);o=s.double()}return i}wNAF(t,e,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,i=this.BASE;const o=Mf(t,this.bits);for(let t=0;t<o.windows;t++){const{nextN:s,offset:a,isZero:c,isNeg:u,isNegF:f,offsetF:l}=qf(n,t,o);n=s,c?i=i.add(zf(f,e[l])):r=r.add(zf(u,e[a]))}return Qf(n),{p:r,f:i}}wNAFUnsafe(t,e,n,r=this.ZERO){const i=Mf(t,this.bits);for(let t=0;t<i.windows&&n!==Hf;t++){const{nextN:o,offset:s,isZero:a,isNeg:c}=qf(n,t,i);if(n=o,!a){const t=e[s];r=r.add(c?t.negate():t)}}return Qf(n),r}getPrecomputes(t,e,n){let r=Yf.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&&("function"==typeof n&&(r=n(r)),Yf.set(e,r))),r}cached(t,e,n){const r=Xf(t);return this.wNAF(r,this.getPrecomputes(r,t,n),e)}unsafe(t,e,n,r){const i=Xf(t);return 1===i?this._unsafeLadder(t,e,r):this.wNAFUnsafe(i,this.getPrecomputes(i,t,n),e,r)}createCache(t,e){Vf(e,this.bits),Jf.set(t,e),Yf.delete(t)}hasCache(t){return 1!==Xf(t)}}function el(t,e,n,r){Wf(n,t),Zf(r,e);const i=n.length,o=r.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,a=uf(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const u=ff(c),f=new Array(Number(u)+1).fill(s);let l=s;for(let t=Math.floor((e.BITS-1)/c)*c;t>=0;t-=c){f.fill(s);for(let e=0;e<o;e++){const i=r[e],o=Number(i>>BigInt(t)&u);f[o]=f[o].add(n[e])}let e=s;for(let t=f.length-1,n=s;t>0;t--)n=n.add(f[t]),e=e.add(n);if(l=l.add(e),0!==t)for(let t=0;t<c;t++)l=l.double()}return l}function nl(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(t){const e=Cf.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});lf(t,e)}(e),e}return Kf(t,{isLE:n})}function rl(t,e,n={},r){if(void 0===r&&(r="edwards"===t),!e||"object"!=typeof e)throw new Error(`expected valid ${t} CURVE object`);for(const t of["p","n","h"]){const n=e[t];if(!("bigint"==typeof n&&n>Hf))throw new Error(`CURVE.${t} must be positive bigint`)}const i=nl(e.p,n.Fp,r),o=nl(e.n,n.Fn,r),s=["Gx","Gy","a","weierstrass"===t?"b":"d"];for(const t of s)if(!i.isValid(e[t]))throw new Error(`CURVE.${t} must be valid field element of CURVE.Fp`);return{CURVE:e=Object.freeze(Object.assign({},e)),Fp:i,Fn:o}}const il=(t,e)=>(t+(t>=0?e:-e)/ll)/e;function ol(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function sl(t,e){const n={};for(let r of Object.keys(e))n[r]=void 0===t[r]?e[r]:t[r];return Yu(n.lowS,"lowS"),Yu(n.prehash,"prehash"),void 0!==n.format&&ol(n.format),n}class al extends Error{constructor(t=""){super(t)}}const cl={Err:al,_tlv:{encode:(t,e)=>{const{Err:n}=cl;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&e.length)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=Xu(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const o=r>127?Xu(i.length/2|128):"";return Xu(t)+o+i+e},decode(t,e){const{Err:n}=cl;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++];let o=0;if(!!(128&i)){const t=127&i;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const s=e.subarray(r,r+t);if(s.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===s[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of s)o=o<<8|t;if(r+=t,o<128)throw new n("tlv.decode(long): not minimal encoding")}else o=i;const s=e.subarray(r,r+o);if(s.length!==o)throw new n("tlv.decode: wrong value length");return{v:s,l:e.subarray(r+o)}}},_int:{encode(t){const{Err:e}=cl;if(t<ul)throw new e("integer: negative integers are not allowed");let n=Xu(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=cl;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return tf(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=cl,i=of("signature",t),{v:o,l:s}=r.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,o),{v:u,l:f}=r.decode(2,c);if(f.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(u)}},hexFromSig(t){const{_tlv:e,_int:n}=cl,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}},ul=BigInt(0),fl=BigInt(1),ll=BigInt(2),hl=BigInt(3),dl=BigInt(4);function pl(t,e){const{BYTES:n}=t;let r;if("bigint"==typeof e)r=e;else{let i=of("private key",e);try{r=t.fromBytes(i)}catch(t){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function yl(t,e={}){const n=rl("weierstrass",t,e),{Fp:r,Fn:i}=n;let o=n.CURVE;const{h:s,n:a}=o;lf(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=e;if(c&&(!r.is0(o.a)||"bigint"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const u=ml(r,i);function f(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const l=e.toBytes||function(t,e,n){const{x:i,y:o}=e.toAffine(),s=r.toBytes(i);if(Yu(n,"isCompressed"),n){f();return Vt(gl(!r.isOdd(o)),s)}return Vt(Uint8Array.of(4),s,r.toBytes(o))},h=e.fromBytes||function(t){Ju(t,void 0,"Point");const{publicKey:e,publicKeyUncompressed:n}=u,i=t.length,o=t[0],s=t.subarray(1);if(i!==e||2!==o&&3!==o){if(i===n&&4===o){const t=r.BYTES,e=r.fromBytes(s.subarray(0,t)),n=r.fromBytes(s.subarray(t,2*t));if(!p(e,n))throw new Error("bad point: is not on curve");return{x:e,y:n}}throw new Error(`bad point: got length ${i}, expected compressed=${e} or uncompressed=${n}`)}{const t=r.fromBytes(s);if(!r.isValid(t))throw new Error("bad point: is not on curve, wrong x");const e=d(t);let n;try{n=r.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("bad point: is not on curve, sqrt error"+e)}f();return!(1&~o)!==r.isOdd(n)&&(n=r.neg(n)),{x:t,y:n}}};function d(t){const e=r.sqr(t),n=r.mul(e,t);return r.add(r.add(n,r.mul(t,o.a)),o.b)}function p(t,e){const n=r.sqr(e),i=d(t);return r.eql(n,i)}if(!p(o.Gx,o.Gy))throw new Error("bad curve params: generator point");const y=r.mul(r.pow(o.a,hl),dl),g=r.mul(r.sqr(o.b),BigInt(27));if(r.is0(r.add(y,g)))throw new Error("bad curve params: a or b");function m(t,e,n=!1){if(!r.isValid(e)||n&&r.is0(e))throw new Error(`bad point coordinate ${t}`);return e}function b(t){if(!(t instanceof A))throw new Error("ProjectivePoint expected")}function w(t){if(!c||!c.basises)throw new Error("no endo");return function(t,e,n){const[[r,i],[o,s]]=e,a=il(s*t,n),c=il(-i*t,n);let u=t-a*r-c*o,f=-a*i-c*s;const l=u<ul,h=f<ul;l&&(u=-u),h&&(f=-f);const d=ff(Math.ceil(uf(n)/2))+fl;if(u<ul||u>=d||f<ul||f>=d)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:l,k1:u,k2neg:h,k2:f}}(t,c.basises,i.ORDER)}const v=df((t,e)=>{const{X:n,Y:i,Z:o}=t;if(r.eql(o,r.ONE))return{x:n,y:i};const s=t.is0();null==e&&(e=s?r.ONE:r.inv(o));const a=r.mul(n,e),c=r.mul(i,e),u=r.mul(o,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),x=df(t=>{if(t.is0()){if(e.allowInfinityPoint&&!r.is0(t.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:i}=t.toAffine();if(!r.isValid(n)||!r.isValid(i))throw new Error("bad point: x or y not field elements");if(!p(n,i))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function E(t,e,n,i,o){return n=new A(r.mul(n.X,t),n.Y,n.Z),e=zf(i,e),n=zf(o,n),e.add(n)}class A{constructor(t,e,n){this.X=m("x",t),this.Y=m("y",e,!0),this.Z=m("z",n),Object.freeze(this)}static CURVE(){return o}static fromAffine(t){const{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw new Error("invalid affine point");if(t instanceof A)throw new Error("projective point not allowed");return r.is0(e)&&r.is0(n)?A.ZERO:new A(e,n,r.ONE)}static fromBytes(t){const e=A.fromAffine(h(Ju(t,void 0,"point")));return e.assertValidity(),e}static fromHex(t){return A.fromBytes(of("pointHex",t))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return B.createCache(this,t),e||this.multiply(hl),this}assertValidity(){x(this)}hasEvenY(){const{y:t}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(t)}equals(t){b(t);const{X:e,Y:n,Z:i}=this,{X:o,Y:s,Z:a}=t,c=r.eql(r.mul(e,a),r.mul(o,i)),u=r.eql(r.mul(n,a),r.mul(s,i));return c&&u}negate(){return new A(this.X,r.neg(this.Y),this.Z)}double(){const{a:t,b:e}=o,n=r.mul(e,hl),{X:i,Y:s,Z:a}=this;let c=r.ZERO,u=r.ZERO,f=r.ZERO,l=r.mul(i,i),h=r.mul(s,s),d=r.mul(a,a),p=r.mul(i,s);return p=r.add(p,p),f=r.mul(i,a),f=r.add(f,f),c=r.mul(t,f),u=r.mul(n,d),u=r.add(c,u),c=r.sub(h,u),u=r.add(h,u),u=r.mul(c,u),c=r.mul(p,c),f=r.mul(n,f),d=r.mul(t,d),p=r.sub(l,d),p=r.mul(t,p),p=r.add(p,f),f=r.add(l,l),l=r.add(f,l),l=r.add(l,d),l=r.mul(l,p),u=r.add(u,l),d=r.mul(s,a),d=r.add(d,d),l=r.mul(d,p),c=r.sub(c,l),f=r.mul(d,h),f=r.add(f,f),f=r.add(f,f),new A(c,u,f)}add(t){b(t);const{X:e,Y:n,Z:i}=this,{X:s,Y:a,Z:c}=t;let u=r.ZERO,f=r.ZERO,l=r.ZERO;const h=o.a,d=r.mul(o.b,hl);let p=r.mul(e,s),y=r.mul(n,a),g=r.mul(i,c),m=r.add(e,n),w=r.add(s,a);m=r.mul(m,w),w=r.add(p,y),m=r.sub(m,w),w=r.add(e,i);let v=r.add(s,c);return w=r.mul(w,v),v=r.add(p,g),w=r.sub(w,v),v=r.add(n,i),u=r.add(a,c),v=r.mul(v,u),u=r.add(y,g),v=r.sub(v,u),l=r.mul(h,w),u=r.mul(d,g),l=r.add(u,l),u=r.sub(y,l),l=r.add(y,l),f=r.mul(u,l),y=r.add(p,p),y=r.add(y,p),g=r.mul(h,g),w=r.mul(d,w),y=r.add(y,g),g=r.sub(p,g),g=r.mul(h,g),w=r.add(w,g),p=r.mul(y,w),f=r.add(f,p),p=r.mul(v,w),u=r.mul(m,u),u=r.sub(u,p),p=r.mul(m,y),l=r.mul(v,l),l=r.add(l,p),new A(u,f,l)}subtract(t){return this.add(t.negate())}is0(){return this.equals(A.ZERO)}multiply(t){const{endo:n}=e;if(!i.isValidNot0(t))throw new Error("invalid scalar: out of range");let r,o;const s=t=>B.cached(this,t,t=>Gf(A,t));if(n){const{k1neg:e,k1:i,k2neg:a,k2:c}=w(t),{p:u,f}=s(i),{p:l,f:h}=s(c);o=f.add(h),r=E(n.beta,u,l,e,a)}else{const{p:e,f:n}=s(t);r=e,o=n}return Gf(A,[r,o])[0]}multiplyUnsafe(t){const{endo:n}=e,r=this;if(!i.isValid(t))throw new Error("invalid scalar: out of range");if(t===ul||r.is0())return A.ZERO;if(t===fl)return r;if(B.hasCache(this))return this.multiply(t);if(n){const{k1neg:e,k1:i,k2neg:o,k2:s}=w(t),{p1:a,p2:c}=function(t,e,n,r){let i=e,o=t.ZERO,s=t.ZERO;for(;n>Hf||r>Hf;)n&jf&&(o=o.add(i)),r&jf&&(s=s.add(i)),i=i.double(),n>>=jf,r>>=jf;return{p1:o,p2:s}}(A,r,i,s);return E(n.beta,a,c,e,o)}return B.unsafe(r,t)}multiplyAndAddUnsafe(t,e,n){const r=this.multiplyUnsafe(e).add(t.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(t){return v(this,t)}isTorsionFree(){const{isTorsionFree:t}=e;return s===fl||(t?t(A,this):B.unsafe(this,a).is0())}clearCofactor(){const{clearCofactor:t}=e;return s===fl?this:t?t(A,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(t=!0){return Yu(t,"isCompressed"),this.assertValidity(),l(A,this,t)}toHex(t=!0){return Ct(this.toBytes(t))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(t=!0){return this.toBytes(t)}_setWindowSize(t){this.precompute(t)}static normalizeZ(t){return Gf(A,t)}static msm(t,e){return el(A,i,t,e)}static fromPrivateKey(t){return A.BASE.multiply(pl(i,t))}}A.BASE=new A(o.Gx,o.Gy,r.ONE),A.ZERO=new A(r.ZERO,r.ONE,r.ZERO),A.Fp=r,A.Fn=i;const I=i.BITS,B=new tl(A,e.endo?Math.ceil(I/2):I);return A.BASE.precompute(8),A}function gl(t){return Uint8Array.of(t?2:3)}function ml(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function bl(t,e={}){const{Fn:n}=t,r=e.randomBytes||Wt,i=Object.assign(ml(t.Fp,n),{seed:Df(n.ORDER)});function o(t){try{return!!pl(n,t)}catch(t){return!1}}function s(t=r(i.seed)){return function(t,e,n=!1){const r=t.length,i=$f(e),o=Df(e);if(r<16||r<o||r>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+r);const s=If(n?ef(t):tf(t),e-yf)+yf;return n?rf(s,i):nf(s,i)}(Ju(t,i.seed,"seed"),n.ORDER)}function a(e,r=!0){return t.BASE.multiply(pl(n,e)).toBytes(r)}function c(e){if("bigint"==typeof e)return!1;if(e instanceof t)return!0;const{secretKey:r,publicKey:o,publicKeyUncompressed:s}=i;if(n.allowedLengths||r===o)return;const a=of("key",e).length;return a===o||a===s}const u={isValidSecretKey:o,isValidPublicKey:function(e,n){const{publicKey:r,publicKeyUncompressed:o}=i;try{const i=e.length;return(!0!==n||i===r)&&((!1!==n||i===o)&&!!t.fromBytes(e))}catch(t){return!1}},randomSecretKey:s,isValidPrivateKey:o,randomPrivateKey:s,normPrivateKeyToScalar:t=>pl(n,t),precompute:(e=8,n=t.BASE)=>n.precompute(e,!1)};return Object.freeze({getPublicKey:a,getSharedSecret:function(e,r,i=!0){if(!0===c(e))throw new Error("first arg must be private key");if(!1===c(r))throw new Error("second arg must be public key");const o=pl(n,e);return t.fromHex(r).multiply(o).toBytes(i)},keygen:function(t){const e=s(t);return{secretKey:e,publicKey:a(e)}},Point:t,utils:u,lengths:i})}function wl(t,e,n={}){xt(e),lf(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||Wt,i=n.hmac||((t,...n)=>qu(e,t,Vt(...n))),{Fp:o,Fn:s}=t,{ORDER:a,BITS:c}=s,{keygen:u,getPublicKey:f,getSharedSecret:l,utils:h,lengths:d}=bl(t,n),p={prehash:!1,lowS:"boolean"==typeof n.lowS&&n.lowS,format:void 0,extraEntropy:!1},y="compact";function g(t){return t>a>>fl}function m(t,e){if(!s.isValidNot0(e))throw new Error(`invalid signature ${t}: out of range 1..Point.Fn.ORDER`);return e}class b{constructor(t,e,n){this.r=m("r",t),this.s=m("s",e),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(t,e=y){let n;if(function(t,e){ol(e);const n=d.signature;Ju(t,"compact"===e?n:"recovered"===e?n+1:void 0,`${e} signature`)}(t,e),"der"===e){const{r:e,s:n}=cl.toSig(Ju(t));return new b(e,n)}"recovered"===e&&(n=t[0],e="compact",t=t.subarray(1));const r=s.BYTES,i=t.subarray(0,r),o=t.subarray(r,2*r);return new b(s.fromBytes(i),s.fromBytes(o),n)}static fromHex(t,e){return this.fromBytes(Ht(t),e)}addRecoveryBit(t){return new b(this.r,this.s,t)}recoverPublicKey(e){const n=o.ORDER,{r,s:i,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*ll<n&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const u=2===c||3===c?r+a:r;if(!o.isValid(u))throw new Error("recovery id 2 or 3 invalid");const f=o.toBytes(u),l=t.fromBytes(Vt(gl(!(1&c)),f)),h=s.inv(u),d=v(of("msgHash",e)),p=s.create(-d*h),y=s.create(i*h),g=t.BASE.multiplyUnsafe(p).add(l.multiplyUnsafe(y));if(g.is0())throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return g(this.s)}toBytes(t=y){if(ol(t),"der"===t)return Ht(cl.hexFromSig(this));const e=s.toBytes(this.r),n=s.toBytes(this.s);if("recovered"===t){if(null==this.recovery)throw new Error("recovery bit must be present");return Vt(Uint8Array.of(this.recovery),e,n)}return Vt(e,n)}toHex(t){return Ct(this.toBytes(t))}assertValidity(){}static fromCompact(t){return b.fromBytes(of("sig",t),"compact")}static fromDER(t){return b.fromBytes(of("sig",t),"der")}normalizeS(){return this.hasHighS()?new b(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Ct(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Ct(this.toBytes("compact"))}}const w=n.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const e=tf(t),n=8*t.length-c;return n>0?e>>BigInt(n):e},v=n.bits2int_modN||function(t){return s.create(w(t))},x=ff(c);function E(t){return cf("num < 2^"+c,t,ul,x),s.toBytes(t)}function A(t,n){return Ju(t,void 0,"message"),n?Ju(e(t),void 0,"prehashed message"):t}return Object.freeze({keygen:u,getPublicKey:f,getSharedSecret:l,utils:h,lengths:d,Point:t,sign:function(n,o,a={}){n=of("message",n);const{seed:c,k2sig:u}=function(e,n,i){if(["recovered","canonical"].some(t=>t in i))throw new Error("sign() legacy options not supported");const{lowS:o,prehash:a,extraEntropy:c}=sl(i,p);e=A(e,a);const u=v(e),f=pl(s,n),l=[E(f),E(u)];if(null!=c&&!1!==c){const t=!0===c?r(d.secretKey):c;l.push(of("extraEntropy",t))}const h=Vt(...l),y=u;return{seed:h,k2sig:function(e){const n=w(e);if(!s.isValidNot0(n))return;const r=s.inv(n),i=t.BASE.multiply(n).toAffine(),a=s.create(i.x);if(a===ul)return;const c=s.create(r*s.create(y+a*f));if(c===ul)return;let u=(i.x===a?0:2)|Number(i.y&fl),l=c;return o&&g(c)&&(l=s.neg(c),u^=1),new b(a,l,u)}}}(n,o,a),f=function(t,e,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const r=t=>new Uint8Array(t),i=t=>Uint8Array.of(t);let o=r(t),s=r(t),a=0;const c=()=>{o.fill(1),s.fill(0),a=0},u=(...t)=>n(s,o,...t),f=(t=r(0))=>{s=u(i(0),t),o=u(),0!==t.length&&(s=u(i(1),t),o=u())},l=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){o=u();const e=o.slice();n.push(e),t+=o.length}return Vt(...n)};return(t,e)=>{let n;for(c(),f(t);!(n=e(l()));)f();return c(),n}}(e.outputLen,s.BYTES,i);return f(c,u)},verify:function(e,n,r,i={}){const{lowS:o,prehash:a,format:c}=sl(i,p);if(r=of("publicKey",r),n=A(of("message",n),a),"strict"in i)throw new Error("options.strict was renamed to lowS");const u=void 0===c?function(t){let e;const n="string"==typeof t||bt(t),r=!n&&null!==t&&"object"==typeof t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!n&&!r)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(r)e=new b(t.r,t.s);else if(n){try{e=b.fromBytes(of("sig",t),"der")}catch(t){if(!(t instanceof cl.Err))throw t}if(!e)try{e=b.fromBytes(of("sig",t),"compact")}catch(t){return!1}}return e||!1}(e):b.fromBytes(of("sig",e),c);if(!1===u)return!1;try{const e=t.fromBytes(r);if(o&&u.hasHighS())return!1;const{r:i,s:a}=u,c=v(n),f=s.inv(a),l=s.create(c*f),h=s.create(i*f),d=t.BASE.multiplyUnsafe(l).add(e.multiplyUnsafe(h));if(d.is0())return!1;return s.create(d.x)===i}catch(t){return!1}},recoverPublicKey:function(t,e,n={}){const{prehash:r}=sl(n,p);return e=A(e,r),b.fromBytes(t,"recovered").recoverPublicKey(e).toBytes()},Signature:b,hash:e})}function vl(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(t=>Math.ceil(t/2)))):void 0;return{CURVE:e,curveOpts:{Fp:n,Fn:Kf(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes}}}function xl(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:i}=function(t){const{CURVE:e,curveOpts:n}=vl(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}(t);return function(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,Ff(n.Fn.ORDER,n.Fn.BITS))})}(t,wl(yl(e,n),r,i))}const El={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Al={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Il=BigInt(2);const Bl=Kf(El.p,{sqrt:function(t){const e=El.p,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,f=u*u*t%e,l=Bf(f,n,e)*f%e,h=Bf(l,n,e)*f%e,d=Bf(h,Il,e)*u%e,p=Bf(d,i,e)*d%e,y=Bf(p,o,e)*p%e,g=Bf(y,a,e)*y%e,m=Bf(g,c,e)*g%e,b=Bf(m,a,e)*y%e,w=Bf(b,n,e)*f%e,v=Bf(w,s,e)*p%e,x=Bf(v,r,e)*u%e,E=Bf(x,Il,e);if(!Bl.eql(Bl.sqr(E),t))throw new Error("Cannot find square root");return E}}),_l=function(t,e){const n=e=>xl({...t,hash:e});return{...n(e),create:n}}({...El,Fp:Bl,lowS:!0,endo:Al},Gu);e();const kl=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]);new Uint32Array(80);const Pl=Math.pow(2,32);Array.from({length:64},(t,e)=>Math.floor(Pl*Math.abs(Math.sin(e+1)))),kl.slice(0,4),new Uint32Array(16);const Sl=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Ol=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),Rl=Ol.map(t=>(9*t+5)%16),Ul=(()=>{const t=[[Ol],[Rl]];for(let e=0;e<4;e++)for(let n of t)n.push(n[e].map(t=>Sl[t]));return t})(),Cl=Ul[0],Ll=Ul[1],Nl=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),Tl=Cl.map((t,e)=>t.map(t=>Nl[e][t])),Fl=Ll.map((t,e)=>t.map(t=>Nl[e][t])),Kl=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),$l=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Dl(t,e,n,r){return 0===t?e^n^r:1===t?e&n|~e&r:2===t?(e|~n)^r:3===t?e&r|n&~r:e^(n|~r)}const Hl=new Uint32Array(16);class jl extends Uu{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:e,h2:n,h3:r,h4:i}=this;return[t,e,n,r,i]}set(t,e,n,r,i){this.h0=0|t,this.h1=0|e,this.h2=0|n,this.h3=0|r,this.h4=0|i}process(t,e){for(let n=0;n<16;n++,e+=4)Hl[n]=t.getUint32(e,!0);let n=0|this.h0,r=n,i=0|this.h1,o=i,s=0|this.h2,a=s,c=0|this.h3,u=c,f=0|this.h4,l=f;for(let t=0;t<5;t++){const e=4-t,h=Kl[t],d=$l[t],p=Cl[t],y=Ll[t],g=Tl[t],m=Fl[t];for(let e=0;e<16;e++){const r=kt(n+Dl(t,i,s,c)+Hl[p[e]]+h,g[e])+f|0;n=f,f=c,c=0|kt(s,10),s=i,i=r}for(let t=0;t<16;t++){const n=kt(r+Dl(e,o,a,u)+Hl[y[t]]+d,m[t])+l|0;r=l,l=u,u=0|kt(a,10),a=o,o=n}}this.set(this.h1+s+u|0,this.h2+c+l|0,this.h3+f+r|0,this.h4+n+o|0,this.h0+i+a|0)}roundClean(){It(Hl)}destroy(){this.destroyed=!0,It(this.buffer),this.set(0,0,0,0,0)}}const zl=qt(()=>new jl);const Gl=Gu;function Vl(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function Ml(t,...e){if(!Vl(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function ql(t,e){return!!Array.isArray(e)&&(0===e.length||(t?e.every(t=>"string"==typeof t):e.every(t=>Number.isSafeInteger(t))))}function Wl(t){if("function"!=typeof t)throw new Error("function expected");return!0}function Zl(t,e){if("string"!=typeof e)throw new Error(`${t}: string expected`);return!0}function Yl(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function Jl(t){if(!Array.isArray(t))throw new Error("array expected")}function Xl(t,e){if(!ql(!0,e))throw new Error(`${t}: array of strings expected`)}function Ql(t,e){if(!ql(!1,e))throw new Error(`${t}: array of numbers expected`)}function th(...t){const e=t=>t,n=(t,e)=>n=>t(e(n));return{encode:t.map(t=>t.encode).reduceRight(n,e),decode:t.map(t=>t.decode).reduce(n,e)}}function eh(t){const e="string"==typeof t?t.split(""):t,n=e.length;Xl("alphabet",e);const r=new Map(e.map((t,e)=>[t,e]));return{encode:r=>(Jl(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${t}`);return e[r]})),decode:e=>(Jl(e),e.map(e=>{Zl("alphabet.decode",e);const n=r.get(e);if(void 0===n)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return n}))}}function nh(t=""){return Zl("join",t),{encode:e=>(Xl("join.decode",e),e.join(t)),decode:e=>(Zl("join.decode",e),e.split(t))}}function rh(t,e="="){return Yl(t),Zl("padding",e),{encode(n){for(Xl("padding.encode",n);n.length*t%8;)n.push(e);return n},decode(n){Xl("padding.decode",n);let r=n.length;if(r*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--){if((r-1)*t%8==0)throw new Error("padding: invalid, string has too much padding")}return n.slice(0,r)}}}function ih(t){return Wl(t),{encode:t=>t,decode:e=>t(e)}}function oh(t,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(Jl(t),!t.length)return[];let r=0;const i=[],o=Array.from(t,t=>{if(Yl(t),t<0||t>=e)throw new Error(`invalid integer: ${t}`);return t}),s=o.length;for(;;){let t=0,a=!0;for(let i=r;i<s;i++){const s=o[i],c=e*t,u=c+s;if(!Number.isSafeInteger(u)||c/e!==t||u-s!==c)throw new Error("convertRadix: carry overflow");const f=u/n;t=u%n;const l=Math.floor(f);if(o[i]=l,!Number.isSafeInteger(l)||l*n+t!==u)throw new Error("convertRadix: carry overflow");a&&(l?a=!1:r=i)}if(i.push(t),a)break}for(let e=0;e<t.length-1&&0===t[e];e++)i.push(0);return i.reverse()}const sh=(t,e)=>0===e?t:sh(e,t%e),ah=(t,e)=>t+(e-sh(t,e)),ch=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function uh(t,e,n,r){if(Jl(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(ah(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${ah(e,n)}`);let i=0,o=0;const s=ch[e],a=ch[n]-1,c=[];for(const r of t){if(Yl(r),r>=s)throw new Error(`convertRadix2: invalid data word=${r} from=${e}`);if(i=i<<e|r,o+e>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)c.push((i>>o-n&a)>>>0);const t=ch[o];if(void 0===t)throw new Error("invalid carry");i&=t-1}if(i=i<<n-o&a,!r&&o>=e)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&c.push(i>>>0),c}function fh(t){Yl(t);return{encode:e=>{if(!Vl(e))throw new Error("radix.encode input should be Uint8Array");return oh(Array.from(e),256,t)},decode:e=>(Ql("radix.decode",e),Uint8Array.from(oh(e,t,256)))}}function lh(t,e=!1){if(Yl(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(ah(8,t)>32||ah(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!Vl(n))throw new Error("radix2.encode input should be Uint8Array");return uh(Array.from(n),8,t,!e)},decode:n=>(Ql("radix2.decode",n),Uint8Array.from(uh(n,t,8,e)))}}function hh(t){return Wl(t),function(...e){try{return t.apply(null,e)}catch(t){}}}function dh(t,e){return Yl(t),Wl(e),{encode(n){if(!Vl(n))throw new Error("checksum.encode: input should be Uint8Array");const r=e(n).slice(0,t),i=new Uint8Array(n.length+t);return i.set(n),i.set(r,n.length),i},decode(n){if(!Vl(n))throw new Error("checksum.decode: input should be Uint8Array");const r=n.slice(0,-t),i=n.slice(-t),o=e(r).slice(0,t);for(let e=0;e<t;e++)if(o[e]!==i[e])throw new Error("Invalid checksum");return r}}}th(lh(4),eh("0123456789ABCDEF"),nh("")),th(lh(5),eh("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),rh(5),nh("")),th(lh(5),eh("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),nh("")),th(lh(5),eh("0123456789ABCDEFGHIJKLMNOPQRSTUV"),rh(5),nh("")),th(lh(5),eh("0123456789ABCDEFGHIJKLMNOPQRSTUV"),nh("")),th(lh(5),eh("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),nh(""),ih(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const ph="function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64,yh=(t,e)=>{Zl("base64",t);const n=e?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=e?"base64url":"base64";if(t.length>0&&!n.test(t))throw new Error("invalid base64");return Uint8Array.fromBase64(t,{alphabet:r,lastChunkHandling:"strict"})},gh=(ph||th(lh(6),eh("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),rh(6),nh("")),th(lh(6),eh("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),nh("")),ph||th(lh(6),eh("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),rh(6),nh("")),th(lh(6),eh("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),nh("")),t=>th(fh(58),eh(t),nh(""))),mh=gh("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),bh=t=>th(dh(4,e=>t(t(e))),mh),wh=th(eh("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),nh("")),vh=[996825010,642813549,513874426,1027748829,705979059];function xh(t){const e=t>>25;let n=(33554431&t)<<5;for(let t=0;t<vh.length;t++)1==(e>>t&1)&&(n^=vh[t]);return n}function Eh(t,e,n=1){const r=t.length;let i=1;for(let e=0;e<r;e++){const n=t.charCodeAt(e);if(n<33||n>126)throw new Error(`Invalid prefix (${t})`);i=xh(i)^n>>5}i=xh(i);for(let e=0;e<r;e++)i=xh(i)^31&t.charCodeAt(e);for(let t of e)i=xh(i)^t;for(let t=0;t<6;t++)i=xh(i);return i^=n,wh.encode(uh([i%ch[30]],30,5,!1))}function Ah(t){const e="bech32"===t?1:734539939,n=lh(5),r=n.decode,i=n.encode,o=hh(r);function s(t,n,r=90){Zl("bech32.encode prefix",t),Vl(n)&&(n=Array.from(n)),Ql("bech32.encode",n);const i=t.length;if(0===i)throw new TypeError(`Invalid prefix length ${i}`);const o=i+7+n.length;if(!1!==r&&o>r)throw new TypeError(`Length ${o} exceeds limit ${r}`);const s=t.toLowerCase(),a=Eh(s,n,e);return`${s}1${wh.encode(n)}${a}`}function a(t,n=90){Zl("bech32.decode input",t);const r=t.length;if(r<8||!1!==n&&r>n)throw new TypeError(`invalid string length: ${r} (${t}). Expected (8..${n})`);const i=t.toLowerCase();if(t!==i&&t!==t.toUpperCase())throw new Error("String must be lowercase or uppercase");const o=i.lastIndexOf("1");if(0===o||-1===o)throw new Error('Letter "1" must be present between prefix and data only');const s=i.slice(0,o),a=i.slice(o+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");const c=wh.decode(a).slice(0,-6),u=Eh(s,c,e);if(!a.endsWith(u))throw new Error(`Invalid checksum in ${t}: expected "${u}"`);return{prefix:s,words:c}}return{encode:s,decode:a,encodeFromBytes:function(t,e){return s(t,i(e))},decodeToBytes:function(t){const{prefix:e,words:n}=a(t,!1);return{prefix:e,words:n,bytes:r(n)}},decodeUnsafe:hh(a),fromWords:r,fromWordsUnsafe:o,toWords:i}}Ah("bech32"),Ah("bech32m"),"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex||th(lh(4),eh("0123456789abcdef"),nh(""),ih(t=>{if("string"!=typeof t||t.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()}));const Ih=BigInt(0),Bh=BigInt(1),_h=BigInt(2),kh=BigInt(8);class Ph{constructor(t){this.ep=t}static fromBytes(t){hf()}static fromHex(t){hf()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return Ct(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,e){return this.init(this.ep.precompute(t,e))}toRawBytes(){return this.toBytes()}}function Sh(t,e,n={}){if("function"!=typeof e)throw new Error('"hash" function param is required');lf(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r}=n,{BASE:i,Fp:o,Fn:s}=t,a=n.randomBytes||Wt,c=n.adjustScalarBytes||(t=>t),u=n.domain||((t,e,n)=>{if(Yu(n,"phflag"),e.length||n)throw new Error("Contexts/pre-hash are not supported");return t});function f(t){return s.create(ef(t))}function l(t){const{head:n,prefix:r,scalar:o}=function(t){const n=g.secretKey;t=of("private key",t,n);const r=of("hashed private key",e(t),2*n),i=c(r.slice(0,n));return{head:i,prefix:r.slice(n,2*n),scalar:f(i)}}(t),s=i.multiply(o),a=s.toBytes();return{head:n,prefix:r,scalar:o,point:s,pointBytes:a}}function h(t){return l(t).pointBytes}function d(t=Uint8Array.of(),...n){const i=Vt(...n);return f(e(u(i,of("context",t),!!r)))}const p={zip215:!0};const y=o.BYTES,g={secretKey:y,publicKey:y,signature:2*y,seed:y};function m(t=a(g.seed)){return Ju(t,g.seed,"seed")}const b={getExtendedPublicKey:l,randomSecretKey:m,isValidSecretKey:function(t){return bt(t)&&t.length===s.BYTES},isValidPublicKey:function(e,n){try{return!!t.fromBytes(e,n)}catch(t){return!1}},toMontgomery(e){const{y:n}=t.fromBytes(e),r=g.publicKey,i=32===r;if(!i&&57!==r)throw new Error("only defined for 25519 and 448");const s=i?o.div(Bh+n,Bh-n):o.div(n-Bh,n+Bh);return o.toBytes(s)},toMontgomerySecret(t){const n=g.secretKey;Ju(t,n);const r=e(t.subarray(0,n));return c(r).subarray(0,n)},randomPrivateKey:m,precompute:(e=8,n=t.BASE)=>n.precompute(e,!1)};return Object.freeze({keygen:function(t){const e=b.randomSecretKey(t);return{secretKey:e,publicKey:h(e)}},getPublicKey:h,sign:function(t,e,n={}){t=of("message",t),r&&(t=r(t));const{prefix:o,scalar:a,pointBytes:c}=l(e),u=d(n.context,o,t),f=i.multiply(u).toBytes(),h=d(n.context,f,c,t),p=s.create(u+h*a);if(!s.isValid(p))throw new Error("sign failed: invalid s");return Ju(Vt(f,s.toBytes(p)),g.signature,"result")},verify:function(e,n,o,s=p){const{context:a,zip215:c}=s,u=g.signature;e=of("signature",e,u),n=of("message",n),o=of("publicKey",o,g.publicKey),void 0!==c&&Yu(c,"zip215"),r&&(n=r(n));const f=u/2,l=e.subarray(0,f),h=ef(e.subarray(f,u));let y,m,b;try{y=t.fromBytes(o,c),m=t.fromBytes(l,c),b=i.multiplyUnsafe(h)}catch(t){return!1}if(!c&&y.isSmallOrder())return!1;const w=d(a,m.toBytes(),y.toBytes(),n);return m.add(y.multiplyUnsafe(w)).subtract(b).clearCofactor().is0()},utils:b,Point:t,lengths:g})}function Oh(t){const{CURVE:e,curveOpts:n,hash:r,eddsaOpts:i}=function(t){const e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n={Fp:t.Fp,Fn:Kf(e.n,t.nBitLength,!0),uvRatio:t.uvRatio},r={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve};return{CURVE:e,curveOpts:n,hash:t.hash,eddsaOpts:r}}(t),o=function(t,e={}){const n=rl("edwards",t,e,e.FpFnLE),{Fp:r,Fn:i}=n;let o=n.CURVE;const{h:s}=o;lf(e,{},{uvRatio:"function"});const a=_h<<BigInt(8*i.BYTES)-Bh,c=t=>r.create(t),u=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:r.sqrt(r.div(t,e))}}catch(t){return{isValid:!1,value:Ih}}});if(!function(t,e,n,r){const i=t.sqr(n),o=t.sqr(r),s=t.add(t.mul(e.a,i),o),a=t.add(t.ONE,t.mul(e.d,t.mul(i,o)));return t.eql(s,a)}(r,o,o.Gx,o.Gy))throw new Error("bad curve params: generator point");function f(t,e,n=!1){return cf("coordinate "+t,e,n?Bh:Ih,a),e}function l(t){if(!(t instanceof p))throw new Error("ExtendedPoint expected")}const h=df((t,e)=>{const{X:n,Y:i,Z:o}=t,s=t.is0();null==e&&(e=s?kh:r.inv(o));const a=c(n*e),u=c(i*e),f=r.mul(o,e);if(s)return{x:Ih,y:Bh};if(f!==Bh)throw new Error("invZ was invalid");return{x:a,y:u}}),d=df(t=>{const{a:e,d:n}=o;if(t.is0())throw new Error("bad point: ZERO");const{X:r,Y:i,Z:s,T:a}=t,u=c(r*r),f=c(i*i),l=c(s*s),h=c(l*l),d=c(u*e);if(c(l*c(d+f))!==c(h+c(n*c(u*f))))throw new Error("bad point: equation left != right (1)");if(c(r*i)!==c(s*a))throw new Error("bad point: equation left != right (2)");return!0});class p{constructor(t,e,n,r){this.X=f("x",t),this.Y=f("y",e),this.Z=f("z",n,!0),this.T=f("t",r),Object.freeze(this)}static CURVE(){return o}static fromAffine(t){if(t instanceof p)throw new Error("extended point not allowed");const{x:e,y:n}=t||{};return f("x",e),f("y",n),new p(e,n,Bh,c(e*n))}static fromBytes(t,e=!1){const n=r.BYTES,{a:i,d:s}=o;t=sf(Ju(t,n,"point")),Yu(e,"zip215");const f=sf(t),l=t[n-1];f[n-1]=-129&l;const h=ef(f),d=e?a:r.ORDER;cf("point.y",h,Ih,d);const y=c(h*h),g=c(y-Bh),m=c(s*y-i);let{isValid:b,value:w}=u(g,m);if(!b)throw new Error("bad point: invalid y coordinate");const v=(w&Bh)===Bh,x=!!(128&l);if(!e&&w===Ih&&x)throw new Error("bad point: x=0 and x_0=1");return x!==v&&(w=c(-w)),p.fromAffine({x:w,y:h})}static fromHex(t,e=!1){return p.fromBytes(of("point",t),e)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return y.createCache(this,t),e||this.multiply(_h),this}assertValidity(){d(this)}equals(t){l(t);const{X:e,Y:n,Z:r}=this,{X:i,Y:o,Z:s}=t,a=c(e*s),u=c(i*r),f=c(n*s),h=c(o*r);return a===u&&f===h}is0(){return this.equals(p.ZERO)}negate(){return new p(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:t}=o,{X:e,Y:n,Z:r}=this,i=c(e*e),s=c(n*n),a=c(_h*c(r*r)),u=c(t*i),f=e+n,l=c(c(f*f)-i-s),h=u+s,d=h-a,y=u-s,g=c(l*d),m=c(h*y),b=c(l*y),w=c(d*h);return new p(g,m,w,b)}add(t){l(t);const{a:e,d:n}=o,{X:r,Y:i,Z:s,T:a}=this,{X:u,Y:f,Z:h,T:d}=t,y=c(r*u),g=c(i*f),m=c(a*n*d),b=c(s*h),w=c((r+i)*(u+f)-y-g),v=b-m,x=b+m,E=c(g-e*y),A=c(w*v),I=c(x*E),B=c(w*E),_=c(v*x);return new p(A,I,_,B)}subtract(t){return this.add(t.negate())}multiply(t){if(!i.isValidNot0(t))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:e,f:n}=y.cached(this,t,t=>Gf(p,t));return Gf(p,[e,n])[0]}multiplyUnsafe(t,e=p.ZERO){if(!i.isValid(t))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return t===Ih?p.ZERO:this.is0()||t===Bh?this:y.unsafe(this,t,t=>Gf(p,t),e)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}isTorsionFree(){return y.unsafe(this,o.n).is0()}toAffine(t){return h(this,t)}clearCofactor(){return s===Bh?this:this.multiplyUnsafe(s)}toBytes(){const{x:t,y:e}=this.toAffine(),n=r.toBytes(e);return n[n.length-1]|=t&Bh?128:0,n}toHex(){return Ct(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(t){return Gf(p,t)}static msm(t,e){return el(p,i,t,e)}_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}p.BASE=new p(o.Gx,o.Gy,Bh,c(o.Gx*o.Gy)),p.ZERO=new p(Ih,Bh,Bh,Ih),p.Fp=r,p.Fn=i;const y=new tl(p,i.BITS);return p.BASE.precompute(8),p}(e,n);return function(t,e){const n=e.Point;return Object.assign({},e,{ExtendedPoint:n,CURVE:t,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}(t,Sh(o,r,i))}const Rh=BigInt(0),Uh=BigInt(1),Ch=BigInt(2),Lh=(BigInt(3),BigInt(5)),Nh=BigInt(8),Th=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Fh={p:Th,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:Nh,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Kh(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),o=Th,s=t*t%o*t%o,a=Bf(s,Ch,o)*s%o,c=Bf(a,Uh,o)*t%o,u=Bf(c,Lh,o)*c%o,f=Bf(u,e,o)*u%o,l=Bf(f,n,o)*f%o,h=Bf(l,r,o)*l%o,d=Bf(h,i,o)*h%o,p=Bf(d,i,o)*h%o,y=Bf(p,e,o)*u%o;return{pow_p_5_8:Bf(y,Ch,o)*t%o,b2:s}}function $h(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const Dh=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Hh(t,e){const n=Th,r=If(e*e*e,n),i=If(r*r*e,n);let o=If(t*r*Kh(t*i).pow_p_5_8,n);const s=If(e*o*o,n),a=o,c=If(o*Dh,n),u=s===t,f=s===If(-t,n),l=s===If(-t*Dh,n);return u&&(o=a),(f||l)&&(o=c),Uf(o,n)&&(o=If(-o,n)),{isValid:u||f,value:o}}const jh=Kf(Fh.p,{isLE:!0}),zh=Kf(Fh.n,{isLE:!0}),Gh={...Fh,Fp:jh,hash:Vu,adjustScalarBytes:$h,uvRatio:Hh},Vh=Oh(Gh);const Mh=Dh,qh=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Wh=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Zh=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Yh=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Jh=t=>Hh(Uh,t),Xh=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Qh=t=>Vh.Point.Fp.create(ef(t)&Xh);function td(t){const{d:e}=Fh,n=Th,r=t=>jh.create(t),i=r(Mh*t*t),o=r((i+Uh)*Zh);let s=BigInt(-1);const a=r((s-e*i)*r(i+e));let{isValid:c,value:u}=Hh(o,a),f=r(u*t);Uf(f,n)||(f=r(-f)),c||(u=f),c||(s=i);const l=r(s*(i-Uh)*Yh-a),h=u*u,d=r((u+u)*a),p=r(l*qh),y=r(Uh-h),g=r(Uh+h);return new Vh.Point(r(d*g),r(y*p),r(p*g),r(d*y))}function ed(t){vt(t,64);const e=td(Qh(t.subarray(0,32))),n=td(Qh(t.subarray(32,64)));return new nd(e.add(n))}class nd extends Ph{constructor(t){super(t)}static fromAffine(t){return new nd(Vh.Point.fromAffine(t))}assertSame(t){if(!(t instanceof nd))throw new Error("RistrettoPoint expected")}init(t){return new nd(t)}static hashToCurve(t){return ed(of("ristrettoHash",t,64))}static fromBytes(t){vt(t,32);const{a:e,d:n}=Fh,r=Th,i=t=>jh.create(t),o=Qh(t);if(!function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}(jh.toBytes(o),t)||Uf(o,r))throw new Error("invalid ristretto255 encoding 1");const s=i(o*o),a=i(Uh+e*s),c=i(Uh-e*s),u=i(a*a),f=i(c*c),l=i(e*n*u-f),{isValid:h,value:d}=Jh(i(l*f)),p=i(d*c),y=i(d*p*l);let g=i((o+o)*p);Uf(g,r)&&(g=i(-g));const m=i(a*y),b=i(g*m);if(!h||Uf(b,r)||m===Rh)throw new Error("invalid ristretto255 encoding 2");return new nd(new Vh.Point(g,m,Uh,b))}static fromHex(t){return nd.fromBytes(of("ristrettoHex",t,32))}static msm(t,e){return el(nd,Vh.Point.Fn,t,e)}toBytes(){let{X:t,Y:e,Z:n,T:r}=this.ep;const i=Th,o=t=>jh.create(t),s=o(o(n+e)*o(n-e)),a=o(t*e),c=o(a*a),{value:u}=Jh(o(s*c)),f=o(u*s),l=o(u*a),h=o(f*l*r);let d;if(Uf(r*h,i)){let n=o(e*Mh),r=o(t*Mh);t=n,e=r,d=o(f*Wh)}else d=l;Uf(t*h,i)&&(e=o(-e));let p=o((n-e)*d);return Uf(p,i)&&(p=o(-p)),jh.toBytes(p)}equals(t){this.assertSame(t);const{X:e,Y:n}=this.ep,{X:r,Y:i}=t.ep,o=t=>jh.create(t),s=o(e*i)===o(n*r),a=o(n*i)===o(e*r);return s||a}is0(){return this.equals(nd.ZERO)}}nd.BASE=new nd(Vh.Point.BASE),nd.ZERO=new nd(Vh.Point.ZERO),nd.Fp=jh,nd.Fn=zh;const rd=Vh.CURVE,id="ed25519",od=_u("ed25519 seed"),sd=t=>!0,ad=!1,cd=33,ud=(t,e)=>{const n=Vh.getPublicKey(t);return Pu([new Uint8Array([0]),n])},fd=(t,e)=>{throw new Error("Ed25519 does not support public key derivation.")},ld=t=>t,hd=t=>t,dd=32,pd="slip10",yd=33;const gd=Vh.CURVE,md="ed25519Bip32",bd=_u("");function wd(t,e){const n=t[e];return iu(void 0!==n,"Private key is too short."),n}const vd=t=>!(7&wd(t,0))&&(!(128&wd(t,31))&&!(64&~wd(t,31))),xd=!0,Ed=32,Ad=t=>{return pu(e=Au(Uint8Array.from(t).reverse())),BigInt(yu(e));var e},Id=t=>{const e=If(Ad(t),gd.n);return Vh.ExtendedPoint.BASE.multiply(e).toRawBytes()},Bd=async(t,e)=>Id(t.slice(0,32)),_d=(t,e)=>Vh.ExtendedPoint.fromHex(gu(Au(t))).add(Vh.ExtendedPoint.fromHex(gu(Au(e)))).toRawBytes(),kd=t=>t,Pd=t=>t,Sd=64,Od="cip3",Rd=32,Ud={secp256k1:m,ed25519:y,ed25519Bip32:g};function Cd(t){return Ud[t]}function Ld(t){return Fd(t),`${Nd(t)}'`}function Nd(t){return Fd(t),`bip32:${t}`}function Td(t){if("number"==typeof t)return Nd(t);if(!t||!Number.isInteger(t.index)||"boolean"!=typeof t.hardened)throw new Error("Invalid BIP-32 index: Must be an object containing the index and whether it is hardened.");return t.hardened?Ld(t.index):Nd(t.index)}function Fd(t){if(!(jd(e=t)&&e<=ou))throw new Error("Invalid BIP-32 index: Must be a non-negative integer.");var e}function Kd(t){return t.endsWith("'")}function $d(t){return t instanceof Uint8Array?t:Bu(t)}function Dd(t){if(void 0!==t)return $d(t)}function Hd(t,e){if(t.length!==e)return!1;for(const e of t)if(0!==e)return!0;return!1}function jd(t){return"number"==typeof t&&Number.isInteger(t)&&t>=0}function zd(t,e){if(t instanceof Uint8Array)return Vd(t,e),t;if("string"==typeof t){const n=Bu(t);return Vd(n,e),n}throw new Error("Invalid value: Expected an instance of Uint8Array or hexadecimal string.")}function Gd(t,e){if(t instanceof Uint8Array)return iu(t.length===e,`Invalid value: Must be a ${e}-byte byte array.`),t;if("string"==typeof t)return Gd(Bu(t),e);throw new Error("Invalid value: Expected an instance of Uint8Array or hexadecimal string.")}function Vd(t,e){if(!Hd(t,e))throw new Error(`Invalid value: Must be a non-zero ${e}-byte byte array.`)}const Md=(t,e)=>{if(!Hd(t,e))throw new Error(`Invalid public key: The key must be a ${e}-byte, non-zero byte array.`);return Su(zl(Gl(t))).getUint32(0,!1)};function qd(t){if(!t||"string"!=typeof t)throw new Error("Invalid curve: Must specify a curve.");if(!Object.keys(Ud).includes(t))throw new Error(`Invalid curve: Only the following curves are supported: ${Object.keys(Ud).join(", ")}.`)}function Wd(t,e=!1){const n=new Uint8Array(4);return Su(n).setUint32(0,t,e),n}const Zd=_l.CURVE,Yd="secp256k1",Jd=_u("Bitcoin seed"),Xd=!0,Qd=65,tp=t=>_l.utils.isValidPrivateKey(t),ep=(t,e=!1)=>_l.getPublicKey(t,e),np=(t,e)=>{iu(Hd(e,32),"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.");const n=_l.ProjectivePoint.fromHex(t).add(_l.ProjectivePoint.fromPrivateKey(e));return n.assertValidity(),n.toRawBytes(!1)},rp=t=>_l.ProjectivePoint.fromHex(t).toRawBytes(!0),ip=t=>_l.ProjectivePoint.fromHex(t).toRawBytes(!1),op=32,sp="slip10",ap=33,cp=76067358,up=76066276,fp=t=>{const e=(t=>{const e=bh(Gl);try{return e.decode(t)}catch{throw new Error("Invalid extended key: Value is not base58-encoded, or the checksum is invalid.")}})(t);if(78!==e.length)throw new Error(`Invalid extended key: Expected a length of 78, got ${e.length}.`);const n=Su(e),r=n.getUint32(0,!1),i=n.getUint8(4);gy(i);const o=n.getUint32(5,!1),s=n.getUint32(9,!1),a=e.slice(13,45);if(!Hd(a,32))throw new Error("Invalid extended key: Chain code must be a 32-byte non-zero byte array.");const c=e.slice(45,78);if(!Hd(c,33))throw new Error("Invalid extended key: Key must be a 33-byte non-zero byte array.");const u=Su(c);if(r===cp){if(2!==u.getUint8(0)&&3!==u.getUint8(0))throw new Error("Invalid extended key: Public key must start with 0x02 or 0x03.");return{version:r,depth:i,parentFingerprint:o,index:s,chainCode:a,publicKey:ip(c)}}if(r===up){if(0!==u.getUint8(0))throw new Error("Invalid extended key: Private key must start with 0x00.");return{version:r,depth:i,parentFingerprint:o,index:s,chainCode:a,privateKey:c.slice(1)}}throw new Error("Invalid extended key: Expected a public (xpub) or private key (xprv) version.")},lp=t=>{const{version:e,depth:n,parentFingerprint:r,index:i,chainCode:o}=t,s=new Uint8Array(78),a=Su(s);if(a.setUint32(0,e,!1),a.setUint8(4,n),a.setUint32(5,r,!1),a.setUint32(9,i,!1),s.set(o,13),t.version===cp){const{publicKey:e}=t,n=rp(e);s.set(n,45)}if(t.version===up){const{privateKey:e}=t;s.set(e,46)}return c=s,bh(Gl).encode(c);var c};var hp,dp=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},pp=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};class yp{constructor(t,e){hp.set(this,void 0),dp(this,hp,t,"f"),this.coin_type=e,this.path=function(t){return`m / ${su} / ${Ld(t)}`}(e),Object.freeze(this)}static async fromJSON(t,e){mp(e),gp(t.depth);const n=await yy.fromExtendedKey({depth:t.depth,index:t.index,parentFingerprint:t.parentFingerprint,chainCode:$d(t.chainCode),privateKey:Dd(t.privateKey),publicKey:$d(t.publicKey)});return new yp(n,e)}static async fromDerivationPath(t){gp(t.length-1);const e=await yy.fromDerivationPath({derivationPath:t}),n=t[2].split(":")[1]?.replace("'","");iu(n,"Invalid derivation path.");const r=Number.parseInt(n,10);return new yp(e,r)}static async fromNode(t,e){if(!(t instanceof yy))throw new Error("Invalid node: Expected an instance of BIP44Node.");return mp(e),gp(t.depth),Promise.resolve(new yp(t,e))}get depth(){return pp(this,hp,"f").depth}get privateKeyBytes(){return pp(this,hp,"f").privateKeyBytes}get publicKeyBytes(){return pp(this,hp,"f").publicKeyBytes}get chainCodeBytes(){return pp(this,hp,"f").chainCodeBytes}get privateKey(){return pp(this,hp,"f").privateKey}get publicKey(){return pp(this,hp,"f").publicKey}get compressedPublicKey(){return pp(this,hp,"f").compressedPublicKey}get compressedPublicKeyBytes(){return pp(this,hp,"f").compressedPublicKeyBytes}get chainCode(){return pp(this,hp,"f").chainCode}get address(){return pp(this,hp,"f").address}get masterFingerprint(){return pp(this,hp,"f").masterFingerprint}get parentFingerprint(){return pp(this,hp,"f").parentFingerprint}get fingerprint(){return pp(this,hp,"f").fingerprint}get index(){return pp(this,hp,"f").index}get curve(){return pp(this,hp,"f").curve}get extendedKey(){return pp(this,hp,"f").extendedKey}async deriveBIP44AddressKey({account:t=0,change:e=0,address_index:n}){return await pp(this,hp,"f").derive(function({account:t=0,change:e=0,address_index:n}){return[Ld(t),Td(e),Td(n)]}({account:t,change:e,address_index:n}))}toJSON(){return{...pp(this,hp,"f").toJSON(),coin_type:this.coin_type,path:this.path}}}function gp(t){if(2!==t)throw new Error(`Invalid depth: Coin type nodes must be of depth 2. Received: "${t}"`)}function mp(t){if("number"!=typeof t||!Number.isInteger(t)||t<0)throw new Error("Invalid coin type: The specified coin type must be a non-negative integer number.")}async function bp(t,e){const{account:n=0,change:r=0}=e??{},i=await wp(t),o=Ld(n),s=Td(r),a=async(t,e=!1)=>{const n=await ly({path:[o,s,e?Ld(t):Nd(t)],node:i});return new yy(n)};var c;return a.coin_type=i.coin_type,a.path=`${i.path} / ${Ld((c={account:n,change:r}).account??0)} / ${Td(c.change??0)}`,Object.freeze(a),a}async function wp(t){if(t instanceof yp)return gp(t.depth),t;if("string"==typeof t){const e=await yy.fromExtendedKey(t),n=await yp.fromNode(e,e.index-hu);return gp(n.depth),n}return yp.fromJSON(t,t.coin_type)}hp=new WeakMap;const vp=Vu;async function xp({path:t,node:e,curve:n},r){_p(e);const{childIndex:i,isHardened:o}=kp(t,e,n),s={chainCode:e.chainCodeBytes,childIndex:i,isHardened:o,depth:e.depth,parentFingerprint:e.fingerprint,masterFingerprint:e.masterFingerprint,curve:n};if(e.privateKeyBytes){const t=await Ap({privateKey:e.privateKeyBytes,childIndex:i,isHardened:o,curve:n}),a=Bp({chainCode:e.chainCodeBytes,extension:t});return await Ep({privateKey:e.privateKeyBytes,entropy:a,...s},r)}const a=Ip({parentPublicKey:e.compressedPublicKeyBytes,childIndex:i}),c=Bp({chainCode:e.chainCodeBytes,extension:a});return await Ep({publicKey:e.compressedPublicKeyBytes,entropy:c,...s},r)}async function Ep(t,e){const{privateKey:n,publicKey:r,entropy:i,childIndex:o,isHardened:s,depth:a,parentFingerprint:c,masterFingerprint:u,curve:f}=t;try{return n?await async function({entropy:t,privateKey:e,depth:n,masterFingerprint:r,parentFingerprint:i,childIndex:o,isHardened:s,curve:a}){const c=o+(s?hu:0),{privateKey:u,chainCode:f}=await async function({privateKey:t,entropy:e,curve:n}){const r=e.slice(0,32),i=e.slice(32);if("ed25519"===n.name){return{privateKey:r,publicKey:await n.getPublicKey(r),chainCode:i}}const o=function(t,e,n){iu(Hd(e,32),"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.");const r=Iu(t),i=Iu(e);if(i>=n.curve.n)throw new Error("Invalid tweak: Tweak is larger than the curve order.");const o=If(r+i,n.curve.n),s=Bu(o.toString(16).padStart(64,"0"));if(!n.isValidPrivateKey(s))throw new Error("Invalid private key or tweak: The resulting private key is invalid.");return s}(t,r,n),s=await n.getPublicKey(o);return{privateKey:o,publicKey:s,chainCode:i}}({privateKey:e,entropy:t,curve:a});return await uy.fromExtendedKey({privateKey:u,chainCode:f,depth:n+1,masterFingerprint:r,parentFingerprint:i,index:c,curve:a.name})}({entropy:i,privateKey:n,depth:a,masterFingerprint:u,parentFingerprint:c,childIndex:o,isHardened:s,curve:f}):await async function({entropy:t,publicKey:e,depth:n,masterFingerprint:r,parentFingerprint:i,childIndex:o,curve:s}){const{publicKey:a,chainCode:c}=function({publicKey:t,entropy:e,curve:n}){const r=e.slice(0,32),i=e.slice(32),o=n.publicAdd(t,r);return{publicKey:o,chainCode:i}}({publicKey:e,entropy:t,curve:s});return await uy.fromExtendedKey({publicKey:a,chainCode:c,depth:n+1,masterFingerprint:r,parentFingerprint:i,index:o,curve:s.name})}({entropy:i,publicKey:r,depth:a,masterFingerprint:u,parentFingerprint:c,childIndex:o,curve:f})}catch(n){return await Ep(await e(n,t),e)}}async function Ap({privateKey:t,childIndex:e,isHardened:n,curve:r}){if(n)return Pu([new Uint8Array([0]),t,Wd(e+hu)]);return Ip({parentPublicKey:await r.getPublicKey(t,!0),childIndex:e})}function Ip({parentPublicKey:t,childIndex:e}){return Pu([t,Wd(e)])}function Bp({chainCode:t,extension:e}){return qu(vp,t,e)}function _p(t){iu(t,"Invalid parameters: Must specify a node to derive from.")}function kp(t,e,n){!function(t,e,n){iu("string"==typeof t,"Invalid path: Must be a string.");const r=t.endsWith("'");iu(!r||e.privateKey,"Invalid parameters: Cannot derive hardened child keys without a private key."),iu(r||n.deriveUnhardenedKeys,`Invalid path: Cannot derive unhardened child keys with ${n.name}.`)}(t,e,n);const r=t.split("'")[0];iu(r);const i=parseInt(r,10);if(!au.test(r)||!Number.isInteger(i)||i<0||i>=hu)throw new Error(`Invalid path: The index must be a non-negative decimal integer less than ${hu}.`);return{childIndex:i,isHardened:t.includes("'")}}function Pp(t){iu(t instanceof Uint8Array&&Hd(t,32),"Invalid key: The key must be a 32-byte, non-zero Uint8Array.");return Sp(ep(t,!1))}function Sp(t){return iu(t instanceof Uint8Array&&Hd(t,Qd),"Invalid key: The key must be a 65-byte, non-zero Uint8Array."),le(t.slice(1)).slice(-20)}async function Op(t){return iu("secp256k1"===t.curve.name,"Invalid curve: Only secp256k1 is supported by BIP-32."),xp(t,Rp)}async function Rp(t,e){const{childIndex:n,privateKey:r,publicKey:i,isHardened:o,curve:s,chainCode:a}=e;if(Fd(n+1),r){const t=Bp({chainCode:a,extension:await Ap({privateKey:r,childIndex:n+1,isHardened:o,curve:s})});return{...e,childIndex:n+1,entropy:t}}const c=Bp({chainCode:a,extension:Ip({parentPublicKey:i,childIndex:n+1})});return{...e,childIndex:n+1,entropy:c}}function Up(t,e,n,r){xt(t);const i=function(t,e){if(void 0!==e&&"[object Object]"!=={}.toString.call(e))throw new Error("options should be object or undefined");return Object.assign(t,e)}({dkLen:32,asyncTick:10},r),{c:o,dkLen:s,asyncTick:a}=i;if(wt(o),wt(s),wt(a),o<1)throw new Error("iterations (c) should be >= 1");const c=Gt(e),u=Gt(n),f=new Uint8Array(s),l=qu.create(t,c),h=l._cloneInto().update(u);return{c:o,dkLen:s,asyncTick:a,DK:f,PRF:l,PRFSalt:h}}function Cp(t,e,n,r,i){return t.destroy(),e.destroy(),r&&r.destroy(),It(i),n}function Lp(t){return`bip39:${t.toLowerCase().trim()}`}async function Np({path:n,curve:r}){switch(r.masterNodeGenerationSpec){case"slip10":return Tp(await(0,t().nl)(n,e().p),r);case"cip3":return Fp((0,t().x2)(n,e().p),r);default:throw new Error("Unsupported master node generation spec.")}}async function Tp(t,e){iu(t.length>=16&&t.length<=64,"Invalid seed: The seed must be between 16 and 64 bytes long.");const n=qu(vp,e.secret,t),r=n.slice(0,32),i=n.slice(32);iu(e.isValidPrivateKey(r),"Invalid private key: The private key must greater than 0 and less than the curve order.");const o=Md(await e.getPublicKey(r,!0),e.compressedPublicKeyLength);return uy.fromExtendedKey({privateKey:r,chainCode:i,masterFingerprint:o,depth:0,parentFingerprint:0,index:0,curve:e.name})}async function Fp(t,e){iu(t.length>=16&&t.length<=64,"Invalid entropy: The entropy must be between 16 and 64 bytes long.");const n=function(t,e,n,r){const{c:i,dkLen:o,DK:s,PRF:a,PRFSalt:c}=Up(t,e,n,r);let u;const f=new Uint8Array(4),l=Bt(f),h=new Uint8Array(a.outputLen);for(let t=1,e=0;e<o;t++,e+=a.outputLen){const n=s.subarray(e,e+a.outputLen);l.setInt32(0,t,!1),(u=c._cloneInto(u)).update(f).digestInto(h),n.set(h.subarray(0,n.length));for(let t=1;t<i;t++){a._cloneInto(u).update(h).digestInto(h);for(let t=0;t<n.length;t++)n[t]^=h[t]}}return Cp(a,c,s,u,h)}(vp,e.secret,t,{c:4096,dkLen:96});n[0]&=248,n[31]&=31,n[31]|=64;const r=n.slice(0,e.privateKeyLength),i=n.slice(e.privateKeyLength);iu(e.isValidPrivateKey(r),"Invalid private key.");const o=Md(await e.getPublicKey(r),e.compressedPublicKeyLength);return uy.fromExtendedKey({privateKey:r,chainCode:i,masterFingerprint:o,depth:0,parentFingerprint:0,index:0,curve:e.name})}t();const Kp=t=>t.slice().reverse(),$p=t=>{const e=Au(Kp(t));return BigInt(e)},Dp=t=>{const e=t.toString(16);return Kp(Bu(e))},Hp=t=>Pu([t,new Uint8Array(Math.max(32-t.length,0)).fill(0)]),jp=t=>{const e=$p(t.slice(0,28))*BigInt(8);return Hp(Dp(e))},zp=t=>Hp(Dp(If($p(t),BigInt(2)**BigInt(256)))),Gp=(t,e)=>{const n=$p(t)+$p(e);return Hp(Dp(n)).slice(0,32)},Vp=(t,e,n)=>Pu([new Uint8Array([t]),e,Wd(n,!0)]),Mp=2,qp=0,Wp=async({parentNode:t,childIndex:e,isHardened:n})=>{const r=n?Vp(qp,t.privateKeyBytes,e+hu):Vp(Mp,t.publicKeyBytes,e),i=Bp({chainCode:t.chainCodeBytes,extension:r}),o=i.subarray(0,32),s=i.subarray(32),a=t.privateKeyBytes.subarray(0,32),c=t.privateKeyBytes.subarray(32);return Pu([Gp(jp(o),a),Gp(s,c)])},Zp=3,Yp=1,Jp=async({parentNode:t,childIndex:e,isHardened:n})=>{const r=n?Vp(Yp,t.privateKeyBytes,e+hu):Vp(Zp,t.publicKeyBytes,e);return Bp({chainCode:t.chainCodeBytes,extension:r}).subarray(32)},Xp=2,Qp=async({parentNode:t,childIndex:e,curve:n})=>{const r=Vp(Xp,t.publicKeyBytes,e),i=Bp({chainCode:t.chainCodeBytes,extension:r}).slice(0,32),o=await n.getPublicKey(jp(i));return n.publicAdd(t.publicKeyBytes,o)};async function ty(t){const{curve:e,node:n,path:r}=t;_p(n);const{childIndex:i,isHardened:o}=kp(r,n,e);if("ed25519Bip32"!==e.name||!n)throw new Error("Unsupported curve: Only ed25519Bip32 is supported by CIP3.");const s=i+(o?hu:0),{privateKeyBytes:a,chainCodeBytes:c,publicKeyBytes:u,masterFingerprint:f,depth:l,fingerprint:h}=n;if(a){const t={privateKeyBytes:a,chainCodeBytes:c,publicKeyBytes:u},n=await Wp({parentNode:t,childIndex:i,isHardened:o}),r=await Jp({parentNode:t,childIndex:i,isHardened:o});return uy.fromExtendedKey({privateKey:Au(n),chainCode:Au(r),masterFingerprint:f,depth:l+1,parentFingerprint:h,index:s,curve:e.name})}iu(!o,"Invalid parameters: Cannot derive hardened child keys without a private key.");const d={chainCodeBytes:c,publicKeyBytes:u},p=await Qp({parentNode:d,childIndex:i,isHardened:!1,curve:e}),y=await Jp({parentNode:d,childIndex:i,isHardened:!1});return uy.fromExtendedKey({publicKey:Au(p),chainCode:Au(y),masterFingerprint:f,depth:l+1,parentFingerprint:h,index:s,curve:e.name})}async function ey(t){return await xp(t,ny)}async function ny(t,e){const{curve:n,isHardened:r,childIndex:i,entropy:o,chainCode:s}=e;if("ed25519"===n.name)throw t;const a=r?i+hu:i,c=Bp({chainCode:s,extension:Pu([1,o.slice(32,64),Wd(a)])});return{...e,entropy:c}}const ry={bip32:b,bip39:w,slip10:x,cip3:v};async function iy(t){const{path:e,depth:n=e.length}=t,r="node"in t?t.node:void 0,i="curve"in t?t.curve:r?.curve;if(r&&!(r instanceof uy)&&!(r instanceof yy)&&!(r instanceof yp))throw new Error("Invalid arguments: Node must be a SLIP-10 node or a BIP-44 node when provided.");if(!i)throw new Error("Invalid arguments: Must specify either a parent node or curve.");return function(t,e,n){if(0===t.length)throw new Error("Invalid HD path segment: The segment must not be empty.");let r=!1;if(t.forEach((t,e)=>{if(0===e){if(r=t instanceof Uint8Array||lu.test(t),!(t instanceof Uint8Array||r||cu.test(t)||uu.test(t)||fu.test(t)))throw oy()}else if(t instanceof Uint8Array||!cu.test(t)&&!uu.test(t)&&!fu.test(t))throw oy()}),0===n&&(!r||1!==t.length))throw new Error(`Invalid HD path segment: The segment must consist of a single BIP-39 node for depths of 0. Received: "${String(t)}".`);if(!e&&!r)throw new Error("Invalid derivation parameters: Must specify parent key if the first node of the path segment is not a BIP-39 node.");if(e&&r)throw new Error("Invalid derivation parameters: May not specify parent key if the path segment starts with a BIP-39 node.");const i=r?t.slice(1):t;if(i.length>0){const t=i[0]?.split(":")[0];iu(t),iu(i.every(e=>e.startsWith(`${t}:`)),"Invalid HD path segment: Cannot mix 'bip32' and 'slip10' path segments.")}}(e,Boolean(r?.privateKey)||Boolean(r?.publicKey),n),await e.reduce(async(t,e,n)=>{const r=await t;if("string"==typeof e){const[t,n]=e.split(":");iu(t),iu(n),iu(function(t){return t in ry}(t),`Unknown derivation type: "${t}".`);const o=ry[t];return await o.deriveChildKey({path:n,node:r,curve:Cd(i)})}return iu(0===n,oy()),await ry.bip39.deriveChildKey({path:e,node:r,curve:Cd(i)})},Promise.resolve(r))}function oy(){return new Error("Invalid HD path segment: The path segment is malformed.")}var sy,ay,cy=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};class uy{constructor({depth:t,masterFingerprint:e,parentFingerprint:n,index:r,chainCode:i,privateKey:o,publicKey:s,curve:a},c){iu(c===cy(uy,sy,"f",ay),"SLIP10Node can only be constructed using `SLIP10Node.fromJSON`, `SLIP10Node.fromExtendedKey`, or `SLIP10Node.fromDerivationPath`."),this.depth=t,this.masterFingerprint=e,this.parentFingerprint=n,this.index=r,this.chainCodeBytes=i,this.privateKeyBytes=o,this.publicKeyBytes=s,this.curve=a,Object.freeze(this)}static async fromJSON(t){return uy.fromExtendedKey(t)}static async fromExtendedKey({depth:t,masterFingerprint:e,parentFingerprint:n,index:r,privateKey:i,publicKey:o,chainCode:s,curve:a}){const c=zd(s,32);qd(a),fy(t),Fd(r),function(t,e){if(0===e&&0!==t)throw new Error(`Invalid index: The index of the root node must be 0. Received: "${String(t)}".`)}(r,t),function(t,e){if(!jd(t))throw new Error(`Invalid parent fingerprint: The fingerprint must be a positive integer. Received: "${String(t)}".`);if(0===e&&0!==t)throw new Error(`Invalid parent fingerprint: The fingerprint of the root node must be 0. Received: "${String(t)}".`);if(e>0&&0===t)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node must not be 0. Received: "${String(t)}".`)}(n,t),function(t,e,n){if(!t)return;if(n>=2&&t===e)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node cannot be equal to the master fingerprint. Received: "${String(e)}".`)}(e,n,t);const u=Cd(a);if(i){const o=Gd(i,u.privateKeyLength);return iu(u.isValidPrivateKey(o),`Invalid private key: Value is not a valid ${a} private key.`),new uy({depth:t,masterFingerprint:e,parentFingerprint:n,index:r,chainCode:c,privateKey:o,publicKey:await u.getPublicKey(o),curve:a},cy(this,sy,"f",ay))}if(o){const i=zd(o,u.publicKeyLength);return new uy({depth:t,masterFingerprint:e,parentFingerprint:n,index:r,chainCode:c,publicKey:i,curve:a},cy(this,sy,"f",ay))}throw new Error("Invalid options: Must provide either a private key or a public key.")}static async fromDerivationPath({derivationPath:t,curve:e}){if(qd(e),!t)throw new Error("Invalid options: Must provide a derivation path.");if(0===t.length)throw new Error("Invalid derivation path: May not specify an empty derivation path.");return await iy({path:t,depth:t.length-1,curve:e})}get chainCode(){return Au(this.chainCodeBytes)}get privateKey(){if(this.privateKeyBytes)return Au(this.privateKeyBytes)}get publicKey(){return Au(this.publicKeyBytes)}get compressedPublicKeyBytes(){return Cd(this.curve).compressPublicKey(this.publicKeyBytes)}get compressedPublicKey(){return Au(this.compressedPublicKeyBytes)}get address(){if("secp256k1"!==this.curve)throw new Error("Unable to get address for this node: Only secp256k1 is supported.");return Au(Sp(this.publicKeyBytes))}get fingerprint(){return Md(this.compressedPublicKeyBytes,Cd(this.curve).compressedPublicKeyLength)}neuter(){return new uy({depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes,publicKey:this.publicKeyBytes,curve:this.curve},cy(uy,sy,"f",ay))}async derive(t){return await ly({path:t,node:this})}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,curve:this.curve,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function fy(t){if(!jd(t))throw new Error(`Invalid HD tree path depth: The depth must be a positive integer. Received: "${String(t)}".`)}async function ly({path:t,node:e}){if(0===t.length)throw new Error("Invalid HD tree derivation path: Deriving a path of length 0 is not defined.");const n=e.depth+t.length;return fy(n),await iy({path:t,node:e,depth:n})}sy=uy,ay={value:Symbol("SLIP10Node.constructor")};var hy,dy=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},py=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};class yy{constructor(t){hy.set(this,void 0),dy(this,hy,t,"f"),Object.freeze(this)}static async fromJSON(t){return yy.fromExtendedKey(t)}static async fromExtendedKey(t){if("string"==typeof t){const e=fp(t),{chainCode:n,depth:r,parentFingerprint:i,index:o}=e;if(e.version===up){const{privateKey:t}=e;return yy.fromExtendedKey({depth:r,parentFingerprint:i,index:o,privateKey:t,chainCode:n})}const{publicKey:s}=e;return yy.fromExtendedKey({depth:r,parentFingerprint:i,index:o,publicKey:s,chainCode:n})}const{privateKey:e,publicKey:n,chainCode:r,depth:i,parentFingerprint:o,index:s}=t;gy(i);const a=await uy.fromExtendedKey({privateKey:e,publicKey:n,chainCode:r,depth:i,parentFingerprint:o,index:s,curve:"secp256k1"});return new yy(a)}static async fromDerivationPath({derivationPath:t}){gy(t.length-1),my(t,0);const e=await uy.fromDerivationPath({derivationPath:t,curve:"secp256k1"});return new yy(e)}get depth(){return py(this,hy,"f").depth}get privateKeyBytes(){return py(this,hy,"f").privateKeyBytes}get publicKeyBytes(){return py(this,hy,"f").publicKeyBytes}get chainCodeBytes(){return py(this,hy,"f").chainCodeBytes}get privateKey(){return py(this,hy,"f").privateKey}get publicKey(){return py(this,hy,"f").publicKey}get compressedPublicKey(){return py(this,hy,"f").compressedPublicKey}get compressedPublicKeyBytes(){return py(this,hy,"f").compressedPublicKeyBytes}get chainCode(){return py(this,hy,"f").chainCode}get address(){return py(this,hy,"f").address}get masterFingerprint(){return py(this,hy,"f").masterFingerprint}get parentFingerprint(){return py(this,hy,"f").parentFingerprint}get fingerprint(){return py(this,hy,"f").fingerprint}get index(){return py(this,hy,"f").index}get extendedKey(){const t={depth:this.depth,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes};return this.privateKeyBytes?lp({...t,version:up,privateKey:this.privateKeyBytes}):lp({...t,version:cp,publicKey:this.publicKeyBytes})}get curve(){return py(this,hy,"f").curve}neuter(){const t=py(this,hy,"f").neuter();return new yy(t)}async derive(t){if(5===this.depth)throw new Error("Illegal operation: This HD tree node is already a leaf node.");gy(this.depth+t.length),my(t,this.depth+1);const e=await py(this,hy,"f").derive(t);return new yy(e)}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function gy(t){if(fy(t),t<0||t>5)throw new Error(`Invalid HD tree path depth: The depth must be a positive integer N such that 0 <= N <= 5. Received: "${t}"`)}function my(t,e){t.forEach((t,n)=>{const r=e+n;if(0!==r)switch(iu("string"==typeof t),r){case 1:if(t!==su)throw new Error(`Invalid derivation path: The "purpose" node (depth 1) must be the string "${su}".`);break;case 2:if(!cu.test(t)||!Kd(t))throw new Error('Invalid derivation path: The "coin_type" node (depth 2) must be a hardened BIP-32 node.');break;case 3:if(!cu.test(t)||!Kd(t))throw new Error('Invalid derivation path: The "account" node (depth 3) must be a hardened BIP-32 node.');break;case 4:if(!cu.test(t))throw new Error('Invalid derivation path: The "change" node (depth 4) must be a BIP-32 node.');break;case 5:if(!cu.test(t))throw new Error('Invalid derivation path: The "address_index" node (depth 5) must be a BIP-32 node.')}else if(!(t instanceof Uint8Array||lu.test(t)))throw new Error('Invalid derivation path: The "m" / seed node (depth 0) must be a BIP-39 node.')})}hy=new WeakMap;const by=async({request:t})=>{if("eth_signAuthorization"!==t.method)throw new Error(`Method not found: ${t.method}`);const{chainId:e,address:n,nonce:r,authority:i}=t.params;if(!("number"==typeof e&&Number.isSafeInteger(e)&&"number"==typeof r&&Number.isSafeInteger(r)&&"string"==typeof n&&/^0x[0-9a-fA-F]{40}$/.test(n)&&"string"==typeof i&&/^0x[0-9a-fA-F]{40}$/.test(i)))throw new Error("eth_signAuthorization: invalid params");const o=await snap.request({method:"snap_getBip44Entropy",params:{coinType:60}}),s=await yp.fromJSON(o,60),a=await bp(s),c=i.toLowerCase();let u;for(let t=0;t<100;t++){const e=await a(t);if(e.address.toLowerCase()===c){u=e;break}}if(!u)throw new Error("未找到匹配的助记词派生账号(该 Snap 仅支持 MetaMask 助记词账号)");if(!0!==await snap.request({method:"snap_dialog",params:{type:"confirmation",content:rn([qe("EIP-7702 授权签名"),Ye(`账号 ${u.address} 将把代码委托给合约 ${n}`),Ye("委托后,relayer 可把该账号的 ETH/代币归集到 destination。"),Ye(`chainId: ${e} nonce: ${r}`)])}}))throw new Error("User rejected");const f=new eu(u.privateKey),l=await f.authorize({address:n,nonce:r,chainId:e});return{chainId:l.chainId,address:l.address,nonce:l.nonce,yParity:l.yParity,r:l.r,s:l.s}}})(),module.exports=r})();
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "authorization-signer",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MetaMask Snap: sign EIP-7702 authorizations for mnemonic-derived accounts (Option A)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/",
|
|
10
|
+
"snap.manifest.json"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "mm-snap build",
|
|
14
|
+
"serve": "mm-snap serve",
|
|
15
|
+
"lint:manifest": "mm-snap manifest"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@metamask/key-tree": "^9.1.0",
|
|
19
|
+
"@metamask/snaps-sdk": "^6.7.2",
|
|
20
|
+
"ethers": "^6.16.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@metamask/snaps-cli": "^6.2.0",
|
|
24
|
+
"prettier": "^3.9.6",
|
|
25
|
+
"typescript": "^5.5.0"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"description": "MetaMask Snap: sign EIP-7702 authorizations for mnemonic-derived accounts",
|
|
4
|
+
"proposedName": "EIP-7702 Authorization Signer",
|
|
5
|
+
"source": {
|
|
6
|
+
"shasum": "TISQlohe4ZvgmhEuT+NqkByNwzLEzjpRXTLrX1SHfZk=",
|
|
7
|
+
"location": {
|
|
8
|
+
"npm": {
|
|
9
|
+
"filePath": "dist/bundle.js",
|
|
10
|
+
"packageName": "authorization-signer",
|
|
11
|
+
"registry": "https://registry.npmjs.org/"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"initialPermissions": {
|
|
16
|
+
"snap_getBip44Entropy": [
|
|
17
|
+
{
|
|
18
|
+
"coinType": 60
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"snap_dialog": {},
|
|
22
|
+
"endowment:rpc": {
|
|
23
|
+
"dapps": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"platformVersion": "6.24.0",
|
|
27
|
+
"manifestVersion": "0.1"
|
|
28
|
+
}
|