magic-sdk 13.6.2 → 14.0.0-2f75fa3-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/index.mjs +1 -1
- package/dist/es/index.mjs.map +1 -1
- package/dist/magic.js +575 -4
- package/dist/types/index.cdn.d.ts +3 -0
- package/package.json +4 -4
package/dist/magic.js
CHANGED
|
@@ -1,6 +1,577 @@
|
|
|
1
|
-
"use strict";var Magic=(()=>{var Un=Object.create;var Ce=Object.defineProperty;var Bn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames,Xt=Object.getOwnPropertySymbols,Gn=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var qt=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jt=(e,t)=>{for(var n in t||(t={}))zt.call(t,n)&&qt(e,n,t[n]);if(Xt)for(var n of Xt(t))jn.call(t,n)&&qt(e,n,t[n]);return e};var xe=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Qt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zt=(e,t)=>{for(var n in t)Ce(e,n,{get:t[n],enumerable:!0})},er=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Fn(t))!zt.call(e,s)&&s!==n&&Ce(e,s,{get:()=>t[s],enumerable:!(o=Bn(t,s))||o.enumerable});return e};var tr=(e,t,n)=>(n=e!=null?Un(Gn(e)):{},er(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e)),kn=e=>er(Ce({},"__esModule",{value:!0}),e);var Ae=(e,t,n)=>new Promise((o,s)=>{var c=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(c,g);p((n=n.apply(e,t)).next())});var Fr=Qt((Br,Nt)=>{(function(e){if(typeof Br=="object"&&typeof Nt<"u")Nt.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return function o(s,c,g){function p(y,N){if(!c[y]){if(!s[y]){var I=typeof xe=="function"&&xe;if(!N&&I)return I(y,!0);if(m)return m(y,!0);var T=new Error("Cannot find module '"+y+"'");throw T.code="MODULE_NOT_FOUND",T}var P=c[y]={exports:{}};s[y][0].call(P.exports,function(B){var L=s[y][1][B];return p(L||B)},P,P.exports,o,s,c,g)}return c[y].exports}for(var m=typeof xe=="function"&&xe,v=0;v<g.length;v++)p(g[v]);return p}({1:[function(o,s,c){(function(g){"use strict";var p=g.MutationObserver||g.WebKitMutationObserver,m;if(p){var v=0,y=new p(B),N=g.document.createTextNode("");y.observe(N,{characterData:!0}),m=function(){N.data=v=++v%2}}else if(!g.setImmediate&&typeof g.MessageChannel<"u"){var I=new g.MessageChannel;I.port1.onmessage=B,m=function(){I.port2.postMessage(0)}}else"document"in g&&"onreadystatechange"in g.document.createElement("script")?m=function(){var G=g.document.createElement("script");G.onreadystatechange=function(){B(),G.onreadystatechange=null,G.parentNode.removeChild(G),G=null},g.document.documentElement.appendChild(G)}:m=function(){setTimeout(B,0)};var T,P=[];function B(){T=!0;for(var G,J,D=P.length;D;){for(J=P,P=[],G=-1;++G<D;)J[G]();D=P.length}T=!1}s.exports=L;function L(G){P.push(G)===1&&!T&&m()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(o,s,c){"use strict";var g=o(1);function p(){}var m={},v=["REJECTED"],y=["FULFILLED"],N=["PENDING"];s.exports=I;function I(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=N,this.queue=[],this.outcome=void 0,S!==p&&L(this,S)}I.prototype.catch=function(S){return this.then(null,S)},I.prototype.then=function(S,j){if(typeof S!="function"&&this.state===y||typeof j!="function"&&this.state===v)return this;var U=new this.constructor(p);if(this.state!==N){var Y=this.state===y?S:j;P(U,Y,this.outcome)}else this.queue.push(new T(U,S,j));return U};function T(S,j,U){this.promise=S,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof U=="function"&&(this.onRejected=U,this.callRejected=this.otherCallRejected)}T.prototype.callFulfilled=function(S){m.resolve(this.promise,S)},T.prototype.otherCallFulfilled=function(S){P(this.promise,this.onFulfilled,S)},T.prototype.callRejected=function(S){m.reject(this.promise,S)},T.prototype.otherCallRejected=function(S){P(this.promise,this.onRejected,S)};function P(S,j,U){g(function(){var Y;try{Y=j(U)}catch(Q){return m.reject(S,Q)}Y===S?m.reject(S,new TypeError("Cannot resolve promise with itself")):m.resolve(S,Y)})}m.resolve=function(S,j){var U=G(B,j);if(U.status==="error")return m.reject(S,U.value);var Y=U.value;if(Y)L(S,Y);else{S.state=y,S.outcome=j;for(var Q=-1,ie=S.queue.length;++Q<ie;)S.queue[Q].callFulfilled(j)}return S},m.reject=function(S,j){S.state=v,S.outcome=j;for(var U=-1,Y=S.queue.length;++U<Y;)S.queue[U].callRejected(j);return S};function B(S){var j=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof j=="function")return function(){j.apply(S,arguments)}}function L(S,j){var U=!1;function Y(se){U||(U=!0,m.reject(S,se))}function Q(se){U||(U=!0,m.resolve(S,se))}function ie(){j(Q,Y)}var ae=G(ie);ae.status==="error"&&Y(ae.value)}function G(S,j){var U={};try{U.value=S(j),U.status="success"}catch(Y){U.status="error",U.value=Y}return U}I.resolve=J;function J(S){return S instanceof this?S:m.resolve(new this(p),S)}I.reject=D;function D(S){var j=new this(p);return m.reject(j,S)}I.all=pe;function pe(S){var j=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,Y=!1;if(!U)return this.resolve([]);for(var Q=new Array(U),ie=0,ae=-1,se=new this(p);++ae<U;)ce(S[ae],ae);return se;function ce(ye,d){j.resolve(ye).then(_,function(A){Y||(Y=!0,m.reject(se,A))});function _(A){Q[d]=A,++ie===U&&!Y&&(Y=!0,m.resolve(se,Q))}}}I.race=ne;function ne(S){var j=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var U=S.length,Y=!1;if(!U)return this.resolve([]);for(var Q=-1,ie=new this(p);++Q<U;)ae(S[Q]);return ie;function ae(se){j.resolve(se).then(function(ce){Y||(Y=!0,m.resolve(ie,ce))},function(ce){Y||(Y=!0,m.reject(ie,ce))})}}},{1:1}],3:[function(o,s,c){(function(g){"use strict";typeof g.Promise!="function"&&(g.Promise=o(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(o,s,c){"use strict";var g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function p(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function m(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var v=m();function y(){try{if(!v||!v.open)return!1;var r=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!r||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function N(r,a){r=r||[],a=a||{};try{return new Blob(r,a)}catch(u){if(u.name!=="TypeError")throw u;for(var i=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,l=new i,f=0;f<r.length;f+=1)l.append(r[f]);return l.getBlob(a.type)}}typeof Promise>"u"&&o(3);var I=Promise;function T(r,a){a&&r.then(function(i){a(null,i)},function(i){a(i)})}function P(r,a,i){typeof a=="function"&&r.then(a),typeof i=="function"&&r.catch(i)}function B(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function L(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var G="local-forage-detect-blob-support",J=void 0,D={},pe=Object.prototype.toString,ne="readonly",S="readwrite";function j(r){for(var a=r.length,i=new ArrayBuffer(a),l=new Uint8Array(i),f=0;f<a;f++)l[f]=r.charCodeAt(f);return i}function U(r){return new I(function(a){var i=r.transaction(G,S),l=N([""]);i.objectStore(G).put(l,"key"),i.onabort=function(f){f.preventDefault(),f.stopPropagation(),a(!1)},i.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),u=navigator.userAgent.match(/Edge\//);a(u||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function Y(r){return typeof J=="boolean"?I.resolve(J):U(r).then(function(a){return J=a,J})}function Q(r){var a=D[r.name],i={};i.promise=new I(function(l,f){i.resolve=l,i.reject=f}),a.deferredOperations.push(i),a.dbReady?a.dbReady=a.dbReady.then(function(){return i.promise}):a.dbReady=i.promise}function ie(r){var a=D[r.name],i=a.deferredOperations.pop();if(i)return i.resolve(),i.promise}function ae(r,a){var i=D[r.name],l=i.deferredOperations.pop();if(l)return l.reject(a),l.promise}function se(r,a){return new I(function(i,l){if(D[r.name]=D[r.name]||Z(),r.db)if(a)Q(r),r.db.close();else return i(r.db);var f=[r.name];a&&f.push(r.version);var u=v.open.apply(v,f);a&&(u.onupgradeneeded=function(h){var E=u.result;try{E.createObjectStore(r.storeName),h.oldVersion<=1&&E.createObjectStore(G)}catch(b){if(b.name==="ConstraintError")console.warn('The database "'+r.name+'" has been upgraded from version '+h.oldVersion+" to version "+h.newVersion+', but the storage "'+r.storeName+'" already exists.');else throw b}}),u.onerror=function(h){h.preventDefault(),l(u.error)},u.onsuccess=function(){var h=u.result;h.onversionchange=function(E){E.target.close()},i(h),ie(r)}})}function ce(r){return se(r,!1)}function ye(r){return se(r,!0)}function d(r,a){if(!r.db)return!0;var i=!r.db.objectStoreNames.contains(r.storeName),l=r.version<r.db.version,f=r.version>r.db.version;if(l&&(r.version!==a&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||i){if(i){var u=r.db.version+1;u>r.version&&(r.version=u)}return!0}return!1}function _(r){return new I(function(a,i){var l=new FileReader;l.onerror=i,l.onloadend=function(f){var u=btoa(f.target.result||"");a({__local_forage_encoded_blob:!0,data:u,type:r.type})},l.readAsBinaryString(r)})}function A(r){var a=j(atob(r.data));return N([a],{type:r.type})}function M(r){return r&&r.__local_forage_encoded_blob}function $(r){var a=this,i=a._initReady().then(function(){var l=D[a._dbInfo.name];if(l&&l.dbReady)return l.dbReady});return P(i,r,r),i}function C(r){Q(r);for(var a=D[r.name],i=a.forages,l=0;l<i.length;l++){var f=i[l];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return r.db=null,ce(r).then(function(u){return r.db=u,d(r)?ye(r):u}).then(function(u){r.db=a.db=u;for(var h=0;h<i.length;h++)i[h]._dbInfo.db=u}).catch(function(u){throw ae(r,u),u})}function k(r,a,i,l){l===void 0&&(l=1);try{var f=r.db.transaction(r.storeName,a);i(null,f)}catch(u){if(l>0&&(!r.db||u.name==="InvalidStateError"||u.name==="NotFoundError"))return I.resolve().then(function(){if(!r.db||u.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),ye(r)}).then(function(){return C(r).then(function(){k(r,a,i,l-1)})}).catch(i);i(u)}}function Z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function we(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=r[l];var f=D[i.name];f||(f=Z(),D[i.name]=f),f.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=$);var u=[];function h(){return I.resolve()}for(var E=0;E<f.forages.length;E++){var b=f.forages[E];b!==a&&u.push(b._initReady().catch(h))}var w=f.forages.slice(0);return I.all(u).then(function(){return i.db=f.db,ce(i)}).then(function(R){return i.db=R,d(i,a._defaultConfig.version)?ye(i):R}).then(function(R){i.db=f.db=R,a._dbInfo=i;for(var O=0;O<w.length;O++){var F=w[O];F!==a&&(F._dbInfo.db=i.db,F._dbInfo.version=i.version)}})}function Ee(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.get(r);w.onsuccess=function(){var R=w.result;R===void 0&&(R=null),M(R)&&(R=A(R)),f(R)},w.onerror=function(){u(w.error)}}catch(R){u(R)}})}).catch(u)});return T(l,a),l}function $e(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.openCursor(),R=1;w.onsuccess=function(){var O=w.result;if(O){var F=O.value;M(F)&&(F=A(F));var W=r(F,O.key,R++);W!==void 0?f(W):O.continue()}else f()},w.onerror=function(){u(w.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function kr(r,a,i){var l=this;r=B(r);var f=new I(function(u,h){var E;l.ready().then(function(){return E=l._dbInfo,pe.call(a)==="[object Blob]"?Y(E.db).then(function(b){return b?a:_(a)}):a}).then(function(b){k(l._dbInfo,S,function(w,R){if(w)return h(w);try{var O=R.objectStore(l._dbInfo.storeName);b===null&&(b=void 0);var F=O.put(b,r);R.oncomplete=function(){b===void 0&&(b=null),u(b)},R.onabort=R.onerror=function(){var W=F.error?F.error:F.transaction.error;h(W)}}catch(W){h(W)}})}).catch(h)});return T(f,i),f}function Wr(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){k(i._dbInfo,S,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=b.delete(r);E.oncomplete=function(){f()},E.onerror=function(){u(w.error)},E.onabort=function(){var R=w.error?w.error:w.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return T(l,a),l}function Yr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,S,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.clear();h.oncomplete=function(){l()},h.onabort=h.onerror=function(){var w=b.error?b.error:b.transaction.error;f(w)}}catch(w){f(w)}})}).catch(f)});return T(i,r),i}function Hr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.count();b.onsuccess=function(){l(b.result)},b.onerror=function(){f(b.error)}}catch(w){f(w)}})}).catch(f)});return T(i,r),i}function Kr(r,a){var i=this,l=new I(function(f,u){if(r<0){f(null);return}i.ready().then(function(){k(i._dbInfo,ne,function(h,E){if(h)return u(h);try{var b=E.objectStore(i._dbInfo.storeName),w=!1,R=b.openKeyCursor();R.onsuccess=function(){var O=R.result;if(!O){f(null);return}r===0||w?f(O.key):(w=!0,O.advance(r))},R.onerror=function(){u(R.error)}}catch(O){u(O)}})}).catch(u)});return T(l,a),l}function Vr(r){var a=this,i=new I(function(l,f){a.ready().then(function(){k(a._dbInfo,ne,function(u,h){if(u)return f(u);try{var E=h.objectStore(a._dbInfo.storeName),b=E.openKeyCursor(),w=[];b.onsuccess=function(){var R=b.result;if(!R){l(w);return}w.push(R.key),R.continue()},b.onerror=function(){f(b.error)}}catch(R){f(R)}})}).catch(f)});return T(i,r),i}function Xr(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;if(!r.name)f=I.reject("Invalid arguments");else{var u=r.name===i.name&&l._dbInfo.db,h=u?I.resolve(l._dbInfo.db):ce(r).then(function(E){var b=D[r.name],w=b.forages;b.db=E;for(var R=0;R<w.length;R++)w[R]._dbInfo.db=E;return E});r.storeName?f=h.then(function(E){if(!!E.objectStoreNames.contains(r.storeName)){var b=E.version+1;Q(r);var w=D[r.name],R=w.forages;E.close();for(var O=0;O<R.length;O++){var F=R[O];F._dbInfo.db=null,F._dbInfo.version=b}var W=new I(function(H,q){var X=v.open(r.name,b);X.onerror=function(ue){var De=X.result;De.close(),q(ue)},X.onupgradeneeded=function(){var ue=X.result;ue.deleteObjectStore(r.storeName)},X.onsuccess=function(){var ue=X.result;ue.close(),H(ue)}});return W.then(function(H){w.db=H;for(var q=0;q<R.length;q++){var X=R[q];X._dbInfo.db=H,ie(X._dbInfo)}}).catch(function(H){throw(ae(r,H)||I.resolve()).catch(function(){}),H})}}):f=h.then(function(E){Q(r);var b=D[r.name],w=b.forages;E.close();for(var R=0;R<w.length;R++){var O=w[R];O._dbInfo.db=null}var F=new I(function(W,H){var q=v.deleteDatabase(r.name);q.onerror=function(){var X=q.result;X&&X.close(),H(q.error)},q.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed')},q.onsuccess=function(){var X=q.result;X&&X.close(),W(X)}});return F.then(function(W){b.db=W;for(var H=0;H<w.length;H++){var q=w[H];ie(q._dbInfo)}}).catch(function(W){throw(ae(r,W)||I.resolve()).catch(function(){}),W})})}return T(f,a),f}var qr={_driver:"asyncStorage",_initStorage:we,_support:y(),iterate:$e,getItem:Ee,setItem:kr,removeItem:Wr,clear:Yr,length:Hr,key:Kr,keys:Vr,dropInstance:Xr};function zr(){return typeof openDatabase=="function"}var me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jr="~~local_forage_type~",Ot=/^~~local_forage_type~([^~]+)~/,He="__lfsc__:",ut=He.length,ct="arbf",lt="blob",Lt="si08",Mt="ui08",$t="uic8",Pt="si16",Dt="si32",Ct="ur16",xt="ui32",Ut="fl32",Bt="fl64",Ft=ut+ct.length,Gt=Object.prototype.toString;function jt(r){var a=r.length*.75,i=r.length,l,f=0,u,h,E,b;r[r.length-1]==="="&&(a--,r[r.length-2]==="="&&a--);var w=new ArrayBuffer(a),R=new Uint8Array(w);for(l=0;l<i;l+=4)u=me.indexOf(r[l]),h=me.indexOf(r[l+1]),E=me.indexOf(r[l+2]),b=me.indexOf(r[l+3]),R[f++]=u<<2|h>>4,R[f++]=(h&15)<<4|E>>2,R[f++]=(E&3)<<6|b&63;return w}function ft(r){var a=new Uint8Array(r),i="",l;for(l=0;l<a.length;l+=3)i+=me[a[l]>>2],i+=me[(a[l]&3)<<4|a[l+1]>>4],i+=me[(a[l+1]&15)<<2|a[l+2]>>6],i+=me[a[l+2]&63];return a.length%3===2?i=i.substring(0,i.length-1)+"=":a.length%3===1&&(i=i.substring(0,i.length-2)+"=="),i}function Qr(r,a){var i="";if(r&&(i=Gt.call(r)),r&&(i==="[object ArrayBuffer]"||r.buffer&&Gt.call(r.buffer)==="[object ArrayBuffer]")){var l,f=He;r instanceof ArrayBuffer?(l=r,f+=ct):(l=r.buffer,i==="[object Int8Array]"?f+=Lt:i==="[object Uint8Array]"?f+=Mt:i==="[object Uint8ClampedArray]"?f+=$t:i==="[object Int16Array]"?f+=Pt:i==="[object Uint16Array]"?f+=Ct:i==="[object Int32Array]"?f+=Dt:i==="[object Uint32Array]"?f+=xt:i==="[object Float32Array]"?f+=Ut:i==="[object Float64Array]"?f+=Bt:a(new Error("Failed to get type for BinaryArray"))),a(f+ft(l))}else if(i==="[object Blob]"){var u=new FileReader;u.onload=function(){var h=Jr+r.type+"~"+ft(this.result);a(He+lt+h)},u.readAsArrayBuffer(r)}else try{a(JSON.stringify(r))}catch(h){console.error("Couldn't convert value into a JSON string: ",r),a(null,h)}}function Zr(r){if(r.substring(0,ut)!==He)return JSON.parse(r);var a=r.substring(Ft),i=r.substring(ut,Ft),l;if(i===lt&&Ot.test(a)){var f=a.match(Ot);l=f[1],a=a.substring(f[0].length)}var u=jt(a);switch(i){case ct:return u;case lt:return N([u],{type:l});case Lt:return new Int8Array(u);case Mt:return new Uint8Array(u);case $t:return new Uint8ClampedArray(u);case Pt:return new Int16Array(u);case Ct:return new Uint16Array(u);case Dt:return new Int32Array(u);case xt:return new Uint32Array(u);case Ut:return new Float32Array(u);case Bt:return new Float64Array(u);default:throw new Error("Unkown type: "+i)}}var dt={serialize:Qr,deserialize:Zr,stringToBuffer:jt,bufferToString:ft};function kt(r,a,i,l){r.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,l)}function en(r){var a=this,i={db:null};if(r)for(var l in r)i[l]=typeof r[l]!="string"?r[l].toString():r[l];var f=new I(function(u,h){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(E){return h(E)}i.db.transaction(function(E){kt(E,i,function(){a._dbInfo=i,u()},function(b,w){h(w)})},h)});return i.serializer=dt,f}function ve(r,a,i,l,f,u){r.executeSql(i,l,f,function(h,E){E.code===E.SYNTAX_ERR?h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(b,w){w.rows.length?u(b,E):kt(b,a,function(){b.executeSql(i,l,f,u)},u)},u):u(h,E)},u)}function tn(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName+" WHERE key = ? LIMIT 1",[r],function(b,w){var R=w.rows.length?w.rows.item(0).value:null;R&&(R=h.serializer.deserialize(R)),f(R)},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function rn(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT * FROM "+h.storeName,[],function(b,w){for(var R=w.rows,O=R.length,F=0;F<O;F++){var W=R.item(F),H=W.value;if(H&&(H=h.serializer.deserialize(H)),H=r(H,W.key,F+1),H!==void 0){f(H);return}}f()},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function Wt(r,a,i,l){var f=this;r=B(r);var u=new I(function(h,E){f.ready().then(function(){a===void 0&&(a=null);var b=a,w=f._dbInfo;w.serializer.serialize(a,function(R,O){O?E(O):w.db.transaction(function(F){ve(F,w,"INSERT OR REPLACE INTO "+w.storeName+" (key, value) VALUES (?, ?)",[r,R],function(){h(b)},function(W,H){E(H)})},function(F){if(F.code===F.QUOTA_ERR){if(l>0){h(Wt.apply(f,[r,b,i,l-1]));return}E(F)}})})}).catch(E)});return T(u,i),u}function nn(r,a,i){return Wt.apply(this,[r,a,i,1])}function on(r,a){var i=this;r=B(r);var l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"DELETE FROM "+h.storeName+" WHERE key = ?",[r],function(){f()},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function an(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"DELETE FROM "+u.storeName,[],function(){l()},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function sn(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT COUNT(key) as c FROM "+u.storeName,[],function(E,b){var w=b.rows.item(0).c;l(w)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function un(r,a){var i=this,l=new I(function(f,u){i.ready().then(function(){var h=i._dbInfo;h.db.transaction(function(E){ve(E,h,"SELECT key FROM "+h.storeName+" WHERE id = ? LIMIT 1",[r+1],function(b,w){var R=w.rows.length?w.rows.item(0).key:null;f(R)},function(b,w){u(w)})})}).catch(u)});return T(l,a),l}function cn(r){var a=this,i=new I(function(l,f){a.ready().then(function(){var u=a._dbInfo;u.db.transaction(function(h){ve(h,u,"SELECT key FROM "+u.storeName,[],function(E,b){for(var w=[],R=0;R<b.rows.length;R++)w.push(b.rows.item(R).key);l(w)},function(E,b){f(b)})})}).catch(f)});return T(i,r),i}function ln(r){return new I(function(a,i){r.transaction(function(l){l.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,u){for(var h=[],E=0;E<u.rows.length;E++)h.push(u.rows.item(E).name);a({db:r,storeNames:h})},function(f,u){i(u)})},function(l){i(l)})})}function fn(r,a){a=L.apply(this,arguments);var i=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||i.name,r.storeName=r.storeName||i.storeName);var l=this,f;return r.name?f=new I(function(u){var h;r.name===i.name?h=l._dbInfo.db:h=openDatabase(r.name,"","",0),r.storeName?u({db:h,storeNames:[r.storeName]}):u(ln(h))}).then(function(u){return new I(function(h,E){u.db.transaction(function(b){function w(W){return new I(function(H,q){b.executeSql("DROP TABLE IF EXISTS "+W,[],function(){H()},function(X,ue){q(ue)})})}for(var R=[],O=0,F=u.storeNames.length;O<F;O++)R.push(w(u.storeNames[O]));I.all(R).then(function(){h()}).catch(function(W){E(W)})},function(b){E(b)})})}):f=I.reject("Invalid arguments"),T(f,a),f}var dn={_driver:"webSQLStorage",_initStorage:en,_support:zr(),iterate:rn,getItem:tn,setItem:nn,removeItem:on,clear:an,length:sn,key:un,keys:cn,dropInstance:fn};function hn(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Yt(r,a){var i=r.name+"/";return r.storeName!==a.storeName&&(i+=r.storeName+"/"),i}function pn(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch{return!0}}function mn(){return!pn()||localStorage.length>0}function vn(r){var a=this,i={};if(r)for(var l in r)i[l]=r[l];return i.keyPrefix=Yt(r,a._defaultConfig),mn()?(a._dbInfo=i,i.serializer=dt,I.resolve()):I.reject()}function gn(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var u=localStorage.key(f);u.indexOf(l)===0&&localStorage.removeItem(u)}});return T(i,r),i}function yn(r,a){var i=this;r=B(r);var l=i.ready().then(function(){var f=i._dbInfo,u=localStorage.getItem(f.keyPrefix+r);return u&&(u=f.serializer.deserialize(u)),u});return T(l,a),l}function En(r,a){var i=this,l=i.ready().then(function(){for(var f=i._dbInfo,u=f.keyPrefix,h=u.length,E=localStorage.length,b=1,w=0;w<E;w++){var R=localStorage.key(w);if(R.indexOf(u)===0){var O=localStorage.getItem(R);if(O&&(O=f.serializer.deserialize(O)),O=r(O,R.substring(h),b++),O!==void 0)return O}}});return T(l,a),l}function _n(r,a){var i=this,l=i.ready().then(function(){var f=i._dbInfo,u;try{u=localStorage.key(r)}catch{u=null}return u&&(u=u.substring(f.keyPrefix.length)),u});return T(l,a),l}function In(r){var a=this,i=a.ready().then(function(){for(var l=a._dbInfo,f=localStorage.length,u=[],h=0;h<f;h++){var E=localStorage.key(h);E.indexOf(l.keyPrefix)===0&&u.push(E.substring(l.keyPrefix.length))}return u});return T(i,r),i}function bn(r){var a=this,i=a.keys().then(function(l){return l.length});return T(i,r),i}function wn(r,a){var i=this;r=B(r);var l=i.ready().then(function(){var f=i._dbInfo;localStorage.removeItem(f.keyPrefix+r)});return T(l,a),l}function Rn(r,a,i){var l=this;r=B(r);var f=l.ready().then(function(){a===void 0&&(a=null);var u=a;return new I(function(h,E){var b=l._dbInfo;b.serializer.serialize(a,function(w,R){if(R)E(R);else try{localStorage.setItem(b.keyPrefix+r,w),h(u)}catch(O){(O.name==="QuotaExceededError"||O.name==="NS_ERROR_DOM_QUOTA_REACHED")&&E(O),E(O)}})})});return T(f,i),f}function An(r,a){if(a=L.apply(this,arguments),r=typeof r!="function"&&r||{},!r.name){var i=this.config();r.name=r.name||i.name,r.storeName=r.storeName||i.storeName}var l=this,f;return r.name?f=new I(function(u){r.storeName?u(Yt(r,l._defaultConfig)):u(r.name+"/")}).then(function(u){for(var h=localStorage.length-1;h>=0;h--){var E=localStorage.key(h);E.indexOf(u)===0&&localStorage.removeItem(E)}}):f=I.reject("Invalid arguments"),T(f,a),f}var Sn={_driver:"localStorageWrapper",_initStorage:vn,_support:hn(),iterate:En,getItem:yn,setItem:Rn,removeItem:wn,clear:gn,length:bn,key:_n,keys:In,dropInstance:An},Nn=function(a,i){return a===i||typeof a=="number"&&typeof i=="number"&&isNaN(a)&&isNaN(i)},Tn=function(a,i){for(var l=a.length,f=0;f<l;){if(Nn(a[f],i))return!0;f++}return!1},Ht=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},Pe={},Kt={},Re={INDEXEDDB:qr,WEBSQL:dn,LOCALSTORAGE:Sn},On=[Re.INDEXEDDB._driver,Re.WEBSQL._driver,Re.LOCALSTORAGE._driver],Ke=["dropInstance"],ht=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ke),Ln={description:"",driver:On.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Mn(r,a){r[a]=function(){var i=arguments;return r.ready().then(function(){return r[a].apply(r,i)})}}function pt(){for(var r=1;r<arguments.length;r++){var a=arguments[r];if(a)for(var i in a)a.hasOwnProperty(i)&&(Ht(a[i])?arguments[0][i]=a[i].slice():arguments[0][i]=a[i])}return arguments[0]}var $n=function(){function r(a){p(this,r);for(var i in Re)if(Re.hasOwnProperty(i)){var l=Re[i],f=l._driver;this[i]=f,Pe[f]||this.defineDriver(l)}this._defaultConfig=pt({},Ln),this._config=pt({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return r.prototype.config=function(i){if((typeof i>"u"?"undefined":g(i))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var l in i){if(l==="storeName"&&(i[l]=i[l].replace(/\W/g,"_")),l==="version"&&typeof i[l]!="number")return new Error("Database version must be a number.");this._config[l]=i[l]}return"driver"in i&&i.driver?this.setDriver(this._config.driver):!0}else return typeof i=="string"?this._config[i]:this._config},r.prototype.defineDriver=function(i,l,f){var u=new I(function(h,E){try{var b=i._driver,w=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!i._driver){E(w);return}for(var R=ht.concat("_initStorage"),O=0,F=R.length;O<F;O++){var W=R[O],H=!Tn(Ke,W);if((H||i[W])&&typeof i[W]!="function"){E(w);return}}var q=function(){for(var De=function(Cn){return function(){var xn=new Error("Method "+Cn+" is not implemented by the current driver"),Vt=I.reject(xn);return T(Vt,arguments[arguments.length-1]),Vt}},mt=0,Dn=Ke.length;mt<Dn;mt++){var vt=Ke[mt];i[vt]||(i[vt]=De(vt))}};q();var X=function(De){Pe[b]&&console.info("Redefining LocalForage driver: "+b),Pe[b]=i,Kt[b]=De,h()};"_support"in i?i._support&&typeof i._support=="function"?i._support().then(X,E):X(!!i._support):X(!0)}catch(ue){E(ue)}});return P(u,l,f),u},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(i,l,f){var u=Pe[i]?I.resolve(Pe[i]):I.reject(new Error("Driver not found."));return P(u,l,f),u},r.prototype.getSerializer=function(i){var l=I.resolve(dt);return P(l,i),l},r.prototype.ready=function(i){var l=this,f=l._driverSet.then(function(){return l._ready===null&&(l._ready=l._initDriver()),l._ready});return P(f,i,i),f},r.prototype.setDriver=function(i,l,f){var u=this;Ht(i)||(i=[i]);var h=this._getSupportedDrivers(i);function E(){u._config.driver=u.driver()}function b(O){return u._extend(O),E(),u._ready=u._initStorage(u._config),u._ready}function w(O){return function(){var F=0;function W(){for(;F<O.length;){var H=O[F];return F++,u._dbInfo=null,u._ready=null,u.getDriver(H).then(b).catch(W)}E();var q=new Error("No available storage method found.");return u._driverSet=I.reject(q),u._driverSet}return W()}}var R=this._driverSet!==null?this._driverSet.catch(function(){return I.resolve()}):I.resolve();return this._driverSet=R.then(function(){var O=h[0];return u._dbInfo=null,u._ready=null,u.getDriver(O).then(function(F){u._driver=F._driver,E(),u._wrapLibraryMethodsWithReady(),u._initDriver=w(h)})}).catch(function(){E();var O=new Error("No available storage method found.");return u._driverSet=I.reject(O),u._driverSet}),P(this._driverSet,l,f),this._driverSet},r.prototype.supports=function(i){return!!Kt[i]},r.prototype._extend=function(i){pt(this,i)},r.prototype._getSupportedDrivers=function(i){for(var l=[],f=0,u=i.length;f<u;f++){var h=i[f];this.supports(h)&&l.push(h)}return l},r.prototype._wrapLibraryMethodsWithReady=function(){for(var i=0,l=ht.length;i<l;i++)Mn(this,ht[i])},r.prototype.createInstance=function(i){return new r(i)},r}(),Pn=new $n;s.exports=Pn},{3:3}]},{},[4])(4)})});var jr=Qt((ot,Gr)=>{(function(e,t){typeof ot=="object"&&typeof Gr<"u"?t(ot):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:ot,function(e){"use strict";var t="localforage-driver-memory";function n(d){var _=typeof Symbol=="function"&&d[Symbol.iterator],A=0;return _?_.call(d):{next:function(){return d&&A>=d.length&&(d=void 0),{value:d&&d[A++],done:!d}}}}function o(d,_){d=d||[],_=_||{};try{return new Blob(d,_)}catch(C){if(C.name!=="TypeError")throw C;for(var A=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,M=new A,$=0;$<d.length;$+=1)M.append(d[$]);return M.getBlob(_.type)}}var s=/^~~local_forage_type~([^~]+)~/,c=9,g=c+4,p=Object.prototype.toString;function m(d){var _=d.length*.75,A=d.length;d[d.length-1]==="="&&(_--,d[d.length-2]==="="&&_--);for(var M=new ArrayBuffer(_),$=new Uint8Array(M),C=0,k=0;C<A;C+=4){var Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C]),we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+1]),Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+2]),$e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(d[C+3]);$[k++]=Z<<2|we>>4,$[k++]=(we&15)<<4|Ee>>2,$[k++]=(Ee&3)<<6|$e&63}return M}function v(d){for(var _=new Uint8Array(d),A="",M=0;M<_.length;M+=3)A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M]>>2],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M]&3)<<4|_[M+1]>>4],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(_[M+1]&15)<<2|_[M+2]>>6],A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_[M+2]&63];return _.length%3===2?A=A.substring(0,A.length-1)+"=":_.length%3===1&&(A=A.substring(0,A.length-2)+"=="),A}function y(d,_){var A="";if(d&&(A=p.call(d)),d&&(A==="[object ArrayBuffer]"||d.buffer&&p.call(d.buffer)==="[object ArrayBuffer]")){var M=void 0,$="__lfsc__:";d instanceof ArrayBuffer?(M=d,$+="arbf"):(M=d.buffer,A==="[object Int8Array]"?$+="si08":A==="[object Uint8Array]"?$+="ui08":A==="[object Uint8ClampedArray]"?$+="uic8":A==="[object Int16Array]"?$+="si16":A==="[object Uint16Array]"?$+="ur16":A==="[object Int32Array]"?$+="si32":A==="[object Uint32Array]"?$+="ui32":A==="[object Float32Array]"?$+="fl32":A==="[object Float64Array]"?$+="fl64":_(new Error("Failed to get type for BinaryArray"))),_($+v(M))}else if(A==="[object Blob]"){var C=new FileReader;C.onload=function(){var k="~~local_forage_type~"+d.type+"~"+v(this.result);_("__lfsc__:blob"+k)},C.readAsArrayBuffer(d)}else try{_(JSON.stringify(d))}catch(k){console.error("Couldn't convert value into a JSON string: ",d),_(null,k)}}function N(d){if(d.substring(0,c)!=="__lfsc__:")return JSON.parse(d);var _=d.substring(g),A=d.substring(c,g),M;if(A==="blob"&&s.test(_)){var $=_.match(s);M=$[1],_=_.substring($[0].length)}var C=m(_);switch(A){case"arbf":return C;case"blob":return o([C],{type:M});case"si08":return new Int8Array(C);case"ui08":return new Uint8Array(C);case"uic8":return new Uint8ClampedArray(C);case"si16":return new Int16Array(C);case"ur16":return new Uint16Array(C);case"si32":return new Int32Array(C);case"ui32":return new Uint32Array(C);case"fl32":return new Float32Array(C);case"fl64":return new Float64Array(C);default:throw new Error("Unkown type: "+A)}}function I(d){var _,A;if(d===null||typeof d!="object"||"isActiveClone"in d)return d;var M=d instanceof Date?new Date(d):d.constructor();try{for(var $=n(Object.keys(d)),C=$.next();!C.done;C=$.next()){var k=C.value;Object.prototype.hasOwnProperty.call(d,k)&&(d.isActiveClone=null,M[k]=I(d[k]),delete d.isActiveClone)}}catch(Z){_={error:Z}}finally{try{C&&!C.done&&(A=$.return)&&A.call($)}finally{if(_)throw _.error}}return M}function T(d,_){return(d.name||_.name)+"/"+(d.storeName||_.storeName)+"/"}function P(d,_){_&&d.then(function(A){_(null,A)},function(A){_(A)})}function B(){for(var d=[],_=0;_<arguments.length;_++)d[_]=arguments[_];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function L(d,_){var A=this;if(_=B.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var M=this.config();d.name=d.name||M.name,d.storeName=d.storeName||M.storeName}var $;return d.name?$=new Promise(function(C){d.storeName?C(T(d,A._defaultConfig)):C(d.name+"/")}):$=Promise.reject("Invalid arguments"),{promise:$,callback:_}}function G(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}var J={bufferToString:v,deserialize:N,serialize:y,stringToBuffer:m},D={},pe=function(){function d(_){this.kp=_,this.data={}}return d.resolve=function(_){return D[_]||(D[_]=new d(_)),D[_]},d.prototype.clear=function(){this.data={}},d.prototype.drop=function(){this.clear(),delete D[this.kp]},d.prototype.get=function(_){return this.data[_]},d.prototype.key=function(_){return this.keys()[_]},d.prototype.keys=function(){return Object.keys(this.data)},d.prototype.rm=function(_){delete this.data[_]},d.prototype.set=function(_,A){this.data[_]=A},d}();function ne(d){var _=d?I(d):{},A=T(_,this._defaultConfig),M=pe.resolve(A);return this._dbInfo=_,this._dbInfo.serializer=J,this._dbInfo.keyPrefix=A,this._dbInfo.mStore=M,Promise.resolve()}function S(d){var _=this,A=this.ready().then(function(){_._dbInfo.mStore.clear()});return P(A,d),A}function j(d,_){var A=L.apply(this,arguments),M=A.promise,$=A.callback,C=M.then(function(k){pe.resolve(k).drop()});return P(C,$),M}function U(d,_){var A=this;d=G(d);var M=this.ready().then(function(){var $=A._dbInfo.mStore.get(d);return $==null?null:A._dbInfo.serializer.deserialize($)});return P(M,_),M}function Y(d,_){var A=this,M=this.ready().then(function(){for(var $=A._dbInfo.mStore,C=$.keys(),k=0;k<C.length;k++){var Z=$.get(C[k]);if(Z&&(Z=A._dbInfo.serializer.deserialize(Z)),Z=d(Z,C[k],k+1),Z!==void 0)return Z}});return P(M,_),M}function Q(d,_){var A=this,M=this.ready().then(function(){var $;try{$=A._dbInfo.mStore.key(d),$===void 0&&($=null)}catch{$=null}return $});return P(M,_),M}function ie(d){var _=this,A=this.ready().then(function(){return _._dbInfo.mStore.keys()});return P(A,d),A}function ae(d){var _=this.keys().then(function(A){return A.length});return P(_,d),_}function se(d,_){var A=this;d=G(d);var M=this.ready().then(function(){A._dbInfo.mStore.rm(d)});return P(M,_),M}function ce(d,_,A){var M=this;d=G(d);var $=this.ready().then(function(){_===void 0&&(_=null);var C=_;return new Promise(function(k,Z){M._dbInfo.serializer.serialize(_,function(we,Ee){if(Ee)Z(Ee);else try{M._dbInfo.mStore.set(d,we),k(C)}catch($e){Z($e)}})})});return P($,A),$}var ye=!0;e._support=ye,e._driver=t,e._initStorage=ne,e.clear=S,e.dropInstance=j,e.getItem=U,e.iterate=Y,e.key=Q,e.keys=ie,e.length=ae,e.removeItem=se,e.setItem=ce,Object.defineProperty(e,"__esModule",{value:!0})})});var Go={};Zt(Go,{default:()=>Fo});var le=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(le||{}),Se=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(Se||{}),Ne=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(Ne||{}),x=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e))(x||{}),fe=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(fe||{}),_e=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(_e||{}),rr=(e=>(e.Harmony="HARMONY",e))(rr||{});var Wn=Object.create,nt=Object.defineProperty,Yn=Object.defineProperties,Hn=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertyNames,nr=Object.getOwnPropertySymbols,Xn=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable,ir=(e,t,n)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yr=(e,t)=>{for(var n in t||(t={}))gr.call(t,n)&&ir(e,n,t[n]);if(nr)for(var n of nr(t))qn.call(t,n)&&ir(e,n,t[n]);return e},zn=(e,t)=>Yn(e,Kn(t)),Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qn=(e,t)=>{for(var n in t)nt(e,n,{get:t[n],enumerable:!0})},Zn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Vn(t))!gr.call(e,s)&&s!==n&&nt(e,s,{get:()=>t[s],enumerable:!(o=Hn(t,s))||o.enumerable});return e},ei=(e,t,n)=>(n=e!=null?Wn(Xn(e)):{},Zn(t||!e||!e.__esModule?nt(n,"default",{value:e,enumerable:!0}):n,e)),de=(e,t,n)=>new Promise((o,s)=>{var c=m=>{try{p(n.next(m))}catch(v){s(v)}},g=m=>{try{p(n.throw(m))}catch(v){s(v)}},p=m=>m.done?o(m.value):Promise.resolve(m.value).then(c,g);p((n=n.apply(e,t)).next())}),ti=Jn((e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty,o="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(o=!1));function c(v,y,N){this.fn=v,this.context=y,this.once=N||!1}function g(v,y,N,I,T){if(typeof N!="function")throw new TypeError("The listener must be a function");var P=new c(N,I||v,T),B=o?o+y:y;return v._events[B]?v._events[B].fn?v._events[B]=[v._events[B],P]:v._events[B].push(P):(v._events[B]=P,v._eventsCount++),v}function p(v,y){--v._eventsCount===0?v._events=new s:delete v._events[y]}function m(){this._events=new s,this._eventsCount=0}m.prototype.eventNames=function(){var v=[],y,N;if(this._eventsCount===0)return v;for(N in y=this._events)n.call(y,N)&&v.push(o?N.slice(1):N);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(y)):v},m.prototype.listeners=function(v){var y=o?o+v:v,N=this._events[y];if(!N)return[];if(N.fn)return[N.fn];for(var I=0,T=N.length,P=new Array(T);I<T;I++)P[I]=N[I].fn;return P},m.prototype.listenerCount=function(v){var y=o?o+v:v,N=this._events[y];return N?N.fn?1:N.length:0},m.prototype.emit=function(v,y,N,I,T,P){var B=o?o+v:v;if(!this._events[B])return!1;var L=this._events[B],G=arguments.length,J,D;if(L.fn){switch(L.once&&this.removeListener(v,L.fn,void 0,!0),G){case 1:return L.fn.call(L.context),!0;case 2:return L.fn.call(L.context,y),!0;case 3:return L.fn.call(L.context,y,N),!0;case 4:return L.fn.call(L.context,y,N,I),!0;case 5:return L.fn.call(L.context,y,N,I,T),!0;case 6:return L.fn.call(L.context,y,N,I,T,P),!0}for(D=1,J=new Array(G-1);D<G;D++)J[D-1]=arguments[D];L.fn.apply(L.context,J)}else{var pe=L.length,ne;for(D=0;D<pe;D++)switch(L[D].once&&this.removeListener(v,L[D].fn,void 0,!0),G){case 1:L[D].fn.call(L[D].context);break;case 2:L[D].fn.call(L[D].context,y);break;case 3:L[D].fn.call(L[D].context,y,N);break;case 4:L[D].fn.call(L[D].context,y,N,I);break;default:if(!J)for(ne=1,J=new Array(G-1);ne<G;ne++)J[ne-1]=arguments[ne];L[D].fn.apply(L[D].context,J)}}return!0},m.prototype.on=function(v,y,N){return g(this,v,y,N,!1)},m.prototype.once=function(v,y,N){return g(this,v,y,N,!0)},m.prototype.removeListener=function(v,y,N,I){var T=o?o+v:v;if(!this._events[T])return this;if(!y)return p(this,T),this;var P=this._events[T];if(P.fn)P.fn===y&&(!I||P.once)&&(!N||P.context===N)&&p(this,T);else{for(var B=0,L=[],G=P.length;B<G;B++)(P[B].fn!==y||I&&!P[B].once||N&&P[B].context!==N)&&L.push(P[B]);L.length?this._events[T]=L.length===1?L[0]:L:p(this,T)}return this},m.prototype.removeAllListeners=function(v){var y;return v?(y=o?o+v:v,this._events[y]&&p(this,y)):(this._events=new s,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prefixed=o,m.EventEmitter=m,typeof t<"u"&&(t.exports=m)});function ri(e){let t={exports:{}};return e(t,t.exports),t.exports}var ni=Number.MAX_SAFE_INTEGER||9007199254740991,_t={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:ni,MAX_SAFE_COMPONENT_LENGTH:16},ii=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},K=ii,We=ri(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=_t,o=(t=e.exports={}).re=[],s=t.src=[],c=t.t={},g=0,p=(m,v,y)=>{let N=g++;K(N,v),c[m]=N,s[N]=v,o[N]=new RegExp(v,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","[0-9]+"),p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),p("MAINVERSION",`(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})\\.(${s[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})\\.(${s[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${s[c.NUMERICIDENTIFIER]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${s[c.NUMERICIDENTIFIERLOOSE]}|${s[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${s[c.PRERELEASEIDENTIFIER]}(?:\\.${s[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${s[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER","[0-9A-Za-z-]+"),p("BUILD",`(?:\\+(${s[c.BUILDIDENTIFIER]}(?:\\.${s[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${s[c.MAINVERSION]}${s[c.PRERELEASE]}?${s[c.BUILD]}?`),p("FULL",`^${s[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${s[c.MAINVERSIONLOOSE]}${s[c.PRERELEASELOOSE]}?${s[c.BUILD]}?`),p("LOOSE",`^${s[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${s[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${s[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:\\.(${s[c.XRANGEIDENTIFIER]})(?:${s[c.PRERELEASE]})?${s[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[c.XRANGEIDENTIFIERLOOSE]})(?:${s[c.PRERELEASELOOSE]})?${s[c.BUILD]}?)?)?`),p("XRANGE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${s[c.GTLT]}\\s*${s[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",s[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${s[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${s[c.LONETILDE]}${s[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${s[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${s[c.LONECARET]}${s[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${s[c.LONECARET]}${s[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${s[c.GTLT]}\\s*(${s[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${s[c.GTLT]}\\s*(${s[c.LOOSEPLAIN]}|${s[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${s[c.XRANGEPLAIN]})\\s+-\\s+(${s[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${s[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0.0.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),or=/^[0-9]+$/,Er=(e,t)=>{let n=or.test(e),o=or.test(t);return n&&o&&(e=+e,t=+t),e===t?0:n&&!o?-1:o&&!n?1:e<t?-1:1},oi=(e,t)=>Er(t,e),ai={compareIdentifiers:Er,rcompareIdentifiers:oi},{MAX_LENGTH:ar,MAX_SAFE_INTEGER:Ve}=_t,{re:sr,t:ur}=We,{compareIdentifiers:Ue}=ai,ee=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>ar)throw new TypeError(`version is longer than ${ar} characters`);K("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?sr[ur.LOOSE]:sr[ur.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ve||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ve||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ve||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<Ve)return s}return o}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(K("SemVer.compare",this.version,this.options,e),!(e instanceof ee)){if(typeof e=="string"&&e===this.version)return 0;e=new ee(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ee||(e=new ee(e,this.options)),Ue(this.major,e.major)||Ue(this.minor,e.minor)||Ue(this.patch,e.patch)}comparePre(e){if(e instanceof ee||(e=new ee(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],o=e.prerelease[t];if(K("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Ue(n,o)}while(++t)}compareBuild(e){e instanceof ee||(e=new ee(e,this.options));let t=0;do{let n=this.build[t],o=e.build[t];if(K("prerelease compare",t,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n!==o)return Ue(n,o)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},si=(e,t,n)=>new ee(e,n).compare(new ee(t,n)),Me=si,ui=(e,t,n)=>Me(e,t,n)===0,ci=ui,li=(e,t,n)=>Me(e,t,n)!==0,fi=li,di=(e,t,n)=>Me(e,t,n)>0,hi=di,pi=(e,t,n)=>Me(e,t,n)>=0,mi=pi,vi=(e,t,n)=>Me(e,t,n)<0,gi=vi,yi=(e,t,n)=>Me(e,t,n)<=0,Ei=yi,_i=(e,t,n,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return ci(e,n,o);case"!=":return fi(e,n,o);case">":return hi(e,n,o);case">=":return mi(e,n,o);case"<":return gi(e,n,o);case"<=":return Ei(e,n,o);default:throw new TypeError(`Invalid operator: ${t}`)}},gt=_i,Be=Symbol("SemVer ANY"),Ge=class{static get ANY(){return Be}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Ge){if(e.loose===!!t.loose)return e;e=e.value}K("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Be?this.value="":this.value=this.operator+this.semver.version,K("comp",this)}parse(e){let t=this.options.loose?cr[lr.COMPARATORLOOSE]:cr[lr.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ee(n[2],this.options.loose):this.semver=Be}toString(){return this.value}test(e){if(K("Comparator.test",e,this.options.loose),this.semver===Be||e===Be)return!0;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}return gt(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ge))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new Oe(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new Oe(this.value,t).test(e.semver);let n=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),o=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),s=this.semver.version===e.semver.version,c=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),g=gt(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),p=gt(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||o||s&&c||g||p}},{re:cr,t:lr}=We,Oe=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Oe)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Oe(e.raw,t);if(e instanceof Ge)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?re[te.HYPHENRANGELOOSE]:re[te.HYPHENRANGE];e=e.replace(n,Pi(this.options.includePrerelease)),K("hyphen replace",e),e=e.replace(re[te.COMPARATORTRIM],Ii),K("comparator trim",e,re[te.COMPARATORTRIM]),e=(e=(e=e.replace(re[te.TILDETRIM],bi)).replace(re[te.CARETTRIM],wi)).split(/\s+/).join(" ");let o=t?re[te.COMPARATORLOOSE]:re[te.COMPARATOR];return e.split(" ").map(s=>Ri(s,this.options)).join(" ").split(/\s+/).map(s=>$i(s,this.options)).filter(this.options.loose?s=>!!s.match(o):()=>!0).map(s=>new Ge(s,this.options))}intersects(e,t){if(!(e instanceof Oe))throw new TypeError("a Range is required");return this.set.some(n=>fr(n,t)&&e.set.some(o=>fr(o,t)&&n.every(s=>o.every(c=>s.intersects(c,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ee(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Di(this.set[t],e,this.options))return!0;return!1}},{re,t:te,comparatorTrimReplace:Ii,tildeTrimReplace:bi,caretTrimReplace:wi}=We,fr=(e,t)=>{let n=!0,o=e.slice(),s=o.pop();for(;n&&o.length;)n=o.every(c=>s.intersects(c,t)),s=o.pop();return n},Ri=(e,t)=>(K("comp",e,t),e=Ni(e,t),K("caret",e),e=Ai(e,t),K("tildes",e),e=Oi(e,t),K("xrange",e),e=Mi(e,t),K("stars",e),e),oe=e=>!e||e.toLowerCase()==="x"||e==="*",Ai=(e,t)=>e.trim().split(/\s+/).map(n=>Si(n,t)).join(" "),Si=(e,t)=>{let n=t.loose?re[te.TILDELOOSE]:re[te.TILDE];return e.replace(n,(o,s,c,g,p)=>{let m;return K("tilde",e,o,s,c,g,p),oe(s)?m="":oe(c)?m=`>=${s}.0.0 <${+s+1}.0.0-0`:oe(g)?m=`>=${s}.${c}.0 <${s}.${+c+1}.0-0`:p?(K("replaceTilde pr",p),m=`>=${s}.${c}.${g}-${p} <${s}.${+c+1}.0-0`):m=`>=${s}.${c}.${g} <${s}.${+c+1}.0-0`,K("tilde return",m),m})},Ni=(e,t)=>e.trim().split(/\s+/).map(n=>Ti(n,t)).join(" "),Ti=(e,t)=>{K("caret",e,t);let n=t.loose?re[te.CARETLOOSE]:re[te.CARET],o=t.includePrerelease?"-0":"";return e.replace(n,(s,c,g,p,m)=>{let v;return K("caret",e,s,c,g,p,m),oe(c)?v="":oe(g)?v=`>=${c}.0.0${o} <${+c+1}.0.0-0`:oe(p)?v=c==="0"?`>=${c}.${g}.0${o} <${c}.${+g+1}.0-0`:`>=${c}.${g}.0${o} <${+c+1}.0.0-0`:m?(K("replaceCaret pr",m),v=c==="0"?g==="0"?`>=${c}.${g}.${p}-${m} <${c}.${g}.${+p+1}-0`:`>=${c}.${g}.${p}-${m} <${c}.${+g+1}.0-0`:`>=${c}.${g}.${p}-${m} <${+c+1}.0.0-0`):(K("no pr"),v=c==="0"?g==="0"?`>=${c}.${g}.${p}${o} <${c}.${g}.${+p+1}-0`:`>=${c}.${g}.${p}${o} <${c}.${+g+1}.0-0`:`>=${c}.${g}.${p} <${+c+1}.0.0-0`),K("caret return",v),v})},Oi=(e,t)=>(K("replaceXRanges",e,t),e.split(/\s+/).map(n=>Li(n,t)).join(" ")),Li=(e,t)=>{e=e.trim();let n=t.loose?re[te.XRANGELOOSE]:re[te.XRANGE];return e.replace(n,(o,s,c,g,p,m)=>{K("xRange",e,o,s,c,g,p,m);let v=oe(c),y=v||oe(g),N=y||oe(p),I=N;return s==="="&&I&&(s=""),m=t.includePrerelease?"-0":"",v?o=s===">"||s==="<"?"<0.0.0-0":"*":s&&I?(y&&(g=0),p=0,s===">"?(s=">=",y?(c=+c+1,g=0,p=0):(g=+g+1,p=0)):s==="<="&&(s="<",y?c=+c+1:g=+g+1),s==="<"&&(m="-0"),o=`${s+c}.${g}.${p}${m}`):y?o=`>=${c}.0.0${m} <${+c+1}.0.0-0`:N&&(o=`>=${c}.${g}.0${m} <${c}.${+g+1}.0-0`),K("xRange return",o),o})},Mi=(e,t)=>(K("replaceStars",e,t),e.trim().replace(re[te.STAR],"")),$i=(e,t)=>(K("replaceGTE0",e,t),e.trim().replace(re[t.includePrerelease?te.GTE0PRE:te.GTE0],"")),Pi=e=>(t,n,o,s,c,g,p,m,v,y,N,I,T)=>`${n=oe(o)?"":oe(s)?`>=${o}.0.0${e?"-0":""}`:oe(c)?`>=${o}.${s}.0${e?"-0":""}`:g?`>=${n}`:`>=${n}${e?"-0":""}`} ${m=oe(v)?"":oe(y)?`<${+v+1}.0.0-0`:oe(N)?`<${v}.${+y+1}.0-0`:I?`<=${v}.${y}.${N}-${I}`:e?`<${v}.${y}.${+N+1}-0`:`<=${m}`}`.trim(),Di=(e,t,n)=>{for(let o=0;o<e.length;o++)if(!e[o].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let o=0;o<e.length;o++)if(K(e[o].semver),e[o].semver!==Ge.ANY&&e[o].semver.prerelease.length>0){let s=e[o].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0},Ci=(e,t,n)=>{try{t=new Oe(t,n)}catch(o){return!1}return t.test(e)},{MAX_LENGTH:xi}=_t,{re:dr,t:hr}=We,Ui=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ee)return e;if(typeof e!="string"||e.length>xi||!(t.loose?dr[hr.LOOSE]:dr[hr.FULL]).test(e))return null;try{return new ee(e,t)}catch(n){return null}},Bi=Ui,{re:Xe,t:qe}=We,Fi=(e,t)=>{if(e instanceof ee)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let n=null;if((t=t||{}).rtl){let o;for(;(o=Xe[qe.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),Xe[qe.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;Xe[qe.COERCERTL].lastIndex=-1}else n=e.match(Xe[qe.COERCE]);return n===null?null:Bi(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Gi(e){return String.fromCharCode(parseInt(e.slice(1),16))}function ji(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function ki(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,Gi))}function Wi(e){return decodeURIComponent(Array.from(atob(e),ji).join(""))}function _r(e){return ki(JSON.stringify(e))}function Yi(e){return JSON.parse(Wi(e))}function Fe(e){return typeof e=="undefined"}function Hi(e){return e===null}function Ir(e){return Hi(e)||Fe(e)}function Ki(e){return Ir(e)?!1:!Fe(e.jsonrpc)&&!Fe(e.id)&&(!Fe(e.result)||!Fe(e.error))}function Vi(e){return Ir(e)?!1:typeof e=="number"&&Object.values(Ne).includes(e)}function yt(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var z={};function br(e,t){return Object.assign(z,t),e}var Xi={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},he=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,he.prototype)}},Le=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Vi(t)?t:Ne.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,Le.prototype)}},Ye=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},it=class extends Error{constructor(e,t,n,o){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=o,this.__proto__=Error,Object.setPrototypeOf(this,it.prototype)}},Ze=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function qi(){return new he(le.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function wr(){return new he(le.ModalNotReady,"Modal is not ready.")}function zi(){return new he(le.MalformedResponse,"Response from the Magic iframe is malformed.")}function Ji(e){return new he(le.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Qi(e){let t=`Some extensions are incompatible with \`${z.sdkName}@${z.version}\`:`;return e.filter(n=>typeof n.compat!="undefined"&&n.compat!==null).forEach(n=>{let o=n.compat[z.sdkName];typeof o=="string"?t+=`
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";var Magic=(()=>{var OK=Object.create;var hl=Object.defineProperty;var RK=Object.getOwnPropertyDescriptor;var IK=Object.getOwnPropertyNames,RS=Object.getOwnPropertySymbols,CK=Object.getPrototypeOf,CS=Object.prototype.hasOwnProperty,TK=Object.prototype.propertyIsEnumerable;var IS=(e,t,r)=>t in e?hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,TS=(e,t)=>{for(var r in t||(t={}))CS.call(t,r)&&IS(e,r,t[r]);if(RS)for(var r of RS(t))TK.call(t,r)&&IS(e,r,t[r]);return e};var dl=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var _t=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sr=(e,t)=>{for(var r in t)hl(e,r,{get:t[r],enumerable:!0})},tp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of IK(t))!CS.call(e,i)&&i!==r&&hl(e,i,{get:()=>t[i],enumerable:!(n=RK(t,i))||n.enumerable});return e},rr=(e,t,r)=>(tp(e,t,"default"),r&&tp(r,t,"default")),Hr=(e,t,r)=>(r=e!=null?OK(CK(e)):{},tp(t||!e||!e.__esModule?hl(r,"default",{value:e,enumerable:!0}):r,e)),Pt=e=>tp(hl({},"__esModule",{value:!0}),e);var Wu=(e,t,r)=>new Promise((n,i)=>{var o=v=>{try{c(r.next(v))}catch(y){i(y)}},a=v=>{try{c(r.throw(v))}catch(y){i(y)}},c=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,a);c((r=r.apply(e,t)).next())});var PS=E(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.getLocalStorage=ur.getLocalStorageOrThrow=ur.getCrypto=ur.getCryptoOrThrow=ur.getLocation=ur.getLocationOrThrow=ur.getNavigator=ur.getNavigatorOrThrow=ur.getDocument=ur.getDocumentOrThrow=ur.getFromWindowOrThrow=ur.getFromWindow=void 0;function fa(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}ur.getFromWindow=fa;function $u(e){let t=fa(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}ur.getFromWindowOrThrow=$u;function kK(){return $u("document")}ur.getDocumentOrThrow=kK;function PK(){return fa("document")}ur.getDocument=PK;function NK(){return $u("navigator")}ur.getNavigatorOrThrow=NK;function qK(){return fa("navigator")}ur.getNavigator=qK;function LK(){return $u("location")}ur.getLocationOrThrow=LK;function BK(){return fa("location")}ur.getLocation=BK;function DK(){return $u("crypto")}ur.getCryptoOrThrow=DK;function jK(){return fa("crypto")}ur.getCrypto=jK;function FK(){return $u("localStorage")}ur.getLocalStorageOrThrow=FK;function UK(){return fa("localStorage")}ur.getLocalStorage=UK});var qS=E(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.getWindowMetadata=void 0;var NS=PS();function HK(){let e,t;try{e=NS.getDocumentOrThrow(),t=NS.getLocationOrThrow()}catch{return null}function r(){let M=e.getElementsByTagName("link"),S=[];for(let R=0;R<M.length;R++){let C=M[R],B=C.getAttribute("rel");if(B&&B.toLowerCase().indexOf("icon")>-1){let N=C.getAttribute("href");if(N)if(N.toLowerCase().indexOf("https:")===-1&&N.toLowerCase().indexOf("http:")===-1&&N.indexOf("//")!==0){let q=t.protocol+"//"+t.host;if(N.indexOf("/")===0)q+=N;else{let H=t.pathname.split("/");H.pop(),q+=H.join("/")+"/"+N}S.push(q)}else if(N.indexOf("//")===0){let q=t.protocol+N;S.push(q)}else S.push(N)}}return S}function n(...M){let S=e.getElementsByTagName("meta");for(let R=0;R<S.length;R++){let C=S[R],B=["itemprop","property","name"].map(N=>C.getAttribute(N)).filter(N=>N?M.includes(N):!1);if(B.length&&B){let N=C.getAttribute("content");if(N)return N}}return""}function i(){let M=n("name","og:site_name","og:title","twitter:title");return M||(M=e.title),M}function o(){return n("description","og:description","twitter:description","keywords")}let a=i(),c=o(),v=t.origin,y=r();return{description:c,url:v,icons:y,name:a}}rp.getWindowMetadata=HK});var LS=E(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.getLocalStorage=fr.getLocalStorageOrThrow=fr.getCrypto=fr.getCryptoOrThrow=fr.getLocation=fr.getLocationOrThrow=fr.getNavigator=fr.getNavigatorOrThrow=fr.getDocument=fr.getDocumentOrThrow=fr.getFromWindowOrThrow=fr.getFromWindow=void 0;function ca(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}fr.getFromWindow=ca;function Ku(e){let t=ca(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}fr.getFromWindowOrThrow=Ku;function WK(){return Ku("document")}fr.getDocumentOrThrow=WK;function zK(){return ca("document")}fr.getDocument=zK;function VK(){return Ku("navigator")}fr.getNavigatorOrThrow=VK;function $K(){return ca("navigator")}fr.getNavigator=$K;function KK(){return Ku("location")}fr.getLocationOrThrow=KK;function GK(){return ca("location")}fr.getLocation=GK;function ZK(){return Ku("crypto")}fr.getCryptoOrThrow=ZK;function YK(){return ca("crypto")}fr.getCrypto=YK;function JK(){return Ku("localStorage")}fr.getLocalStorageOrThrow=JK;function QK(){return ca("localStorage")}fr.getLocalStorage=QK});function FS(e){return e?jS(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new iG:typeof navigator<"u"?jS(navigator.userAgent):cG()}function uG(e){return e!==""&&aG.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function jS(e){var t=uG(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new nG;var i=n[1]&&n[1].split(/[._]/).slice(0,3);i?i.length<BS&&(i=XK(i,lG(BS-i.length))):i=[];var o=i.join("."),a=fG(e),c=sG.exec(e);return c&&c[1]?new rG(r,o,a,c[1]):new eG(r,o,a)}function fG(e){for(var t=0,r=DS.length;t<r;t++){var n=DS[t],i=n[0],o=n[1],a=o.exec(e);if(a)return i}return null}function cG(){var e=typeof process<"u"&&process.version;return e?new tG(process.version.slice(1)):null}function lG(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var XK,eG,tG,rG,nG,iG,oG,sG,BS,aG,DS,US=_t(()=>{XK=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,c=o.length;a<c;a++,i++)n[i]=o[a];return n},eG=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),tG=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e}(),rG=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),nG=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),iG=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),oG=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,sG=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,BS=3,aG=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",oG]],DS=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});function pl(e){return FS(e)}function np(){let e=pl();return e&&e.os?e.os:void 0}function WS(){let e=np();return e?e.toLowerCase().includes("android"):!1}function zS(){let e=np();return e?e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function iy(){return np()?WS()||zS():!1}function VS(){let e=pl();return e&&e.name?e.name.toLowerCase()==="node":!1}function oy(){return!VS()&&!!$S()}function ip(){return HS.getWindowMetadata()}var HS,gr,sy,hG,dG,pG,vG,$S,mG,ay,gG,bG,yG,vl,uy=_t(()=>{HS=Hr(qS()),gr=Hr(LS());US();sy=gr.getFromWindow,hG=gr.getFromWindowOrThrow,dG=gr.getDocumentOrThrow,pG=gr.getDocument,vG=gr.getNavigatorOrThrow,$S=gr.getNavigator,mG=gr.getLocationOrThrow,ay=gr.getLocation,gG=gr.getCryptoOrThrow,bG=gr.getCrypto,yG=gr.getLocalStorageOrThrow,vl=gr.getLocalStorage});function KS(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e)}catch{return e}}function GS(e){return typeof e=="string"?e:JSON.stringify(e)}var ZS=_t(()=>{});var fy,cy,ly=_t(()=>{ZS();fy=KS,cy=GS});function ml(e,t){let r=cy(t),n=vl();n&&n.setItem(e,r)}function gl(e){let t=null,r=null,n=vl();return n&&(r=n.getItem(e)),t=r&&fy(r),t}function bl(e){let t=vl();t&&t.removeItem(e)}var hy=_t(()=>{ly();uy()});function wG(e,t){let r=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${r}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function xG(e){let t=e.href.split("?")[0];ml(yl,Object.assign(Object.assign({},e),{href:t}))}function YS(e,t){return e.filter(r=>r.name.toLowerCase().includes(t.toLowerCase()))[0]}function MG(e,t){let r=e;return t&&(r=t.map(n=>YS(e,n)).filter(Boolean)),r}var yl,JS=_t(()=>{hy();yl="WALLETCONNECT_DEEPLINK_CHOICE"});function SG(){return QS+"/api/v2/wallets"}function EG(){return QS+"/api/v2/dapps"}function XS(e,t="mobile"){var r;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:(r=e.image_url.sm)!==null&&r!==void 0?r:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}function AG(e,t="mobile"){return Object.values(e).filter(r=>!!r[t].universal||!!r[t].native).map(r=>XS(r,t))}var QS,eE=_t(()=>{QS="https://registry.walletconnect.com"});var tE={};Sr(tE,{detectEnv:()=>pl,detectOS:()=>np,formatIOSMobile:()=>wG,formatMobileRegistry:()=>AG,formatMobileRegistryEntry:()=>XS,getClientMeta:()=>ip,getCrypto:()=>bG,getCryptoOrThrow:()=>gG,getDappRegistryUrl:()=>EG,getDocument:()=>pG,getDocumentOrThrow:()=>dG,getFromWindow:()=>sy,getFromWindowOrThrow:()=>hG,getLocal:()=>gl,getLocalStorage:()=>vl,getLocalStorageOrThrow:()=>yG,getLocation:()=>ay,getLocationOrThrow:()=>mG,getMobileLinkRegistry:()=>MG,getMobileRegistryEntry:()=>YS,getNavigator:()=>$S,getNavigatorOrThrow:()=>vG,getWalletRegistryUrl:()=>SG,isAndroid:()=>WS,isBrowser:()=>oy,isIOS:()=>zS,isMobile:()=>iy,isNode:()=>VS,mobileLinkChoiceKey:()=>yl,removeLocal:()=>bl,safeJsonParse:()=>fy,safeJsonStringify:()=>cy,saveMobileLinkInfo:()=>xG,setLocal:()=>ml});var dy=_t(()=>{uy();ly();hy();JS();eE()});var xE={};Sr(xE,{Buffer:()=>_e,INSPECT_MAX_BYTES:()=>cE,SlowBuffer:()=>BG,isBuffer:()=>Qi,kMaxLength:()=>kG});function aE(){vy=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)Yi[t]=e[t],ui[e.charCodeAt(t)]=t;ui["-".charCodeAt(0)]=62,ui["_".charCodeAt(0)]=63}function RG(e){vy||aE();var t,r,n,i,o,a,c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[c-2]==="="?2:e[c-1]==="="?1:0,a=new OG(c*3/4-o),n=o>0?c-4:c;var v=0;for(t=0,r=0;t<n;t+=4,r+=3)i=ui[e.charCodeAt(t)]<<18|ui[e.charCodeAt(t+1)]<<12|ui[e.charCodeAt(t+2)]<<6|ui[e.charCodeAt(t+3)],a[v++]=i>>16&255,a[v++]=i>>8&255,a[v++]=i&255;return o===2?(i=ui[e.charCodeAt(t)]<<2|ui[e.charCodeAt(t+1)]>>4,a[v++]=i&255):o===1&&(i=ui[e.charCodeAt(t)]<<10|ui[e.charCodeAt(t+1)]<<4|ui[e.charCodeAt(t+2)]>>2,a[v++]=i>>8&255,a[v++]=i&255),a}function IG(e){return Yi[e>>18&63]+Yi[e>>12&63]+Yi[e>>6&63]+Yi[e&63]}function CG(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(IG(n));return i.join("")}function iE(e){vy||aE();for(var t,r=e.length,n=r%3,i="",o=[],a=16383,c=0,v=r-n;c<v;c+=a)o.push(CG(e,c,c+a>v?v:c+a));return n===1?(t=e[r-1],i+=Yi[t>>2],i+=Yi[t<<4&63],i+="=="):n===2&&(t=(e[r-2]<<8)+e[r-1],i+=Yi[t>>10],i+=Yi[t>>4&63],i+=Yi[t<<2&63],i+="="),o.push(i),o.join("")}function ap(e,t,r,n,i){var o,a,c=i*8-n-1,v=(1<<c)-1,y=v>>1,w=-7,M=r?i-1:0,S=r?-1:1,R=e[t+M];for(M+=S,o=R&(1<<-w)-1,R>>=-w,w+=c;w>0;o=o*256+e[t+M],M+=S,w-=8);for(a=o&(1<<-w)-1,o>>=-w,w+=n;w>0;a=a*256+e[t+M],M+=S,w-=8);if(o===0)o=1-y;else{if(o===v)return a?NaN:(R?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-y}return(R?-1:1)*a*Math.pow(2,o-n)}function uE(e,t,r,n,i,o){var a,c,v,y=o*8-i-1,w=(1<<y)-1,M=w>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=n?0:o-1,C=n?1:-1,B=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=w):(a=Math.floor(Math.log(t)/Math.LN2),t*(v=Math.pow(2,-a))<1&&(a--,v*=2),a+M>=1?t+=S/v:t+=S*Math.pow(2,1-M),t*v>=2&&(a++,v/=2),a+M>=w?(c=0,a=w):a+M>=1?(c=(t*v-1)*Math.pow(2,i),a=a+M):(c=t*Math.pow(2,M-1)*Math.pow(2,i),a=0));i>=8;e[r+R]=c&255,R+=C,c/=256,i-=8);for(a=a<<i|c,y+=i;y>0;e[r+R]=a&255,R+=C,a/=256,y-=8);e[r+R-C]|=B*128}function op(){return _e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function No(e,t){if(op()<t)throw new RangeError("Invalid typed array length");return _e.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=_e.prototype):(e===null&&(e=new _e(t)),e.length=t),e}function _e(e,t,r){if(!_e.TYPED_ARRAY_SUPPORT&&!(this instanceof _e))return new _e(e,t,r);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return my(this,e)}return lE(this,e,t,r)}function lE(e,t,r,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?qG(e,t,r,n):typeof t=="string"?NG(e,t,r):LG(e,t)}function hE(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function PG(e,t,r,n){return hE(t),t<=0?No(e,t):r!==void 0?typeof n=="string"?No(e,t).fill(r,n):No(e,t).fill(r):No(e,t)}function my(e,t){if(hE(t),e=No(e,t<0?0:gy(t)|0),!_e.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function NG(e,t,r){if((typeof r!="string"||r==="")&&(r="utf8"),!_e.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=dE(t,r)|0;e=No(e,n);var i=e.write(t,r);return i!==n&&(e=e.slice(0,i)),e}function py(e,t){var r=t.length<0?0:gy(t.length)|0;e=No(e,r);for(var n=0;n<r;n+=1)e[n]=t[n]&255;return e}function qG(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?t=new Uint8Array(t):n===void 0?t=new Uint8Array(t,r):t=new Uint8Array(t,r,n),_e.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=_e.prototype):e=py(e,t),e}function LG(e,t){if(Ji(t)){var r=gy(t.length)|0;return e=No(e,r),e.length===0||t.copy(e,0,0,r),e}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||rZ(t.length)?No(e,0):py(e,t);if(t.type==="Buffer"&&fE(t.data))return py(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function gy(e){if(e>=op())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+op().toString(16)+" bytes");return e|0}function BG(e){return+e!=e&&(e=0),_e.alloc(+e)}function Ji(e){return!!(e!=null&&e._isBuffer)}function dE(e,t){if(Ji(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var r=e.length;if(r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return sp(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return _E(e).length;default:if(n)return sp(e).length;t=(""+t).toLowerCase(),n=!0}}function DG(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return GG(this,t,r);case"utf8":case"utf-8":return mE(this,t,r);case"ascii":return $G(this,t,r);case"latin1":case"binary":return KG(this,t,r);case"base64":return zG(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ZG(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function la(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function pE(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=_e.from(t,n)),Ji(t))return t.length===0?-1:oE(e,t,r,n,i);if(typeof t=="number")return t=t&255,_e.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):oE(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function oE(e,t,r,n,i){var o=1,a=e.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,r/=2}function v(R,C){return o===1?R[C]:R.readUInt16BE(C*o)}var y;if(i){var w=-1;for(y=r;y<a;y++)if(v(e,y)===v(t,w===-1?0:y-w)){if(w===-1&&(w=y),y-w+1===c)return w*o}else w!==-1&&(y-=y-w),w=-1}else for(r+c>a&&(r=a-c),y=r;y>=0;y--){for(var M=!0,S=0;S<c;S++)if(v(e,y+S)!==v(t,S)){M=!1;break}if(M)return y}return-1}function jG(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var c=parseInt(t.substr(a*2,2),16);if(isNaN(c))return a;e[r+a]=c}return a}function FG(e,t,r,n){return cp(sp(t,e.length-r),e,r,n)}function vE(e,t,r,n){return cp(eZ(t),e,r,n)}function UG(e,t,r,n){return vE(e,t,r,n)}function HG(e,t,r,n){return cp(_E(t),e,r,n)}function WG(e,t,r,n){return cp(tZ(t,e.length-r),e,r,n)}function zG(e,t,r){return t===0&&r===e.length?iE(e):iE(e.slice(t,r))}function mE(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var v,y,w,M;switch(c){case 1:o<128&&(a=o);break;case 2:v=e[i+1],(v&192)===128&&(M=(o&31)<<6|v&63,M>127&&(a=M));break;case 3:v=e[i+1],y=e[i+2],(v&192)===128&&(y&192)===128&&(M=(o&15)<<12|(v&63)<<6|y&63,M>2047&&(M<55296||M>57343)&&(a=M));break;case 4:v=e[i+1],y=e[i+2],w=e[i+3],(v&192)===128&&(y&192)===128&&(w&192)===128&&(M=(o&15)<<18|(v&63)<<12|(y&63)<<6|w&63,M>65535&&M<1114112&&(a=M))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return VG(n)}function VG(e){var t=e.length;if(t<=sE)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=sE));return r}function $G(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function KG(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function GG(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=XG(e[o]);return i}function ZG(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}function Wr(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Fn(e,t,r,n,i,o){if(!Ji(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function up(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}function fp(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>(n?i:3-i)*8&255}function gE(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function bE(e,t,r,n,i){return i||gE(e,t,r,4),uE(e,t,r,n,23,4),r+4}function yE(e,t,r,n,i){return i||gE(e,t,r,8),uE(e,t,r,n,52,8),r+8}function JG(e){if(e=QG(e).replace(YG,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function QG(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function XG(e){return e<16?"0"+e.toString(16):e.toString(16)}function sp(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function eZ(e){for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function tZ(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function _E(e){return RG(JG(e))}function cp(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function rZ(e){return e!==e}function Qi(e){return e!=null&&(!!e._isBuffer||wE(e)||nZ(e))}function wE(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function nZ(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&wE(e.slice(0,0))}var Yi,ui,OG,vy,TG,fE,cE,kG,sE,YG,ha=_t(()=>{Yi=[],ui=[],OG=typeof Uint8Array<"u"?Uint8Array:Array,vy=!1;TG={}.toString,fE=Array.isArray||function(e){return TG.call(e)=="[object Array]"};cE=50;_e.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;kG=op();_e.poolSize=8192;_e._augment=function(e){return e.__proto__=_e.prototype,e};_e.from=function(e,t,r){return lE(null,e,t,r)};_e.TYPED_ARRAY_SUPPORT&&(_e.prototype.__proto__=Uint8Array.prototype,_e.__proto__=Uint8Array);_e.alloc=function(e,t,r){return PG(null,e,t,r)};_e.allocUnsafe=function(e){return my(null,e)};_e.allocUnsafeSlow=function(e){return my(null,e)};_e.isBuffer=Qi;_e.compare=function(t,r){if(!Ji(t)||!Ji(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0};_e.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};_e.concat=function(t,r){if(!fE(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return _e.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=_e.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){var a=t[n];if(!Ji(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};_e.byteLength=dE;_e.prototype._isBuffer=!0;_e.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)la(this,r,r+1);return this};_e.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)la(this,r,r+3),la(this,r+1,r+2);return this};_e.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)la(this,r,r+7),la(this,r+1,r+6),la(this,r+2,r+5),la(this,r+3,r+4);return this};_e.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?mE(this,0,t):DG.apply(this,arguments)};_e.prototype.equals=function(t){if(!Ji(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:_e.compare(this,t)===0};_e.prototype.inspect=function(){var t="",r=cE;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"};_e.prototype.compare=function(t,r,n,i,o){if(!Ji(t))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,c=n-r,v=Math.min(a,c),y=this.slice(i,o),w=t.slice(r,n),M=0;M<v;++M)if(y[M]!==w[M]){a=y[M],c=w[M];break}return a<c?-1:c<a?1:0};_e.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};_e.prototype.indexOf=function(t,r,n){return pE(this,t,r,n,!0)};_e.prototype.lastIndexOf=function(t,r,n){return pE(this,t,r,n,!1)};_e.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-r;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return jG(this,t,r,n);case"utf8":case"utf-8":return FG(this,t,r,n);case"ascii":return vE(this,t,r,n);case"latin1":case"binary":return UG(this,t,r,n);case"base64":return HG(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return WG(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};_e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};sE=4096;_e.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i;if(_e.TYPED_ARRAY_SUPPORT)i=this.subarray(t,r),i.__proto__=_e.prototype;else{var o=r-t;i=new _e(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};_e.prototype.readUIntLE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return i};_e.prototype.readUIntBE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=this[t+--r],o=1;r>0&&(o*=256);)i+=this[t+--r]*o;return i};_e.prototype.readUInt8=function(t,r){return r||Wr(t,1,this.length),this[t]};_e.prototype.readUInt16LE=function(t,r){return r||Wr(t,2,this.length),this[t]|this[t+1]<<8};_e.prototype.readUInt16BE=function(t,r){return r||Wr(t,2,this.length),this[t]<<8|this[t+1]};_e.prototype.readUInt32LE=function(t,r){return r||Wr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};_e.prototype.readUInt32BE=function(t,r){return r||Wr(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};_e.prototype.readIntLE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=this[t],o=1,a=0;++a<r&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};_e.prototype.readIntBE=function(t,r,n){t=t|0,r=r|0,n||Wr(t,r,this.length);for(var i=r,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};_e.prototype.readInt8=function(t,r){return r||Wr(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};_e.prototype.readInt16LE=function(t,r){r||Wr(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};_e.prototype.readInt16BE=function(t,r){r||Wr(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};_e.prototype.readInt32LE=function(t,r){return r||Wr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};_e.prototype.readInt32BE=function(t,r){return r||Wr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};_e.prototype.readFloatLE=function(t,r){return r||Wr(t,4,this.length),ap(this,t,!0,23,4)};_e.prototype.readFloatBE=function(t,r){return r||Wr(t,4,this.length),ap(this,t,!1,23,4)};_e.prototype.readDoubleLE=function(t,r){return r||Wr(t,8,this.length),ap(this,t,!0,52,8)};_e.prototype.readDoubleBE=function(t,r){return r||Wr(t,8,this.length),ap(this,t,!1,52,8)};_e.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;Fn(this,t,r,n,o,0)}var a=1,c=0;for(this[r]=t&255;++c<n&&(a*=256);)this[r+c]=t/a&255;return r+n};_e.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;Fn(this,t,r,n,o,0)}var a=n-1,c=1;for(this[r+a]=t&255;--a>=0&&(c*=256);)this[r+a]=t/c&255;return r+n};_e.prototype.writeUInt8=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,1,255,0),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t&255,r+1};_e.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):up(this,t,r,!0),r+2};_e.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):up(this,t,r,!1),r+2};_e.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255):fp(this,t,r,!0),r+4};_e.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):fp(this,t,r,!1),r+4};_e.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r|0,!i){var o=Math.pow(2,8*n-1);Fn(this,t,r,n,o-1,-o)}var a=0,c=1,v=0;for(this[r]=t&255;++a<n&&(c*=256);)t<0&&v===0&&this[r+a-1]!==0&&(v=1),this[r+a]=(t/c>>0)-v&255;return r+n};_e.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r|0,!i){var o=Math.pow(2,8*n-1);Fn(this,t,r,n,o-1,-o)}var a=n-1,c=1,v=0;for(this[r+a]=t&255;--a>=0&&(c*=256);)t<0&&v===0&&this[r+a+1]!==0&&(v=1),this[r+a]=(t/c>>0)-v&255;return r+n};_e.prototype.writeInt8=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,1,127,-128),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=t&255,r+1};_e.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):up(this,t,r,!0),r+2};_e.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):up(this,t,r,!1),r+2};_e.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,2147483647,-2147483648),_e.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):fp(this,t,r,!0),r+4};_e.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r|0,n||Fn(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),_e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):fp(this,t,r,!1),r+4};_e.prototype.writeFloatLE=function(t,r,n){return bE(this,t,r,!0,n)};_e.prototype.writeFloatBE=function(t,r,n){return bE(this,t,r,!1,n)};_e.prototype.writeDoubleLE=function(t,r,n){return yE(this,t,r,!0,n)};_e.prototype.writeDoubleBE=function(t,r,n){return yE(this,t,r,!1,n)};_e.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n,a;if(this===t&&n<r&&r<i)for(a=o-1;a>=0;--a)t[a+r]=this[a+n];else if(o<1e3||!_e.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+r]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r);return o};_e.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!_e.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof t=="number"&&(t=t&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{var c=Ji(t)?t:sp(new _e(t,i).toString()),v=c.length;for(a=0;a<n-r;++a)this[a+r]=c[a%v]}return this};YG=/[^+\/0-9A-Za-z-_]/g});var fi=E((QOe,lp)=>{var da=(ha(),Pt(xE));if(da&&da.default){lp.exports=da.default;for(let e in da)lp.exports[e]=da[e]}else da&&(lp.exports=da)});var SE=E((ME,by)=>{(function(e,t){"use strict";function r(k,m){if(!k)throw new Error(m||"Assertion failed")}function n(k,m){k.super_=m;var s=function(){};s.prototype=m.prototype,k.prototype=new s,k.prototype.constructor=k}function i(k,m,s){if(i.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((m==="le"||m==="be")&&(s=m,m=10),this._init(k||0,m||10,s||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{o=fi().Buffer}catch{}i.isBN=function(m){return m instanceof i?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===i.wordSize&&Array.isArray(m.words)},i.max=function(m,s){return m.cmp(s)>0?m:s},i.min=function(m,s){return m.cmp(s)<0?m:s},i.prototype._init=function(m,s,l){if(typeof m=="number")return this._initNumber(m,s,l);if(typeof m=="object")return this._initArray(m,s,l);s==="hex"&&(s=16),r(s===(s|0)&&s>=2&&s<=36),m=m.toString().replace(/\s+/g,"");var d=0;m[0]==="-"&&d++,s===16?this._parseHex(m,d):this._parseBase(m,s,d),m[0]==="-"&&(this.negative=1),this.strip(),l==="le"&&this._initArray(this.toArray(),s,l)},i.prototype._initNumber=function(m,s,l){m<0&&(this.negative=1,m=-m),m<67108864?(this.words=[m&67108863],this.length=1):m<4503599627370496?(this.words=[m&67108863,m/67108864&67108863],this.length=2):(r(m<9007199254740992),this.words=[m&67108863,m/67108864&67108863,1],this.length=3),l==="le"&&this._initArray(this.toArray(),s,l)},i.prototype._initArray=function(m,s,l){if(r(typeof m.length=="number"),m.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(m.length/3),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var f,p,g=0;if(l==="be")for(d=m.length-1,f=0;d>=0;d-=3)p=m[d]|m[d-1]<<8|m[d-2]<<16,this.words[f]|=p<<g&67108863,this.words[f+1]=p>>>26-g&67108863,g+=24,g>=26&&(g-=26,f++);else if(l==="le")for(d=0,f=0;d<m.length;d+=3)p=m[d]|m[d+1]<<8|m[d+2]<<16,this.words[f]|=p<<g&67108863,this.words[f+1]=p>>>26-g&67108863,g+=24,g>=26&&(g-=26,f++);return this.strip()};function a(k,m,s){for(var l=0,d=Math.min(k.length,s),f=m;f<d;f++){var p=k.charCodeAt(f)-48;l<<=4,p>=49&&p<=54?l|=p-49+10:p>=17&&p<=22?l|=p-17+10:l|=p&15}return l}i.prototype._parseHex=function(m,s){this.length=Math.ceil((m.length-s)/6),this.words=new Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,f,p=0;for(l=m.length-6,d=0;l>=s;l-=6)f=a(m,l,l+6),this.words[d]|=f<<p&67108863,this.words[d+1]|=f>>>26-p&4194303,p+=24,p>=26&&(p-=26,d++);l+6!==s&&(f=a(m,s,l+6),this.words[d]|=f<<p&67108863,this.words[d+1]|=f>>>26-p&4194303),this.strip()};function c(k,m,s,l){for(var d=0,f=Math.min(k.length,s),p=m;p<f;p++){var g=k.charCodeAt(p)-48;d*=l,g>=49?d+=g-49+10:g>=17?d+=g-17+10:d+=g}return d}i.prototype._parseBase=function(m,s,l){this.words=[0],this.length=1;for(var d=0,f=1;f<=67108863;f*=s)d++;d--,f=f/s|0;for(var p=m.length-l,g=p%d,b=Math.min(p,p-g)+l,h=0,u=l;u<b;u+=d)h=c(m,u,u+d,s),this.imuln(f),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(g!==0){var _=1;for(h=c(m,u,m.length,s),u=0;u<g;u++)_*=s;this.imuln(_),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},i.prototype.copy=function(m){m.words=new Array(this.length);for(var s=0;s<this.length;s++)m.words[s]=this.words[s];m.length=this.length,m.negative=this.negative,m.red=this.red},i.prototype.clone=function(){var m=new i(null);return this.copy(m),m},i.prototype._expand=function(m){for(;this.length<m;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var v=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],w=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(m,s){m=m||10,s=s|0||1;var l;if(m===16||m==="hex"){l="";for(var d=0,f=0,p=0;p<this.length;p++){var g=this.words[p],b=((g<<d|f)&16777215).toString(16);f=g>>>24-d&16777215,f!==0||p!==this.length-1?l=v[6-b.length]+b+l:l=b+l,d+=2,d>=26&&(d-=26,p--)}for(f!==0&&(l=f.toString(16)+l);l.length%s!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}if(m===(m|0)&&m>=2&&m<=36){var h=y[m],u=w[m];l="";var _=this.clone();for(_.negative=0;!_.isZero();){var A=_.modn(u).toString(m);_=_.idivn(u),_.isZero()?l=A+l:l=v[h-A.length]+A+l}for(this.isZero()&&(l="0"+l);l.length%s!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(m,s){return r(typeof o<"u"),this.toArrayLike(o,m,s)},i.prototype.toArray=function(m,s){return this.toArrayLike(Array,m,s)},i.prototype.toArrayLike=function(m,s,l){var d=this.byteLength(),f=l||Math.max(1,d);r(d<=f,"byte array longer than desired length"),r(f>0,"Requested array length <= 0"),this.strip();var p=s==="le",g=new m(f),b,h,u=this.clone();if(p){for(h=0;!u.isZero();h++)b=u.andln(255),u.iushrn(8),g[h]=b;for(;h<f;h++)g[h]=0}else{for(h=0;h<f-d;h++)g[h]=0;for(h=0;!u.isZero();h++)b=u.andln(255),u.iushrn(8),g[f-h-1]=b}return g},Math.clz32?i.prototype._countBits=function(m){return 32-Math.clz32(m)}:i.prototype._countBits=function(m){var s=m,l=0;return s>=4096&&(l+=13,s>>>=13),s>=64&&(l+=7,s>>>=7),s>=8&&(l+=4,s>>>=4),s>=2&&(l+=2,s>>>=2),l+s},i.prototype._zeroBits=function(m){if(m===0)return 26;var s=m,l=0;return(s&8191)===0&&(l+=13,s>>>=13),(s&127)===0&&(l+=7,s>>>=7),(s&15)===0&&(l+=4,s>>>=4),(s&3)===0&&(l+=2,s>>>=2),(s&1)===0&&l++,l},i.prototype.bitLength=function(){var m=this.words[this.length-1],s=this._countBits(m);return(this.length-1)*26+s};function M(k){for(var m=new Array(k.bitLength()),s=0;s<m.length;s++){var l=s/26|0,d=s%26;m[s]=(k.words[l]&1<<d)>>>d}return m}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,s=0;s<this.length;s++){var l=this._zeroBits(this.words[s]);if(m+=l,l!==26)break}return m},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(m){return this.negative!==0?this.abs().inotn(m).iaddn(1):this.clone()},i.prototype.fromTwos=function(m){return this.testn(m-1)?this.notn(m).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(m){for(;this.length<m.length;)this.words[this.length++]=0;for(var s=0;s<m.length;s++)this.words[s]=this.words[s]|m.words[s];return this.strip()},i.prototype.ior=function(m){return r((this.negative|m.negative)===0),this.iuor(m)},i.prototype.or=function(m){return this.length>m.length?this.clone().ior(m):m.clone().ior(this)},i.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},i.prototype.iuand=function(m){var s;this.length>m.length?s=m:s=this;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]&m.words[l];return this.length=s.length,this.strip()},i.prototype.iand=function(m){return r((this.negative|m.negative)===0),this.iuand(m)},i.prototype.and=function(m){return this.length>m.length?this.clone().iand(m):m.clone().iand(this)},i.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},i.prototype.iuxor=function(m){var s,l;this.length>m.length?(s=this,l=m):(s=m,l=this);for(var d=0;d<l.length;d++)this.words[d]=s.words[d]^l.words[d];if(this!==s)for(;d<s.length;d++)this.words[d]=s.words[d];return this.length=s.length,this.strip()},i.prototype.ixor=function(m){return r((this.negative|m.negative)===0),this.iuxor(m)},i.prototype.xor=function(m){return this.length>m.length?this.clone().ixor(m):m.clone().ixor(this)},i.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},i.prototype.inotn=function(m){r(typeof m=="number"&&m>=0);var s=Math.ceil(m/26)|0,l=m%26;this._expand(s),l>0&&s--;for(var d=0;d<s;d++)this.words[d]=~this.words[d]&67108863;return l>0&&(this.words[d]=~this.words[d]&67108863>>26-l),this.strip()},i.prototype.notn=function(m){return this.clone().inotn(m)},i.prototype.setn=function(m,s){r(typeof m=="number"&&m>=0);var l=m/26|0,d=m%26;return this._expand(l+1),s?this.words[l]=this.words[l]|1<<d:this.words[l]=this.words[l]&~(1<<d),this.strip()},i.prototype.iadd=function(m){var s;if(this.negative!==0&&m.negative===0)return this.negative=0,s=this.isub(m),this.negative^=1,this._normSign();if(this.negative===0&&m.negative!==0)return m.negative=0,s=this.isub(m),m.negative=1,s._normSign();var l,d;this.length>m.length?(l=this,d=m):(l=m,d=this);for(var f=0,p=0;p<d.length;p++)s=(l.words[p]|0)+(d.words[p]|0)+f,this.words[p]=s&67108863,f=s>>>26;for(;f!==0&&p<l.length;p++)s=(l.words[p]|0)+f,this.words[p]=s&67108863,f=s>>>26;if(this.length=l.length,f!==0)this.words[this.length]=f,this.length++;else if(l!==this)for(;p<l.length;p++)this.words[p]=l.words[p];return this},i.prototype.add=function(m){var s;return m.negative!==0&&this.negative===0?(m.negative=0,s=this.sub(m),m.negative^=1,s):m.negative===0&&this.negative!==0?(this.negative=0,s=m.sub(this),this.negative=1,s):this.length>m.length?this.clone().iadd(m):m.clone().iadd(this)},i.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var s=this.iadd(m);return m.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var l=this.cmp(m);if(l===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,f;l>0?(d=this,f=m):(d=m,f=this);for(var p=0,g=0;g<f.length;g++)s=(d.words[g]|0)-(f.words[g]|0)+p,p=s>>26,this.words[g]=s&67108863;for(;p!==0&&g<d.length;g++)s=(d.words[g]|0)+p,p=s>>26,this.words[g]=s&67108863;if(p===0&&g<d.length&&d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this.length=Math.max(this.length,g),d!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(m){return this.clone().isub(m)};function S(k,m,s){s.negative=m.negative^k.negative;var l=k.length+m.length|0;s.length=l,l=l-1|0;var d=k.words[0]|0,f=m.words[0]|0,p=d*f,g=p&67108863,b=p/67108864|0;s.words[0]=g;for(var h=1;h<l;h++){for(var u=b>>>26,_=b&67108863,A=Math.min(h,m.length-1),x=Math.max(0,h-k.length+1);x<=A;x++){var I=h-x|0;d=k.words[I]|0,f=m.words[x]|0,p=d*f+_,u+=p/67108864|0,_=p&67108863}s.words[h]=_|0,b=u|0}return b!==0?s.words[h]=b|0:s.length--,s.strip()}var R=function(m,s,l){var d=m.words,f=s.words,p=l.words,g=0,b,h,u,_=d[0]|0,A=_&8191,x=_>>>13,I=d[1]|0,j=I&8191,O=I>>>13,L=d[2]|0,W=L&8191,F=L>>>13,K=d[3]|0,De=K&8191,Y=K>>>13,Q=d[4]|0,Ve=Q&8191,J=Q>>>13,be=d[5]|0,Ke=be&8191,ye=be>>>13,Re=d[6]|0,et=Re&8191,oe=Re>>>13,xe=d[7]|0,it=xe&8191,ce=xe>>>13,Ie=d[8]|0,ft=Ie&8191,le=Ie>>>13,Ce=d[9]|0,ot=Ce&8191,se=Ce>>>13,Me=f[0]|0,st=Me&8191,ae=Me>>>13,Se=f[1]|0,at=Se&8191,re=Se>>>13,Te=f[2]|0,ct=Te&8191,ne=Te>>>13,Ee=f[3]|0,lt=Ee&8191,te=Ee>>>13,ke=f[4]|0,ht=ke&8191,ue=ke>>>13,Pe=f[5]|0,dt=Pe&8191,he=Pe>>>13,Ne=f[6]|0,pt=Ne&8191,de=Ne>>>13,qe=f[7]|0,vt=qe&8191,pe=qe>>>13,Le=f[8]|0,ut=Le&8191,ve=Le>>>13,Be=f[9]|0,mt=Be&8191,me=Be>>>13;l.negative=m.negative^s.negative,l.length=19,b=Math.imul(A,st),h=Math.imul(A,ae),h=h+Math.imul(x,st)|0,u=Math.imul(x,ae);var Ae=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,b=Math.imul(j,st),h=Math.imul(j,ae),h=h+Math.imul(O,st)|0,u=Math.imul(O,ae),b=b+Math.imul(A,at)|0,h=h+Math.imul(A,re)|0,h=h+Math.imul(x,at)|0,u=u+Math.imul(x,re)|0;var $t=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+($t>>>26)|0,$t&=67108863,b=Math.imul(W,st),h=Math.imul(W,ae),h=h+Math.imul(F,st)|0,u=Math.imul(F,ae),b=b+Math.imul(j,at)|0,h=h+Math.imul(j,re)|0,h=h+Math.imul(O,at)|0,u=u+Math.imul(O,re)|0,b=b+Math.imul(A,ct)|0,h=h+Math.imul(A,ne)|0,h=h+Math.imul(x,ct)|0,u=u+Math.imul(x,ne)|0;var Je=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Je>>>26)|0,Je&=67108863,b=Math.imul(De,st),h=Math.imul(De,ae),h=h+Math.imul(Y,st)|0,u=Math.imul(Y,ae),b=b+Math.imul(W,at)|0,h=h+Math.imul(W,re)|0,h=h+Math.imul(F,at)|0,u=u+Math.imul(F,re)|0,b=b+Math.imul(j,ct)|0,h=h+Math.imul(j,ne)|0,h=h+Math.imul(O,ct)|0,u=u+Math.imul(O,ne)|0,b=b+Math.imul(A,lt)|0,h=h+Math.imul(A,te)|0,h=h+Math.imul(x,lt)|0,u=u+Math.imul(x,te)|0;var Qe=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,b=Math.imul(Ve,st),h=Math.imul(Ve,ae),h=h+Math.imul(J,st)|0,u=Math.imul(J,ae),b=b+Math.imul(De,at)|0,h=h+Math.imul(De,re)|0,h=h+Math.imul(Y,at)|0,u=u+Math.imul(Y,re)|0,b=b+Math.imul(W,ct)|0,h=h+Math.imul(W,ne)|0,h=h+Math.imul(F,ct)|0,u=u+Math.imul(F,ne)|0,b=b+Math.imul(j,lt)|0,h=h+Math.imul(j,te)|0,h=h+Math.imul(O,lt)|0,u=u+Math.imul(O,te)|0,b=b+Math.imul(A,ht)|0,h=h+Math.imul(A,ue)|0,h=h+Math.imul(x,ht)|0,u=u+Math.imul(x,ue)|0;var Lt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,b=Math.imul(Ke,st),h=Math.imul(Ke,ae),h=h+Math.imul(ye,st)|0,u=Math.imul(ye,ae),b=b+Math.imul(Ve,at)|0,h=h+Math.imul(Ve,re)|0,h=h+Math.imul(J,at)|0,u=u+Math.imul(J,re)|0,b=b+Math.imul(De,ct)|0,h=h+Math.imul(De,ne)|0,h=h+Math.imul(Y,ct)|0,u=u+Math.imul(Y,ne)|0,b=b+Math.imul(W,lt)|0,h=h+Math.imul(W,te)|0,h=h+Math.imul(F,lt)|0,u=u+Math.imul(F,te)|0,b=b+Math.imul(j,ht)|0,h=h+Math.imul(j,ue)|0,h=h+Math.imul(O,ht)|0,u=u+Math.imul(O,ue)|0,b=b+Math.imul(A,dt)|0,h=h+Math.imul(A,he)|0,h=h+Math.imul(x,dt)|0,u=u+Math.imul(x,he)|0;var Bt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,b=Math.imul(et,st),h=Math.imul(et,ae),h=h+Math.imul(oe,st)|0,u=Math.imul(oe,ae),b=b+Math.imul(Ke,at)|0,h=h+Math.imul(Ke,re)|0,h=h+Math.imul(ye,at)|0,u=u+Math.imul(ye,re)|0,b=b+Math.imul(Ve,ct)|0,h=h+Math.imul(Ve,ne)|0,h=h+Math.imul(J,ct)|0,u=u+Math.imul(J,ne)|0,b=b+Math.imul(De,lt)|0,h=h+Math.imul(De,te)|0,h=h+Math.imul(Y,lt)|0,u=u+Math.imul(Y,te)|0,b=b+Math.imul(W,ht)|0,h=h+Math.imul(W,ue)|0,h=h+Math.imul(F,ht)|0,u=u+Math.imul(F,ue)|0,b=b+Math.imul(j,dt)|0,h=h+Math.imul(j,he)|0,h=h+Math.imul(O,dt)|0,u=u+Math.imul(O,he)|0,b=b+Math.imul(A,pt)|0,h=h+Math.imul(A,de)|0,h=h+Math.imul(x,pt)|0,u=u+Math.imul(x,de)|0;var Dt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,b=Math.imul(it,st),h=Math.imul(it,ae),h=h+Math.imul(ce,st)|0,u=Math.imul(ce,ae),b=b+Math.imul(et,at)|0,h=h+Math.imul(et,re)|0,h=h+Math.imul(oe,at)|0,u=u+Math.imul(oe,re)|0,b=b+Math.imul(Ke,ct)|0,h=h+Math.imul(Ke,ne)|0,h=h+Math.imul(ye,ct)|0,u=u+Math.imul(ye,ne)|0,b=b+Math.imul(Ve,lt)|0,h=h+Math.imul(Ve,te)|0,h=h+Math.imul(J,lt)|0,u=u+Math.imul(J,te)|0,b=b+Math.imul(De,ht)|0,h=h+Math.imul(De,ue)|0,h=h+Math.imul(Y,ht)|0,u=u+Math.imul(Y,ue)|0,b=b+Math.imul(W,dt)|0,h=h+Math.imul(W,he)|0,h=h+Math.imul(F,dt)|0,u=u+Math.imul(F,he)|0,b=b+Math.imul(j,pt)|0,h=h+Math.imul(j,de)|0,h=h+Math.imul(O,pt)|0,u=u+Math.imul(O,de)|0,b=b+Math.imul(A,vt)|0,h=h+Math.imul(A,pe)|0,h=h+Math.imul(x,vt)|0,u=u+Math.imul(x,pe)|0;var jt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(jt>>>26)|0,jt&=67108863,b=Math.imul(ft,st),h=Math.imul(ft,ae),h=h+Math.imul(le,st)|0,u=Math.imul(le,ae),b=b+Math.imul(it,at)|0,h=h+Math.imul(it,re)|0,h=h+Math.imul(ce,at)|0,u=u+Math.imul(ce,re)|0,b=b+Math.imul(et,ct)|0,h=h+Math.imul(et,ne)|0,h=h+Math.imul(oe,ct)|0,u=u+Math.imul(oe,ne)|0,b=b+Math.imul(Ke,lt)|0,h=h+Math.imul(Ke,te)|0,h=h+Math.imul(ye,lt)|0,u=u+Math.imul(ye,te)|0,b=b+Math.imul(Ve,ht)|0,h=h+Math.imul(Ve,ue)|0,h=h+Math.imul(J,ht)|0,u=u+Math.imul(J,ue)|0,b=b+Math.imul(De,dt)|0,h=h+Math.imul(De,he)|0,h=h+Math.imul(Y,dt)|0,u=u+Math.imul(Y,he)|0,b=b+Math.imul(W,pt)|0,h=h+Math.imul(W,de)|0,h=h+Math.imul(F,pt)|0,u=u+Math.imul(F,de)|0,b=b+Math.imul(j,vt)|0,h=h+Math.imul(j,pe)|0,h=h+Math.imul(O,vt)|0,u=u+Math.imul(O,pe)|0,b=b+Math.imul(A,ut)|0,h=h+Math.imul(A,ve)|0,h=h+Math.imul(x,ut)|0,u=u+Math.imul(x,ve)|0;var Ft=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,b=Math.imul(ot,st),h=Math.imul(ot,ae),h=h+Math.imul(se,st)|0,u=Math.imul(se,ae),b=b+Math.imul(ft,at)|0,h=h+Math.imul(ft,re)|0,h=h+Math.imul(le,at)|0,u=u+Math.imul(le,re)|0,b=b+Math.imul(it,ct)|0,h=h+Math.imul(it,ne)|0,h=h+Math.imul(ce,ct)|0,u=u+Math.imul(ce,ne)|0,b=b+Math.imul(et,lt)|0,h=h+Math.imul(et,te)|0,h=h+Math.imul(oe,lt)|0,u=u+Math.imul(oe,te)|0,b=b+Math.imul(Ke,ht)|0,h=h+Math.imul(Ke,ue)|0,h=h+Math.imul(ye,ht)|0,u=u+Math.imul(ye,ue)|0,b=b+Math.imul(Ve,dt)|0,h=h+Math.imul(Ve,he)|0,h=h+Math.imul(J,dt)|0,u=u+Math.imul(J,he)|0,b=b+Math.imul(De,pt)|0,h=h+Math.imul(De,de)|0,h=h+Math.imul(Y,pt)|0,u=u+Math.imul(Y,de)|0,b=b+Math.imul(W,vt)|0,h=h+Math.imul(W,pe)|0,h=h+Math.imul(F,vt)|0,u=u+Math.imul(F,pe)|0,b=b+Math.imul(j,ut)|0,h=h+Math.imul(j,ve)|0,h=h+Math.imul(O,ut)|0,u=u+Math.imul(O,ve)|0,b=b+Math.imul(A,mt)|0,h=h+Math.imul(A,me)|0,h=h+Math.imul(x,mt)|0,u=u+Math.imul(x,me)|0;var hr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(hr>>>26)|0,hr&=67108863,b=Math.imul(ot,at),h=Math.imul(ot,re),h=h+Math.imul(se,at)|0,u=Math.imul(se,re),b=b+Math.imul(ft,ct)|0,h=h+Math.imul(ft,ne)|0,h=h+Math.imul(le,ct)|0,u=u+Math.imul(le,ne)|0,b=b+Math.imul(it,lt)|0,h=h+Math.imul(it,te)|0,h=h+Math.imul(ce,lt)|0,u=u+Math.imul(ce,te)|0,b=b+Math.imul(et,ht)|0,h=h+Math.imul(et,ue)|0,h=h+Math.imul(oe,ht)|0,u=u+Math.imul(oe,ue)|0,b=b+Math.imul(Ke,dt)|0,h=h+Math.imul(Ke,he)|0,h=h+Math.imul(ye,dt)|0,u=u+Math.imul(ye,he)|0,b=b+Math.imul(Ve,pt)|0,h=h+Math.imul(Ve,de)|0,h=h+Math.imul(J,pt)|0,u=u+Math.imul(J,de)|0,b=b+Math.imul(De,vt)|0,h=h+Math.imul(De,pe)|0,h=h+Math.imul(Y,vt)|0,u=u+Math.imul(Y,pe)|0,b=b+Math.imul(W,ut)|0,h=h+Math.imul(W,ve)|0,h=h+Math.imul(F,ut)|0,u=u+Math.imul(F,ve)|0,b=b+Math.imul(j,mt)|0,h=h+Math.imul(j,me)|0,h=h+Math.imul(O,mt)|0,u=u+Math.imul(O,me)|0;var dr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(dr>>>26)|0,dr&=67108863,b=Math.imul(ot,ct),h=Math.imul(ot,ne),h=h+Math.imul(se,ct)|0,u=Math.imul(se,ne),b=b+Math.imul(ft,lt)|0,h=h+Math.imul(ft,te)|0,h=h+Math.imul(le,lt)|0,u=u+Math.imul(le,te)|0,b=b+Math.imul(it,ht)|0,h=h+Math.imul(it,ue)|0,h=h+Math.imul(ce,ht)|0,u=u+Math.imul(ce,ue)|0,b=b+Math.imul(et,dt)|0,h=h+Math.imul(et,he)|0,h=h+Math.imul(oe,dt)|0,u=u+Math.imul(oe,he)|0,b=b+Math.imul(Ke,pt)|0,h=h+Math.imul(Ke,de)|0,h=h+Math.imul(ye,pt)|0,u=u+Math.imul(ye,de)|0,b=b+Math.imul(Ve,vt)|0,h=h+Math.imul(Ve,pe)|0,h=h+Math.imul(J,vt)|0,u=u+Math.imul(J,pe)|0,b=b+Math.imul(De,ut)|0,h=h+Math.imul(De,ve)|0,h=h+Math.imul(Y,ut)|0,u=u+Math.imul(Y,ve)|0,b=b+Math.imul(W,mt)|0,h=h+Math.imul(W,me)|0,h=h+Math.imul(F,mt)|0,u=u+Math.imul(F,me)|0;var sr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(ot,lt),h=Math.imul(ot,te),h=h+Math.imul(se,lt)|0,u=Math.imul(se,te),b=b+Math.imul(ft,ht)|0,h=h+Math.imul(ft,ue)|0,h=h+Math.imul(le,ht)|0,u=u+Math.imul(le,ue)|0,b=b+Math.imul(it,dt)|0,h=h+Math.imul(it,he)|0,h=h+Math.imul(ce,dt)|0,u=u+Math.imul(ce,he)|0,b=b+Math.imul(et,pt)|0,h=h+Math.imul(et,de)|0,h=h+Math.imul(oe,pt)|0,u=u+Math.imul(oe,de)|0,b=b+Math.imul(Ke,vt)|0,h=h+Math.imul(Ke,pe)|0,h=h+Math.imul(ye,vt)|0,u=u+Math.imul(ye,pe)|0,b=b+Math.imul(Ve,ut)|0,h=h+Math.imul(Ve,ve)|0,h=h+Math.imul(J,ut)|0,u=u+Math.imul(J,ve)|0,b=b+Math.imul(De,mt)|0,h=h+Math.imul(De,me)|0,h=h+Math.imul(Y,mt)|0,u=u+Math.imul(Y,me)|0;var Kt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,b=Math.imul(ot,ht),h=Math.imul(ot,ue),h=h+Math.imul(se,ht)|0,u=Math.imul(se,ue),b=b+Math.imul(ft,dt)|0,h=h+Math.imul(ft,he)|0,h=h+Math.imul(le,dt)|0,u=u+Math.imul(le,he)|0,b=b+Math.imul(it,pt)|0,h=h+Math.imul(it,de)|0,h=h+Math.imul(ce,pt)|0,u=u+Math.imul(ce,de)|0,b=b+Math.imul(et,vt)|0,h=h+Math.imul(et,pe)|0,h=h+Math.imul(oe,vt)|0,u=u+Math.imul(oe,pe)|0,b=b+Math.imul(Ke,ut)|0,h=h+Math.imul(Ke,ve)|0,h=h+Math.imul(ye,ut)|0,u=u+Math.imul(ye,ve)|0,b=b+Math.imul(Ve,mt)|0,h=h+Math.imul(Ve,me)|0,h=h+Math.imul(J,mt)|0,u=u+Math.imul(J,me)|0;var ar=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(ar>>>26)|0,ar&=67108863,b=Math.imul(ot,dt),h=Math.imul(ot,he),h=h+Math.imul(se,dt)|0,u=Math.imul(se,he),b=b+Math.imul(ft,pt)|0,h=h+Math.imul(ft,de)|0,h=h+Math.imul(le,pt)|0,u=u+Math.imul(le,de)|0,b=b+Math.imul(it,vt)|0,h=h+Math.imul(it,pe)|0,h=h+Math.imul(ce,vt)|0,u=u+Math.imul(ce,pe)|0,b=b+Math.imul(et,ut)|0,h=h+Math.imul(et,ve)|0,h=h+Math.imul(oe,ut)|0,u=u+Math.imul(oe,ve)|0,b=b+Math.imul(Ke,mt)|0,h=h+Math.imul(Ke,me)|0,h=h+Math.imul(ye,mt)|0,u=u+Math.imul(ye,me)|0;var Ut=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,b=Math.imul(ot,pt),h=Math.imul(ot,de),h=h+Math.imul(se,pt)|0,u=Math.imul(se,de),b=b+Math.imul(ft,vt)|0,h=h+Math.imul(ft,pe)|0,h=h+Math.imul(le,vt)|0,u=u+Math.imul(le,pe)|0,b=b+Math.imul(it,ut)|0,h=h+Math.imul(it,ve)|0,h=h+Math.imul(ce,ut)|0,u=u+Math.imul(ce,ve)|0,b=b+Math.imul(et,mt)|0,h=h+Math.imul(et,me)|0,h=h+Math.imul(oe,mt)|0,u=u+Math.imul(oe,me)|0;var pr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(pr>>>26)|0,pr&=67108863,b=Math.imul(ot,vt),h=Math.imul(ot,pe),h=h+Math.imul(se,vt)|0,u=Math.imul(se,pe),b=b+Math.imul(ft,ut)|0,h=h+Math.imul(ft,ve)|0,h=h+Math.imul(le,ut)|0,u=u+Math.imul(le,ve)|0,b=b+Math.imul(it,mt)|0,h=h+Math.imul(it,me)|0,h=h+Math.imul(ce,mt)|0,u=u+Math.imul(ce,me)|0;var Jt=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,b=Math.imul(ot,ut),h=Math.imul(ot,ve),h=h+Math.imul(se,ut)|0,u=Math.imul(se,ve),b=b+Math.imul(ft,mt)|0,h=h+Math.imul(ft,me)|0,h=h+Math.imul(le,mt)|0,u=u+Math.imul(le,me)|0;var tr=(g+b|0)+((h&8191)<<13)|0;g=(u+(h>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(ot,mt),h=Math.imul(ot,me),h=h+Math.imul(se,mt)|0,u=Math.imul(se,me);var Rr=(g+b|0)+((h&8191)<<13)|0;return g=(u+(h>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,p[0]=Ae,p[1]=$t,p[2]=Je,p[3]=Qe,p[4]=Lt,p[5]=Bt,p[6]=Dt,p[7]=jt,p[8]=Ft,p[9]=hr,p[10]=dr,p[11]=sr,p[12]=Kt,p[13]=ar,p[14]=Ut,p[15]=pr,p[16]=Jt,p[17]=tr,p[18]=Rr,g!==0&&(p[19]=g,l.length++),l};Math.imul||(R=S);function C(k,m,s){s.negative=m.negative^k.negative,s.length=k.length+m.length;for(var l=0,d=0,f=0;f<s.length-1;f++){var p=d;d=0;for(var g=l&67108863,b=Math.min(f,m.length-1),h=Math.max(0,f-k.length+1);h<=b;h++){var u=f-h,_=k.words[u]|0,A=m.words[h]|0,x=_*A,I=x&67108863;p=p+(x/67108864|0)|0,I=I+g|0,g=I&67108863,p=p+(I>>>26)|0,d+=p>>>26,p&=67108863}s.words[f]=g,l=p,p=d}return l!==0?s.words[f]=l:s.length--,s.strip()}function B(k,m,s){var l=new N;return l.mulp(k,m,s)}i.prototype.mulTo=function(m,s){var l,d=this.length+m.length;return this.length===10&&m.length===10?l=R(this,m,s):d<63?l=S(this,m,s):d<1024?l=C(this,m,s):l=B(this,m,s),l};function N(k,m){this.x=k,this.y=m}N.prototype.makeRBT=function(m){for(var s=new Array(m),l=i.prototype._countBits(m)-1,d=0;d<m;d++)s[d]=this.revBin(d,l,m);return s},N.prototype.revBin=function(m,s,l){if(m===0||m===l-1)return m;for(var d=0,f=0;f<s;f++)d|=(m&1)<<s-f-1,m>>=1;return d},N.prototype.permute=function(m,s,l,d,f,p){for(var g=0;g<p;g++)d[g]=s[m[g]],f[g]=l[m[g]]},N.prototype.transform=function(m,s,l,d,f,p){this.permute(p,m,s,l,d,f);for(var g=1;g<f;g<<=1)for(var b=g<<1,h=Math.cos(2*Math.PI/b),u=Math.sin(2*Math.PI/b),_=0;_<f;_+=b)for(var A=h,x=u,I=0;I<g;I++){var j=l[_+I],O=d[_+I],L=l[_+I+g],W=d[_+I+g],F=A*L-x*W;W=A*W+x*L,L=F,l[_+I]=j+L,d[_+I]=O+W,l[_+I+g]=j-L,d[_+I+g]=O-W,I!==b&&(F=h*A-u*x,x=h*x+u*A,A=F)}},N.prototype.guessLen13b=function(m,s){var l=Math.max(s,m)|1,d=l&1,f=0;for(l=l/2|0;l;l=l>>>1)f++;return 1<<f+1+d},N.prototype.conjugate=function(m,s,l){if(!(l<=1))for(var d=0;d<l/2;d++){var f=m[d];m[d]=m[l-d-1],m[l-d-1]=f,f=s[d],s[d]=-s[l-d-1],s[l-d-1]=-f}},N.prototype.normalize13b=function(m,s){for(var l=0,d=0;d<s/2;d++){var f=Math.round(m[2*d+1]/s)*8192+Math.round(m[2*d]/s)+l;m[d]=f&67108863,f<67108864?l=0:l=f/67108864|0}return m},N.prototype.convert13b=function(m,s,l,d){for(var f=0,p=0;p<s;p++)f=f+(m[p]|0),l[2*p]=f&8191,f=f>>>13,l[2*p+1]=f&8191,f=f>>>13;for(p=2*s;p<d;++p)l[p]=0;r(f===0),r((f&-8192)===0)},N.prototype.stub=function(m){for(var s=new Array(m),l=0;l<m;l++)s[l]=0;return s},N.prototype.mulp=function(m,s,l){var d=2*this.guessLen13b(m.length,s.length),f=this.makeRBT(d),p=this.stub(d),g=new Array(d),b=new Array(d),h=new Array(d),u=new Array(d),_=new Array(d),A=new Array(d),x=l.words;x.length=d,this.convert13b(m.words,m.length,g,d),this.convert13b(s.words,s.length,u,d),this.transform(g,p,b,h,d,f),this.transform(u,p,_,A,d,f);for(var I=0;I<d;I++){var j=b[I]*_[I]-h[I]*A[I];h[I]=b[I]*A[I]+h[I]*_[I],b[I]=j}return this.conjugate(b,h,d),this.transform(b,h,x,p,d,f),this.conjugate(x,p,d),this.normalize13b(x,d),l.negative=m.negative^s.negative,l.length=m.length+s.length,l.strip()},i.prototype.mul=function(m){var s=new i(null);return s.words=new Array(this.length+m.length),this.mulTo(m,s)},i.prototype.mulf=function(m){var s=new i(null);return s.words=new Array(this.length+m.length),B(this,m,s)},i.prototype.imul=function(m){return this.clone().mulTo(m,this)},i.prototype.imuln=function(m){r(typeof m=="number"),r(m<67108864);for(var s=0,l=0;l<this.length;l++){var d=(this.words[l]|0)*m,f=(d&67108863)+(s&67108863);s>>=26,s+=d/67108864|0,s+=f>>>26,this.words[l]=f&67108863}return s!==0&&(this.words[l]=s,this.length++),this},i.prototype.muln=function(m){return this.clone().imuln(m)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(m){var s=M(m);if(s.length===0)return new i(1);for(var l=this,d=0;d<s.length&&s[d]===0;d++,l=l.sqr());if(++d<s.length)for(var f=l.sqr();d<s.length;d++,f=f.sqr())s[d]!==0&&(l=l.mul(f));return l},i.prototype.iushln=function(m){r(typeof m=="number"&&m>=0);var s=m%26,l=(m-s)/26,d=67108863>>>26-s<<26-s,f;if(s!==0){var p=0;for(f=0;f<this.length;f++){var g=this.words[f]&d,b=(this.words[f]|0)-g<<s;this.words[f]=b|p,p=g>>>26-s}p&&(this.words[f]=p,this.length++)}if(l!==0){for(f=this.length-1;f>=0;f--)this.words[f+l]=this.words[f];for(f=0;f<l;f++)this.words[f]=0;this.length+=l}return this.strip()},i.prototype.ishln=function(m){return r(this.negative===0),this.iushln(m)},i.prototype.iushrn=function(m,s,l){r(typeof m=="number"&&m>=0);var d;s?d=(s-s%26)/26:d=0;var f=m%26,p=Math.min((m-f)/26,this.length),g=67108863^67108863>>>f<<f,b=l;if(d-=p,d=Math.max(0,d),b){for(var h=0;h<p;h++)b.words[h]=this.words[h];b.length=p}if(p!==0)if(this.length>p)for(this.length-=p,h=0;h<this.length;h++)this.words[h]=this.words[h+p];else this.words[0]=0,this.length=1;var u=0;for(h=this.length-1;h>=0&&(u!==0||h>=d);h--){var _=this.words[h]|0;this.words[h]=u<<26-f|_>>>f,u=_&g}return b&&u!==0&&(b.words[b.length++]=u),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(m,s,l){return r(this.negative===0),this.iushrn(m,s,l)},i.prototype.shln=function(m){return this.clone().ishln(m)},i.prototype.ushln=function(m){return this.clone().iushln(m)},i.prototype.shrn=function(m){return this.clone().ishrn(m)},i.prototype.ushrn=function(m){return this.clone().iushrn(m)},i.prototype.testn=function(m){r(typeof m=="number"&&m>=0);var s=m%26,l=(m-s)/26,d=1<<s;if(this.length<=l)return!1;var f=this.words[l];return!!(f&d)},i.prototype.imaskn=function(m){r(typeof m=="number"&&m>=0);var s=m%26,l=(m-s)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=l)return this;if(s!==0&&l++,this.length=Math.min(l,this.length),s!==0){var d=67108863^67108863>>>s<<s;this.words[this.length-1]&=d}return this.strip()},i.prototype.maskn=function(m){return this.clone().imaskn(m)},i.prototype.iaddn=function(m){return r(typeof m=="number"),r(m<67108864),m<0?this.isubn(-m):this.negative!==0?this.length===1&&(this.words[0]|0)<m?(this.words[0]=m-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(m),this.negative=1,this):this._iaddn(m)},i.prototype._iaddn=function(m){this.words[0]+=m;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},i.prototype.isubn=function(m){if(r(typeof m=="number"),r(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this.strip()},i.prototype.addn=function(m){return this.clone().iaddn(m)},i.prototype.subn=function(m){return this.clone().isubn(m)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(m,s,l){var d=m.length+l,f;this._expand(d);var p,g=0;for(f=0;f<m.length;f++){p=(this.words[f+l]|0)+g;var b=(m.words[f]|0)*s;p-=b&67108863,g=(p>>26)-(b/67108864|0),this.words[f+l]=p&67108863}for(;f<this.length-l;f++)p=(this.words[f+l]|0)+g,g=p>>26,this.words[f+l]=p&67108863;if(g===0)return this.strip();for(r(g===-1),g=0,f=0;f<this.length;f++)p=-(this.words[f]|0)+g,g=p>>26,this.words[f]=p&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(m,s){var l=this.length-m.length,d=this.clone(),f=m,p=f.words[f.length-1]|0,g=this._countBits(p);l=26-g,l!==0&&(f=f.ushln(l),d.iushln(l),p=f.words[f.length-1]|0);var b=d.length-f.length,h;if(s!=="mod"){h=new i(null),h.length=b+1,h.words=new Array(h.length);for(var u=0;u<h.length;u++)h.words[u]=0}var _=d.clone()._ishlnsubmul(f,1,b);_.negative===0&&(d=_,h&&(h.words[b]=1));for(var A=b-1;A>=0;A--){var x=(d.words[f.length+A]|0)*67108864+(d.words[f.length+A-1]|0);for(x=Math.min(x/p|0,67108863),d._ishlnsubmul(f,x,A);d.negative!==0;)x--,d.negative=0,d._ishlnsubmul(f,1,A),d.isZero()||(d.negative^=1);h&&(h.words[A]=x)}return h&&h.strip(),d.strip(),s!=="div"&&l!==0&&d.iushrn(l),{div:h||null,mod:d}},i.prototype.divmod=function(m,s,l){if(r(!m.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var d,f,p;return this.negative!==0&&m.negative===0?(p=this.neg().divmod(m,s),s!=="mod"&&(d=p.div.neg()),s!=="div"&&(f=p.mod.neg(),l&&f.negative!==0&&f.iadd(m)),{div:d,mod:f}):this.negative===0&&m.negative!==0?(p=this.divmod(m.neg(),s),s!=="mod"&&(d=p.div.neg()),{div:d,mod:p.mod}):(this.negative&m.negative)!==0?(p=this.neg().divmod(m.neg(),s),s!=="div"&&(f=p.mod.neg(),l&&f.negative!==0&&f.isub(m)),{div:p.div,mod:f}):m.length>this.length||this.cmp(m)<0?{div:new i(0),mod:this}:m.length===1?s==="div"?{div:this.divn(m.words[0]),mod:null}:s==="mod"?{div:null,mod:new i(this.modn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new i(this.modn(m.words[0]))}:this._wordDiv(m,s)},i.prototype.div=function(m){return this.divmod(m,"div",!1).div},i.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},i.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},i.prototype.divRound=function(m){var s=this.divmod(m);if(s.mod.isZero())return s.div;var l=s.div.negative!==0?s.mod.isub(m):s.mod,d=m.ushrn(1),f=m.andln(1),p=l.cmp(d);return p<0||f===1&&p===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},i.prototype.modn=function(m){r(m<=67108863);for(var s=(1<<26)%m,l=0,d=this.length-1;d>=0;d--)l=(s*l+(this.words[d]|0))%m;return l},i.prototype.idivn=function(m){r(m<=67108863);for(var s=0,l=this.length-1;l>=0;l--){var d=(this.words[l]|0)+s*67108864;this.words[l]=d/m|0,s=d%m}return this.strip()},i.prototype.divn=function(m){return this.clone().idivn(m)},i.prototype.egcd=function(m){r(m.negative===0),r(!m.isZero());var s=this,l=m.clone();s.negative!==0?s=s.umod(m):s=s.clone();for(var d=new i(1),f=new i(0),p=new i(0),g=new i(1),b=0;s.isEven()&&l.isEven();)s.iushrn(1),l.iushrn(1),++b;for(var h=l.clone(),u=s.clone();!s.isZero();){for(var _=0,A=1;(s.words[0]&A)===0&&_<26;++_,A<<=1);if(_>0)for(s.iushrn(_);_-- >0;)(d.isOdd()||f.isOdd())&&(d.iadd(h),f.isub(u)),d.iushrn(1),f.iushrn(1);for(var x=0,I=1;(l.words[0]&I)===0&&x<26;++x,I<<=1);if(x>0)for(l.iushrn(x);x-- >0;)(p.isOdd()||g.isOdd())&&(p.iadd(h),g.isub(u)),p.iushrn(1),g.iushrn(1);s.cmp(l)>=0?(s.isub(l),d.isub(p),f.isub(g)):(l.isub(s),p.isub(d),g.isub(f))}return{a:p,b:g,gcd:l.iushln(b)}},i.prototype._invmp=function(m){r(m.negative===0),r(!m.isZero());var s=this,l=m.clone();s.negative!==0?s=s.umod(m):s=s.clone();for(var d=new i(1),f=new i(0),p=l.clone();s.cmpn(1)>0&&l.cmpn(1)>0;){for(var g=0,b=1;(s.words[0]&b)===0&&g<26;++g,b<<=1);if(g>0)for(s.iushrn(g);g-- >0;)d.isOdd()&&d.iadd(p),d.iushrn(1);for(var h=0,u=1;(l.words[0]&u)===0&&h<26;++h,u<<=1);if(h>0)for(l.iushrn(h);h-- >0;)f.isOdd()&&f.iadd(p),f.iushrn(1);s.cmp(l)>=0?(s.isub(l),d.isub(f)):(l.isub(s),f.isub(d))}var _;return s.cmpn(1)===0?_=d:_=f,_.cmpn(0)<0&&_.iadd(m),_},i.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var s=this.clone(),l=m.clone();s.negative=0,l.negative=0;for(var d=0;s.isEven()&&l.isEven();d++)s.iushrn(1),l.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;l.isEven();)l.iushrn(1);var f=s.cmp(l);if(f<0){var p=s;s=l,l=p}else if(f===0||l.cmpn(1)===0)break;s.isub(l)}while(!0);return l.iushln(d)},i.prototype.invm=function(m){return this.egcd(m).a.umod(m)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(m){return this.words[0]&m},i.prototype.bincn=function(m){r(typeof m=="number");var s=m%26,l=(m-s)/26,d=1<<s;if(this.length<=l)return this._expand(l+1),this.words[l]|=d,this;for(var f=d,p=l;f!==0&&p<this.length;p++){var g=this.words[p]|0;g+=f,f=g>>>26,g&=67108863,this.words[p]=g}return f!==0&&(this.words[p]=f,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(m){var s=m<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this.strip();var l;if(this.length>1)l=1;else{s&&(m=-m),r(m<=67108863,"Number is too big");var d=this.words[0]|0;l=d===m?0:d<m?-1:1}return this.negative!==0?-l|0:l},i.prototype.cmp=function(m){if(this.negative!==0&&m.negative===0)return-1;if(this.negative===0&&m.negative!==0)return 1;var s=this.ucmp(m);return this.negative!==0?-s|0:s},i.prototype.ucmp=function(m){if(this.length>m.length)return 1;if(this.length<m.length)return-1;for(var s=0,l=this.length-1;l>=0;l--){var d=this.words[l]|0,f=m.words[l]|0;if(d!==f){d<f?s=-1:d>f&&(s=1);break}}return s},i.prototype.gtn=function(m){return this.cmpn(m)===1},i.prototype.gt=function(m){return this.cmp(m)===1},i.prototype.gten=function(m){return this.cmpn(m)>=0},i.prototype.gte=function(m){return this.cmp(m)>=0},i.prototype.ltn=function(m){return this.cmpn(m)===-1},i.prototype.lt=function(m){return this.cmp(m)===-1},i.prototype.lten=function(m){return this.cmpn(m)<=0},i.prototype.lte=function(m){return this.cmp(m)<=0},i.prototype.eqn=function(m){return this.cmpn(m)===0},i.prototype.eq=function(m){return this.cmp(m)===0},i.red=function(m){return new X(m)},i.prototype.toRed=function(m){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(m){return this.red=m,this},i.prototype.forceRed=function(m){return r(!this.red,"Already a number in reduction context"),this._forceRed(m)},i.prototype.redAdd=function(m){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},i.prototype.redIAdd=function(m){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},i.prototype.redSub=function(m){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},i.prototype.redISub=function(m){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},i.prototype.redShl=function(m){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},i.prototype.redMul=function(m){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},i.prototype.redIMul=function(m){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(m){return r(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var q={k256:null,p224:null,p192:null,p25519:null};function H(k,m){this.name=k,this.p=new i(m,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var m=new i(null);return m.words=new Array(Math.ceil(this.n/13)),m},H.prototype.ireduce=function(m){var s=m,l;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),l=s.bitLength();while(l>this.n);var d=l<this.n?-1:s.ucmp(this.p);return d===0?(s.words[0]=0,s.length=1):d>0?s.isub(this.p):s.strip(),s},H.prototype.split=function(m,s){m.iushrn(this.n,0,s)},H.prototype.imulK=function(m){return m.imul(this.k)};function D(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(D,H),D.prototype.split=function(m,s){for(var l=4194303,d=Math.min(m.length,9),f=0;f<d;f++)s.words[f]=m.words[f];if(s.length=d,m.length<=9){m.words[0]=0,m.length=1;return}var p=m.words[9];for(s.words[s.length++]=p&l,f=10;f<m.length;f++){var g=m.words[f]|0;m.words[f-10]=(g&l)<<4|p>>>22,p=g}p>>>=22,m.words[f-10]=p,p===0&&m.length>10?m.length-=10:m.length-=9},D.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var s=0,l=0;l<m.length;l++){var d=m.words[l]|0;s+=d*977,m.words[l]=s&67108863,s=d*64+(s/67108864|0)}return m.words[m.length-1]===0&&(m.length--,m.words[m.length-1]===0&&m.length--),m};function ee(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ee,H);function ge(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(ge,H);function Z(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(Z,H),Z.prototype.imulK=function(m){for(var s=0,l=0;l<m.length;l++){var d=(m.words[l]|0)*19+s,f=d&67108863;d>>>=26,m.words[l]=f,s=d}return s!==0&&(m.words[m.length++]=s),m},i._prime=function(m){if(q[m])return q[m];var s;if(m==="k256")s=new D;else if(m==="p224")s=new ee;else if(m==="p192")s=new ge;else if(m==="p25519")s=new Z;else throw new Error("Unknown prime "+m);return q[m]=s,s};function X(k){if(typeof k=="string"){var m=i._prime(k);this.m=m.p,this.prime=m}else r(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}X.prototype._verify1=function(m){r(m.negative===0,"red works only with positives"),r(m.red,"red works only with red numbers")},X.prototype._verify2=function(m,s){r((m.negative|s.negative)===0,"red works only with positives"),r(m.red&&m.red===s.red,"red works only with red numbers")},X.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):m.umod(this.m)._forceRed(this)},X.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},X.prototype.add=function(m,s){this._verify2(m,s);var l=m.add(s);return l.cmp(this.m)>=0&&l.isub(this.m),l._forceRed(this)},X.prototype.iadd=function(m,s){this._verify2(m,s);var l=m.iadd(s);return l.cmp(this.m)>=0&&l.isub(this.m),l},X.prototype.sub=function(m,s){this._verify2(m,s);var l=m.sub(s);return l.cmpn(0)<0&&l.iadd(this.m),l._forceRed(this)},X.prototype.isub=function(m,s){this._verify2(m,s);var l=m.isub(s);return l.cmpn(0)<0&&l.iadd(this.m),l},X.prototype.shl=function(m,s){return this._verify1(m),this.imod(m.ushln(s))},X.prototype.imul=function(m,s){return this._verify2(m,s),this.imod(m.imul(s))},X.prototype.mul=function(m,s){return this._verify2(m,s),this.imod(m.mul(s))},X.prototype.isqr=function(m){return this.imul(m,m.clone())},X.prototype.sqr=function(m){return this.mul(m,m)},X.prototype.sqrt=function(m){if(m.isZero())return m.clone();var s=this.m.andln(3);if(r(s%2===1),s===3){var l=this.m.add(new i(1)).iushrn(2);return this.pow(m,l)}for(var d=this.m.subn(1),f=0;!d.isZero()&&d.andln(1)===0;)f++,d.iushrn(1);r(!d.isZero());var p=new i(1).toRed(this),g=p.redNeg(),b=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);this.pow(h,b).cmp(g)!==0;)h.redIAdd(g);for(var u=this.pow(h,d),_=this.pow(m,d.addn(1).iushrn(1)),A=this.pow(m,d),x=f;A.cmp(p)!==0;){for(var I=A,j=0;I.cmp(p)!==0;j++)I=I.redSqr();r(j<x);var O=this.pow(u,new i(1).iushln(x-j-1));_=_.redMul(O),u=O.redSqr(),A=A.redMul(u),x=j}return _},X.prototype.invm=function(m){var s=m._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},X.prototype.pow=function(m,s){if(s.isZero())return new i(1).toRed(this);if(s.cmpn(1)===0)return m.clone();var l=4,d=new Array(1<<l);d[0]=new i(1).toRed(this),d[1]=m;for(var f=2;f<d.length;f++)d[f]=this.mul(d[f-1],m);var p=d[0],g=0,b=0,h=s.bitLength()%26;for(h===0&&(h=26),f=s.length-1;f>=0;f--){for(var u=s.words[f],_=h-1;_>=0;_--){var A=u>>_&1;if(p!==d[0]&&(p=this.sqr(p)),A===0&&g===0){b=0;continue}g<<=1,g|=A,b++,!(b!==l&&(f!==0||_!==0))&&(p=this.mul(p,d[g]),b=0,g=0)}h=26}return p},X.prototype.convertTo=function(m){var s=m.umod(this.m);return s===m?s.clone():s},X.prototype.convertFrom=function(m){var s=m.clone();return s.red=null,s},i.mont=function(m){return new V(m)};function V(k){X.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(V,X),V.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},V.prototype.convertFrom=function(m){var s=this.imod(m.mul(this.rinv));return s.red=null,s},V.prototype.imul=function(m,s){if(m.isZero()||s.isZero())return m.words[0]=0,m.length=1,m;var l=m.imul(s),d=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=l.isub(d).iushrn(this.shift),p=f;return f.cmp(this.m)>=0?p=f.isub(this.m):f.cmpn(0)<0&&(p=f.iadd(this.m)),p._forceRed(this)},V.prototype.mul=function(m,s){if(m.isZero()||s.isZero())return new i(0)._forceRed(this);var l=m.mul(s),d=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=l.isub(d).iushrn(this.shift),p=f;return f.cmp(this.m)>=0?p=f.isub(this.m):f.cmpn(0)<0&&(p=f.iadd(this.m)),p._forceRed(this)},V.prototype.invm=function(m){var s=this.imod(m._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(typeof by>"u"||by,ME)});var _y=E((XOe,OE)=>{OE.exports=yy;yy.strict=EE;yy.loose=AE;var iZ=Object.prototype.toString,oZ={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function yy(e){return EE(e)||AE(e)}function EE(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function AE(e){return oZ[iZ.call(e)]}});var IE=E((eRe,RE)=>{var sZ=_y().strict;RE.exports=function(t){if(sZ(t)){var r=Buffer.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(r=r.slice(t.byteOffset,t.byteOffset+t.byteLength)),r}else return Buffer.from(t)}});var zE=E((uRe,bp)=>{(function(){"use strict";var e="input is invalid type",t="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=globalThis:i&&(n=self);var a=!n.JS_SHA3_NO_COMMON_JS&&typeof bp=="object"&&bp.exports,c=typeof define=="function"&&define.amd,v=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",y="0123456789abcdef".split(""),w=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],S=[1,256,65536,16777216],R=[6,1536,393216,100663296],C=[0,8,16,24],B=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],N=[224,256,384,512],q=[128,256],H=["hex","buffer","arrayBuffer","array","digest"],D={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),v&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(O){return typeof O=="object"&&O.buffer&&O.buffer.constructor===ArrayBuffer});for(var ee=function(O,L,W){return function(F){return new x(O,L,O).update(F)[W]()}},ge=function(O,L,W){return function(F,K){return new x(O,L,K).update(F)[W]()}},Z=function(O,L,W){return function(F,K,De,Y){return f["cshake"+O].update(F,K,De,Y)[W]()}},X=function(O,L,W){return function(F,K,De,Y){return f["kmac"+O].update(F,K,De,Y)[W]()}},V=function(O,L,W,F){for(var K=0;K<H.length;++K){var De=H[K];O[De]=L(W,F,De)}return O},k=function(O,L){var W=ee(O,L,"hex");return W.create=function(){return new x(O,L,O)},W.update=function(F){return W.create().update(F)},V(W,ee,O,L)},m=function(O,L){var W=ge(O,L,"hex");return W.create=function(F){return new x(O,L,F)},W.update=function(F,K){return W.create(K).update(F)},V(W,ge,O,L)},s=function(O,L){var W=D[O],F=Z(O,L,"hex");return F.create=function(K,De,Y){return!De&&!Y?f["shake"+O].create(K):new x(O,L,K).bytepad([De,Y],W)},F.update=function(K,De,Y,Q){return F.create(De,Y,Q).update(K)},V(F,Z,O,L)},l=function(O,L){var W=D[O],F=X(O,L,"hex");return F.create=function(K,De,Y){return new I(O,L,De).bytepad(["KMAC",Y],W).bytepad([K],W)},F.update=function(K,De,Y,Q){return F.create(K,Y,Q).update(De)},V(F,X,O,L)},d=[{name:"keccak",padding:S,bits:N,createMethod:k},{name:"sha3",padding:R,bits:N,createMethod:k},{name:"shake",padding:w,bits:q,createMethod:m},{name:"cshake",padding:M,bits:q,createMethod:s},{name:"kmac",padding:M,bits:q,createMethod:l}],f={},p=[],g=0;g<d.length;++g)for(var b=d[g],h=b.bits,u=0;u<h.length;++u){var _=b.name+"_"+h[u];if(p.push(_),f[_]=b.createMethod(h[u],b.padding),b.name!=="sha3"){var A=b.name+h[u];p.push(A),f[A]=f[_]}}function x(O,L,W){this.blocks=[],this.s=[],this.padding=L,this.outputBits=W,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(O<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=W>>5,this.extraBytes=(W&31)>>3;for(var F=0;F<50;++F)this.s[F]=0}x.prototype.update=function(O){if(this.finalized)throw new Error(t);var L,W=typeof O;if(W!=="string"){if(W==="object"){if(O===null)throw new Error(e);if(v&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!v||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);L=!0}for(var F=this.blocks,K=this.byteCount,De=O.length,Y=this.blockCount,Q=0,Ve=this.s,J,be;Q<De;){if(this.reset)for(this.reset=!1,F[0]=this.block,J=1;J<Y+1;++J)F[J]=0;if(L)for(J=this.start;Q<De&&J<K;++Q)F[J>>2]|=O[Q]<<C[J++&3];else for(J=this.start;Q<De&&J<K;++Q)be=O.charCodeAt(Q),be<128?F[J>>2]|=be<<C[J++&3]:be<2048?(F[J>>2]|=(192|be>>6)<<C[J++&3],F[J>>2]|=(128|be&63)<<C[J++&3]):be<55296||be>=57344?(F[J>>2]|=(224|be>>12)<<C[J++&3],F[J>>2]|=(128|be>>6&63)<<C[J++&3],F[J>>2]|=(128|be&63)<<C[J++&3]):(be=65536+((be&1023)<<10|O.charCodeAt(++Q)&1023),F[J>>2]|=(240|be>>18)<<C[J++&3],F[J>>2]|=(128|be>>12&63)<<C[J++&3],F[J>>2]|=(128|be>>6&63)<<C[J++&3],F[J>>2]|=(128|be&63)<<C[J++&3]);if(this.lastByteIndex=J,J>=K){for(this.start=J-K,this.block=F[Y],J=0;J<Y;++J)Ve[J]^=F[J];j(Ve),this.reset=!0}else this.start=J}return this},x.prototype.encode=function(O,L){var W=O&255,F=1,K=[W];for(O=O>>8,W=O&255;W>0;)K.unshift(W),O=O>>8,W=O&255,++F;return L?K.push(F):K.unshift(F),this.update(K),K.length},x.prototype.encodeString=function(O){var L,W=typeof O;if(W!=="string"){if(W==="object"){if(O===null)throw new Error(e);if(v&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!v||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);L=!0}var F=0,K=O.length;if(L)F=K;else for(var De=0;De<O.length;++De){var Y=O.charCodeAt(De);Y<128?F+=1:Y<2048?F+=2:Y<55296||Y>=57344?F+=3:(Y=65536+((Y&1023)<<10|O.charCodeAt(++De)&1023),F+=4)}return F+=this.encode(F*8),this.update(O),F},x.prototype.bytepad=function(O,L){for(var W=this.encode(L),F=0;F<O.length;++F)W+=this.encodeString(O[F]);var K=L-W%L,De=[];return De.length=K,this.update(De),this},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var O=this.blocks,L=this.lastByteIndex,W=this.blockCount,F=this.s;if(O[L>>2]|=this.padding[L&3],this.lastByteIndex===this.byteCount)for(O[0]=O[W],L=1;L<W+1;++L)O[L]=0;for(O[W-1]|=2147483648,L=0;L<W;++L)F[L]^=O[L];j(F)}},x.prototype.toString=x.prototype.hex=function(){this.finalize();for(var O=this.blockCount,L=this.s,W=this.outputBlocks,F=this.extraBytes,K=0,De=0,Y="",Q;De<W;){for(K=0;K<O&&De<W;++K,++De)Q=L[K],Y+=y[Q>>4&15]+y[Q&15]+y[Q>>12&15]+y[Q>>8&15]+y[Q>>20&15]+y[Q>>16&15]+y[Q>>28&15]+y[Q>>24&15];De%O===0&&(j(L),K=0)}return F&&(Q=L[K],Y+=y[Q>>4&15]+y[Q&15],F>1&&(Y+=y[Q>>12&15]+y[Q>>8&15]),F>2&&(Y+=y[Q>>20&15]+y[Q>>16&15])),Y},x.prototype.arrayBuffer=function(){this.finalize();var O=this.blockCount,L=this.s,W=this.outputBlocks,F=this.extraBytes,K=0,De=0,Y=this.outputBits>>3,Q;F?Q=new ArrayBuffer(W+1<<2):Q=new ArrayBuffer(Y);for(var Ve=new Uint32Array(Q);De<W;){for(K=0;K<O&&De<W;++K,++De)Ve[De]=L[K];De%O===0&&j(L)}return F&&(Ve[K]=L[K],Q=Q.slice(0,Y)),Q},x.prototype.buffer=x.prototype.arrayBuffer,x.prototype.digest=x.prototype.array=function(){this.finalize();for(var O=this.blockCount,L=this.s,W=this.outputBlocks,F=this.extraBytes,K=0,De=0,Y=[],Q,Ve;De<W;){for(K=0;K<O&&De<W;++K,++De)Q=De<<2,Ve=L[K],Y[Q]=Ve&255,Y[Q+1]=Ve>>8&255,Y[Q+2]=Ve>>16&255,Y[Q+3]=Ve>>24&255;De%O===0&&j(L)}return F&&(Q=De<<2,Ve=L[K],Y[Q]=Ve&255,F>1&&(Y[Q+1]=Ve>>8&255),F>2&&(Y[Q+2]=Ve>>16&255)),Y};function I(O,L,W){x.call(this,O,L,W)}I.prototype=new x,I.prototype.finalize=function(){return this.encode(this.outputBits,!0),x.prototype.finalize.call(this)};var j=function(O){var L,W,F,K,De,Y,Q,Ve,J,be,Ke,ye,Re,et,oe,xe,it,ce,Ie,ft,le,Ce,ot,se,Me,st,ae,Se,at,re,Te,ct,ne,Ee,lt,te,ke,ht,ue,Pe,dt,he,Ne,pt,de,qe,vt,pe,Le,ut,ve,Be,mt,me,Ae,$t,Je,Qe,Lt,Bt,Dt,jt,Ft;for(F=0;F<48;F+=2)K=O[0]^O[10]^O[20]^O[30]^O[40],De=O[1]^O[11]^O[21]^O[31]^O[41],Y=O[2]^O[12]^O[22]^O[32]^O[42],Q=O[3]^O[13]^O[23]^O[33]^O[43],Ve=O[4]^O[14]^O[24]^O[34]^O[44],J=O[5]^O[15]^O[25]^O[35]^O[45],be=O[6]^O[16]^O[26]^O[36]^O[46],Ke=O[7]^O[17]^O[27]^O[37]^O[47],ye=O[8]^O[18]^O[28]^O[38]^O[48],Re=O[9]^O[19]^O[29]^O[39]^O[49],L=ye^(Y<<1|Q>>>31),W=Re^(Q<<1|Y>>>31),O[0]^=L,O[1]^=W,O[10]^=L,O[11]^=W,O[20]^=L,O[21]^=W,O[30]^=L,O[31]^=W,O[40]^=L,O[41]^=W,L=K^(Ve<<1|J>>>31),W=De^(J<<1|Ve>>>31),O[2]^=L,O[3]^=W,O[12]^=L,O[13]^=W,O[22]^=L,O[23]^=W,O[32]^=L,O[33]^=W,O[42]^=L,O[43]^=W,L=Y^(be<<1|Ke>>>31),W=Q^(Ke<<1|be>>>31),O[4]^=L,O[5]^=W,O[14]^=L,O[15]^=W,O[24]^=L,O[25]^=W,O[34]^=L,O[35]^=W,O[44]^=L,O[45]^=W,L=Ve^(ye<<1|Re>>>31),W=J^(Re<<1|ye>>>31),O[6]^=L,O[7]^=W,O[16]^=L,O[17]^=W,O[26]^=L,O[27]^=W,O[36]^=L,O[37]^=W,O[46]^=L,O[47]^=W,L=be^(K<<1|De>>>31),W=Ke^(De<<1|K>>>31),O[8]^=L,O[9]^=W,O[18]^=L,O[19]^=W,O[28]^=L,O[29]^=W,O[38]^=L,O[39]^=W,O[48]^=L,O[49]^=W,et=O[0],oe=O[1],qe=O[11]<<4|O[10]>>>28,vt=O[10]<<4|O[11]>>>28,Se=O[20]<<3|O[21]>>>29,at=O[21]<<3|O[20]>>>29,Bt=O[31]<<9|O[30]>>>23,Dt=O[30]<<9|O[31]>>>23,he=O[40]<<18|O[41]>>>14,Ne=O[41]<<18|O[40]>>>14,Ee=O[2]<<1|O[3]>>>31,lt=O[3]<<1|O[2]>>>31,xe=O[13]<<12|O[12]>>>20,it=O[12]<<12|O[13]>>>20,pe=O[22]<<10|O[23]>>>22,Le=O[23]<<10|O[22]>>>22,re=O[33]<<13|O[32]>>>19,Te=O[32]<<13|O[33]>>>19,jt=O[42]<<2|O[43]>>>30,Ft=O[43]<<2|O[42]>>>30,me=O[5]<<30|O[4]>>>2,Ae=O[4]<<30|O[5]>>>2,te=O[14]<<6|O[15]>>>26,ke=O[15]<<6|O[14]>>>26,ce=O[25]<<11|O[24]>>>21,Ie=O[24]<<11|O[25]>>>21,ut=O[34]<<15|O[35]>>>17,ve=O[35]<<15|O[34]>>>17,ct=O[45]<<29|O[44]>>>3,ne=O[44]<<29|O[45]>>>3,se=O[6]<<28|O[7]>>>4,Me=O[7]<<28|O[6]>>>4,$t=O[17]<<23|O[16]>>>9,Je=O[16]<<23|O[17]>>>9,ht=O[26]<<25|O[27]>>>7,ue=O[27]<<25|O[26]>>>7,ft=O[36]<<21|O[37]>>>11,le=O[37]<<21|O[36]>>>11,Be=O[47]<<24|O[46]>>>8,mt=O[46]<<24|O[47]>>>8,pt=O[8]<<27|O[9]>>>5,de=O[9]<<27|O[8]>>>5,st=O[18]<<20|O[19]>>>12,ae=O[19]<<20|O[18]>>>12,Qe=O[29]<<7|O[28]>>>25,Lt=O[28]<<7|O[29]>>>25,Pe=O[38]<<8|O[39]>>>24,dt=O[39]<<8|O[38]>>>24,Ce=O[48]<<14|O[49]>>>18,ot=O[49]<<14|O[48]>>>18,O[0]=et^~xe&ce,O[1]=oe^~it&Ie,O[10]=se^~st&Se,O[11]=Me^~ae&at,O[20]=Ee^~te&ht,O[21]=lt^~ke&ue,O[30]=pt^~qe&pe,O[31]=de^~vt&Le,O[40]=me^~$t&Qe,O[41]=Ae^~Je&Lt,O[2]=xe^~ce&ft,O[3]=it^~Ie&le,O[12]=st^~Se&re,O[13]=ae^~at&Te,O[22]=te^~ht&Pe,O[23]=ke^~ue&dt,O[32]=qe^~pe&ut,O[33]=vt^~Le&ve,O[42]=$t^~Qe&Bt,O[43]=Je^~Lt&Dt,O[4]=ce^~ft&Ce,O[5]=Ie^~le&ot,O[14]=Se^~re&ct,O[15]=at^~Te&ne,O[24]=ht^~Pe&he,O[25]=ue^~dt&Ne,O[34]=pe^~ut&Be,O[35]=Le^~ve&mt,O[44]=Qe^~Bt&jt,O[45]=Lt^~Dt&Ft,O[6]=ft^~Ce&et,O[7]=le^~ot&oe,O[16]=re^~ct&se,O[17]=Te^~ne&Me,O[26]=Pe^~he&Ee,O[27]=dt^~Ne<,O[36]=ut^~Be&pt,O[37]=ve^~mt&de,O[46]=Bt^~jt&me,O[47]=Dt^~Ft&Ae,O[8]=Ce^~et&xe,O[9]=ot^~oe&it,O[18]=ct^~se&st,O[19]=ne^~Me&ae,O[28]=he^~Ee&te,O[29]=Ne^~lt&ke,O[38]=Be^~pt&qe,O[39]=mt^~de&vt,O[48]=jt^~me&$t,O[49]=Ft^~Ae&Je,O[0]^=B[F],O[1]^=B[F+1]};if(a)bp.exports=f;else{for(g=0;g<p.length;++g)n[p[g]]=f[p[g]];c&&define(function(){return f})}})()});var m8=E((hRe,Ep)=>{var YE,JE,QE,XE,e8,t8,r8,n8,i8,Sp,Ay,o8,s8,Yu,a8,u8,f8,c8,l8,h8,d8,p8,v8;(function(e){var t=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Ep=="object"&&typeof Ep.exports=="object"?e(r(t,r(Ep.exports))):e(r(t));function r(n,i){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,a){return n[o]=i?i(o,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])};YE=function(r,n){t(r,n);function i(){this.constructor=r}r.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)},JE=Object.assign||function(r){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},QE=function(r,n){var i={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(i[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(r);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(r,o[a])&&(i[o[a]]=r[o[a]]);return i},XE=function(r,n,i,o){var a=arguments.length,c=a<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,i):o,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,n,i,o);else for(var y=r.length-1;y>=0;y--)(v=r[y])&&(c=(a<3?v(c):a>3?v(n,i,c):v(n,i))||c);return a>3&&c&&Object.defineProperty(n,i,c),c},e8=function(r,n){return function(i,o){n(i,o,r)}},t8=function(r,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,n)},r8=function(r,n,i,o){function a(c){return c instanceof i?c:new i(function(v){v(c)})}return new(i||(i=Promise))(function(c,v){function y(S){try{M(o.next(S))}catch(R){v(R)}}function w(S){try{M(o.throw(S))}catch(R){v(R)}}function M(S){S.done?c(S.value):a(S.value).then(y,w)}M((o=o.apply(r,n||[])).next())})},n8=function(r,n){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,a,c,v;return v={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function y(M){return function(S){return w([M,S])}}function w(M){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(c=M[0]&2?a.return:M[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,M[1])).done)return c;switch(a=0,c&&(M=[M[0]&2,c.value]),M[0]){case 0:case 1:c=M;break;case 4:return i.label++,{value:M[1],done:!1};case 5:i.label++,a=M[1],M=[0];continue;case 7:M=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(M[0]===6||M[0]===2)){i=0;continue}if(M[0]===3&&(!c||M[1]>c[0]&&M[1]<c[3])){i.label=M[1];break}if(M[0]===6&&i.label<c[1]){i.label=c[1],c=M;break}if(c&&i.label<c[2]){i.label=c[2],i.ops.push(M);break}c[2]&&i.ops.pop(),i.trys.pop();continue}M=n.call(r,i)}catch(S){M=[6,S],a=0}finally{o=c=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}},v8=function(r,n,i,o){o===void 0&&(o=i),r[o]=n[i]},i8=function(r,n){for(var i in r)i!=="default"&&!n.hasOwnProperty(i)&&(n[i]=r[i])},Sp=function(r){var n=typeof Symbol=="function"&&Symbol.iterator,i=n&&r[n],o=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},Ay=function(r,n){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var o=i.call(r),a,c=[],v;try{for(;(n===void 0||n-- >0)&&!(a=o.next()).done;)c.push(a.value)}catch(y){v={error:y}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(v)throw v.error}}return c},o8=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Ay(arguments[n]));return r},s8=function(){for(var r=0,n=0,i=arguments.length;n<i;n++)r+=arguments[n].length;for(var o=Array(r),a=0,n=0;n<i;n++)for(var c=arguments[n],v=0,y=c.length;v<y;v++,a++)o[a]=c[v];return o},Yu=function(r){return this instanceof Yu?(this.v=r,this):new Yu(r)},a8=function(r,n,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(r,n||[]),a,c=[];return a={},v("next"),v("throw"),v("return"),a[Symbol.asyncIterator]=function(){return this},a;function v(C){o[C]&&(a[C]=function(B){return new Promise(function(N,q){c.push([C,B,N,q])>1||y(C,B)})})}function y(C,B){try{w(o[C](B))}catch(N){R(c[0][3],N)}}function w(C){C.value instanceof Yu?Promise.resolve(C.value.v).then(M,S):R(c[0][2],C)}function M(C){y("next",C)}function S(C){y("throw",C)}function R(C,B){C(B),c.shift(),c.length&&y(c[0][0],c[0][1])}},u8=function(r){var n,i;return n={},o("next"),o("throw",function(a){throw a}),o("return"),n[Symbol.iterator]=function(){return this},n;function o(a,c){n[a]=r[a]?function(v){return(i=!i)?{value:Yu(r[a](v)),done:a==="return"}:c?c(v):v}:c}},f8=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r[Symbol.asyncIterator],i;return n?n.call(r):(r=typeof Sp=="function"?Sp(r):r[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(c){i[c]=r[c]&&function(v){return new Promise(function(y,w){v=r[c](v),a(y,w,v.done,v.value)})}}function a(c,v,y,w){Promise.resolve(w).then(function(M){c({value:M,done:y})},v)}},c8=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r},l8=function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n.default=r,n},h8=function(r){return r&&r.__esModule?r:{default:r}},d8=function(r,n){if(!n.has(r))throw new TypeError("attempted to get private field on non-instance");return n.get(r)},p8=function(r,n,i){if(!n.has(r))throw new TypeError("attempted to set private field on non-instance");return n.set(r,i),i},e("__extends",YE),e("__assign",JE),e("__rest",QE),e("__decorate",XE),e("__param",e8),e("__metadata",t8),e("__awaiter",r8),e("__generator",n8),e("__exportStar",i8),e("__createBinding",v8),e("__values",Sp),e("__read",Ay),e("__spread",o8),e("__spreadArrays",s8),e("__await",Yu),e("__asyncGenerator",a8),e("__asyncDelegator",u8),e("__asyncValues",f8),e("__makeTemplateObject",c8),e("__importStar",l8),e("__importDefault",h8),e("__classPrivateFieldGet",d8),e("__classPrivateFieldSet",p8)})});var b8=E(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.isBrowserCryptoAvailable=ls.getSubtleCrypto=ls.getBrowerCrypto=void 0;function Oy(){return globalThis?.crypto||globalThis?.msCrypto||{}}ls.getBrowerCrypto=Oy;function g8(){let e=Oy();return e.subtle||e.webkitSubtle}ls.getSubtleCrypto=g8;function vZ(){return!!Oy()&&!!g8()}ls.isBrowserCryptoAvailable=vZ});var w8=E(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.isBrowser=hs.isNode=hs.isReactNative=void 0;function y8(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}hs.isReactNative=y8;function _8(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}hs.isNode=_8;function mZ(){return!y8()&&!_8()}hs.isBrowser=mZ});var Ju=E(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});var x8=m8();x8.__exportStar(b8(),Ap);x8.__exportStar(w8(),Ap)});var j8=E((rIe,D8)=>{"use strict";D8.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)});var z8=E((nIe,W8)=>{"use strict";var H8="%[a-f0-9]{2}",F8=new RegExp("("+H8+")|([^%]+?)","gi"),U8=new RegExp("("+H8+")+","gi");function Py(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],Py(r),Py(n))}function qZ(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(F8)||[],r=1;r<t.length;r++)e=Py(t,r).join(""),t=e.match(F8)||[];return e}}function LZ(e){for(var t={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=U8.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{var n=qZ(r[0]);n!==r[0]&&(t[r[0]]=n)}r=U8.exec(e)}t["%C2"]="\uFFFD";for(var i=Object.keys(t),o=0;o<i.length;o++){var a=i[o];e=e.replace(new RegExp(a,"g"),t[a])}return e}W8.exports=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return LZ(e)}}});var $8=E((iIe,V8)=>{"use strict";V8.exports=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];let r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]}});var e9=E(Lo=>{"use strict";var BZ=j8(),DZ=z8(),G8=$8(),jZ=e=>e==null;function FZ(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[en(t,e),"[",i,"]"].join("")]:[...r,[en(t,e),"[",en(i,e),"]=",en(n,e)].join("")]};case"bracket":return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,[en(t,e),"[]"].join("")]:[...r,[en(t,e),"[]=",en(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>n==null||n.length===0?r:r.length===0?[[en(t,e),"=",en(n,e)].join("")]:[[r,en(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>n===void 0||e.skipNull&&n===null||e.skipEmptyString&&n===""?r:n===null?[...r,en(t,e)]:[...r,[en(t,e),"=",en(n,e)].join("")]}}function UZ(e){let t;switch(e.arrayFormat){case"index":return(r,n,i)=>{if(t=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!t){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][t[1]]=n};case"bracket":return(r,n,i)=>{if(t=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!t){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[].concat(i[r],n)};case"comma":case"separator":return(r,n,i)=>{let a=typeof n=="string"&&n.split("").indexOf(e.arrayFormatSeparator)>-1?n.split(e.arrayFormatSeparator).map(c=>Sl(c,e)):n===null?n:Sl(n,e);i[r]=a};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[].concat(i[r],n)}}}function Z8(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function en(e,t){return t.encode?t.strict?BZ(e):encodeURIComponent(e):e}function Sl(e,t){return t.decode?DZ(e):e}function Y8(e){return Array.isArray(e)?e.sort():typeof e=="object"?Y8(Object.keys(e)).sort((t,r)=>Number(t)-Number(r)).map(t=>e[t]):e}function J8(e){let t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function HZ(e){let t="",r=e.indexOf("#");return r!==-1&&(t=e.slice(r)),t}function Q8(e){e=J8(e);let t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function K8(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function X8(e,t){t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t),Z8(t.arrayFormatSeparator);let r=UZ(t),n=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return n;for(let i of e.split("&")){let[o,a]=G8(t.decode?i.replace(/\+/g," "):i,"=");a=a===void 0?null:["comma","separator"].includes(t.arrayFormat)?a:Sl(a,t),r(Sl(o,t),a,n)}for(let i of Object.keys(n)){let o=n[i];if(typeof o=="object"&&o!==null)for(let a of Object.keys(o))o[a]=K8(o[a],t);else n[i]=K8(o,t)}return t.sort===!1?n:(t.sort===!0?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((i,o)=>{let a=n[o];return Boolean(a)&&typeof a=="object"&&!Array.isArray(a)?i[o]=Y8(a):i[o]=a,i},Object.create(null))}Lo.extract=Q8;Lo.parse=X8;Lo.stringify=(e,t)=>{if(!e)return"";t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t),Z8(t.arrayFormatSeparator);let r=a=>t.skipNull&&jZ(e[a])||t.skipEmptyString&&e[a]==="",n=FZ(t),i={};for(let a of Object.keys(e))r(a)||(i[a]=e[a]);let o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(a=>{let c=e[a];return c===void 0?"":c===null?en(a,t):Array.isArray(c)?c.reduce(n(a),[]).join("&"):en(a,t)+"="+en(c,t)}).filter(a=>a.length>0).join("&")};Lo.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[r,n]=G8(e,"#");return Object.assign({url:r.split("?")[0]||"",query:X8(Q8(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:Sl(n,t)}:{})};Lo.stringifyUrl=(e,t)=>{t=Object.assign({encode:!0,strict:!0},t);let r=J8(e.url).split("?")[0]||"",n=Lo.extract(e.url),i=Lo.parse(n,{sort:!1}),o=Object.assign(i,e.query),a=Lo.stringify(o,t);a&&(a=`?${a}`);let c=HZ(e.url);return e.fragmentIdentifier&&(c=`#${en(e.fragmentIdentifier,t)}`),`${r}${a}${c}`}});var a9=E((_Ie,s9)=>{"use strict";s9.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var N9=E((wCe,P9)=>{P9.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Fp=E((xCe,q9)=>{var AY={}.toString;q9.exports=Array.isArray||function(e){return AY.call(e)=="[object Array]"}});var ma=E((MCe,a_)=>{"use strict";var OY=Fp();function RY(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e.foo()===42}catch{return!1}}St.TYPED_ARRAY_SUPPORT=RY();var L9=St.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function St(e,t,r){return!St.TYPED_ARRAY_SUPPORT&&!(this instanceof St)?new St(e,t,r):typeof e=="number"?B9(this,e):qY(this,e,t,r)}St.TYPED_ARRAY_SUPPORT&&(St.prototype.__proto__=Uint8Array.prototype,St.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&St[Symbol.species]===St&&Object.defineProperty(St,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function s_(e){if(e>=L9)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+L9.toString(16)+" bytes");return e|0}function IY(e){return e!==e}function tf(e,t){var r;return St.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=St.prototype):(r=e,r===null&&(r=new St(t)),r.length=t),r}function B9(e,t){var r=tf(e,t<0?0:s_(t)|0);if(!St.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)r[n]=0;return r}function CY(e,t){var r=j9(t)|0,n=tf(e,r),i=n.write(t);return i!==r&&(n=n.slice(0,i)),n}function o_(e,t){for(var r=t.length<0?0:s_(t.length)|0,n=tf(e,r),i=0;i<r;i+=1)n[i]=t[i]&255;return n}function TY(e,t,r,n){if(r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");var i;return r===void 0&&n===void 0?i=new Uint8Array(t):n===void 0?i=new Uint8Array(t,r):i=new Uint8Array(t,r,n),St.TYPED_ARRAY_SUPPORT?i.__proto__=St.prototype:i=o_(e,i),i}function kY(e,t){if(St.isBuffer(t)){var r=s_(t.length)|0,n=tf(e,r);return n.length===0||t.copy(n,0,0,r),n}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||IY(t.length)?tf(e,0):o_(e,t);if(t.type==="Buffer"&&Array.isArray(t.data))return o_(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function D9(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function j9(e){if(St.isBuffer(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;return t===0?0:D9(e).length}function PY(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function NY(e,t,r,n){return PY(D9(t,e.length-r),e,r,n)}function qY(e,t,r,n){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?TY(e,t,r,n):typeof t=="string"?CY(e,t,r):kY(e,t)}St.prototype.write=function(t,r,n){r===void 0?(n=this.length,r=0):n===void 0&&typeof r=="string"?(n=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(n)?n=n|0:n=void 0);var i=this.length-r;if((n===void 0||n>i)&&(n=i),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return NY(this,t,r,n)};St.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);var i;if(St.TYPED_ARRAY_SUPPORT)i=this.subarray(t,r),i.__proto__=St.prototype;else{var o=r-t;i=new St(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+t]}return i};St.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);var o=i-n,a;if(this===t&&n<r&&r<i)for(a=o-1;a>=0;--a)t[a+r]=this[a+n];else if(o<1e3||!St.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)t[a+r]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r);return o};St.prototype.fill=function(t,r,n){if(typeof t=="string"){if(typeof r=="string"?(r=0,n=this.length):typeof n=="string"&&(n=this.length),t.length===1){var i=t.charCodeAt(0);i<256&&(t=i)}}else typeof t=="number"&&(t=t&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var o;if(typeof t=="number")for(o=r;o<n;++o)this[o]=t;else{var a=St.isBuffer(t)?t:new St(t),c=a.length;for(o=0;o<n-r;++o)this[o+r]=a[o%c]}return this};St.concat=function(t,r){if(!OY(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return tf(null,0);var n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;var i=B9(null,r),o=0;for(n=0;n<t.length;++n){var a=t[n];if(!St.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};St.byteLength=j9;St.prototype._isBuffer=!0;St.isBuffer=function(t){return!!(t!=null&&t._isBuffer)};a_.exports.alloc=function(e){var t=new St(e);return t.fill(0),t};a_.exports.from=function(e){return new St(e)}});var vs=E(ga=>{var u_,LY=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];ga.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};ga.getSymbolTotalCodewords=function(t){return LY[t]};ga.getBCHDigit=function(e){for(var t=0;e!==0;)t++,e>>>=1;return t};ga.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');u_=t};ga.isKanjiModeEnabled=function(){return typeof u_<"u"};ga.toSJIS=function(t){return u_(t)}});var Up=E(hi=>{hi.L={bit:1};hi.M={bit:0};hi.Q={bit:3};hi.H={bit:2};function BY(e){if(typeof e!="string")throw new Error("Param is not a string");var t=e.toLowerCase();switch(t){case"l":case"low":return hi.L;case"m":case"medium":return hi.M;case"q":case"quartile":return hi.Q;case"h":case"high":return hi.H;default:throw new Error("Unknown EC Level: "+e)}}hi.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};hi.from=function(t,r){if(hi.isValid(t))return t;try{return BY(t)}catch{return r}}});var H9=E((ACe,U9)=>{function F9(){this.buffer=[],this.length=0}F9.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};U9.exports=F9});var V9=E((OCe,z9)=>{var W9=ma();function Ol(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=W9.alloc(e*e),this.reservedBit=W9.alloc(e*e)}Ol.prototype.set=function(e,t,r,n){var i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)};Ol.prototype.get=function(e,t){return this.data[e*this.size+t]};Ol.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};Ol.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};z9.exports=Ol});var $9=E(Hp=>{var DY=vs().getSymbolSize;Hp.getRowColCoords=function(t){if(t===1)return[];for(var r=Math.floor(t/7)+2,n=DY(t),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,o=[n-7],a=1;a<r-1;a++)o[a]=o[a-1]-i;return o.push(6),o.reverse()};Hp.getPositions=function(t){for(var r=[],n=Hp.getRowColCoords(t),i=n.length,o=0;o<i;o++)for(var a=0;a<i;a++)o===0&&a===0||o===0&&a===i-1||o===i-1&&a===0||r.push([n[o],n[a]]);return r}});var Z9=E(G9=>{var jY=vs().getSymbolSize,K9=7;G9.getPositions=function(t){var r=jY(t);return[[0,0],[r-K9,0],[0,r-K9]]}});var Y9=E(cr=>{cr.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var ba={N1:3,N2:3,N3:40,N4:10};cr.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};cr.from=function(t){return cr.isValid(t)?parseInt(t,10):void 0};cr.getPenaltyN1=function(t){for(var r=t.size,n=0,i=0,o=0,a=null,c=null,v=0;v<r;v++){i=o=0,a=c=null;for(var y=0;y<r;y++){var w=t.get(v,y);w===a?i++:(i>=5&&(n+=ba.N1+(i-5)),a=w,i=1),w=t.get(y,v),w===c?o++:(o>=5&&(n+=ba.N1+(o-5)),c=w,o=1)}i>=5&&(n+=ba.N1+(i-5)),o>=5&&(n+=ba.N1+(o-5))}return n};cr.getPenaltyN2=function(t){for(var r=t.size,n=0,i=0;i<r-1;i++)for(var o=0;o<r-1;o++){var a=t.get(i,o)+t.get(i,o+1)+t.get(i+1,o)+t.get(i+1,o+1);(a===4||a===0)&&n++}return n*ba.N2};cr.getPenaltyN3=function(t){for(var r=t.size,n=0,i=0,o=0,a=0;a<r;a++){i=o=0;for(var c=0;c<r;c++)i=i<<1&2047|t.get(a,c),c>=10&&(i===1488||i===93)&&n++,o=o<<1&2047|t.get(c,a),c>=10&&(o===1488||o===93)&&n++}return n*ba.N3};cr.getPenaltyN4=function(t){for(var r=0,n=t.data.length,i=0;i<n;i++)r+=t.data[i];var o=Math.abs(Math.ceil(r*100/n/5)-10);return o*ba.N4};function FY(e,t,r){switch(e){case cr.Patterns.PATTERN000:return(t+r)%2===0;case cr.Patterns.PATTERN001:return t%2===0;case cr.Patterns.PATTERN010:return r%3===0;case cr.Patterns.PATTERN011:return(t+r)%3===0;case cr.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case cr.Patterns.PATTERN101:return t*r%2+t*r%3===0;case cr.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case cr.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}cr.applyMask=function(t,r){for(var n=r.size,i=0;i<n;i++)for(var o=0;o<n;o++)r.isReserved(o,i)||r.xor(o,i,FY(t,o,i))};cr.getBestMask=function(t,r){for(var n=Object.keys(cr.Patterns).length,i=0,o=1/0,a=0;a<n;a++){r(a),cr.applyMask(a,t);var c=cr.getPenaltyN1(t)+cr.getPenaltyN2(t)+cr.getPenaltyN3(t)+cr.getPenaltyN4(t);cr.applyMask(a,t),c<o&&(o=c,i=a)}return i}});var c_=E(f_=>{var ms=Up(),Wp=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],zp=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];f_.getBlocksCount=function(t,r){switch(r){case ms.L:return Wp[(t-1)*4+0];case ms.M:return Wp[(t-1)*4+1];case ms.Q:return Wp[(t-1)*4+2];case ms.H:return Wp[(t-1)*4+3];default:return}};f_.getTotalCodewordsCount=function(t,r){switch(r){case ms.L:return zp[(t-1)*4+0];case ms.M:return zp[(t-1)*4+1];case ms.Q:return zp[(t-1)*4+2];case ms.H:return zp[(t-1)*4+3];default:return}}});var Q9=E($p=>{var J9=ma(),Rl=J9.alloc(512),Vp=J9.alloc(256);(function(){for(var t=1,r=0;r<255;r++)Rl[r]=t,Vp[t]=r,t<<=1,t&256&&(t^=285);for(r=255;r<512;r++)Rl[r]=Rl[r-255]})();$p.log=function(t){if(t<1)throw new Error("log("+t+")");return Vp[t]};$p.exp=function(t){return Rl[t]};$p.mul=function(t,r){return t===0||r===0?0:Rl[Vp[t]+Vp[r]]}});var X9=E(Il=>{var l_=ma(),h_=Q9();Il.mul=function(t,r){for(var n=l_.alloc(t.length+r.length-1),i=0;i<t.length;i++)for(var o=0;o<r.length;o++)n[i+o]^=h_.mul(t[i],r[o]);return n};Il.mod=function(t,r){for(var n=l_.from(t);n.length-r.length>=0;){for(var i=n[0],o=0;o<r.length;o++)n[o]^=h_.mul(r[o],i);for(var a=0;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n};Il.generateECPolynomial=function(t){for(var r=l_.from([1]),n=0;n<t;n++)r=Il.mul(r,[1,h_.exp(n)]);return r}});var n7=E((NCe,r7)=>{var e7=ma(),t7=X9(),UY=fi().Buffer;function d_(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}d_.prototype.initialize=function(t){this.degree=t,this.genPoly=t7.generateECPolynomial(this.degree)};d_.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var r=e7.alloc(this.degree),n=UY.concat([t,r],t.length+this.degree),i=t7.mod(n,this.genPoly),o=this.degree-i.length;if(o>0){var a=e7.alloc(this.degree);return i.copy(a,o),a}return i};r7.exports=d_});var p_=E(i7=>{i7.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var v_=E(Do=>{var o7="[0-9]+",HY="[A-Z $%*+\\-./:]+",Cl="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Cl=Cl.replace(/u/g,"\\u");var WY="(?:(?![A-Z0-9 $%*+\\-./:]|"+Cl+`)(?:.|[\r
|
|
2
|
+
]))+`;Do.KANJI=new RegExp(Cl,"g");Do.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Do.BYTE=new RegExp(WY,"g");Do.NUMERIC=new RegExp(o7,"g");Do.ALPHANUMERIC=new RegExp(HY,"g");var zY=new RegExp("^"+Cl+"$"),VY=new RegExp("^"+o7+"$"),$Y=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Do.testKanji=function(t){return zY.test(t)};Do.testNumeric=function(t){return VY.test(t)};Do.testAlphanumeric=function(t){return $Y.test(t)}});var gs=E(Nr=>{var KY=p_(),m_=v_();Nr.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]};Nr.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]};Nr.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]};Nr.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]};Nr.MIXED={bit:-1};Nr.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!KY.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]};Nr.getBestModeForData=function(t){return m_.testNumeric(t)?Nr.NUMERIC:m_.testAlphanumeric(t)?Nr.ALPHANUMERIC:m_.testKanji(t)?Nr.KANJI:Nr.BYTE};Nr.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};Nr.isValid=function(t){return t&&t.bit&&t.ccBits};function GY(e){if(typeof e!="string")throw new Error("Param is not a string");var t=e.toLowerCase();switch(t){case"numeric":return Nr.NUMERIC;case"alphanumeric":return Nr.ALPHANUMERIC;case"kanji":return Nr.KANJI;case"byte":return Nr.BYTE;default:throw new Error("Unknown mode: "+e)}}Nr.from=function(t,r){if(Nr.isValid(t))return t;try{return GY(t)}catch{return r}}});var c7=E(ya=>{var Kp=vs(),ZY=c_(),s7=Up(),bs=gs(),g_=p_(),YY=Fp(),u7=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a7=Kp.getBCHDigit(u7);function JY(e,t,r){for(var n=1;n<=40;n++)if(t<=ya.getCapacity(n,r,e))return n}function f7(e,t){return bs.getCharCountIndicator(e,t)+4}function QY(e,t){var r=0;return e.forEach(function(n){var i=f7(n.mode,t);r+=i+n.getBitsLength()}),r}function XY(e,t){for(var r=1;r<=40;r++){var n=QY(e,r);if(n<=ya.getCapacity(r,t,bs.MIXED))return r}}ya.from=function(t,r){return g_.isValid(t)?parseInt(t,10):r};ya.getCapacity=function(t,r,n){if(!g_.isValid(t))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=bs.BYTE);var i=Kp.getSymbolTotalCodewords(t),o=ZY.getTotalCodewordsCount(t,r),a=(i-o)*8;if(n===bs.MIXED)return a;var c=a-f7(n,t);switch(n){case bs.NUMERIC:return Math.floor(c/10*3);case bs.ALPHANUMERIC:return Math.floor(c/11*2);case bs.KANJI:return Math.floor(c/13);case bs.BYTE:default:return Math.floor(c/8)}};ya.getBestVersionForData=function(t,r){var n,i=s7.from(r,s7.M);if(YY(t)){if(t.length>1)return XY(t,i);if(t.length===0)return 1;n=t[0]}else n=t;return JY(n.mode,n.getLength(),i)};ya.getEncodedBits=function(t){if(!g_.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var r=t<<12;Kp.getBCHDigit(r)-a7>=0;)r^=u7<<Kp.getBCHDigit(r)-a7;return t<<12|r}});var p7=E(d7=>{var b_=vs(),h7=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,eJ=1<<14|1<<12|1<<10|1<<4|1<<1,l7=b_.getBCHDigit(h7);d7.getEncodedBits=function(t,r){for(var n=t.bit<<3|r,i=n<<10;b_.getBCHDigit(i)-l7>=0;)i^=h7<<b_.getBCHDigit(i)-l7;return(n<<10|i)^eJ}});var m7=E((FCe,v7)=>{var tJ=gs();function rf(e){this.mode=tJ.NUMERIC,this.data=e.toString()}rf.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};rf.prototype.getLength=function(){return this.data.length};rf.prototype.getBitsLength=function(){return rf.getBitsLength(this.data.length)};rf.prototype.write=function(t){var r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),t.put(i,10);var o=this.data.length-r;o>0&&(n=this.data.substr(r),i=parseInt(n,10),t.put(i,o*3+1))};v7.exports=rf});var b7=E((UCe,g7)=>{var rJ=gs(),y_=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function nf(e){this.mode=rJ.ALPHANUMERIC,this.data=e}nf.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};nf.prototype.getLength=function(){return this.data.length};nf.prototype.getBitsLength=function(){return nf.getBitsLength(this.data.length)};nf.prototype.write=function(t){var r;for(r=0;r+2<=this.data.length;r+=2){var n=y_.indexOf(this.data[r])*45;n+=y_.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(y_.indexOf(this.data[r]),6)};g7.exports=nf});var _7=E((HCe,y7)=>{var nJ=ma(),iJ=gs();function of(e){this.mode=iJ.BYTE,this.data=nJ.from(e)}of.getBitsLength=function(t){return t*8};of.prototype.getLength=function(){return this.data.length};of.prototype.getBitsLength=function(){return of.getBitsLength(this.data.length)};of.prototype.write=function(e){for(var t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};y7.exports=of});var x7=E((WCe,w7)=>{var oJ=gs(),sJ=vs();function sf(e){this.mode=oJ.KANJI,this.data=e}sf.getBitsLength=function(t){return t*13};sf.prototype.getLength=function(){return this.data.length};sf.prototype.getBitsLength=function(){return sf.getBitsLength(this.data.length)};sf.prototype.write=function(e){var t;for(t=0;t<this.data.length;t++){var r=sJ.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
|
+
Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};w7.exports=sf});var M7=E((zCe,__)=>{"use strict";var Tl={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var o=Tl.PriorityQueue.make();o.push(t,0);for(var a,c,v,y,w,M,S,R,C;!o.empty();){a=o.pop(),c=a.value,y=a.cost,w=e[c]||{};for(v in w)w.hasOwnProperty(v)&&(M=w[v],S=y+M,R=i[v],C=typeof i[v]>"u",(C||R>S)&&(i[v]=S,o.push(v,S),n[v]=c))}if(typeof r<"u"&&typeof i[r]>"u"){var B=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(B)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t,i;n;)r.push(n),i=e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=Tl.single_source_shortest_paths(e,t,r);return Tl.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t=Tl.PriorityQueue,r={},n;e=e||{};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof __<"u"&&(__.exports=Tl)});var T7=E(af=>{var Wt=gs(),A7=m7(),O7=b7(),R7=_7(),I7=x7(),kl=v_(),Gp=vs(),aJ=M7();function S7(e){return unescape(encodeURIComponent(e)).length}function Pl(e,t,r){for(var n=[],i;(i=e.exec(r))!==null;)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function C7(e){var t=Pl(kl.NUMERIC,Wt.NUMERIC,e),r=Pl(kl.ALPHANUMERIC,Wt.ALPHANUMERIC,e),n,i;Gp.isKanjiModeEnabled()?(n=Pl(kl.BYTE,Wt.BYTE,e),i=Pl(kl.KANJI,Wt.KANJI,e)):(n=Pl(kl.BYTE_KANJI,Wt.BYTE,e),i=[]);var o=t.concat(r,n,i);return o.sort(function(a,c){return a.index-c.index}).map(function(a){return{data:a.data,mode:a.mode,length:a.length}})}function w_(e,t){switch(t){case Wt.NUMERIC:return A7.getBitsLength(e);case Wt.ALPHANUMERIC:return O7.getBitsLength(e);case Wt.KANJI:return I7.getBitsLength(e);case Wt.BYTE:return R7.getBitsLength(e)}}function uJ(e){return e.reduce(function(t,r){var n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===r.mode?(t[t.length-1].data+=r.data,t):(t.push(r),t)},[])}function fJ(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];switch(n.mode){case Wt.NUMERIC:t.push([n,{data:n.data,mode:Wt.ALPHANUMERIC,length:n.length},{data:n.data,mode:Wt.BYTE,length:n.length}]);break;case Wt.ALPHANUMERIC:t.push([n,{data:n.data,mode:Wt.BYTE,length:n.length}]);break;case Wt.KANJI:t.push([n,{data:n.data,mode:Wt.BYTE,length:S7(n.data)}]);break;case Wt.BYTE:t.push([{data:n.data,mode:Wt.BYTE,length:S7(n.data)}])}}return t}function cJ(e,t){for(var r={},n={start:{}},i=["start"],o=0;o<e.length;o++){for(var a=e[o],c=[],v=0;v<a.length;v++){var y=a[v],w=""+o+v;c.push(w),r[w]={node:y,lastCount:0},n[w]={};for(var M=0;M<i.length;M++){var S=i[M];r[S]&&r[S].node.mode===y.mode?(n[S][w]=w_(r[S].lastCount+y.length,y.mode)-w_(r[S].lastCount,y.mode),r[S].lastCount+=y.length):(r[S]&&(r[S].lastCount=y.length),n[S][w]=w_(y.length,y.mode)+4+Wt.getCharCountIndicator(y.mode,t))}}i=c}for(M=0;M<i.length;M++)n[i[M]].end=0;return{map:n,table:r}}function E7(e,t){var r,n=Wt.getBestModeForData(e);if(r=Wt.from(t,n),r!==Wt.BYTE&&r.bit<n.bit)throw new Error('"'+e+'" cannot be encoded with mode '+Wt.toString(r)+`.
|
|
4
|
+
Suggested mode is: `+Wt.toString(n));switch(r===Wt.KANJI&&!Gp.isKanjiModeEnabled()&&(r=Wt.BYTE),r){case Wt.NUMERIC:return new A7(e);case Wt.ALPHANUMERIC:return new O7(e);case Wt.KANJI:return new I7(e);case Wt.BYTE:return new R7(e)}}af.fromArray=function(t){return t.reduce(function(r,n){return typeof n=="string"?r.push(E7(n,null)):n.data&&r.push(E7(n.data,n.mode)),r},[])};af.fromString=function(t,r){for(var n=C7(t,Gp.isKanjiModeEnabled()),i=fJ(n),o=cJ(i,r),a=aJ.find_path(o.map,"start","end"),c=[],v=1;v<a.length-1;v++)c.push(o.table[a[v]].node);return af.fromArray(uJ(c))};af.rawSplit=function(t){return af.fromArray(C7(t,Gp.isKanjiModeEnabled()))}});var N7=E(P7=>{var k7=ma(),Yp=vs(),x_=Up(),lJ=H9(),hJ=V9(),dJ=$9(),pJ=Z9(),E_=Y9(),A_=c_(),vJ=n7(),Zp=c7(),mJ=p7(),gJ=gs(),M_=T7(),bJ=Fp();function yJ(e,t){for(var r=e.size,n=pJ.getPositions(t),i=0;i<n.length;i++)for(var o=n[i][0],a=n[i][1],c=-1;c<=7;c++)if(!(o+c<=-1||r<=o+c))for(var v=-1;v<=7;v++)a+v<=-1||r<=a+v||(c>=0&&c<=6&&(v===0||v===6)||v>=0&&v<=6&&(c===0||c===6)||c>=2&&c<=4&&v>=2&&v<=4?e.set(o+c,a+v,!0,!0):e.set(o+c,a+v,!1,!0))}function _J(e){for(var t=e.size,r=8;r<t-8;r++){var n=r%2===0;e.set(r,6,n,!0),e.set(6,r,n,!0)}}function wJ(e,t){for(var r=dJ.getPositions(t),n=0;n<r.length;n++)for(var i=r[n][0],o=r[n][1],a=-2;a<=2;a++)for(var c=-2;c<=2;c++)a===-2||a===2||c===-2||c===2||a===0&&c===0?e.set(i+a,o+c,!0,!0):e.set(i+a,o+c,!1,!0)}function xJ(e,t){for(var r=e.size,n=Zp.getEncodedBits(t),i,o,a,c=0;c<18;c++)i=Math.floor(c/3),o=c%3+r-8-3,a=(n>>c&1)===1,e.set(i,o,a,!0),e.set(o,i,a,!0)}function S_(e,t,r){var n=e.size,i=mJ.getEncodedBits(t,r),o,a;for(o=0;o<15;o++)a=(i>>o&1)===1,o<6?e.set(o,8,a,!0):o<8?e.set(o+1,8,a,!0):e.set(n-15+o,8,a,!0),o<8?e.set(8,n-o-1,a,!0):o<9?e.set(8,15-o-1+1,a,!0):e.set(8,15-o-1,a,!0);e.set(n-8,8,1,!0)}function MJ(e,t){for(var r=e.size,n=-1,i=r-1,o=7,a=0,c=r-1;c>0;c-=2)for(c===6&&c--;;){for(var v=0;v<2;v++)if(!e.isReserved(i,c-v)){var y=!1;a<t.length&&(y=(t[a]>>>o&1)===1),e.set(i,c-v,y),o--,o===-1&&(a++,o=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function SJ(e,t,r){var n=new lJ;r.forEach(function(y){n.put(y.mode.bit,4),n.put(y.getLength(),gJ.getCharCountIndicator(y.mode,e)),y.write(n)});var i=Yp.getSymbolTotalCodewords(e),o=A_.getTotalCodewordsCount(e,t),a=(i-o)*8;for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);for(var c=(a-n.getLengthInBits())/8,v=0;v<c;v++)n.put(v%2?17:236,8);return EJ(n,e,t)}function EJ(e,t,r){for(var n=Yp.getSymbolTotalCodewords(t),i=A_.getTotalCodewordsCount(t,r),o=n-i,a=A_.getBlocksCount(t,r),c=n%a,v=a-c,y=Math.floor(n/a),w=Math.floor(o/a),M=w+1,S=y-w,R=new vJ(S),C=0,B=new Array(a),N=new Array(a),q=0,H=k7.from(e.buffer),D=0;D<a;D++){var ee=D<v?w:M;B[D]=H.slice(C,C+ee),N[D]=R.encode(B[D]),C+=ee,q=Math.max(q,ee)}var ge=k7.alloc(n),Z=0,X,V;for(X=0;X<q;X++)for(V=0;V<a;V++)X<B[V].length&&(ge[Z++]=B[V][X]);for(X=0;X<S;X++)for(V=0;V<a;V++)ge[Z++]=N[V][X];return ge}function AJ(e,t,r,n){var i;if(bJ(e))i=M_.fromArray(e);else if(typeof e=="string"){var o=t;if(!o){var a=M_.rawSplit(e);o=Zp.getBestVersionForData(a,r)}i=M_.fromString(e,o||40)}else throw new Error("Invalid data");var c=Zp.getBestVersionForData(i,r);if(!c)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=c;else if(t<c)throw new Error(`
|
|
5
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
+
Minimum version required to store current data is: `+c+`.
|
|
7
|
+
`);var v=SJ(t,r,i),y=Yp.getSymbolSize(t),w=new hJ(y);return yJ(w,t),_J(w),wJ(w,t),S_(w,r,0),t>=7&&xJ(w,t),MJ(w,v),isNaN(n)&&(n=E_.getBestMask(w,S_.bind(null,w,r))),E_.applyMask(n,w),S_(w,r,n),{modules:w,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}P7.create=function(t,r){if(typeof t>"u"||t==="")throw new Error("No input text");var n=x_.M,i,o;return typeof r<"u"&&(n=x_.from(r.errorCorrectionLevel,x_.M),i=Zp.from(r.version),o=E_.from(r.maskPattern),r.toSJISFunc&&Yp.setToSJISFunction(r.toSJISFunc)),AJ(t,i,n,o)}});var O_=E(_a=>{function q7(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(n){return[n,n]}))),t.length===6&&t.push("F","F");var r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+t.slice(0,6).join("")}}_a.getOptions=function(t){t||(t={}),t.color||(t.color={});var r=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:q7(t.color.dark||"#000000ff"),light:q7(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};_a.getScale=function(t,r){return r.width&&r.width>=t+r.margin*2?r.width/(t+r.margin*2):r.scale};_a.getImageWidth=function(t,r){var n=_a.getScale(t,r);return Math.floor((t+r.margin*2)*n)};_a.qrToImageData=function(t,r,n){for(var i=r.modules.size,o=r.modules.data,a=_a.getScale(i,n),c=Math.floor((i+n.margin*2)*a),v=n.margin*a,y=[n.color.light,n.color.dark],w=0;w<c;w++)for(var M=0;M<c;M++){var S=(w*c+M)*4,R=n.color.light;if(w>=v&&M>=v&&w<c-v&&M<c-v){var C=Math.floor((w-v)/a),B=Math.floor((M-v)/a);R=y[o[C*i+B]?1:0]}t[S++]=R.r,t[S++]=R.g,t[S++]=R.b,t[S]=R.a}}});var L7=E(Jp=>{var R_=O_();function OJ(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}function RJ(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Jp.render=function(t,r,n){var i=n,o=r;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),r||(o=RJ()),i=R_.getOptions(i);var a=R_.getImageWidth(t.modules.size,i),c=o.getContext("2d"),v=c.createImageData(a,a);return R_.qrToImageData(v.data,t,i),OJ(c,o,a),c.putImageData(v,0,0),o};Jp.renderToDataURL=function(t,r,n){var i=n;typeof i>"u"&&(!r||!r.getContext)&&(i=r,r=void 0),i||(i={});var o=Jp.render(t,r,i),a=i.type||"image/png",c=i.rendererOpts||{};return o.toDataURL(a,c.quality)}});var j7=E(D7=>{var IJ=O_();function B7(e,t){var r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function I_(e,t,r){var n=e+t;return typeof r<"u"&&(n+=" "+r),n}function CJ(e,t,r){for(var n="",i=0,o=!1,a=0,c=0;c<e.length;c++){var v=Math.floor(c%t),y=Math.floor(c/t);!v&&!o&&(o=!0),e[c]?(a++,c>0&&v>0&&e[c-1]||(n+=o?I_("M",v+r,.5+y+r):I_("m",i,0),i=0,o=!1),v+1<t&&e[c+1]||(n+=I_("h",a),a=0)):i++}return n}D7.render=function(t,r,n){var i=IJ.getOptions(r),o=t.modules.size,a=t.modules.data,c=o+i.margin*2,v=i.color.light.a?"<path "+B7(i.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",y="<path "+B7(i.color.dark,"stroke")+' d="'+CJ(a,o,i.margin)+'"/>',w='viewBox="0 0 '+c+" "+c+'"',M=i.width?'width="'+i.width+'" height="'+i.width+'" ':"",S='<svg xmlns="http://www.w3.org/2000/svg" '+M+w+' shape-rendering="crispEdges">'+v+y+`</svg>
|
|
8
|
+
`;return typeof n=="function"&&n(null,S),S}});var U7=E(Nl=>{var TJ=N9(),C_=N7(),F7=L7(),kJ=j7();function T_(e,t,r,n,i){var o=[].slice.call(arguments,1),a=o.length,c=typeof o[a-1]=="function";if(!c&&!TJ())throw new Error("Callback required as last argument");if(c){if(a<2)throw new Error("Too few arguments provided");a===2?(i=r,r=t,t=n=void 0):a===3&&(t.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(r=t,t=n=void 0):a===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(y,w){try{var M=C_.create(r,n);y(e(M,t,n))}catch(S){w(S)}})}try{var v=C_.create(r,n);i(null,e(v,t,n))}catch(y){i(y)}}Nl.create=C_.create;Nl.toCanvas=T_.bind(null,F7.render);Nl.toDataURL=T_.bind(null,F7.renderToDataURL);Nl.toString=T_.bind(null,function(e,t,r){return kJ.render(e,r)})});var W7=E((JCe,H7)=>{H7.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(i){e.addRange(i)}),t&&t.focus()}}});var $7=E((QCe,V7)=>{"use strict";var PJ=W7(),z7={"text/plain":"Text","text/html":"Url",default:"Text"},NJ="Copy to clipboard: #{key}, Enter";function qJ(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function LJ(e,t){var r,n,i,o,a,c,v=!1;t||(t={}),r=t.debug||!1;try{i=PJ(),o=document.createRange(),a=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(w){if(w.stopPropagation(),t.format)if(w.preventDefault(),typeof w.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var M=z7[t.format]||z7.default;window.clipboardData.setData(M,e)}else w.clipboardData.clearData(),w.clipboardData.setData(t.format,e);t.onCopy&&(w.preventDefault(),t.onCopy(w.clipboardData))}),document.body.appendChild(c),o.selectNodeContents(c),a.addRange(o);var y=document.execCommand("copy");if(!y)throw new Error("copy command was unsuccessful");v=!0}catch(w){r&&console.error("unable to copy using execCommand: ",w),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),v=!0}catch(M){r&&console.error("unable to copy using clipboardData: ",M),r&&console.error("falling back to prompt"),n=qJ("message"in t?t.message:NJ),window.prompt(n,e)}}finally{a&&(typeof a.removeRange=="function"?a.removeRange(o):a.removeAllRanges()),c&&document.body.removeChild(c),i()}return v}V7.exports=LJ});function jo(e,t){for(var r in t)e[r]=t[r];return e}function Q7(e){var t=e.parentNode;t&&t.removeChild(e)}function Ti(e,t,r){var n,i=arguments,o={};for(n in t)n!=="key"&&n!=="ref"&&(o[n]=t[n]);if(arguments.length>3)for(r=[r],n=3;n<arguments.length;n++)r.push(i[n]);if(r!=null&&(o.children=r),typeof e=="function"&&e.defaultProps!=null)for(n in e.defaultProps)o[n]===void 0&&(o[n]=e.defaultProps[n]);return Xp(e,o,t&&t.key,t&&t.ref,null)}function Xp(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i};return i==null&&(o.__v=o),Ge.vnode&&Ge.vnode(o),o}function rv(){return{}}function wa(e){return e.children}function Qn(e,t){this.props=e,this.context=t}function Ll(e,t){if(t==null)return e.__?Ll(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Ll(e):null}function X7(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return X7(e)}}function Qp(e){(!e.__d&&(e.__d=!0)&&ql.push(e)&&!k_++||K7!==Ge.debounceRendering)&&((K7=Ge.debounceRendering)||Y7)(jJ)}function jJ(){for(var e;k_=ql.length;)e=ql.sort(function(t,r){return t.__v.__b-r.__v.__b}),ql=[],e.some(function(t){var r,n,i,o,a,c,v;t.__d&&(c=(a=(r=t).__v).__e,(v=r.__P)&&(n=[],(i=jo({},a)).__v=i,o=N_(v,a,i,r.__n,v.ownerSVGElement!==void 0,null,n,c??Ll(a)),tA(n,a),o!=c&&X7(a)))})}function eA(e,t,r,n,i,o,a,c,v){var y,w,M,S,R,C,B,N=r&&r.__k||tv,q=N.length;if(c==Fo&&(c=o!=null?o[0]:q?Ll(r,0):null),y=0,t.__k=Uo(t.__k,function(H){if(H!=null){if(H.__=t,H.__b=t.__b+1,(M=N[y])===null||M&&H.key==M.key&&H.type===M.type)N[y]=void 0;else for(w=0;w<q;w++){if((M=N[w])&&H.key==M.key&&H.type===M.type){N[w]=void 0;break}M=null}if(S=N_(e,H,M=M||Fo,n,i,o,a,c,v),(w=H.ref)&&M.ref!=w&&(B||(B=[]),M.ref&&B.push(M.ref,null,H),B.push(w,H.__c||S,H)),S!=null){var D;if(C==null&&(C=S),H.__d!==void 0)D=H.__d,H.__d=void 0;else if(o==M||S!=c||S.parentNode==null){e:if(c==null||c.parentNode!==e)e.appendChild(S),D=null;else{for(R=c,w=0;(R=R.nextSibling)&&w<q;w+=2)if(R==S)break e;e.insertBefore(S,c),D=c}t.type=="option"&&(e.value="")}c=D!==void 0?D:S.nextSibling,typeof t.type=="function"&&(t.__d=c)}else c&&M.__e==c&&c.parentNode!=e&&(c=Ll(M))}return y++,H}),t.__e=C,o!=null&&typeof t.type!="function")for(y=o.length;y--;)o[y]!=null&&Q7(o[y]);for(y=q;y--;)N[y]!=null&&uf(N[y],N[y]);if(B)for(y=0;y<B.length;y++)rA(B[y],B[++y],B[++y])}function Uo(e,t,r){if(r==null&&(r=[]),e==null||typeof e=="boolean")t&&r.push(t(null));else if(Array.isArray(e))for(var n=0;n<e.length;n++)Uo(e[n],t,r);else r.push(t?t(typeof e=="string"||typeof e=="number"?Xp(null,e,null,null,e):e.__e!=null||e.__c!=null?Xp(e.type,e.props,e.key,null,e.__v):e):e);return r}function FJ(e,t,r,n,i){var o;for(o in r)o==="children"||o==="key"||o in t||ev(e,o,null,r[o],n);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||r[o]===t[o]||ev(e,o,t[o],r[o],n)}function G7(e,t,r){t[0]==="-"?e.setProperty(t,r):e[t]=typeof r=="number"&&DJ.test(t)===!1?r+"px":r??""}function ev(e,t,r,n,i){var o,a,c,v,y;if(i?t==="className"&&(t="class"):t==="class"&&(t="className"),t==="style")if(o=e.style,typeof r=="string")o.cssText=r;else{if(typeof n=="string"&&(o.cssText="",n=null),n)for(v in n)r&&v in r||G7(o,v,"");if(r)for(y in r)n&&r[y]===n[y]||G7(o,y,r[y])}else t[0]==="o"&&t[1]==="n"?(a=t!==(t=t.replace(/Capture$/,"")),c=t.toLowerCase(),t=(c in e?c:t).slice(2),r?(n||e.addEventListener(t,Z7,a),(e.l||(e.l={}))[t]=r):e.removeEventListener(t,Z7,a)):t!=="list"&&t!=="tagName"&&t!=="form"&&t!=="type"&&t!=="size"&&!i&&t in e?e[t]=r??"":typeof r!="function"&&t!=="dangerouslySetInnerHTML"&&(t!==(t=t.replace(/^xlink:?/,""))?r==null||r===!1?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):r==null||r===!1&&!/^ar/.test(t)?e.removeAttribute(t):e.setAttribute(t,r))}function Z7(e){this.l[e.type](Ge.event?Ge.event(e):e)}function N_(e,t,r,n,i,o,a,c,v){var y,w,M,S,R,C,B,N,q,H,D=t.type;if(t.constructor!==void 0)return null;(y=Ge.__b)&&y(t);try{e:if(typeof D=="function"){if(N=t.props,q=(y=D.contextType)&&n[y.__c],H=y?q?q.props.value:y.__:n,r.__c?B=(w=t.__c=r.__c).__=w.__E:("prototype"in D&&D.prototype.render?t.__c=w=new D(N,H):(t.__c=w=new Qn(N,H),w.constructor=D,w.render=HJ),q&&q.sub(w),w.props=N,w.state||(w.state={}),w.context=H,w.__n=n,M=w.__d=!0,w.__h=[]),w.__s==null&&(w.__s=w.state),D.getDerivedStateFromProps!=null&&(w.__s==w.state&&(w.__s=jo({},w.__s)),jo(w.__s,D.getDerivedStateFromProps(N,w.__s))),S=w.props,R=w.state,M)D.getDerivedStateFromProps==null&&w.componentWillMount!=null&&w.componentWillMount(),w.componentDidMount!=null&&w.__h.push(w.componentDidMount);else{if(D.getDerivedStateFromProps==null&&N!==S&&w.componentWillReceiveProps!=null&&w.componentWillReceiveProps(N,H),!w.__e&&w.shouldComponentUpdate!=null&&w.shouldComponentUpdate(N,w.__s,H)===!1||t.__v===r.__v&&!w.__){for(w.props=N,w.state=w.__s,t.__v!==r.__v&&(w.__d=!1),w.__v=t,t.__e=r.__e,t.__k=r.__k,w.__h.length&&a.push(w),y=0;y<t.__k.length;y++)t.__k[y]&&(t.__k[y].__=t);break e}w.componentWillUpdate!=null&&w.componentWillUpdate(N,w.__s,H),w.componentDidUpdate!=null&&w.__h.push(function(){w.componentDidUpdate(S,R,C)})}w.context=H,w.props=N,w.state=w.__s,(y=Ge.__r)&&y(t),w.__d=!1,w.__v=t,w.__P=e,y=w.render(w.props,w.state,w.context),t.__k=y!=null&&y.type==wa&&y.key==null?y.props.children:Array.isArray(y)?y:[y],w.getChildContext!=null&&(n=jo(jo({},n),w.getChildContext())),M||w.getSnapshotBeforeUpdate==null||(C=w.getSnapshotBeforeUpdate(S,R)),eA(e,t,r,n,i,o,a,c,v),w.base=t.__e,w.__h.length&&a.push(w),B&&(w.__E=w.__=null),w.__e=!1}else o==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=UJ(r.__e,t,r,n,i,o,a,v);(y=Ge.diffed)&&y(t)}catch(ee){t.__v=null,Ge.__e(ee,t,r)}return t.__e}function tA(e,t){Ge.__c&&Ge.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(n){n.call(r)})}catch(n){Ge.__e(n,r.__v)}})}function UJ(e,t,r,n,i,o,a,c){var v,y,w,M,S,R=r.props,C=t.props;if(i=t.type==="svg"||i,o!=null){for(v=0;v<o.length;v++)if((y=o[v])!=null&&((t.type===null?y.nodeType===3:y.localName===t.type)||e==y)){e=y,o[v]=null;break}}if(e==null){if(t.type===null)return document.createTextNode(C);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,C.is&&{is:C.is}),o=null,c=!1}if(t.type===null)R!==C&&e.data!=C&&(e.data=C);else{if(o!=null&&(o=tv.slice.call(e.childNodes)),w=(R=r.props||Fo).dangerouslySetInnerHTML,M=C.dangerouslySetInnerHTML,!c){if(R===Fo)for(R={},S=0;S<e.attributes.length;S++)R[e.attributes[S].name]=e.attributes[S].value;(M||w)&&(M&&w&&M.__html==w.__html||(e.innerHTML=M&&M.__html||""))}FJ(e,C,R,i,c),M?t.__k=[]:(t.__k=t.props.children,eA(e,t,r,n,t.type!=="foreignObject"&&i,o,a,Fo,c)),c||("value"in C&&(v=C.value)!==void 0&&v!==e.value&&ev(e,"value",v,R.value,!1),"checked"in C&&(v=C.checked)!==void 0&&v!==e.checked&&ev(e,"checked",v,R.checked,!1))}return e}function rA(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){Ge.__e(n,r)}}function uf(e,t,r){var n,i,o;if(Ge.unmount&&Ge.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||rA(n,null,t)),r||typeof e.type=="function"||(r=(i=e.__e)!=null),e.__e=e.__d=void 0,(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(a){Ge.__e(a,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&uf(n[o],t,r);i!=null&&Q7(i)}function HJ(e,t,r){return this.constructor(e,r)}function ff(e,t,r){var n,i,o;Ge.__&&Ge.__(e,t),i=(n=r===P_)?null:r&&r.__k||t.__k,e=Ti(wa,null,[e]),o=[],N_(t,(n?t:r||t).__k=e,i||Fo,Fo,t.ownerSVGElement!==void 0,r&&!n?[r]:i?null:tv.slice.call(t.childNodes),o,r||Fo,n),tA(o,e)}function q_(e,t){ff(e,t,P_)}function nA(e,t){var r,n;for(n in t=jo(jo({},e.props),t),arguments.length>2&&(t.children=tv.slice.call(arguments,2)),r={},t)n!=="key"&&n!=="ref"&&(r[n]=t[n]);return Xp(e.type,r,t.key||e.key,t.ref||e.ref,null)}function nv(e){var t={},r={__c:"__cC"+J7++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,o=this;return this.getChildContext||(i=[],this.getChildContext=function(){return t[r.__c]=o,t},this.shouldComponentUpdate=function(a){o.props.value!==a.value&&i.some(function(c){c.context=a.value,Qp(c)})},this.sub=function(a){i.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Consumer.contextType=r,r.Provider.__=r,r}var Ge,BJ,ql,k_,Y7,K7,P_,J7,Fo,tv,DJ,iv=_t(()=>{Fo={},tv=[],DJ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;Ge={__e:function(e,t){for(var r,n;t=t.__;)if((r=t.__c)&&!r.__)try{if(r.constructor&&r.constructor.getDerivedStateFromError!=null&&(n=!0,r.setState(r.constructor.getDerivedStateFromError(e))),r.componentDidCatch!=null&&(n=!0,r.componentDidCatch(e)),n)return Qp(r.__E=r)}catch(i){e=i}throw e}},BJ=function(e){return e!=null&&e.constructor===void 0},Qn.prototype.setState=function(e,t){var r;r=this.__s!==this.state?this.__s:this.__s=jo({},this.state),typeof e=="function"&&(e=e(r,this.props)),e&&jo(r,e),e!=null&&this.__v&&(t&&this.__h.push(t),Qp(this))},Qn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Qp(this))},Qn.prototype.render=wa,ql=[],k_=0,Y7=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,P_=Fo,J7=0});function lf(e,t){Ge.__h&&Ge.__h(Un,e,cf||t),cf=0;var r=Un.__H||(Un.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ov(e){return cf=1,sv(fA,e)}function sv(e,t,r){var n=lf(xa++,2);return n.__c||(n.__c=Un,n.__=[r?r(t):fA(void 0,t),function(i){var o=e(n.__[0],i);n.__[0]!==o&&(n.__[0]=o,n.__c.setState({}))}]),n.__}function j_(e,t){var r=lf(xa++,3);!Ge.__s&&V_(r.__H,t)&&(r.__=e,r.__H=t,Un.__H.__h.push(r))}function av(e,t){var r=lf(xa++,4);!Ge.__s&&V_(r.__H,t)&&(r.__=e,r.__H=t,Un.__h.push(r))}function F_(e){return cf=5,Bl(function(){return{current:e}},[])}function U_(e,t,r){cf=6,av(function(){typeof e=="function"?e(t()):e&&(e.current=t())},r==null?r:r.concat(e))}function Bl(e,t){var r=lf(xa++,7);return V_(r.__H,t)?(r.__H=t,r.__h=e,r.__=e()):r.__}function H_(e,t){return cf=8,Bl(function(){return e},t)}function W_(e){var t=Un.context[e.__c],r=lf(xa++,9);return r.__c=e,t?(r.__==null&&(r.__=!0,t.sub(Un)),t.props.value):e.__}function z_(e,t){Ge.useDebugValue&&Ge.useDebugValue(t?t(e):e)}function WJ(e){var t=lf(xa++,10),r=ov();return t.__=e,Un.componentDidCatch||(Un.componentDidCatch=function(n){t.__&&t.__(n),r[1](n)}),[r[0],function(){r[1](void 0)}]}function zJ(){L_.some(function(e){if(e.__P)try{e.__H.__h.forEach(B_),e.__H.__h.forEach(D_),e.__H.__h=[]}catch(t){return e.__H.__h=[],Ge.__e(t,e.__v),!0}}),L_=[]}function B_(e){e.t&&e.t()}function D_(e){var t=e.__();typeof t=="function"&&(e.t=t)}function V_(e,t){return!e||t.some(function(r,n){return r!==e[n]})}function fA(e,t){return typeof t=="function"?t(e):t}var xa,Un,iA,cf,L_,oA,sA,aA,uA,$_=_t(()=>{iv();cf=0,L_=[],oA=Ge.__r,sA=Ge.diffed,aA=Ge.__c,uA=Ge.unmount;Ge.__r=function(e){oA&&oA(e),xa=0,(Un=e.__c).__H&&(Un.__H.__h.forEach(B_),Un.__H.__h.forEach(D_),Un.__H.__h=[])},Ge.diffed=function(e){sA&&sA(e);var t=e.__c;if(t){var r=t.__H;r&&r.__h.length&&(L_.push(t)!==1&&iA===Ge.requestAnimationFrame||((iA=Ge.requestAnimationFrame)||function(n){var i,o=function(){clearTimeout(a),cancelAnimationFrame(i),setTimeout(n)},a=setTimeout(o,100);typeof window<"u"&&(i=requestAnimationFrame(o))})(zJ))}},Ge.__c=function(e,t){t.some(function(r){try{r.__h.forEach(B_),r.__h=r.__h.filter(function(n){return!n.__||D_(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ge.__e(n,r.__v)}}),aA&&aA(e,t)},Ge.unmount=function(e){uA&&uA(e);var t=e.__c;if(t){var r=t.__H;if(r)try{r.__.forEach(function(n){return n.t&&n.t()})}catch(n){Ge.__e(n,t.__v)}}}});var TA={};Sr(TA,{Children:()=>_A,Component:()=>Qn,Fragment:()=>wa,PureComponent:()=>gA,Suspense:()=>uv,SuspenseList:()=>hf,cloneElement:()=>OA,createContext:()=>nv,createElement:()=>Ti,createFactory:()=>AA,createPortal:()=>SA,createRef:()=>rv,default:()=>YJ,findDOMNode:()=>IA,forwardRef:()=>yA,hydrate:()=>GJ,isValidElement:()=>J_,lazy:()=>MA,memo:()=>bA,render:()=>Z_,unmountComponentAtNode:()=>RA,unstable_batchedUpdates:()=>CA,useCallback:()=>H_,useContext:()=>W_,useDebugValue:()=>z_,useEffect:()=>j_,useErrorBoundary:()=>WJ,useImperativeHandle:()=>U_,useLayoutEffect:()=>av,useMemo:()=>Bl,useReducer:()=>sv,useRef:()=>F_,useState:()=>ov,version:()=>ZJ});function Y_(e,t){for(var r in t)e[r]=t[r];return e}function G_(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function bA(e,t){function r(i){var o=this.props.ref,a=o==i.ref;return!a&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!a:G_(this.props,i)}function n(i){return this.shouldComponentUpdate=r,Ti(e,Y_({},i))}return n.prototype.isReactComponent=!0,n.displayName="Memo("+(e.displayName||e.name)+")",n.t=!0,n}function yA(e){function t(r){var n=Y_({},r);return delete n.ref,e(n,r.ref)}return t.prototype.isReactComponent=t.t=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}function wA(e){return e&&((e=Y_({},e)).__c=null,e.__k=e.__k&&e.__k.map(wA)),e}function uv(){this.__u=0,this.o=null,this.__b=null}function xA(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function MA(e){var t,r,n;function i(o){if(t||(t=e()).then(function(a){r=a.default||a},function(a){n=a}),n)throw n;if(!r)throw t;return Ti(r,o)}return i.displayName="Lazy",i.t=!0,i}function hf(){this.i=null,this.l=null}function KJ(e){var t=this,r=e.container,n=Ti($J,{context:t.context},e.vnode);return t.s&&t.s!==r&&(t.v.parentNode&&t.s.removeChild(t.v),uf(t.h),t.p=!1),e.vnode?t.p?(r.__k=t.__k,ff(n,r),t.__k=r.__k):(t.v=document.createTextNode(""),q_("",r),r.appendChild(t.v),t.p=!0,t.s=r,ff(n,r,t.v),t.__k=t.v.__k):t.p&&(t.v.parentNode&&t.s.removeChild(t.v),uf(t.h)),t.h=n,t.componentWillUnmount=function(){t.v.parentNode&&t.s.removeChild(t.v),uf(t.h)},null}function SA(e,t){return Ti(KJ,{vnode:e,container:t})}function Z_(e,t,r){if(t.__k==null)for(;t.firstChild;)t.removeChild(t.firstChild);return ff(e,t),typeof r=="function"&&r(),e?e.__c:null}function GJ(e,t,r){return q_(e,t),typeof r=="function"&&r(),e?e.__c:null}function K_(e,t){e["UNSAFE_"+t]&&!e[t]&&Object.defineProperty(e,t,{configurable:!1,get:function(){return this["UNSAFE_"+t]},set:function(r){this["UNSAFE_"+t]=r}})}function AA(e){return Ti.bind(null,e)}function J_(e){return!!e&&e.$$typeof===EA}function OA(e){return J_(e)?nA.apply(null,arguments):e}function RA(e){return!!e.__k&&(ff(null,e),!0)}function IA(e){return e&&(e.base||e.nodeType===1&&e)||null}var gA,cA,lA,_A,VJ,hA,$J,dA,EA,pA,vA,mA,ZJ,CA,YJ,kA=_t(()=>{$_();$_();iv();iv();gA=function(e){var t,r;function n(i){var o;return(o=e.call(this,i)||this).isPureReactComponent=!0,o}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype.shouldComponentUpdate=function(i,o){return G_(this.props,i)||G_(this.state,o)},n}(Qn);cA=Ge.__b;Ge.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),cA&&cA(e)};lA=function(e,t){return e?Uo(e).reduce(function(r,n,i){return r.concat(t(n,i))},[]):null},_A={map:lA,forEach:lA,count:function(e){return e?Uo(e).length:0},only:function(e){if((e=Uo(e)).length!==1)throw new Error("Children.only() expects only one child.");return e[0]},toArray:Uo},VJ=Ge.__e;Ge.__e=function(e,t,r){if(e.then){for(var n,i=t;i=i.__;)if((n=i.__c)&&n.__c)return n.__c(e,t.__c)}VJ(e,t,r)},(uv.prototype=new Qn).__c=function(e,t){var r=this;r.o==null&&(r.o=[]),r.o.push(t);var n=xA(r.__v),i=!1,o=function(){i||(i=!0,n?n(a):a())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){o(),t.__c&&t.__c()};var a=function(){var c;if(!--r.__u)for(r.__v.__k[0]=r.state.u,r.setState({u:r.__b=null});c=r.o.pop();)c.forceUpdate()};r.__u++||r.setState({u:r.__b=r.__v.__k[0]}),e.then(o,o)},uv.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=wA(this.__b),this.__b=null),[Ti(Qn,null,t.u?null:e.children),t.u&&e.fallback]};hA=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(hf.prototype=new Qn).u=function(e){var t=this,r=xA(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),hA(t,e,n)):i()};r?r(o):o()}},hf.prototype.render=function(e){this.i=null,this.l=new Map;var t=Uo(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},hf.prototype.componentDidUpdate=hf.prototype.componentDidMount=function(){var e=this;e.l.forEach(function(t,r){hA(e,r,t)})};$J=function(){function e(){}var t=e.prototype;return t.getChildContext=function(){return this.props.context},t.render=function(r){return r.children},e}();dA=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;Qn.prototype.isReactComponent={};EA=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103;pA=Ge.event;Ge.event=function(e){pA&&(e=pA(e)),e.persist=function(){};var t=!1,r=!1,n=e.stopPropagation;e.stopPropagation=function(){n.call(e),t=!0};var i=e.preventDefault;return e.preventDefault=function(){i.call(e),r=!0},e.isPropagationStopped=function(){return t},e.isDefaultPrevented=function(){return r},e.nativeEvent=e};vA={configurable:!0,get:function(){return this.class}},mA=Ge.vnode;Ge.vnode=function(e){e.$$typeof=EA;var t=e.type,r=e.props;if(t){if(r.class!=r.className&&(vA.enumerable="className"in r,r.className!=null&&(r.class=r.className),Object.defineProperty(r,"className",vA)),typeof t!="function"){var n,i,o;for(o in r.defaultValue&&r.value!==void 0&&(r.value||r.value===0||(r.value=r.defaultValue),delete r.defaultValue),Array.isArray(r.value)&&r.multiple&&t==="select"&&(Uo(r.children).forEach(function(a){r.value.indexOf(a.props.value)!=-1&&(a.props.selected=!0)}),delete r.value),r)if(n=dA.test(o))break;if(n)for(o in i=e.props={},r)i[dA.test(o)?o.replace(/[A-Z0-9]/,"-$&").toLowerCase():o]=r[o]}(function(a){var c=e.type,v=e.props;if(v&&typeof c=="string"){var y={};for(var w in v)/^on(Ani|Tra|Tou)/.test(w)&&(v[w.toLowerCase()]=v[w],delete v[w]),y[w.toLowerCase()]=w;if(y.ondoubleclick&&(v.ondblclick=v[y.ondoubleclick],delete v[y.ondoubleclick]),y.onbeforeinput&&(v.onbeforeinput=v[y.onbeforeinput],delete v[y.onbeforeinput]),y.onchange&&(c==="textarea"||c.toLowerCase()==="input"&&!/^fil|che|ra/i.test(v.type))){var M=y.oninput||"oninput";v[M]||(v[M]=v[y.onchange],delete v[y.onchange])}}})(),typeof t=="function"&&!t.m&&t.prototype&&(K_(t.prototype,"componentWillMount"),K_(t.prototype,"componentWillReceiveProps"),K_(t.prototype,"componentWillUpdate"),t.m=!0)}mA&&mA(e)};ZJ="16.8.0";CA=function(e,t){return e(t)},YJ={useState:ov,useReducer:sv,useEffect:j_,useLayoutEffect:av,useRef:F_,useImperativeHandle:U_,useMemo:Bl,useCallback:H_,useContext:W_,useDebugValue:z_,version:"16.8.0",Children:_A,render:Z_,hydrate:Z_,unmountComponentAtNode:RA,createPortal:SA,createElement:Ti,createContext:nv,createFactory:AA,cloneElement:OA,createRef:rv,Fragment:wa,isValidElement:J_,findDOMNode:IA,Component:Qn,PureComponent:gA,memo:bA,forwardRef:yA,unstable_batchedUpdates:CA,Suspense:uv,SuspenseList:hf,lazy:MA}});var WA=E((uTe,HA)=>{function qA(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Cn=(dy(),Pt(tE)),LA=qA(U7()),JJ=qA($7()),He=(kA(),Pt(TA));function QJ(e){LA.toString(e,{type:"terminal"}).then(console.log)}var XJ=`:root {
|
|
9
|
+
--animation-duration: 300ms;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@keyframes fadeIn {
|
|
13
|
+
from {
|
|
14
|
+
opacity: 0;
|
|
15
|
+
}
|
|
16
|
+
to {
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes fadeOut {
|
|
22
|
+
from {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
}
|
|
25
|
+
to {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.animated {
|
|
31
|
+
animation-duration: var(--animation-duration);
|
|
32
|
+
animation-fill-mode: both;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.fadeIn {
|
|
36
|
+
animation-name: fadeIn;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.fadeOut {
|
|
40
|
+
animation-name: fadeOut;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#walletconnect-wrapper {
|
|
44
|
+
-webkit-user-select: none;
|
|
45
|
+
align-items: center;
|
|
46
|
+
display: flex;
|
|
47
|
+
height: 100%;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
left: 0;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
position: fixed;
|
|
52
|
+
top: 0;
|
|
53
|
+
user-select: none;
|
|
54
|
+
width: 100%;
|
|
55
|
+
z-index: 99999999999999;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.walletconnect-modal__headerLogo {
|
|
59
|
+
height: 21px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.walletconnect-modal__header p {
|
|
63
|
+
color: #ffffff;
|
|
64
|
+
font-size: 20px;
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
margin: 0;
|
|
67
|
+
align-items: flex-start;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex: 1;
|
|
70
|
+
margin-left: 5px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.walletconnect-modal__close__wrapper {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 0px;
|
|
76
|
+
right: 0px;
|
|
77
|
+
z-index: 10000;
|
|
78
|
+
background: white;
|
|
79
|
+
border-radius: 26px;
|
|
80
|
+
padding: 6px;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
width: 26px;
|
|
83
|
+
height: 26px;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.walletconnect-modal__close__icon {
|
|
88
|
+
position: relative;
|
|
89
|
+
top: 7px;
|
|
90
|
+
right: 0;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
transform: rotate(45deg);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.walletconnect-modal__close__line1 {
|
|
98
|
+
position: absolute;
|
|
99
|
+
width: 100%;
|
|
100
|
+
border: 1px solid rgb(48, 52, 59);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.walletconnect-modal__close__line2 {
|
|
104
|
+
position: absolute;
|
|
105
|
+
width: 100%;
|
|
106
|
+
border: 1px solid rgb(48, 52, 59);
|
|
107
|
+
transform: rotate(90deg);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.walletconnect-qrcode__base {
|
|
111
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
112
|
+
background: rgba(37, 41, 46, 0.95);
|
|
113
|
+
height: 100%;
|
|
114
|
+
left: 0;
|
|
115
|
+
pointer-events: auto;
|
|
116
|
+
position: fixed;
|
|
117
|
+
top: 0;
|
|
118
|
+
transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
|
|
119
|
+
width: 100%;
|
|
120
|
+
will-change: opacity;
|
|
121
|
+
padding: 40px;
|
|
122
|
+
box-sizing: border-box;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.walletconnect-qrcode__text {
|
|
126
|
+
color: rgba(60, 66, 82, 0.6);
|
|
127
|
+
font-size: 16px;
|
|
128
|
+
font-weight: 600;
|
|
129
|
+
letter-spacing: 0;
|
|
130
|
+
line-height: 1.1875em;
|
|
131
|
+
margin: 10px 0 20px 0;
|
|
132
|
+
text-align: center;
|
|
133
|
+
width: 100%;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media only screen and (max-width: 768px) {
|
|
137
|
+
.walletconnect-qrcode__text {
|
|
138
|
+
font-size: 4vw;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@media only screen and (max-width: 320px) {
|
|
143
|
+
.walletconnect-qrcode__text {
|
|
144
|
+
font-size: 14px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.walletconnect-qrcode__image {
|
|
149
|
+
width: calc(100% - 30px);
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
cursor: none;
|
|
152
|
+
margin: 0 auto;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.walletconnect-qrcode__notification {
|
|
156
|
+
position: absolute;
|
|
157
|
+
bottom: 0;
|
|
158
|
+
left: 0;
|
|
159
|
+
right: 0;
|
|
160
|
+
font-size: 16px;
|
|
161
|
+
padding: 16px 20px;
|
|
162
|
+
border-radius: 16px;
|
|
163
|
+
text-align: center;
|
|
164
|
+
transition: all 0.1s ease-in-out;
|
|
165
|
+
background: white;
|
|
166
|
+
color: black;
|
|
167
|
+
margin-bottom: -60px;
|
|
168
|
+
opacity: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.walletconnect-qrcode__notification.notification__show {
|
|
172
|
+
opacity: 1;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@media only screen and (max-width: 768px) {
|
|
176
|
+
.walletconnect-modal__header {
|
|
177
|
+
height: 130px;
|
|
178
|
+
}
|
|
179
|
+
.walletconnect-modal__base {
|
|
180
|
+
overflow: auto;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@media only screen and (min-device-width: 415px) and (max-width: 768px) {
|
|
185
|
+
#content {
|
|
186
|
+
max-width: 768px;
|
|
187
|
+
box-sizing: border-box;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@media only screen and (min-width: 375px) and (max-width: 415px) {
|
|
192
|
+
#content {
|
|
193
|
+
max-width: 414px;
|
|
194
|
+
box-sizing: border-box;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@media only screen and (min-width: 320px) and (max-width: 375px) {
|
|
199
|
+
#content {
|
|
200
|
+
max-width: 375px;
|
|
201
|
+
box-sizing: border-box;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@media only screen and (max-width: 320px) {
|
|
206
|
+
#content {
|
|
207
|
+
max-width: 320px;
|
|
208
|
+
box-sizing: border-box;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.walletconnect-modal__base {
|
|
213
|
+
-webkit-font-smoothing: antialiased;
|
|
214
|
+
background: #ffffff;
|
|
215
|
+
border-radius: 24px;
|
|
216
|
+
box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);
|
|
217
|
+
font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,
|
|
218
|
+
-apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
|
|
219
|
+
"Open Sans", "Helvetica Neue", sans-serif;
|
|
220
|
+
margin-top: 41px;
|
|
221
|
+
padding: 24px 24px 22px;
|
|
222
|
+
pointer-events: auto;
|
|
223
|
+
position: relative;
|
|
224
|
+
text-align: center;
|
|
225
|
+
transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
|
|
226
|
+
will-change: transform;
|
|
227
|
+
overflow: visible;
|
|
228
|
+
transform: translateY(-50%);
|
|
229
|
+
top: 50%;
|
|
230
|
+
max-width: 500px;
|
|
231
|
+
margin: auto;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@media only screen and (max-width: 320px) {
|
|
235
|
+
.walletconnect-modal__base {
|
|
236
|
+
padding: 24px 12px;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.walletconnect-modal__base .hidden {
|
|
241
|
+
transform: translateY(150%);
|
|
242
|
+
transition: 0.125s cubic-bezier(0.4, 0, 1, 1);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.walletconnect-modal__header {
|
|
246
|
+
align-items: center;
|
|
247
|
+
display: flex;
|
|
248
|
+
height: 26px;
|
|
249
|
+
left: 0;
|
|
250
|
+
justify-content: space-between;
|
|
251
|
+
position: absolute;
|
|
252
|
+
top: -42px;
|
|
253
|
+
width: 100%;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.walletconnect-modal__base .wc-logo {
|
|
257
|
+
align-items: center;
|
|
258
|
+
display: flex;
|
|
259
|
+
height: 26px;
|
|
260
|
+
margin-top: 15px;
|
|
261
|
+
padding-bottom: 15px;
|
|
262
|
+
pointer-events: auto;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.walletconnect-modal__base .wc-logo div {
|
|
266
|
+
background-color: #3399ff;
|
|
267
|
+
height: 21px;
|
|
268
|
+
margin-right: 5px;
|
|
269
|
+
mask-image: url("images/wc-logo.svg") center no-repeat;
|
|
270
|
+
width: 32px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.walletconnect-modal__base .wc-logo p {
|
|
274
|
+
color: #ffffff;
|
|
275
|
+
font-size: 20px;
|
|
276
|
+
font-weight: 600;
|
|
277
|
+
margin: 0;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.walletconnect-modal__base h2 {
|
|
281
|
+
color: rgba(60, 66, 82, 0.6);
|
|
282
|
+
font-size: 16px;
|
|
283
|
+
font-weight: 600;
|
|
284
|
+
letter-spacing: 0;
|
|
285
|
+
line-height: 1.1875em;
|
|
286
|
+
margin: 0 0 19px 0;
|
|
287
|
+
text-align: center;
|
|
288
|
+
width: 100%;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.walletconnect-modal__base__row {
|
|
292
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
293
|
+
align-items: center;
|
|
294
|
+
border-radius: 20px;
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
display: flex;
|
|
297
|
+
height: 56px;
|
|
298
|
+
justify-content: space-between;
|
|
299
|
+
padding: 0 15px;
|
|
300
|
+
position: relative;
|
|
301
|
+
margin: 0px 0px 8px;
|
|
302
|
+
text-align: left;
|
|
303
|
+
transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
304
|
+
will-change: transform;
|
|
305
|
+
text-decoration: none;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.walletconnect-modal__base__row:hover {
|
|
309
|
+
background: rgba(60, 66, 82, 0.06);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.walletconnect-modal__base__row:active {
|
|
313
|
+
background: rgba(60, 66, 82, 0.06);
|
|
314
|
+
transform: scale(0.975);
|
|
315
|
+
transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.walletconnect-modal__base__row__h3 {
|
|
319
|
+
color: #25292e;
|
|
320
|
+
font-size: 20px;
|
|
321
|
+
font-weight: 700;
|
|
322
|
+
margin: 0;
|
|
323
|
+
padding-bottom: 3px;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.walletconnect-modal__base__row__right {
|
|
327
|
+
align-items: center;
|
|
328
|
+
display: flex;
|
|
329
|
+
justify-content: center;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.walletconnect-modal__base__row__right__app-icon {
|
|
333
|
+
border-radius: 8px;
|
|
334
|
+
height: 34px;
|
|
335
|
+
margin: 0 11px 2px 0;
|
|
336
|
+
width: 34px;
|
|
337
|
+
background-size: 100%;
|
|
338
|
+
box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.walletconnect-modal__base__row__right__caret {
|
|
342
|
+
height: 18px;
|
|
343
|
+
opacity: 0.3;
|
|
344
|
+
transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
345
|
+
width: 8px;
|
|
346
|
+
will-change: opacity;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.walletconnect-modal__base__row:hover .caret,
|
|
350
|
+
.walletconnect-modal__base__row:active .caret {
|
|
351
|
+
opacity: 0.6;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.walletconnect-modal__mobile__toggle {
|
|
355
|
+
width: 80%;
|
|
356
|
+
display: flex;
|
|
357
|
+
margin: 0 auto;
|
|
358
|
+
position: relative;
|
|
359
|
+
overflow: hidden;
|
|
360
|
+
border-radius: 8px;
|
|
361
|
+
margin-bottom: 18px;
|
|
362
|
+
background: #d4d5d9;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.walletconnect-modal__single_wallet {
|
|
366
|
+
display: flex;
|
|
367
|
+
justify-content: center;
|
|
368
|
+
margin-top: 7px;
|
|
369
|
+
margin-bottom: 18px;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.walletconnect-modal__single_wallet a {
|
|
373
|
+
cursor: pointer;
|
|
374
|
+
color: rgb(64, 153, 255);
|
|
375
|
+
font-size: 21px;
|
|
376
|
+
font-weight: 800;
|
|
377
|
+
text-decoration: none !important;
|
|
378
|
+
margin: 0 auto;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.walletconnect-modal__mobile__toggle_selector {
|
|
382
|
+
width: calc(50% - 8px);
|
|
383
|
+
background: white;
|
|
384
|
+
position: absolute;
|
|
385
|
+
border-radius: 5px;
|
|
386
|
+
height: calc(100% - 8px);
|
|
387
|
+
top: 4px;
|
|
388
|
+
transition: all 0.2s ease-in-out;
|
|
389
|
+
transform: translate3d(4px, 0, 0);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {
|
|
393
|
+
transform: translate3d(calc(100% + 12px), 0, 0);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.walletconnect-modal__mobile__toggle a {
|
|
397
|
+
font-size: 12px;
|
|
398
|
+
width: 50%;
|
|
399
|
+
text-align: center;
|
|
400
|
+
padding: 8px;
|
|
401
|
+
margin: 0;
|
|
402
|
+
font-weight: 600;
|
|
403
|
+
z-index: 1;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.walletconnect-modal__footer {
|
|
407
|
+
display: flex;
|
|
408
|
+
justify-content: center;
|
|
409
|
+
margin-top: 20px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
@media only screen and (max-width: 768px) {
|
|
413
|
+
.walletconnect-modal__footer {
|
|
414
|
+
margin-top: 5vw;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.walletconnect-modal__footer a {
|
|
419
|
+
cursor: pointer;
|
|
420
|
+
color: #898d97;
|
|
421
|
+
font-size: 15px;
|
|
422
|
+
margin: 0 auto;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@media only screen and (max-width: 320px) {
|
|
426
|
+
.walletconnect-modal__footer a {
|
|
427
|
+
font-size: 14px;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.walletconnect-connect__buttons__wrapper {
|
|
432
|
+
max-height: 44vh;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.walletconnect-connect__buttons__wrapper__android {
|
|
436
|
+
margin: 50% 0;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.walletconnect-connect__buttons__wrapper__wrap {
|
|
440
|
+
display: grid;
|
|
441
|
+
grid-template-columns: repeat(4, 1fr);
|
|
442
|
+
margin: 10px 0;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
@media only screen and (min-width: 768px) {
|
|
446
|
+
.walletconnect-connect__buttons__wrapper__wrap {
|
|
447
|
+
margin-top: 40px;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.walletconnect-connect__button {
|
|
452
|
+
background-color: rgb(64, 153, 255);
|
|
453
|
+
padding: 12px;
|
|
454
|
+
border-radius: 8px;
|
|
455
|
+
text-decoration: none;
|
|
456
|
+
color: rgb(255, 255, 255);
|
|
457
|
+
font-weight: 500;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.walletconnect-connect__button__icon_anchor {
|
|
461
|
+
cursor: pointer;
|
|
462
|
+
display: flex;
|
|
463
|
+
justify-content: flex-start;
|
|
464
|
+
align-items: center;
|
|
465
|
+
margin: 8px;
|
|
466
|
+
width: 42px;
|
|
467
|
+
justify-self: center;
|
|
468
|
+
flex-direction: column;
|
|
469
|
+
text-decoration: none !important;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
@media only screen and (max-width: 320px) {
|
|
473
|
+
.walletconnect-connect__button__icon_anchor {
|
|
474
|
+
margin: 4px;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.walletconnect-connect__button__icon {
|
|
479
|
+
border-radius: 10px;
|
|
480
|
+
height: 42px;
|
|
481
|
+
margin: 0;
|
|
482
|
+
width: 42px;
|
|
483
|
+
background-size: cover !important;
|
|
484
|
+
box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.walletconnect-connect__button__text {
|
|
488
|
+
color: #424952;
|
|
489
|
+
font-size: 2.7vw;
|
|
490
|
+
text-decoration: none !important;
|
|
491
|
+
padding: 0;
|
|
492
|
+
margin-top: 1.8vw;
|
|
493
|
+
font-weight: 600;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
@media only screen and (min-width: 768px) {
|
|
497
|
+
.walletconnect-connect__button__text {
|
|
498
|
+
font-size: 16px;
|
|
499
|
+
margin-top: 12px;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.walletconnect-search__input {
|
|
504
|
+
border: none;
|
|
505
|
+
background: #d4d5d9;
|
|
506
|
+
border-style: none;
|
|
507
|
+
padding: 8px 16px;
|
|
508
|
+
outline: none;
|
|
509
|
+
font-style: normal;
|
|
510
|
+
font-stretch: normal;
|
|
511
|
+
font-size: 16px;
|
|
512
|
+
font-style: normal;
|
|
513
|
+
font-stretch: normal;
|
|
514
|
+
line-height: normal;
|
|
515
|
+
letter-spacing: normal;
|
|
516
|
+
text-align: left;
|
|
517
|
+
border-radius: 8px;
|
|
518
|
+
width: calc(100% - 16px);
|
|
519
|
+
margin: 0;
|
|
520
|
+
margin-bottom: 8px;
|
|
521
|
+
}
|
|
522
|
+
`,sTe=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator",aTe=typeof Symbol<"u"?Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")):"@@asyncIterator";function eQ(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}var tQ="data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",rQ="WalletConnect",nQ=300,iQ="rgb(64, 153, 255)",BA="walletconnect-wrapper",PA="walletconnect-style-sheet",DA="walletconnect-qrcode-modal",oQ="walletconnect-qrcode-close",jA="walletconnect-qrcode-text",sQ="walletconnect-connect-button";function aQ(e){return He.createElement("div",{className:"walletconnect-modal__header"},He.createElement("img",{src:tQ,className:"walletconnect-modal__headerLogo"}),He.createElement("p",null,rQ),He.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:e.onClose},He.createElement("div",{id:oQ,className:"walletconnect-modal__close__icon"},He.createElement("div",{className:"walletconnect-modal__close__line1"}),He.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function uQ(e){return He.createElement("a",{className:"walletconnect-connect__button",href:e.href,id:sQ+"-"+e.name,onClick:e.onClick,rel:"noopener noreferrer",style:{backgroundColor:e.color},target:"_blank"},e.name)}var fQ="data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E";function cQ(e){var t=e.color,r=e.href,n=e.name,i=e.logo,o=e.onClick;return He.createElement("a",{className:"walletconnect-modal__base__row",href:r,onClick:o,rel:"noopener noreferrer",target:"_blank"},He.createElement("h3",{className:"walletconnect-modal__base__row__h3"},n),He.createElement("div",{className:"walletconnect-modal__base__row__right"},He.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+i+"') "+t,backgroundSize:"100%"}}),He.createElement("img",{src:fQ,className:"walletconnect-modal__base__row__right__caret"})))}function lQ(e){var t=e.color,r=e.href,n=e.name,i=e.logo,o=e.onClick,a=window.innerWidth<768?(n.length>8?2.5:2.7)+"vw":"inherit";return He.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:r,onClick:o,rel:"noopener noreferrer",target:"_blank"},He.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+i+"') "+t,backgroundSize:"100%"}}),He.createElement("div",{style:{fontSize:a},className:"walletconnect-connect__button__text"},n))}var hQ=5,Q_=12;function dQ(e){var t=Cn.isAndroid(),r=He.useState(""),n=r[0],i=r[1],o=He.useState(""),a=o[0],c=o[1],v=He.useState(1),y=v[0],w=v[1],M=a?e.links.filter(function(ee){return ee.name.toLowerCase().includes(a.toLowerCase())}):e.links,S=e.errorMessage,R=a||M.length>hQ,C=Math.ceil(M.length/Q_),B=[(y-1)*Q_+1,y*Q_],N=M.length?M.filter(function(ee,ge){return ge+1>=B[0]&&ge+1<=B[1]}):[],q=!t&&C>1,H=void 0;function D(ee){i(ee.target.value),clearTimeout(H),ee.target.value?H=setTimeout(function(){c(ee.target.value),w(1)},1e3):(i(""),c(""),w(1))}return He.createElement("div",null,He.createElement("p",{id:jA,className:"walletconnect-qrcode__text"},t?e.text.connect_mobile_wallet:e.text.choose_preferred_wallet),!t&&He.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:n,onChange:D}),He.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(t?"__android":R&&M.length?"__wrap":"")},t?He.createElement(uQ,{name:e.text.connect,color:iQ,href:e.uri,onClick:He.useCallback(function(){Cn.saveMobileLinkInfo({name:"Unknown",href:e.uri})},[])}):N.length?N.map(function(ee){var ge=ee.color,Z=ee.name,X=ee.shortName,V=ee.logo,k=Cn.formatIOSMobile(e.uri,ee),m=He.useCallback(function(){Cn.saveMobileLinkInfo({name:Z,href:k})},[N]);return R?He.createElement(lQ,{color:ge,href:k,name:X||Z,logo:V,onClick:m}):He.createElement(cQ,{color:ge,href:k,name:Z,logo:V,onClick:m})}):He.createElement(He.Fragment,null,He.createElement("p",null,S.length?e.errorMessage:!!e.links.length&&!M.length?e.text.no_wallets_found:e.text.loading))),q&&He.createElement("div",{className:"walletconnect-modal__footer"},Array(C).fill(0).map(function(ee,ge){var Z=ge+1,X=y===Z;return He.createElement("a",{style:{margin:"auto 10px",fontWeight:X?"bold":"normal"},onClick:function(){return w(Z)}},Z)})))}function pQ(e){var t=!!e.message.trim();return He.createElement("div",{className:"walletconnect-qrcode__notification"+(t?" notification__show":"")},e.message)}var vQ=function(e){try{var t="";return Promise.resolve(LA.toString(e,{margin:0,type:"svg"})).then(function(r){return typeof r=="string"&&(t=r.replace("<svg",'<svg class="walletconnect-qrcode__image"')),t})}catch(r){return Promise.reject(r)}};function mQ(e){var t=He.useState(""),r=t[0],n=t[1],i=He.useState(""),o=i[0],a=i[1];He.useEffect(function(){try{return Promise.resolve(vQ(e.uri)).then(function(v){a(v)})}catch(v){Promise.reject(v)}},[]);var c=function(){var v=JJ(e.uri);v?(n(e.text.copied_to_clipboard),setInterval(function(){return n("")},1200)):(n("Error"),setInterval(function(){return n("")},1200))};return He.createElement("div",null,He.createElement("p",{id:jA,className:"walletconnect-qrcode__text"},e.text.scan_qrcode_with_wallet),He.createElement("div",{dangerouslySetInnerHTML:{__html:o}}),He.createElement("div",{className:"walletconnect-modal__footer"},He.createElement("a",{onClick:c},e.text.copy_to_clipboard)),He.createElement(pQ,{message:r}))}function gQ(e){var t=Cn.isAndroid(),r=Cn.isMobile(),n=r?e.qrcodeModalOptions&&e.qrcodeModalOptions.mobileLinks?e.qrcodeModalOptions.mobileLinks:void 0:e.qrcodeModalOptions&&e.qrcodeModalOptions.desktopLinks?e.qrcodeModalOptions.desktopLinks:void 0,i=He.useState(!1),o=i[0],a=i[1],c=He.useState(!1),v=c[0],y=c[1],w=He.useState(!r),M=w[0],S=w[1],R={mobile:r,text:e.text,uri:e.uri,qrcodeModalOptions:e.qrcodeModalOptions},C=He.useState(""),B=C[0],N=C[1],q=He.useState(!1),H=q[0],D=q[1],ee=He.useState([]),ge=ee[0],Z=ee[1],X=He.useState(""),V=X[0],k=X[1],m=function(){v||o||n&&!n.length||ge.length>0||He.useEffect(function(){var l=function(){try{if(t)return Promise.resolve();a(!0);var d=eQ(function(){var f=e.qrcodeModalOptions&&e.qrcodeModalOptions.registryUrl?e.qrcodeModalOptions.registryUrl:Cn.getWalletRegistryUrl();return Promise.resolve(fetch(f)).then(function(p){return Promise.resolve(p.json()).then(function(g){var b=g.listings,h=r?"mobile":"desktop",u=Cn.getMobileLinkRegistry(Cn.formatMobileRegistry(b,h),n);a(!1),y(!0),k(u.length?"":e.text.no_supported_wallets),Z(u);var _=u.length===1;_&&(N(Cn.formatIOSMobile(e.uri,u[0])),S(!0)),D(_)})})},function(f){a(!1),y(!0),k(e.text.something_went_wrong),console.error(f)});return Promise.resolve(d&&d.then?d.then(function(){}):void 0)}catch(f){return Promise.reject(f)}};l()})};m();var s=r?M:!M;return He.createElement("div",{id:DA,className:"walletconnect-qrcode__base animated fadeIn"},He.createElement("div",{className:"walletconnect-modal__base"},He.createElement(aQ,{onClose:e.onClose}),H&&M?He.createElement("div",{className:"walletconnect-modal__single_wallet"},He.createElement("a",{onClick:function(){return Cn.saveMobileLinkInfo({name:ge[0].name,href:B})},href:B,rel:"noopener noreferrer",target:"_blank"},e.text.connect_with+" "+(H?ge[0].name:"")+" \u203A")):t||o||!o&&ge.length?He.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(s?" right__selected":"")},He.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),r?He.createElement(He.Fragment,null,He.createElement("a",{onClick:function(){return S(!1),m()}},e.text.mobile),He.createElement("a",{onClick:function(){return S(!0)}},e.text.qrcode)):He.createElement(He.Fragment,null,He.createElement("a",{onClick:function(){return S(!0)}},e.text.qrcode),He.createElement("a",{onClick:function(){return S(!1),m()}},e.text.desktop))):null,He.createElement("div",null,M||!t&&!o&&!ge.length?He.createElement(mQ,Object.assign({},R)):He.createElement(dQ,Object.assign({},R,{links:ge,errorMessage:V})))))}var bQ={choose_preferred_wallet:"W\xE4hle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterst\xFCtzten Wallet",no_wallets_found:"keine Wallet gefunden"},yQ={choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},_Q={choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera m\xF3vil",scan_qrcode_with_wallet:"Escanea el c\xF3digo QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"C\xF3digo QR",mobile:"M\xF3vil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo sali\xF3 mal",no_supported_wallets:"Todav\xEDa no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},wQ={choose_preferred_wallet:"Choisissez votre portefeuille pr\xE9f\xE9r\xE9",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copi\xE9!",connect_with:"Connectez-vous \xE0 l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourn\xE9",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouv\xE9"},xQ={choose_preferred_wallet:"\uC6D0\uD558\uB294 \uC9C0\uAC11\uC744 \uC120\uD0DD\uD558\uC138\uC694",connect_mobile_wallet:"\uBAA8\uBC14\uC77C \uC9C0\uAC11\uACFC \uC5F0\uACB0",scan_qrcode_with_wallet:"WalletConnect \uC9C0\uC6D0 \uC9C0\uAC11\uC5D0\uC11C QR\uCF54\uB4DC\uB97C \uC2A4\uCE94\uD558\uC138\uC694",connect:"\uC5F0\uACB0",qrcode:"QR \uCF54\uB4DC",mobile:"\uBAA8\uBC14\uC77C",desktop:"\uB370\uC2A4\uD06C\uD0D1",copy_to_clipboard:"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC",copied_to_clipboard:"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4!",connect_with:"\uC640 \uC5F0\uACB0\uD558\uB2E4",loading:"\uB85C\uB4DC \uC911...",something_went_wrong:"\uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.",no_supported_wallets:"\uC544\uC9C1 \uC9C0\uC6D0\uB418\uB294 \uC9C0\uAC11\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",no_wallets_found:"\uC9C0\uAC11\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4"},MQ={choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se \xE0 carteira m\xF3vel",scan_qrcode_with_wallet:"Ler o c\xF3digo QR com uma carteira compat\xEDvel com WalletConnect",connect:"Conectar",qrcode:"C\xF3digo QR",mobile:"M\xF3vel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda n\xE3o h\xE1 carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},SQ={choose_preferred_wallet:"\u9009\u62E9\u4F60\u7684\u94B1\u5305",connect_mobile_wallet:"\u8FDE\u63A5\u81F3\u79FB\u52A8\u7AEF\u94B1\u5305",scan_qrcode_with_wallet:"\u4F7F\u7528\u517C\u5BB9 WalletConnect \u7684\u94B1\u5305\u626B\u63CF\u4E8C\u7EF4\u7801",connect:"\u8FDE\u63A5",qrcode:"\u4E8C\u7EF4\u7801",mobile:"\u79FB\u52A8",desktop:"\u684C\u9762",copy_to_clipboard:"\u590D\u5236\u5230\u526A\u8D34\u677F",copied_to_clipboard:"\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F\uFF01",connect_with:"\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u8FDE\u63A5",loading:"\u6B63\u5728\u52A0\u8F7D...",something_went_wrong:"\u51FA\u4E86\u95EE\u9898",no_supported_wallets:"\u76EE\u524D\u8FD8\u6CA1\u6709\u652F\u6301\u7684\u94B1\u5305",no_wallets_found:"\u6CA1\u6709\u627E\u5230\u94B1\u5305"},EQ={choose_preferred_wallet:"\u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u062E\u0648\u062F \u0631\u0627 \u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F",connect_mobile_wallet:"\u0628\u0647 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0648\u0635\u0644 \u0634\u0648\u06CC\u062F",scan_qrcode_with_wallet:"\u06A9\u062F QR \u0631\u0627 \u0628\u0627 \u06CC\u06A9 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u0633\u0627\u0632\u06AF\u0627\u0631 \u0628\u0627 WalletConnect \u0627\u0633\u06A9\u0646 \u06A9\u0646\u06CC\u062F",connect:"\u0627\u062A\u0635\u0627\u0644",qrcode:"\u06A9\u062F QR",mobile:"\u0633\u06CC\u0627\u0631",desktop:"\u062F\u0633\u06A9\u062A\u0627\u067E",copy_to_clipboard:"\u06A9\u067E\u06CC \u0628\u0647 \u06A9\u0644\u06CC\u067E \u0628\u0648\u0631\u062F",copied_to_clipboard:"\u062F\u0631 \u06A9\u0644\u06CC\u067E \u0628\u0648\u0631\u062F \u06A9\u067E\u06CC \u0634\u062F!",connect_with:"\u0627\u0631\u062A\u0628\u0627\u0637 \u0628\u0627",loading:"...\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",something_went_wrong:"\u0645\u0634\u06A9\u0644\u06CC \u067E\u06CC\u0634 \u0622\u0645\u062F",no_supported_wallets:"\u0647\u0646\u0648\u0632 \u0647\u06CC\u0686 \u06A9\u06CC\u0641 \u067E\u0648\u0644 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0634\u062F\u0647 \u0627\u06CC \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F",no_wallets_found:"\u0647\u06CC\u0686 \u06A9\u06CC\u0641 \u067E\u0648\u0644\u06CC \u067E\u06CC\u062F\u0627 \u0646\u0634\u062F"},NA={de:bQ,en:yQ,es:_Q,fr:wQ,ko:xQ,pt:MQ,zh:SQ,fa:EQ};function AQ(){var e=Cn.getDocumentOrThrow(),t=e.getElementById(PA);t&&e.head.removeChild(t);var r=e.createElement("style");r.setAttribute("id",PA),r.innerText=XJ,e.head.appendChild(r)}function OQ(){var e=Cn.getDocumentOrThrow(),t=e.createElement("div");return t.setAttribute("id",BA),e.body.appendChild(t),t}function FA(){var e=Cn.getDocumentOrThrow(),t=e.getElementById(DA);t&&(t.className=t.className.replace("fadeIn","fadeOut"),setTimeout(function(){var r=e.getElementById(BA);r&&e.body.removeChild(r)},nQ))}function RQ(e){return function(){FA(),e&&e()}}function IQ(){var e=Cn.getNavigatorOrThrow().language.split("-")[0]||"en";return NA[e]||NA.en}function CQ(e,t,r){AQ();var n=OQ();He.render(He.createElement(gQ,{text:IQ(),uri:e,onClose:RQ(t),qrcodeModalOptions:r}),n)}function TQ(){FA()}var UA=function(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"};function kQ(e,t,r){console.log(e),UA()?QJ(e):CQ(e,t,r)}function PQ(){UA()||TQ()}var NQ={open:kQ,close:PQ};HA.exports=NQ});var VA=E((fTe,X_)=>{"use strict";var qQ=Object.prototype.hasOwnProperty,Tn="~";function Dl(){}Object.create&&(Dl.prototype=Object.create(null),new Dl().__proto__||(Tn=!1));function LQ(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function zA(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new LQ(r,n||e,i),a=Tn?Tn+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}function fv(e,t){--e._eventsCount===0?e._events=new Dl:delete e._events[t]}function ln(){this._events=new Dl,this._eventsCount=0}ln.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)qQ.call(r,n)&&t.push(Tn?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ln.prototype.listeners=function(t){var r=Tn?Tn+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a};ln.prototype.listenerCount=function(t){var r=Tn?Tn+t:t,n=this._events[r];return n?n.fn?1:n.length:0};ln.prototype.emit=function(t,r,n,i,o,a){var c=Tn?Tn+t:t;if(!this._events[c])return!1;var v=this._events[c],y=arguments.length,w,M;if(v.fn){switch(v.once&&this.removeListener(t,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,r),!0;case 3:return v.fn.call(v.context,r,n),!0;case 4:return v.fn.call(v.context,r,n,i),!0;case 5:return v.fn.call(v.context,r,n,i,o),!0;case 6:return v.fn.call(v.context,r,n,i,o,a),!0}for(M=1,w=new Array(y-1);M<y;M++)w[M-1]=arguments[M];v.fn.apply(v.context,w)}else{var S=v.length,R;for(M=0;M<S;M++)switch(v[M].once&&this.removeListener(t,v[M].fn,void 0,!0),y){case 1:v[M].fn.call(v[M].context);break;case 2:v[M].fn.call(v[M].context,r);break;case 3:v[M].fn.call(v[M].context,r,n);break;case 4:v[M].fn.call(v[M].context,r,n,i);break;default:if(!w)for(R=1,w=new Array(y-1);R<y;R++)w[R-1]=arguments[R];v[M].fn.apply(v[M].context,w)}}return!0};ln.prototype.on=function(t,r,n){return zA(this,t,r,n,!1)};ln.prototype.once=function(t,r,n){return zA(this,t,r,n,!0)};ln.prototype.removeListener=function(t,r,n,i){var o=Tn?Tn+t:t;if(!this._events[o])return this;if(!r)return fv(this,o),this;var a=this._events[o];if(a.fn)a.fn===r&&(!i||a.once)&&(!n||a.context===n)&&fv(this,o);else{for(var c=0,v=[],y=a.length;c<y;c++)(a[c].fn!==r||i&&!a[c].once||n&&a[c].context!==n)&&v.push(a[c]);v.length?this._events[o]=v.length===1?v[0]:v:fv(this,o)}return this};ln.prototype.removeAllListeners=function(t){var r;return t?(r=Tn?Tn+t:t,this._events[r]&&fv(this,r)):(this._events=new Dl,this._eventsCount=0),this};ln.prototype.off=ln.prototype.removeListener;ln.prototype.addListener=ln.prototype.on;ln.prefixed=Tn;ln.EventEmitter=ln;typeof X_<"u"&&(X_.exports=ln)});function $A(){if(typeof jl<"u")return jl;try{new globalThis.Blob([new ArrayBuffer(1)]),jl=!0}catch{jl=!1}return jl}function ew(e){Ma||(Ma=new globalThis.XMLHttpRequest,Ma.open("GET",globalThis.location.host?"/":"https://example.com"));try{return Ma.responseType=e,Ma.responseType===e}catch{return!1}}function Fl(e){return typeof e=="function"}var cv,jl,Ma,tw,BQ,KA,GA,ZA,lv,YA,rw=_t(()=>{cv=Fl(globalThis.fetch)&&Fl(globalThis.ReadableStream);tw=typeof globalThis.ArrayBuffer<"u",BQ=tw&&Fl(globalThis.ArrayBuffer.prototype.slice),KA=tw&&ew("arraybuffer"),GA=!cv&&BQ&&ew("ms-stream"),ZA=!cv&&tw&&ew("moz-chunked-arraybuffer"),lv=Fl(Ma.overrideMimeType),YA=Fl(globalThis.VBArray);Ma=null});function JA(){throw new Error("setTimeout has not been defined")}function QA(){throw new Error("clearTimeout has not been defined")}function XA(e){if(ys===setTimeout)return setTimeout(e,0);if((ys===JA||!ys)&&setTimeout)return ys=setTimeout,setTimeout(e,0);try{return ys(e,0)}catch{try{return ys.call(null,e,0)}catch{return ys.call(this,e,0)}}}function jQ(e){if(_s===clearTimeout)return clearTimeout(e);if((_s===QA||!_s)&&clearTimeout)return _s=clearTimeout,clearTimeout(e);try{return _s(e)}catch{try{return _s.call(null,e)}catch{return _s.call(this,e)}}}function FQ(){!pf||!Sa||(pf=!1,Sa.length?Ho=Sa.concat(Ho):hv=-1,Ho.length&&eO())}function eO(){if(!pf){var e=XA(FQ);pf=!0;for(var t=Ho.length;t;){for(Sa=Ho,Ho=[];++hv<t;)Sa&&Sa[hv].run();hv=-1,t=Ho.length}Sa=null,pf=!1,jQ(e)}}function hn(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ho.push(new tO(e,t)),Ho.length===1&&!pf&&XA(eO)}function tO(e,t){this.fun=e,this.array=t}function Ea(){}function nX(e){throw new Error("process.binding is not supported")}function iX(){return"/"}function oX(e){throw new Error("process.chdir is not supported")}function sX(){return 0}function uX(e){var t=aX.call(df)*.001,r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r=r-e[0],n=n-e[1],n<0&&(r--,n+=1e9)),[r,n]}function cX(){var e=new Date,t=e-fX;return t/1e3}var ys,_s,Ho,pf,Sa,hv,UQ,HQ,WQ,zQ,VQ,$Q,KQ,GQ,ZQ,YQ,JQ,QQ,XQ,eX,tX,rX,df,aX,fX,lX,Ul,Hl=_t(()=>{ys=JA,_s=QA;typeof globalThis.setTimeout=="function"&&(ys=setTimeout);typeof globalThis.clearTimeout=="function"&&(_s=clearTimeout);Ho=[],pf=!1,hv=-1;tO.prototype.run=function(){this.fun.apply(null,this.array)};UQ="browser",HQ="browser",WQ=!0,zQ={},VQ=[],$Q="",KQ={},GQ={},ZQ={};YQ=Ea,JQ=Ea,QQ=Ea,XQ=Ea,eX=Ea,tX=Ea,rX=Ea;df=globalThis.performance||{},aX=df.now||df.mozNow||df.msNow||df.oNow||df.webkitNow||function(){return new Date().getTime()};fX=new Date;lX={nextTick:hn,title:UQ,browser:WQ,env:zQ,argv:VQ,version:$Q,versions:KQ,on:YQ,addListener:JQ,once:QQ,off:XQ,removeListener:eX,removeAllListeners:tX,emit:rX,binding:nX,cwd:iX,chdir:oX,umask:sX,hrtime:uX,platform:HQ,release:GQ,config:ZQ,uptime:cX},Ul=lX});var nw,Cr,rO=_t(()=>{typeof Object.create=="function"?nw=function(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:nw=function(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t};Cr=nw});var aO={};Sr(aO,{_extend:()=>lw,debuglog:()=>mv,default:()=>wX,deprecate:()=>Wl,format:()=>vv,inherits:()=>Cr,inspect:()=>di,isArray:()=>uw,isBoolean:()=>gv,isBuffer:()=>iO,isDate:()=>Oa,isError:()=>Aa,isFunction:()=>xs,isNull:()=>ro,isNullOrUndefined:()=>bv,isNumber:()=>fw,isObject:()=>no,isPrimitive:()=>zl,isRegExp:()=>ws,isString:()=>Wo,isSymbol:()=>nO,isUndefined:()=>to,log:()=>oO});function vv(e){if(!Wo(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(di(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(e).replace(hX,function(c){if(c==="%%")return"%";if(r>=i)return c;switch(c){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return c}}),a=n[r];r<i;a=n[++r])ro(a)||!no(a)?o+=" "+a:o+=" "+di(a);return o}function Wl(e,t){if(to(globalThis.process))return function(){return Wl(e,t).apply(this,arguments)};if(Ul.noDeprecation===!0)return e;var r=!1;function n(){if(!r){if(Ul.throwDeprecation)throw new Error(t);Ul.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}return n}function mv(e){if(to(iw)&&(iw=Ul.env.NODE_DEBUG||""),e=e.toUpperCase(),!dv[e])if(new RegExp("\\b"+e+"\\b","i").test(iw)){var t=0;dv[e]=function(){var r=vv.apply(null,arguments);console.error("%s %d: %s",e,t,r)}}else dv[e]=function(){};return dv[e]}function di(e,t){var r={seen:[],stylize:pX};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),gv(t)?r.showHidden=t:t&&lw(r,t),to(r.showHidden)&&(r.showHidden=!1),to(r.depth)&&(r.depth=2),to(r.colors)&&(r.colors=!1),to(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=dX),pv(r,e,r.depth)}function dX(e,t){var r=di.styles[t];return r?"\x1B["+di.colors[r][0]+"m"+e+"\x1B["+di.colors[r][1]+"m":e}function pX(e,t){return e}function vX(e){var t={};return e.forEach(function(r,n){t[r]=!0}),t}function pv(e,t,r){if(e.customInspect&&t&&xs(t.inspect)&&t.inspect!==di&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(r,e);return Wo(n)||(n=pv(e,n,r)),n}var i=mX(e,t);if(i)return i;var o=Object.keys(t),a=vX(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Aa(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return ow(t);if(o.length===0){if(xs(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(ws(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Oa(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Aa(t))return ow(t)}var v="",y=!1,w=["{","}"];if(uw(t)&&(y=!0,w=["[","]"]),xs(t)){var M=t.name?": "+t.name:"";v=" [Function"+M+"]"}if(ws(t)&&(v=" "+RegExp.prototype.toString.call(t)),Oa(t)&&(v=" "+Date.prototype.toUTCString.call(t)),Aa(t)&&(v=" "+ow(t)),o.length===0&&(!y||t.length==0))return w[0]+v+w[1];if(r<0)return ws(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var S;return y?S=gX(e,t,r,a,o):S=o.map(function(R){return aw(e,t,r,a,R,y)}),e.seen.pop(),bX(S,v,w)}function mX(e,t){if(to(t))return e.stylize("undefined","undefined");if(Wo(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(fw(t))return e.stylize(""+t,"number");if(gv(t))return e.stylize(""+t,"boolean");if(ro(t))return e.stylize("null","null")}function ow(e){return"["+Error.prototype.toString.call(e)+"]"}function gX(e,t,r,n,i){for(var o=[],a=0,c=t.length;a<c;++a)sO(t,String(a))?o.push(aw(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(v){v.match(/^\d+$/)||o.push(aw(e,t,r,n,v,!0))}),o}function aw(e,t,r,n,i,o){var a,c,v;if(v=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},v.get?v.set?c=e.stylize("[Getter/Setter]","special"):c=e.stylize("[Getter]","special"):v.set&&(c=e.stylize("[Setter]","special")),sO(n,i)||(a="["+i+"]"),c||(e.seen.indexOf(v.value)<0?(ro(r)?c=pv(e,v.value,null):c=pv(e,v.value,r-1),c.indexOf(`
|
|
523
|
+
`)>-1&&(o?c=c.split(`
|
|
524
|
+
`).map(function(y){return" "+y}).join(`
|
|
525
|
+
`).substr(2):c=`
|
|
526
|
+
`+c.split(`
|
|
527
|
+
`).map(function(y){return" "+y}).join(`
|
|
528
|
+
`))):c=e.stylize("[Circular]","special")),to(a)){if(o&&i.match(/^\d+$/))return c;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+c}function bX(e,t,r){var n=0,i=e.reduce(function(o,a){return n++,a.indexOf(`
|
|
529
|
+
`)>=0&&n++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(t===""?"":t+`
|
|
530
|
+
`)+" "+e.join(`,
|
|
531
|
+
`)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function uw(e){return Array.isArray(e)}function gv(e){return typeof e=="boolean"}function ro(e){return e===null}function bv(e){return e==null}function fw(e){return typeof e=="number"}function Wo(e){return typeof e=="string"}function nO(e){return typeof e=="symbol"}function to(e){return e===void 0}function ws(e){return no(e)&&cw(e)==="[object RegExp]"}function no(e){return typeof e=="object"&&e!==null}function Oa(e){return no(e)&&cw(e)==="[object Date]"}function Aa(e){return no(e)&&(cw(e)==="[object Error]"||e instanceof Error)}function xs(e){return typeof e=="function"}function zl(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function iO(e){return Buffer.isBuffer(e)}function cw(e){return Object.prototype.toString.call(e)}function sw(e){return e<10?"0"+e.toString(10):e.toString(10)}function _X(){var e=new Date,t=[sw(e.getHours()),sw(e.getMinutes()),sw(e.getSeconds())].join(":");return[e.getDate(),yX[e.getMonth()],t].join(" ")}function oO(){console.log("%s - %s",_X(),vv.apply(null,arguments))}function lw(e,t){if(!t||!no(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function sO(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var hX,dv,iw,yX,wX,pi=_t(()=>{Hl();rO();hX=/%[sdj%]/g;dv={};di.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};di.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};yX=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];wX={inherits:Cr,_extend:lw,log:oO,isBuffer:iO,isPrimitive:zl,isFunction:xs,isError:Aa,isDate:Oa,isObject:no,isRegExp:ws,isUndefined:to,isSymbol:nO,isString:Wo,isNumber:fw,isNullOrUndefined:bv,isNull:ro,isBoolean:gv,isArray:uw,inspect:di,deprecate:Wl,format:vv,debuglog:mv}});var hO={};Sr(hO,{EventEmitter:()=>qt,default:()=>zo});function Ms(){}function qt(){qt.init.call(this)}function uO(e){return e._maxListeners===void 0?qt.defaultMaxListeners:e._maxListeners}function xX(e,t,r){if(t)e.call(r);else for(var n=e.length,i=Vl(e,n),o=0;o<n;++o)i[o].call(r)}function MX(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,o=Vl(e,i),a=0;a<i;++a)o[a].call(r,n)}function SX(e,t,r,n,i){if(t)e.call(r,n,i);else for(var o=e.length,a=Vl(e,o),c=0;c<o;++c)a[c].call(r,n,i)}function EX(e,t,r,n,i,o){if(t)e.call(r,n,i,o);else for(var a=e.length,c=Vl(e,a),v=0;v<a;++v)c[v].call(r,n,i,o)}function AX(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,o=Vl(e,i),a=0;a<i;++a)o[a].apply(r,n)}function fO(e,t,r,n){var i,o,a;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(o=e._events,o?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]):(o=e._events=new Ms,e._eventsCount=0),!a)a=o[t]=r,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(i=uO(e),i&&i>0&&a.length>i)){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,OX(c)}return e}function OX(e){typeof console.warn=="function"?console.warn(e):console.log(e)}function cO(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function lO(e){var t=this._events;if(t){var r=t[e];if(typeof r=="function")return 1;if(r)return r.length}return 0}function RX(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}function Vl(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function IX(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}var hw,zo,$l=_t(()=>{"use strict";Ms.prototype=Object.create(null);zo=qt;qt.EventEmitter=qt;qt.usingDomains=!1;qt.prototype.domain=void 0;qt.prototype._events=void 0;qt.prototype._maxListeners=void 0;qt.defaultMaxListeners=10;qt.init=function(){this.domain=null,qt.usingDomains&&hw.active&&!(this instanceof hw.Domain)&&(this.domain=hw.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new Ms,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};qt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this};qt.prototype.getMaxListeners=function(){return uO(this)};qt.prototype.emit=function(t){var r,n,i,o,a,c,v,y=!1,w=t==="error";if(c=this._events,c)w=w&&c.error==null;else if(!w)return!1;if(v=this.domain,w){if(r=arguments[1],v)r||(r=new Error('Uncaught, unspecified "error" event')),r.domainEmitter=this,r.domain=v,r.domainThrown=!1,v.emit("error",r);else{if(r instanceof Error)throw r;var M=new Error('Uncaught, unspecified "error" event. ('+r+")");throw M.context=r,M}return!1}if(n=c[t],!n)return!1;var S=typeof n=="function";switch(i=arguments.length,i){case 1:xX(n,S,this);break;case 2:MX(n,S,this,arguments[1]);break;case 3:SX(n,S,this,arguments[1],arguments[2]);break;case 4:EX(n,S,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];AX(n,S,this,o)}return y&&v.exit(),!0};qt.prototype.addListener=function(t,r){return fO(this,t,r,!1)};qt.prototype.on=qt.prototype.addListener;qt.prototype.prependListener=function(t,r){return fO(this,t,r,!0)};qt.prototype.once=function(t,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,cO(this,t,r)),this};qt.prototype.prependOnceListener=function(t,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,cO(this,t,r)),this};qt.prototype.removeListener=function(t,r){var n,i,o,a,c;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(n=i[t],!n)return this;if(n===r||n.listener&&n.listener===r)--this._eventsCount===0?this._events=new Ms:(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length;a-- >0;)if(n[a]===r||n[a].listener&&n[a].listener===r){c=n[a].listener,o=a;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount===0)return this._events=new Ms,this;delete i[t]}else RX(n,o);i.removeListener&&this.emit("removeListener",t,c||r)}return this};qt.prototype.removeAllListeners=function(t){var r,n;if(n=this._events,!n)return this;if(!n.removeListener)return arguments.length===0?(this._events=new Ms,this._eventsCount=0):n[t]&&(--this._eventsCount===0?this._events=new Ms:delete n[t]),this;if(arguments.length===0){for(var i=Object.keys(n),o=0,a;o<i.length;++o)a=i[o],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=new Ms,this._eventsCount=0,this}if(r=n[t],typeof r=="function")this.removeListener(t,r);else if(r)do this.removeListener(t,r[r.length-1]);while(r[0]);return this};qt.prototype.listeners=function(t){var r,n,i=this._events;return i?(r=i[t],r?typeof r=="function"?n=[r.listener||r]:n=IX(r):n=[]):n=[],n};qt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):lO.call(e,t)};qt.prototype.listenerCount=lO;qt.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}});function Ra(){this.head=null,this.tail=null,this.length=0}var dO,pO=_t(()=>{ha();dO=Ra;Ra.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length};Ra.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length};Ra.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}};Ra.prototype.clear=function(){this.head=this.tail=null,this.length=0};Ra.prototype.join=function(e){if(this.length===0)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r};Ra.prototype.concat=function(e){if(this.length===0)return _e.alloc(0);if(this.length===1)return this.head.data;for(var t=_e.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t}});var vO={};Sr(vO,{StringDecoder:()=>Ia});function TX(e){if(e&&!CX(e))throw new Error("Unknown encoding: "+e)}function Ia(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),TX(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=PX;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=NX;break;default:this.write=kX;return}this.charBuffer=new _e(6),this.charReceived=0,this.charLength=0}function kX(e){return e.toString(this.encoding)}function PX(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function NX(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var CX,dw=_t(()=>{ha();CX=_e.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};Ia.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";e=e.slice(r,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize,t="";continue}if(this.charReceived=this.charLength=0,e.length===0)return t;break}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived),t+=e.toString(this.encoding,0,n);var n=t.length-1,i=t.charCodeAt(n);if(i>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t};Ia.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};Ia.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}});function qX(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function LX(e,t){return e.listeners(t).length}function yO(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof tn&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new dO,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Ia(e.encoding),this.encoding=e.encoding)}function Qt(e){if(!(this instanceof Qt))return new Qt(e);this._readableState=new yO(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),zo.call(this)}function _O(e,t,r,n,i){var o=jX(t,r);if(o)e.emit("error",o);else if(r===null)t.reading=!1,FX(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var c=new Error("stream.unshift() after end event");e.emit("error",c)}else{var v;t.decoder&&!i&&!n&&(r=t.decoder.write(r),v=!t.objectMode&&r.length===0),i||(t.reading=!1),v||(t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&yv(e))),UX(e,t)}else i||(t.reading=!1);return BX(t)}function BX(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}function DX(e){return e>=mO?e=mO:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function gO(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=DX(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function jX(e,t){var r=null;return!Buffer.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function FX(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,yv(e)}}function yv(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Zt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?hn(bO,e):bO(e))}function bO(e){Zt("emit readable"),e.emit("readable"),vw(e)}function UX(e,t){t.readingMore||(t.readingMore=!0,hn(HX,e,t))}function HX(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(Zt("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function WX(e){return function(){var t=e._readableState;Zt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&e.listeners("data").length&&(t.flowing=!0,vw(e))}}function zX(e){Zt("readable nexttick read 0"),e.read(0)}function VX(e,t){t.resumeScheduled||(t.resumeScheduled=!0,hn($X,e,t))}function $X(e,t){t.reading||(Zt("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),vw(e),t.flowing&&!t.reading&&e.read(0)}function vw(e){var t=e._readableState;for(Zt("flow",t.flowing);t.flowing&&e.read()!==null;);}function wO(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=KX(e,t.buffer,t.decoder),r}function KX(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?n=t.shift():n=r?GX(e,t):ZX(e,t),n}function GX(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),e-=a,e===0){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}function ZX(e,t){var r=Buffer.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}function pw(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,hn(YX,t,e))}function YX(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function JX(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}function xO(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}var Zt,mO,mw=_t(()=>{"use strict";$l();pi();pO();dw();Kl();Hl();Qt.ReadableState=yO;Zt=mv("stream");Cr(Qt,zo);Qt.prototype.push=function(e,t){var r=this._readableState;return!r.objectMode&&typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Buffer.from(e,t),t="")),_O(this,r,e,t,!1)};Qt.prototype.unshift=function(e){var t=this._readableState;return _O(this,t,e,"",!0)};Qt.prototype.isPaused=function(){return this._readableState.flowing===!1};Qt.prototype.setEncoding=function(e){return this._readableState.decoder=new Ia(e),this._readableState.encoding=e,this};mO=8388608;Qt.prototype.read=function(e){Zt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Zt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?pw(this):yv(this),null;if(e=gO(e,t),e===0&&t.ended)return t.length===0&&pw(this),null;var n=t.needReadable;Zt("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,Zt("length less than watermark",n)),t.ended||t.reading?(n=!1,Zt("reading or ended",n)):n&&(Zt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=gO(r,t)));var i;return e>0?i=wO(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&pw(this)),i!==null&&this.emit("data",i),i};Qt.prototype._read=function(e){this.emit("error",new Error("not implemented"))};Qt.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,Zt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||t.end!==!1,o=i?c:w;n.endEmitted?hn(o):r.once("end",o),e.on("unpipe",a);function a(q){Zt("onunpipe"),q===r&&w()}function c(){Zt("onend"),e.end()}var v=WX(r);e.on("drain",v);var y=!1;function w(){Zt("cleanup"),e.removeListener("close",C),e.removeListener("finish",B),e.removeListener("drain",v),e.removeListener("error",R),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",w),r.removeListener("data",S),y=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&v()}var M=!1;r.on("data",S);function S(q){Zt("ondata"),M=!1;var H=e.write(q);H===!1&&!M&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&xO(n.pipes,e)!==-1)&&!y&&(Zt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,M=!0),r.pause())}function R(q){Zt("onerror",q),N(),e.removeListener("error",R),LX(e,"error")===0&&e.emit("error",q)}qX(e,"error",R);function C(){e.removeListener("finish",B),N()}e.once("close",C);function B(){Zt("onfinish"),e.removeListener("close",C),N()}e.once("finish",B);function N(){Zt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(Zt("pipe resume"),r.resume()),e};Qt.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=xO(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)};Qt.prototype.on=function(e,t){var r=zo.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var n=this._readableState;!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&yv(this,n):hn(zX,this))}return r};Qt.prototype.addListener=Qt.prototype.on;Qt.prototype.resume=function(){var e=this._readableState;return e.flowing||(Zt("resume"),e.flowing=!0,VX(this,e)),this};Qt.prototype.pause=function(){return Zt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Zt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};Qt.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;e.on("end",function(){if(Zt("wrapped end"),t.decoder&&!t.ended){var a=t.decoder.end();a&&a.length&&n.push(a)}n.push(null)}),e.on("data",function(a){if(Zt("wrapped data"),t.decoder&&(a=t.decoder.write(a)),!(t.objectMode&&a==null)&&!(!t.objectMode&&(!a||!a.length))){var c=n.push(a);c||(r=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(a){return function(){return e[a].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return JX(o,function(a){e.on(a,n.emit.bind(n,a))}),n._read=function(a){Zt("wrapped _read",a),r&&(r=!1,e.resume())},n};Qt._fromList=wO});function QX(){}function XX(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function bw(e,t){Object.defineProperty(this,"buffer",{get:Wl(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof tn&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=e.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){see(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new RO(this)}function wr(e){if(!(this instanceof wr)&&!(this instanceof tn))return new wr(e);this._writableState=new bw(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev)),qt.call(this)}function eee(e,t){var r=new Error("write after end");e.emit("error",r),hn(t,r)}function tee(e,t,r,n){var i=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):!_e.isBuffer(r)&&typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),hn(n,o),i=!1),i}function ree(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=_e.from(t,r)),t}function nee(e,t,r,n,i){r=ree(t,r,n),_e.isBuffer(r)&&(n="buffer");var o=t.objectMode?1:r.length;t.length+=o;var a=t.length<t.highWaterMark;if(a||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest=new XX(r,n,i),c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else gw(e,t,!1,o,r,n,i);return a}function gw(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function iee(e,t,r,n,i){--t.pendingcb,r?hn(i,n):i(n),e._writableState.errorEmitted=!0,e.emit("error",n)}function oee(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function see(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(oee(r),t)iee(e,r,n,t,i);else{var o=AO(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&EO(e,r),n?hn(MO,e,r,o,i):MO(e,r,o,i)}}function MO(e,t,r,n){r||aee(e,t),t.pendingcb--,n(),OO(e,t)}function aee(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function EO(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0;r;)i[a]=r,r=r.next,a+=1;gw(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new RO(t)}else{for(;r;){var c=r.chunk,v=r.encoding,y=r.callback,w=t.objectMode?1:c.length;if(gw(e,t,!1,w,c,v,y),r=r.next,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function AO(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function SO(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function OO(e,t){var r=AO(t);return r&&(t.pendingcb===0?(SO(e,t),t.finished=!0,e.emit("finish")):SO(e,t)),r}function uee(e,t,r){t.ending=!0,OO(e,t),r&&(t.finished?hn(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function RO(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}var yw=_t(()=>{pi();ha();$l();Kl();Hl();wr.WritableState=bw;Cr(wr,qt);bw.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};wr.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};wr.prototype.write=function(e,t,r){var n=this._writableState,i=!1;return typeof t=="function"&&(r=t,t=null),_e.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=QX),n.ended?eee(this,r):tee(this,n,e,r)&&(n.pendingcb++,i=nee(this,n,e,t,r)),i};wr.prototype.cork=function(){var e=this._writableState;e.corked++};wr.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&EO(this,e))};wr.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};wr.prototype._write=function(e,t,r){r(new Error("not implemented"))};wr.prototype._writev=null;wr.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),!n.ending&&!n.finished&&uee(this,n,r)}});function tn(e){if(!(this instanceof tn))return new tn(e);Qt.call(this,e),wr.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",fee)}function fee(){this.allowHalfOpen||this._writableState.ended||hn(cee,this)}function cee(e){e.end()}var IO,wv,_v,Kl=_t(()=>{pi();Hl();mw();yw();Cr(tn,Qt);IO=Object.keys(wr.prototype);for(_v=0;_v<IO.length;_v++)wv=IO[_v],tn.prototype[wv]||(tn.prototype[wv]=wr.prototype[wv])});function lee(e){this.afterTransform=function(t,r){return hee(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function hee(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,r!=null&&e.push(r),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function Xn(e){if(!(this instanceof Xn))return new Xn(e);tn.call(this,e),this._transformState=new lee(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(r){CO(t,r)}):CO(t)})}function CO(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}var _w=_t(()=>{Kl();pi();Cr(Xn,tn);Xn.prototype.push=function(e,t){return this._transformState.needTransform=!1,tn.prototype.push.call(this,e,t)};Xn.prototype._transform=function(e,t,r){throw new Error("Not implemented")};Xn.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Xn.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}});function Ca(e){if(!(this instanceof Ca))return new Ca(e);Xn.call(this,e)}var TO=_t(()=>{_w();pi();Cr(Ca,Xn);Ca.prototype._transform=function(e,t,r){r(null,e)}});var kO={};Sr(kO,{Duplex:()=>tn,PassThrough:()=>Ca,Readable:()=>Qt,Stream:()=>ki,Transform:()=>Xn,Writable:()=>wr,default:()=>dee});function ki(){zo.call(this)}var dee,xv=_t(()=>{$l();pi();Kl();mw();yw();_w();TO();Cr(ki,zo);ki.Readable=Qt;ki.Writable=wr;ki.Duplex=tn;ki.Transform=Xn;ki.PassThrough=Ca;ki.Stream=ki;dee=ki;ki.prototype.pipe=function(e,t){var r=this;function n(w){e.writable&&e.write(w)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",a),r.on("close",c));var o=!1;function a(){o||(o=!0,e.end())}function c(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function v(w){if(y(),zo.listenerCount(this,"error")===0)throw w}r.on("error",v),e.on("error",v);function y(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",v),e.removeListener("error",v),r.removeListener("end",y),r.removeListener("close",y),e.removeListener("close",y)}return r.on("end",y),r.on("close",y),e.on("close",y),e.emit("pipe",r),e}});function Gl(e,t,r){var n=this;Qt.call(n),n._mode=r,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){process.nextTick(function(){n.emit("close")})});var i;if(r==="fetch"){n._fetchResponse=t,n.url=t.url,n.statusCode=t.status,n.statusMessage=t.statusText;for(var o,a,c=t.headers[Symbol.iterator]();o=(a=c.next()).value,!a.done;)n.headers[o[0].toLowerCase()]=o[1],n.rawHeaders.push(o[0],o[1]);var v=t.body.getReader();i=function(){v.read().then(function(S){if(!n._destroyed){if(S.done){n.push(null);return}n.push(new Buffer(S.value)),i()}})},i()}else{n._xhr=e,n._pos=0,n.url=e.responseURL,n.statusCode=e.status,n.statusMessage=e.statusText;var y=e.getAllResponseHeaders().split(/\r?\n/);if(y.forEach(function(S){var R=S.match(/^([^:]+):\s*(.*)/);if(R){var C=R[1].toLowerCase();C==="set-cookie"?(n.headers[C]===void 0&&(n.headers[C]=[]),n.headers[C].push(R[2])):n.headers[C]!==void 0?n.headers[C]+=", "+R[2]:n.headers[C]=R[2],n.rawHeaders.push(R[1],R[2])}}),n._charset="x-user-defined",!lv){var w=n.rawHeaders["mime-type"];if(w){var M=w.match(/;\s*charset=([^;])(;|$)/);M&&(n._charset=M[1].toLowerCase())}n._charset||(n._charset="utf-8")}}}var Ss,PO=_t(()=>{rw();pi();xv();Ss={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};Cr(Gl,Qt);Gl.prototype._read=function(){};Gl.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==Ss.DONE)break;try{r=new globalThis.VBArray(t.responseBody).toArray()}catch{}if(r!==null){e.push(new Buffer(r));break}case"text":try{r=t.responseText}catch{e._mode="text:vbarray";break}if(r.length>e._pos){var n=r.substr(e._pos);if(e._charset==="x-user-defined"){for(var i=new Buffer(n.length),o=0;o<n.length;o++)i[o]=n.charCodeAt(o)&255;e.push(i)}else e.push(n,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==Ss.DONE||!t.response)break;r=t.response,e.push(new Buffer(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==Ss.LOADING||!r)break;e.push(new Buffer(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==Ss.LOADING)break;var a=new globalThis.MSStreamReader;a.onprogress=function(){a.result.byteLength>e._pos&&(e.push(new Buffer(new Uint8Array(a.result.slice(e._pos)))),e._pos=a.result.byteLength)},a.onload=function(){e.push(null)},a.readAsArrayBuffer(r);break}e._xhr.readyState===Ss.DONE&&e._mode!=="ms-stream"&&e.push(null)}});function NO(e){if(e instanceof Uint8Array){if(e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e.buffer;if(typeof e.buffer.slice=="function")return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(Qi(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n<r;n++)t[n]=e[n];return t.buffer}else throw new Error("Argument must be a Buffer")}var qO=_t(()=>{ha()});function pee(e,t){return cv&&t?"fetch":ZA?"moz-chunked-arraybuffer":GA?"ms-stream":KA&&e?"arraybuffer":YA&&e?"text:vbarray":"text"}function dn(e){var t=this;wr.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new Buffer(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(i){t.setHeader(i,e.headers[i])});var r,n=!0;if(e.mode==="disable-fetch")n=!1,r=!0;else if(e.mode==="prefer-streaming")r=!1;else if(e.mode==="allow-wrong-content-type")r=!lv;else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");t._mode=pee(r,n),t.on("finish",function(){t._onFinish()})}function mee(e){try{var t=e.status;return t!==null&&t!==0}catch{return!1}}var Mv,vee,ww=_t(()=>{rw();pi();PO();xv();qO();Mv=dn;Cr(dn,wr);vee=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];dn.prototype.setHeader=function(e,t){var r=this,n=e.toLowerCase();vee.indexOf(n)===-1&&(r._headers[n]={name:e,value:t})};dn.prototype.getHeader=function(e){var t=this;return t._headers[e.toLowerCase()].value};dn.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]};dn.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,r=e._headers,n;if((t.method==="POST"||t.method==="PUT"||t.method==="PATCH")&&($A()?n=new globalThis.Blob(e._body.map(function(a){return NO(a)}),{type:(r["content-type"]||{}).value||""}):n=Buffer.concat(e._body).toString()),e._mode==="fetch"){var i=Object.keys(r).map(function(a){return[r[a].name,r[a].value]});globalThis.fetch(e._opts.url,{method:e._opts.method,headers:i,body:n,mode:"cors",credentials:t.withCredentials?"include":"same-origin"}).then(function(a){e._fetchResponse=a,e._connect()},function(a){e.emit("error",a)})}else{var o=e._xhr=new globalThis.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(a){process.nextTick(function(){e.emit("error",a)});return}"responseType"in o&&(o.responseType=e._mode.split(":")[0]),"withCredentials"in o&&(o.withCredentials=!!t.withCredentials),e._mode==="text"&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(r).forEach(function(a){o.setRequestHeader(r[a].name,r[a].value)}),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case Ss.LOADING:case Ss.DONE:e._onXHRProgress();break}},e._mode==="moz-chunked-arraybuffer"&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{o.send(n)}catch(a){process.nextTick(function(){e.emit("error",a)});return}}}};dn.prototype._onXHRProgress=function(){var e=this;!mee(e._xhr)||e._destroyed||(e._response||e._connect(),e._response._onXHRProgress())};dn.prototype._connect=function(){var e=this;e._destroyed||(e._response=new Gl(e._xhr,e._fetchResponse,e._mode),e.emit("response",e._response))};dn.prototype._write=function(e,t,r){var n=this;n._body.push(e),r()};dn.prototype.abort=dn.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()};dn.prototype.end=function(e,t,r){var n=this;typeof e=="function"&&(r=e,e=void 0),wr.prototype.end.call(n,e,t,r)};dn.prototype.flushHeaders=function(){};dn.prototype.setTimeout=function(){};dn.prototype.setNoDelay=function(){};dn.prototype.setSocketKeepAlive=function(){}});function LO(e){throw new RangeError(See[e])}function Eee(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function Aee(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(Mee,".");var i=e.split("."),o=Eee(i,t).join(".");return n+o}function Oee(e){for(var t=[],r=0,n=e.length,i,o;r<n;)i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n?(o=e.charCodeAt(r++),(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),r--)):t.push(i);return t}function BO(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function Ree(e,t,r){var n=0;for(e=r?vf(e/bee):e>>1,e+=vf(e/t);e>Mw*Ew>>1;n+=Zl)e=vf(e/Mw);return vf(n+(Mw+1)*e/(e+gee))}function Iee(e){var t,r,n,i,o,a,c,v,y,w,M,S=[],R,C,B,N;for(e=Oee(e),R=e.length,t=_ee,r=0,o=yee,a=0;a<R;++a)M=e[a],M<128&&S.push(Sw(M));for(n=i=S.length,i&&S.push(wee);n<R;){for(c=xw,a=0;a<R;++a)M=e[a],M>=t&&M<c&&(c=M);for(C=n+1,c-t>vf((xw-r)/C)&&LO("overflow"),r+=(c-t)*C,t=c,a=0;a<R;++a)if(M=e[a],M<t&&++r>xw&&LO("overflow"),M==t){for(v=r,y=Zl;w=y<=o?DO:y>=o+Ew?Ew:y-o,!(v<w);y+=Zl)N=v-w,B=Zl-w,S.push(Sw(BO(w+N%B,0))),v=vf(N/B);S.push(Sw(BO(v,0))),o=Ree(r,C,n==i),r=0,++n}++r,++t}return S.join("")}function jO(e){return Aee(e,function(t){return xee.test(t)?"xn--"+Iee(t):t})}var xw,Zl,DO,Ew,gee,bee,yee,_ee,wee,xee,Mee,See,Mw,vf,Sw,FO=_t(()=>{xw=2147483647,Zl=36,DO=1,Ew=26,gee=38,bee=700,yee=72,_ee=128,wee="-",xee=/[^\x20-\x7E]/,Mee=/[\x2E\u3002\uFF0E\uFF61]/g,See={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Mw=Zl-DO,vf=Math.floor,Sw=String.fromCharCode});function Cee(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yl(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function WO(e,t,r,n){return t=t||"&",r=r||"=",e===null&&(e=void 0),typeof e=="object"?UO(Tee(e),function(i){var o=encodeURIComponent(Yl(i))+r;return HO(e[i])?UO(e[i],function(a){return o+encodeURIComponent(Yl(a))}).join(t):o+encodeURIComponent(Yl(e[i]))}).join(t):n?encodeURIComponent(Yl(n))+r+encodeURIComponent(Yl(e)):""}function UO(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}function Aw(e,t,r,n){t=t||"&",r=r||"=";var i={};if(typeof e!="string"||e.length===0)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&typeof n.maxKeys=="number"&&(a=n.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var v=0;v<c;++v){var y=e[v].replace(o,"%20"),w=y.indexOf(r),M,S,R,C;w>=0?(M=y.substr(0,w),S=y.substr(w+1)):(M=y,S=""),R=decodeURIComponent(M),C=decodeURIComponent(S),Cee(i,R)?HO(i[R])?i[R].push(C):i[R]=[i[R],C]:i[R]=C}return i}var HO,Tee,zO=_t(()=>{HO=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};Tee=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}});var XO={};Sr(XO,{Url:()=>Pi,default:()=>kee,format:()=>ZO,parse:()=>Vo,resolve:()=>YO,resolveObject:()=>JO});function Pi(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Vo(e,t,r){if(e&&no(e)&&e instanceof Pi)return e;var n=new Pi;return n.parse(e,t,r),n}function GO(e,t,r,n){if(!Wo(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=i!==-1&&i<t.indexOf("#")?"?":"#",a=t.split(o),c=/\\/g;a[0]=a[0].replace(c,"/"),t=a.join(o);var v=t;if(v=v.trim(),!n&&t.split("#").length===1){var y=qee.exec(v);if(y)return e.path=v,e.href=v,e.pathname=y[1],y[2]?(e.search=y[2],r?e.query=Aw(e.search.substr(1)):e.query=e.search.substr(1)):r&&(e.search="",e.query={}),e}var w=Pee.exec(v);if(w){w=w[0];var M=w.toLowerCase();e.protocol=M,v=v.substr(w.length)}if(n||w||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var S=v.substr(0,2)==="//";S&&!(w&&Rw[w])&&(v=v.substr(2),e.slashes=!0)}var R,C,B,N;if(!Rw[w]&&(S||w&&!mf[w])){var q=-1;for(R=0;R<$O.length;R++)C=v.indexOf($O[R]),C!==-1&&(q===-1||C<q)&&(q=C);var H,D;for(q===-1?D=v.lastIndexOf("@"):D=v.lastIndexOf("@",q),D!==-1&&(H=v.slice(0,D),v=v.slice(D+1),e.auth=decodeURIComponent(H)),q=-1,R=0;R<VO.length;R++)C=v.indexOf(VO[R]),C!==-1&&(q===-1||C<q)&&(q=C);q===-1&&(q=v.length),e.host=v.slice(0,q),v=v.slice(q),QO(e),e.hostname=e.hostname||"";var ee=e.hostname[0]==="["&&e.hostname[e.hostname.length-1]==="]";if(!ee){var ge=e.hostname.split(/\./);for(R=0,B=ge.length;R<B;R++){var Z=ge[R];if(!!Z&&!Z.match(KO)){for(var X="",V=0,k=Z.length;V<k;V++)Z.charCodeAt(V)>127?X+="x":X+=Z[V];if(!X.match(KO)){var m=ge.slice(0,R),s=ge.slice(R+1),l=Z.match(jee);l&&(m.push(l[1]),s.unshift(l[2])),s.length&&(v="/"+s.join(".")+v),e.hostname=m.join(".");break}}}}e.hostname.length>Dee?e.hostname="":e.hostname=e.hostname.toLowerCase(),ee||(e.hostname=jO(e.hostname)),N=e.port?":"+e.port:"";var d=e.hostname||"";e.host=d+N,e.href+=e.host,ee&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),v[0]!=="/"&&(v="/"+v))}if(!Fee[M])for(R=0,B=Ow.length;R<B;R++){var f=Ow[R];if(v.indexOf(f)!==-1){var p=encodeURIComponent(f);p===f&&(p=escape(f)),v=v.split(f).join(p)}}var g=v.indexOf("#");g!==-1&&(e.hash=v.substr(g),v=v.slice(0,g));var b=v.indexOf("?");if(b!==-1?(e.search=v.substr(b),e.query=v.substr(b+1),r&&(e.query=Aw(e.query)),v=v.slice(0,b)):r&&(e.search="",e.query={}),v&&(e.pathname=v),mf[M]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){N=e.pathname||"";var h=e.search||"";e.path=N+h}return e.href=Iw(e),e}function ZO(e){return Wo(e)&&(e=GO({},e)),Iw(e)}function Iw(e){var t=e.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(e.hostname.indexOf(":")===-1?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&no(e.query)&&Object.keys(e.query).length&&(a=WO(e.query));var c=e.search||a&&"?"+a||"";return r&&r.substr(-1)!==":"&&(r+=":"),e.slashes||(!r||mf[r])&&o!==!1?(o="//"+(o||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):o||(o=""),i&&i.charAt(0)!=="#"&&(i="#"+i),c&&c.charAt(0)!=="?"&&(c="?"+c),n=n.replace(/[?#]/g,function(v){return encodeURIComponent(v)}),c=c.replace("#","%23"),r+o+n+c+i}function YO(e,t){return Vo(e,!1,!0).resolve(t)}function JO(e,t){return e?Vo(e,!1,!0).resolveObject(t):t}function QO(e){var t=e.host,r=Nee.exec(t);r&&(r=r[0],r!==":"&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}var kee,Pee,Nee,qee,Lee,Bee,Ow,VO,$O,Dee,KO,jee,Fee,Rw,mf,Sv=_t(()=>{FO();pi();zO();kee={parse:Vo,resolve:YO,resolveObject:JO,format:ZO,Url:Pi};Pee=/^([a-z0-9.+-]+:)/i,Nee=/:[0-9]*$/,qee=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Lee=["<",">",'"',"`"," ","\r",`
|
|
532
|
+
`," "],Bee=["{","}","|","\\","^","`"].concat(Lee),Ow=["'"].concat(Bee),VO=["%","/","?",";","#"].concat(Ow),$O=["/","?","#"],Dee=255,KO=/^[+a-z0-9A-Z_-]{0,63}$/,jee=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Fee={javascript:!0,"javascript:":!0},Rw={javascript:!0,"javascript:":!0},mf={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};Pi.prototype.parse=function(e,t,r){return GO(this,e,t,r)};Pi.prototype.format=function(){return Iw(this)};Pi.prototype.resolve=function(e){return this.resolveObject(Vo(e,!1,!0)).format()};Pi.prototype.resolveObject=function(e){if(Wo(e)){var t=new Pi;t.parse(e,!1,!0),e=t}for(var r=new Pi,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];r[o]=this[o]}if(r.hash=e.hash,e.href==="")return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),c=0;c<a.length;c++){var v=a[c];v!=="protocol"&&(r[v]=e[v])}return mf[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}var y;if(e.protocol&&e.protocol!==r.protocol){if(!mf[e.protocol]){for(var w=Object.keys(e),M=0;M<w.length;M++){var S=w[M];r[S]=e[S]}return r.href=r.format(),r}if(r.protocol=e.protocol,!e.host&&!Rw[e.protocol]){for(y=(e.pathname||"").split("/");y.length&&!(e.host=y.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),y[0]!==""&&y.unshift(""),y.length<2&&y.unshift(""),r.pathname=y.join("/")}else r.pathname=e.pathname;if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var R=r.pathname||"",C=r.search||"";r.path=R+C}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var B=r.pathname&&r.pathname.charAt(0)==="/",N=e.host||e.pathname&&e.pathname.charAt(0)==="/",q=N||B||r.host&&e.pathname,H=q,D=r.pathname&&r.pathname.split("/")||[],ee=r.protocol&&!mf[r.protocol];y=e.pathname&&e.pathname.split("/")||[],ee&&(r.hostname="",r.port=null,r.host&&(D[0]===""?D[0]=r.host:D.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(y[0]===""?y[0]=e.host:y.unshift(e.host)),e.host=null),q=q&&(y[0]===""||D[0]===""));var ge;if(N)r.host=e.host||e.host===""?e.host:r.host,r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname,r.search=e.search,r.query=e.query,D=y;else if(y.length)D||(D=[]),D.pop(),D=D.concat(y),r.search=e.search,r.query=e.query;else if(!bv(e.search))return ee&&(r.hostname=r.host=D.shift(),ge=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1,ge&&(r.auth=ge.shift(),r.host=r.hostname=ge.shift())),r.search=e.search,r.query=e.query,(!ro(r.pathname)||!ro(r.search))&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!D.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var Z=D.slice(-1)[0],X=(r.host||e.host||D.length>1)&&(Z==="."||Z==="..")||Z==="",V=0,k=D.length;k>=0;k--)Z=D[k],Z==="."?D.splice(k,1):Z===".."?(D.splice(k,1),V++):V&&(D.splice(k,1),V--);if(!q&&!H)for(;V--;V)D.unshift("..");q&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),X&&D.join("/").substr(-1)!=="/"&&D.push("");var m=D[0]===""||D[0]&&D[0].charAt(0)==="/";return ee&&(r.hostname=r.host=m?"":D.length?D.shift():"",ge=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1,ge&&(r.auth=ge.shift(),r.host=r.hostname=ge.shift())),q=q||r.host&&D.length,q&&!m&&D.unshift(""),D.length?r.pathname=D.join("/"):(r.pathname=null,r.path=null),(!ro(r.pathname)||!ro(r.search))&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r};Pi.prototype.parseHost=function(){return QO(this)}});var nR={};Sr(nR,{Agent:()=>Tw,METHODS:()=>tR,STATUS_CODES:()=>rR,default:()=>Uee,get:()=>eR,request:()=>Cw});function Cw(e,t){typeof e=="string"&&(e=Vo(e));var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,a=e.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+a,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new Mv(e);return t&&c.on("response",t),c}function eR(e,t){var r=Cw(e,t);return r.end(),r}function Tw(){}var tR,rR,Uee,iR=_t(()=>{ww();Sv();Tw.defaultMaxSockets=4;tR=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],rR={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Uee={request:Cw,get:eR,Agent:Tw,METHODS:tR,STATUS_CODES:rR}});var oR=E((hke,Ev)=>{var Ta=(iR(),Pt(nR));if(Ta&&Ta.default){Ev.exports=Ta.default;for(let e in Ta)Ev.exports[e]=Ta[e]}else Ta&&(Ev.exports=Ta)});var fR={};Sr(fR,{Agent:()=>Pw,METHODS:()=>aR,STATUS_CODES:()=>uR,default:()=>Hee,get:()=>sR,request:()=>kw});function kw(e,t){typeof e=="string"&&(e=Vo(e));var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,a=e.path||"/";i&&i.indexOf(":")!==-1&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+a,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new Mv(e);return t&&c.on("response",t),c}function sR(e,t){var r=kw(e,t);return r.end(),r}function Pw(){}var aR,uR,Hee,cR=_t(()=>{ww();Sv();Pw.defaultMaxSockets=4;aR=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],uR={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"},Hee={request:kw,get:sR,Agent:Pw,METHODS:aR,STATUS_CODES:uR}});var lR=E((vke,Av)=>{var ka=(cR(),Pt(fR));if(ka&&ka.default){Av.exports=ka.default;for(let e in ka)Av.exports[e]=ka[e]}else ka&&(Av.exports=ka)});var ER={};Sr(ER,{EOL:()=>SR,arch:()=>Wee,cpus:()=>bR,default:()=>Vee,endianness:()=>hR,freemem:()=>mR,getNetworkInterfaces:()=>xR,hostname:()=>dR,loadavg:()=>pR,networkInterfaces:()=>wR,platform:()=>zee,release:()=>_R,tmpDir:()=>Nw,tmpdir:()=>MR,totalmem:()=>gR,type:()=>yR,uptime:()=>vR});function hR(){if(typeof Ov>"u"){var e=new ArrayBuffer(2),t=new Uint8Array(e),r=new Uint16Array(e);if(t[0]=1,t[1]=2,r[0]===258)Ov="BE";else if(r[0]===513)Ov="LE";else throw new Error("unable to figure out endianess")}return Ov}function dR(){return typeof globalThis.location<"u"?globalThis.location.hostname:""}function pR(){return[]}function vR(){return 0}function mR(){return Number.MAX_VALUE}function gR(){return Number.MAX_VALUE}function bR(){return[]}function yR(){return"Browser"}function _R(){return typeof globalThis.navigator<"u"?globalThis.navigator.appVersion:""}function wR(){}function xR(){}function Wee(){return"javascript"}function zee(){return"browser"}function Nw(){return"/tmp"}var Ov,MR,SR,Vee,AR=_t(()=>{MR=Nw,SR=`
|
|
533
|
+
`,Vee={EOL:SR,tmpdir:MR,tmpDir:Nw,networkInterfaces:wR,getNetworkInterfaces:xR,release:_R,type:yR,cpus:bR,totalmem:gR,freemem:mR,uptime:vR,loadavg:pR,hostname:dR,endianness:hR}});var OR=E((mke,Rv)=>{var Pa=(AR(),Pt(ER));if(Pa&&Pa.default){Rv.exports=Pa.default;for(let e in Pa)Rv.exports[e]=Pa[e]}else Pa&&(Rv.exports=Pa)});var RR=E((gke,Iv)=>{var Na=(Sv(),Pt(XO));if(Na&&Na.default){Iv.exports=Na.default;for(let e in Na)Iv.exports[e]=Na[e]}else Na&&(Iv.exports=Na)});var IR=E(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});var $ee=function(){function e(t){this.type=t,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0}return e}();qw.ProgressEvent=$ee});var CR=E(Es=>{"use strict";var Cv=Es&&Es.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Es,"__esModule",{value:!0});var Kee=function(e){Cv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Es.SecurityError=Kee;var Gee=function(e){Cv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Es.InvalidStateError=Gee;var Zee=function(e){Cv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Es.NetworkError=Zee;var Yee=function(e){Cv(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);Es.SyntaxError=Yee});var Tv=E(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var Jee=function(){function e(){this.listeners={}}return e.prototype.addEventListener=function(t,r){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(r.handleEvent||r)},e.prototype.removeEventListener=function(t,r){if(t=t.toLowerCase(),!!this.listeners[t]){var n=this.listeners[t].indexOf(r.handleEvent||r);n<0||this.listeners[t].splice(n,1)}},e.prototype.dispatchEvent=function(t){var r=t.type.toLowerCase();if(t.target=this,this.listeners[r])for(var n=0,i=this.listeners[r];n<i.length;n++){var o=i[n];o.call(this,t)}var a=this["on"+r];return a&&a.call(this,t),!0},e}();Lw.XMLHttpRequestEventTarget=Jee});var TR=E(Jl=>{"use strict";var Qee=Jl&&Jl.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Jl,"__esModule",{value:!0});var Xee=Tv(),ete=function(e){Qee(t,e);function t(){var r=e.call(this)||this;return r._contentType=null,r._body=null,r._reset(),r}return t.prototype._reset=function(){this._contentType=null,this._body=null},t.prototype._setData=function(r){if(r!=null)if(typeof r=="string")r.length!==0&&(this._contentType="text/plain;charset=UTF-8"),this._body=new Buffer(r,"utf-8");else if(Buffer.isBuffer(r))this._body=r;else if(r instanceof ArrayBuffer){for(var n=new Buffer(r.byteLength),i=new Uint8Array(r),o=0;o<r.byteLength;o++)n[o]=i[o];this._body=n}else if(r.buffer&&r.buffer instanceof ArrayBuffer){for(var n=new Buffer(r.byteLength),a=r.byteOffset,i=new Uint8Array(r.buffer),o=0;o<r.byteLength;o++)n[o]=i[o+a];this._body=n}else throw new Error("Unsupported send() data "+r)},t.prototype._finalizeHeaders=function(r,n){this._contentType&&!n["content-type"]&&(r["Content-Type"]=this._contentType),this._body&&(r["Content-Length"]=this._body.length.toString())},t.prototype._startUpload=function(r){this._body&&r.write(this._body),r.end()},t}(Xee.XMLHttpRequestEventTarget);Jl.XMLHttpRequestUpload=ete});var kR=E(kv=>{(function(){"use strict";function e(i,o,a,c){return this instanceof e?(this.domain=i||void 0,this.path=o||"/",this.secure=!!a,this.script=!!c,this):new e(i,o,a,c)}e.All=Object.freeze(Object.create(null)),kv.CookieAccessInfo=e;function t(i,o,a){return i instanceof t?i:this instanceof t?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(a||"/"),this.explicit_path=!1,this.domain=o||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,i&&this.parse(i,o,a),this):new t(i,o,a)}kv.Cookie=t,t.prototype.toString=function(){var o=[this.name+"="+this.value];return this.expiration_date!==1/0&&o.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&o.push("domain="+this.domain),this.path&&o.push("path="+this.path),this.secure&&o.push("secure"),this.noscript&&o.push("httponly"),o.join("; ")},t.prototype.toValueString=function(){return this.name+"="+this.value};var r=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;t.prototype.parse=function(o,a,c){if(this instanceof t){if(o.length>32768){console.warn("Cookie too long for parsing (>32768 characters)");return}var v=o.split(";").filter(function(R){return!!R}),y,w=v[0].match(/([^=]+)=([\s\S]*)/);if(!w){console.warn("Invalid cookie header encountered. Header: '"+o+"'");return}var M=w[1],S=w[2];if(typeof M!="string"||M.length===0||typeof S!="string"){console.warn("Unable to extract values from cookie header. Cookie: '"+o+"'");return}for(this.name=M,this.value=S,y=1;y<v.length;y+=1)switch(w=v[y].match(/([^=]+)(?:=([\s\S]*))?/),M=w[1].trim().toLowerCase(),S=w[2],M){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=S?Number(Date.parse(S)):1/0;break;case"path":this.path=S?S.trim():"",this.explicit_path=!0;break;case"domain":this.domain=S?S.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0;break}return this.explicit_path||(this.path=c||"/"),this.explicit_domain||(this.domain=a),this}return new t().parse(o,a,c)},t.prototype.matches=function(o){return o===e.All?!0:!(this.noscript&&o.script||this.secure&&!o.secure||!this.collidesWith(o))},t.prototype.collidesWith=function(o){if(this.path&&!o.path||this.domain&&!o.domain||this.path&&o.path.indexOf(this.path)!==0||this.explicit_path&&o.path.indexOf(this.path)!==0)return!1;var a=o.domain&&o.domain.replace(/^[\.]/,""),c=this.domain&&this.domain.replace(/^[\.]/,"");if(c===a)return!0;if(c){if(!this.explicit_domain)return!1;var v=a.indexOf(c);return!(v===-1||v!==a.length-c.length)}return!0};function n(){var i,o,a;return this instanceof n?(i=Object.create(null),this.setCookie=function(v,y,w){var M,S;if(v=new t(v,y,w),M=v.expiration_date<=Date.now(),i[v.name]!==void 0){for(o=i[v.name],S=0;S<o.length;S+=1)if(a=o[S],a.collidesWith(v))return M?(o.splice(S,1),o.length===0&&delete i[v.name],!1):(o[S]=v,v);return M?!1:(o.push(v),v)}return M?!1:(i[v.name]=[v],i[v.name])},this.getCookie=function(v,y){var w,M;if(o=i[v],!!o)for(M=0;M<o.length;M+=1){if(w=o[M],w.expiration_date<=Date.now()){o.length===0&&delete i[w.name];continue}if(w.matches(y))return w}},this.getCookies=function(v){var y=[],w,M;for(w in i)M=this.getCookie(w,v),M&&y.push(M);return y.toString=function(){return y.join(":")},y.toValueString=function(){return y.map(function(R){return R.toValueString()}).join("; ")},y},this):new n}kv.CookieJar=n,n.prototype.setCookies=function(o,a,c){o=Array.isArray(o)?o:o.split(r);var v=[],y,w;for(o=o.map(function(M){return new t(M,a,c)}),y=0;y<o.length;y+=1)w=o[y],this.setCookie(w,a,c)&&v.push(w);return v}})()});var DR=E(qa=>{"use strict";var tte=qa&&qa.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),rte=qa&&qa.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(qa,"__esModule",{value:!0});var Dw=oR(),BR=lR(),PR=OR(),Bw=RR(),NR=IR(),Pv=CR(),nte=Tv(),qR=TR(),LR=kR(),Nv=function(e){tte(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.UNSENT=t.UNSENT,n.OPENED=t.OPENED,n.HEADERS_RECEIVED=t.HEADERS_RECEIVED,n.LOADING=t.LOADING,n.DONE=t.DONE,n.onreadystatechange=null,n.readyState=t.UNSENT,n.response=null,n.responseText="",n.responseType="",n.status=0,n.statusText="",n.timeout=0,n.upload=new qR.XMLHttpRequestUpload,n.responseUrl="",n.withCredentials=!1,n._method=null,n._url=null,n._sync=!1,n._headers={},n._loweredHeaders={},n._mimeOverride=null,n._request=null,n._response=null,n._responseParts=null,n._responseHeaders=null,n._aborting=null,n._error=null,n._loadedBytes=0,n._totalBytes=0,n._lengthComputable=!1,n._restrictedMethods={CONNECT:!0,TRACE:!0,TRACK:!0},n._restrictedHeaders={"accept-charset":!0,"accept-encoding":!0,"access-control-request-headers":!0,"access-control-request-method":!0,connection:!0,"content-length":!0,cookie:!0,cookie2:!0,date:!0,dnt:!0,expect:!0,host:!0,"keep-alive":!0,origin:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,via:!0},n._privateHeaders={"set-cookie":!0,"set-cookie2":!0},n._userAgent="Mozilla/5.0 ("+PR.type()+" "+PR.arch()+") node.js/"+process.versions.node+" v8/"+process.versions.v8,n._anonymous=r.anon||!1,n}return t.prototype.open=function(r,n,i,o,a){if(i===void 0&&(i=!0),r=r.toUpperCase(),this._restrictedMethods[r])throw new t.SecurityError("HTTP method "+r+" is not allowed in XHR");var c=this._parseUrl(n,o,a);this.readyState===t.HEADERS_RECEIVED||(this.readyState,t.LOADING),this._method=r,this._url=c,this._sync=!i,this._headers={},this._loweredHeaders={},this._mimeOverride=null,this._setReadyState(t.OPENED),this._request=null,this._response=null,this.status=0,this.statusText="",this._responseParts=[],this._responseHeaders=null,this._loadedBytes=0,this._totalBytes=0,this._lengthComputable=!1},t.prototype.setRequestHeader=function(r,n){if(this.readyState!==t.OPENED)throw new t.InvalidStateError("XHR readyState must be OPENED");var i=r.toLowerCase();if(this._restrictedHeaders[i]||/^sec-/.test(i)||/^proxy-/.test(i)){console.warn('Refused to set unsafe header "'+r+'"');return}n=n.toString(),this._loweredHeaders[i]!=null?(r=this._loweredHeaders[i],this._headers[r]=this._headers[r]+", "+n):(this._loweredHeaders[i]=r,this._headers[r]=n)},t.prototype.send=function(r){if(this.readyState!==t.OPENED)throw new t.InvalidStateError("XHR readyState must be OPENED");if(this._request)throw new t.InvalidStateError("send() already called");switch(this._url.protocol){case"file:":return this._sendFile(r);case"http:":case"https:":return this._sendHttp(r);default:throw new t.NetworkError("Unsupported protocol "+this._url.protocol)}},t.prototype.abort=function(){this._request!=null&&(this._request.abort(),this._setError(),this._dispatchProgress("abort"),this._dispatchProgress("loadend"))},t.prototype.getResponseHeader=function(r){if(this._responseHeaders==null||r==null)return null;var n=r.toLowerCase();return this._responseHeaders.hasOwnProperty(n)?this._responseHeaders[r.toLowerCase()]:null},t.prototype.getAllResponseHeaders=function(){var r=this;return this._responseHeaders==null?"":Object.keys(this._responseHeaders).map(function(n){return n+": "+r._responseHeaders[n]}).join(`\r
|
|
534
|
+
`)},t.prototype.overrideMimeType=function(r){if(this.readyState===t.LOADING||this.readyState===t.DONE)throw new t.InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");this._mimeOverride=r.toLowerCase()},t.prototype.nodejsSet=function(r){if(this.nodejsHttpAgent=r.httpAgent||this.nodejsHttpAgent,this.nodejsHttpsAgent=r.httpsAgent||this.nodejsHttpsAgent,r.hasOwnProperty("baseUrl")){if(r.baseUrl!=null){var n=Bw.parse(r.baseUrl,!1,!0);if(!n.protocol)throw new t.SyntaxError("baseUrl must be an absolute URL")}this.nodejsBaseUrl=r.baseUrl}},t.nodejsSet=function(r){t.prototype.nodejsSet(r)},t.prototype._setReadyState=function(r){this.readyState=r,this.dispatchEvent(new NR.ProgressEvent("readystatechange"))},t.prototype._sendFile=function(r){throw new Error("Protocol file: not implemented")},t.prototype._sendHttp=function(r){if(this._sync)throw new Error("Synchronous XHR processing not implemented");r&&(this._method==="GET"||this._method==="HEAD")?(console.warn("Discarding entity body for "+this._method+" requests"),r=null):r=r||"",this.upload._setData(r),this._finalizeHeaders(),this._sendHxxpRequest()},t.prototype._sendHxxpRequest=function(){var r=this;if(this.withCredentials){var n=t.cookieJar.getCookies(LR.CookieAccessInfo(this._url.hostname,this._url.pathname,this._url.protocol==="https:")).toValueString();this._headers.cookie=this._headers.cookie2=n}var i=this._url.protocol==="http:"?[Dw,this.nodejsHttpAgent]:[BR,this.nodejsHttpsAgent],o=i[0],a=i[1],c=o.request.bind(o),v=c({hostname:this._url.hostname,port:+this._url.port,path:this._url.path,auth:this._url.auth,method:this._method,headers:this._headers,agent:a});this._request=v,this.timeout&&v.setTimeout(this.timeout,function(){return r._onHttpTimeout(v)}),v.on("response",function(y){return r._onHttpResponse(v,y)}),v.on("error",function(y){return r._onHttpRequestError(v,y)}),this.upload._startUpload(v),this._request===v&&this._dispatchProgress("loadstart")},t.prototype._finalizeHeaders=function(){this._headers=rte({},this._headers,{Connection:"keep-alive",Host:this._url.host,"User-Agent":this._userAgent},this._anonymous?{Referer:"about:blank"}:{}),this.upload._finalizeHeaders(this._headers,this._loweredHeaders)},t.prototype._onHttpResponse=function(r,n){var i=this;if(this._request===r){if(this.withCredentials&&(n.headers["set-cookie"]||n.headers["set-cookie2"])&&t.cookieJar.setCookies(n.headers["set-cookie"]||n.headers["set-cookie2"]),[301,302,303,307,308].indexOf(n.statusCode)>=0){this._url=this._parseUrl(n.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),this._headers["Content-Type"]!=null&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),this._sendHxxpRequest();return}this._response=n,this._response.on("data",function(a){return i._onHttpResponseData(n,a)}),this._response.on("end",function(){return i._onHttpResponseEnd(n)}),this._response.on("close",function(){return i._onHttpResponseClose(n)}),this.responseUrl=this._url.href.split("#")[0],this.status=n.statusCode,this.statusText=Dw.STATUS_CODES[this.status],this._parseResponseHeaders(n);var o=this._responseHeaders["content-length"]||"";this._totalBytes=+o,this._lengthComputable=!!o,this._setReadyState(t.HEADERS_RECEIVED)}},t.prototype._onHttpResponseData=function(r,n){this._response===r&&(this._responseParts.push(new Buffer(n)),this._loadedBytes+=n.length,this.readyState!==t.LOADING&&this._setReadyState(t.LOADING),this._dispatchProgress("progress"))},t.prototype._onHttpResponseEnd=function(r){this._response===r&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(t.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},t.prototype._onHttpResponseClose=function(r){if(this._response===r){var n=this._request;this._setError(),n.abort(),this._setReadyState(t.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},t.prototype._onHttpTimeout=function(r){this._request===r&&(this._setError(),r.abort(),this._setReadyState(t.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},t.prototype._onHttpRequestError=function(r,n){this._request===r&&(this._setError(),r.abort(),this._setReadyState(t.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},t.prototype._dispatchProgress=function(r){var n=new t.ProgressEvent(r);n.lengthComputable=this._lengthComputable,n.loaded=this._loadedBytes,n.total=this._totalBytes,this.dispatchEvent(n)},t.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},t.prototype._parseUrl=function(r,n,i){var o=this.nodejsBaseUrl==null?r:Bw.resolve(this.nodejsBaseUrl,r),a=Bw.parse(o,!1,!0);a.hash=null;var c=(a.auth||"").split(":"),v=c[0],y=c[1];return(v||y||n||i)&&(a.auth=(n||v||"")+":"+(i||y||"")),a},t.prototype._parseResponseHeaders=function(r){this._responseHeaders={};for(var n in r.headers){var i=n.toLowerCase();this._privateHeaders[i]||(this._responseHeaders[i]=r.headers[n])}this._mimeOverride!=null&&(this._responseHeaders["content-type"]=this._mimeOverride)},t.prototype._parseResponse=function(){var r=Buffer.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(r.toString("utf-8"))}catch{this.response=null}return;case"buffer":this.responseText=null,this.response=r;return;case"arraybuffer":this.responseText=null;for(var n=new ArrayBuffer(r.length),i=new Uint8Array(n),o=0;o<r.length;o++)i[o]=r[o];this.response=n;return;case"text":default:try{this.responseText=r.toString(this._parseResponseEncoding())}catch{this.responseText=r.toString("binary")}this.response=this.responseText}},t.prototype._parseResponseEncoding=function(){return/;\s*charset=(.*)$/.exec(this._responseHeaders["content-type"]||"")[1]||"utf-8"},t.ProgressEvent=NR.ProgressEvent,t.InvalidStateError=Pv.InvalidStateError,t.NetworkError=Pv.NetworkError,t.SecurityError=Pv.SecurityError,t.SyntaxError=Pv.SyntaxError,t.XMLHttpRequestUpload=qR.XMLHttpRequestUpload,t.UNSENT=0,t.OPENED=1,t.HEADERS_RECEIVED=2,t.LOADING=3,t.DONE=4,t.cookieJar=LR.CookieJar(),t}(nte.XMLHttpRequestEventTarget);qa.XMLHttpRequest=Nv;Nv.prototype.nodejsHttpAgent=Dw.globalAgent;Nv.prototype.nodejsHttpsAgent=BR.globalAgent;Nv.prototype.nodejsBaseUrl=null});var jR=E(Ql=>{"use strict";function ite(e){for(var t in e)Ql.hasOwnProperty(t)||(Ql[t]=e[t])}Object.defineProperty(Ql,"__esModule",{value:!0});ite(DR());var ote=Tv();Ql.XMLHttpRequestEventTarget=ote.XMLHttpRequestEventTarget});var gf=E((Oke,qv)=>{var La=($l(),Pt(hO));if(La&&La.default){qv.exports=La.default;for(let e in La)qv.exports[e]=La[e]}else La&&(qv.exports=La)});var $o=E((Rke,Lv)=>{var Ba=(pi(),Pt(aO));if(Ba&&Ba.default){Lv.exports=Ba.default;for(let e in Ba)Lv.exports[e]=Ba[e]}else Ba&&(Lv.exports=Ba)});var WR=E(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});function ate(e){return function(t){var r=e();return r.update(t),Buffer.from(r.digest())}}Fw.createHashFunction=ate});var Uw=E((Cke,zR)=>{zR.exports=gf().EventEmitter});var GR=E((kke,KR)=>{"use strict";function VR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $R(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VR(Object(r),!0).forEach(function(n){ute(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ute(e,t,r){return t=fte(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fte(e){var t=cte(e,"string");return typeof t=="symbol"?t:String(t)}function cte(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lte=fi(),Bv=lte.Buffer,hte=$o(),Hw=hte.inspect,dte=Hw&&Hw.custom||"inspect";function pte(e,t,r){Bv.prototype.copy.call(e,t,r)}KR.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";for(var r=this.head,n=""+r.data;r=r.next;)n+=t+r.data;return n}concat(t){if(this.length===0)return Bv.alloc(0);let r=Bv.allocUnsafe(t>>>0);for(var n=this.head,i=0;n;)pte(n.data,r,i),i+=n.data.length,n=n.next;return r}consume(t,r){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?n=this.shift():n=r?this._getString(t):this._getBuffer(t),n}first(){return this.head.data}_getString(t){var r=this.head,n=1,i=r.data;for(t-=i.length;r=r.next;){let o=r.data,a=t>o.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),t-=a,t===0){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,i}_getBuffer(t){let r=Bv.allocUnsafe(t);var n=this.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){let o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),t-=a,t===0){a===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++i}return this.length-=i,r}[dte](t,r){return Hw(this,$R($R({},r),{},{depth:0,customInspect:!1}))}}});var zw=E((Pke,YR)=>{"use strict";function vte(e,t){let r=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return r||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ww,this,e)):process.nextTick(Ww,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,i=>{!t&&i?this._writableState?this._writableState.errorEmitted?process.nextTick(Dv,this):(this._writableState.errorEmitted=!0,process.nextTick(ZR,this,i)):process.nextTick(ZR,this,i):t?(process.nextTick(Dv,this),t(i)):process.nextTick(Dv,this)}),this)}function ZR(e,t){Ww(e,t),Dv(e)}function Dv(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function mte(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Ww(e,t){e.emit("error",t)}function gte(e,t){let r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}YR.exports={destroy:vte,undestroy:mte,errorOrDestroy:gte}});var Da=E((Nke,XR)=>{"use strict";function bte(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var QR={};function vi(e,t,r){r||(r=Error);function n(o,a,c){return typeof t=="string"?t:t(o,a,c)}var i=function(o){bte(a,o);function a(c,v,y){return o.call(this,n(c,v,y))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,QR[e]=i}function JR(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function yte(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function _te(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function wte(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}vi("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);vi("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&yte(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(_te(e," argument"))i="The ".concat(e," ").concat(n," ").concat(JR(t,"type"));else{var o=wte(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(JR(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);vi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vi("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});vi("ERR_STREAM_PREMATURE_CLOSE","Premature close");vi("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});vi("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vi("ERR_STREAM_WRITE_AFTER_END","write after end");vi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vi("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);vi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");XR.exports.codes=QR});var Vw=E((qke,eI)=>{"use strict";var xte=Da().codes.ERR_INVALID_OPT_VALUE;function Mte(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Ste(e,t,r,n){let i=Mte(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){let o=n?r:"highWaterMark";throw new xte(o,i)}return Math.floor(i)}return e.objectMode?16:16*1024}eI.exports={getHighWaterMark:Ste}});var Tr=E((Lke,$w)=>{typeof Object.create=="function"?$w.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:$w.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}});var rI=E((Bke,tI)=>{tI.exports=Ete;function Ete(e,t){if(Kw("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Kw("throwDeprecation"))throw new Error(t);Kw("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Kw(e){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}});var Yw=E((Dke,uI)=>{"use strict";uI.exports=Er;function iI(e){this.next=null,this.entry=null,this.finish=()=>{Qte(this,e)}}var bf;Er.WritableState=eh;var Ate={deprecate:rI()},oI=Uw(),Fv=fi().Buffer,Ote=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Rte(e){return Fv.from(e)}function Ite(e){return Fv.isBuffer(e)||e instanceof Ote}var Zw=zw(),Cte=Vw(),Tte=Cte.getHighWaterMark,As=Da().codes,kte=As.ERR_INVALID_ARG_TYPE,Pte=As.ERR_METHOD_NOT_IMPLEMENTED,Nte=As.ERR_MULTIPLE_CALLBACK,qte=As.ERR_STREAM_CANNOT_PIPE,Lte=As.ERR_STREAM_DESTROYED,Bte=As.ERR_STREAM_NULL_VALUES,Dte=As.ERR_STREAM_WRITE_AFTER_END,jte=As.ERR_UNKNOWN_ENCODING,yf=Zw.errorOrDestroy;Tr()(Er,oI);function Fte(){}function eh(e,t,r){bf=bf||ja(),e=e||{},typeof r!="boolean"&&(r=t instanceof bf),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Tte(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){Kte(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new iI(this)}eh.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(eh.prototype,"buffer",{get:Ate.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var jv;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(jv=Function.prototype[Symbol.hasInstance],Object.defineProperty(Er,Symbol.hasInstance,{value:function(t){return jv.call(this,t)?!0:this!==Er?!1:t&&t._writableState instanceof eh}})):jv=function(t){return t instanceof this};function Er(e){bf=bf||ja();let t=this instanceof bf;if(!t&&!jv.call(Er,this))return new Er(e);this._writableState=new eh(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),oI.call(this)}Er.prototype.pipe=function(){yf(this,new qte)};function Ute(e,t){var r=new Dte;yf(e,r),process.nextTick(t,r)}function Hte(e,t,r,n){var i;return r===null?i=new Bte:typeof r!="string"&&!t.objectMode&&(i=new kte("chunk",["string","Buffer"],r)),i?(yf(e,i),process.nextTick(n,i),!1):!0}Er.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&Ite(e);return o&&!Fv.isBuffer(e)&&(e=Rte(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=Fte),n.ending?Ute(this,r):(o||Hte(this,n,e,r))&&(n.pendingcb++,i=zte(this,n,o,e,t,r)),i};Er.prototype.cork=function(){this._writableState.corked++};Er.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&sI(this,e))};Er.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new jte(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(Er.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Wte(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Fv.from(t,r)),t}Object.defineProperty(Er.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function zte(e,t,r,n,i,o){if(!r){var a=Wte(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var c=t.objectMode?1:n.length;t.length+=c;var v=t.length<t.highWaterMark;if(v||(t.needDrain=!0),t.writing||t.corked){var y=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},y?y.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Gw(e,t,!1,c,n,i,o);return v}function Gw(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new Lte("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function Vte(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(Xl,e,t),e._writableState.errorEmitted=!0,yf(e,n)):(i(n),e._writableState.errorEmitted=!0,yf(e,n),Xl(e,t))}function $te(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function Kte(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Nte;if($te(r),t)Vte(e,r,n,t,i);else{var o=aI(r)||e.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&sI(e,r),n?process.nextTick(nI,e,r,o,i):nI(e,r,o,i)}}function nI(e,t,r,n){r||Gte(e,t),t.pendingcb--,n(),Xl(e,t)}function Gte(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function sI(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,Gw(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new iI(t),t.bufferedRequestCount=0}else{for(;r;){var v=r.chunk,y=r.encoding,w=r.callback,M=t.objectMode?1:v.length;if(Gw(e,t,!1,M,v,y,w),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}Er.prototype._write=function(e,t,r){r(new Pte("_write()"))};Er.prototype._writev=null;Er.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||Jte(this,n,r),this};Object.defineProperty(Er.prototype,"writableLength",{enumerable:!1,get(){return this._writableState.length}});function aI(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Zte(e,t){e._final(r=>{t.pendingcb--,r&&yf(e,r),t.prefinished=!0,e.emit("prefinish"),Xl(e,t)})}function Yte(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(Zte,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function Xl(e,t){var r=aI(t);if(r&&(Yte(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){let n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function Jte(e,t,r){t.ending=!0,Xl(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function Qte(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(Er.prototype,"destroyed",{enumerable:!1,get(){return this._writableState===void 0?!1:this._writableState.destroyed},set(e){!this._writableState||(this._writableState.destroyed=e)}});Er.prototype.destroy=Zw.destroy;Er.prototype._undestroy=Zw.undestroy;Er.prototype._destroy=function(e,t){t(e)}});var ja=E((jke,cI)=>{"use strict";var Xte=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};cI.exports=io;var fI=Qw(),Jw=Yw();Tr()(io,fI);{let e=Xte(Jw.prototype);for(Uv=0;Uv<e.length;Uv++){let t=e[Uv];io.prototype[t]||(io.prototype[t]=Jw.prototype[t])}}var Uv;function io(e){if(!(this instanceof io))return new io(e);fI.call(this,e),Jw.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",ere)))}Object.defineProperty(io.prototype,"writableHighWaterMark",{enumerable:!1,get(){return this._writableState.highWaterMark}});Object.defineProperty(io.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(io.prototype,"writableLength",{enumerable:!1,get(){return this._writableState.length}});function ere(){this._writableState.ended||process.nextTick(tre,this)}function tre(e){e.end()}Object.defineProperty(io.prototype,"destroyed",{enumerable:!1,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Hn=E((Xw,hI)=>{var Hv=fi(),oo=Hv.Buffer;function lI(e,t){for(var r in e)t[r]=e[r]}oo.from&&oo.alloc&&oo.allocUnsafe&&oo.allocUnsafeSlow?hI.exports=Hv:(lI(Hv,Xw),Xw.Buffer=Fa);function Fa(e,t,r){return oo(e,t,r)}Fa.prototype=Object.create(oo.prototype);lI(oo,Fa);Fa.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return oo(e,t,r)};Fa.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=oo(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};Fa.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return oo(e)};Fa.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Hv.SlowBuffer(e)}});var r2=E(pI=>{"use strict";var t2=Hn().Buffer,dI=t2.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function rre(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function nre(e){var t=rre(e);if(typeof t!="string"&&(t2.isEncoding===dI||!dI(e)))throw new Error("Unknown encoding: "+e);return t||e}pI.StringDecoder=th;function th(e){this.encoding=nre(e);var t;switch(this.encoding){case"utf16le":this.text=fre,this.end=cre,t=4;break;case"utf8":this.fillLast=sre,t=4;break;case"base64":this.text=lre,this.end=hre,t=3;break;default:this.write=dre,this.end=pre;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t2.allocUnsafe(t)}th.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};th.prototype.end=ure;th.prototype.text=are;th.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function e2(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function ire(e,t,r){var n=t.length-1;if(n<r)return 0;var i=e2(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=e2(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=e2(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function ore(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function sre(e){var t=this.lastTotal-this.lastNeed,r=ore(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function are(e,t){var r=ire(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function ure(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function fre(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function cre(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function lre(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function hre(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function dre(e){return e.toString(this.encoding)}function pre(e){return e&&e.length?this.write(e):""}});var Wv=E((Uke,gI)=>{"use strict";var vI=Da().codes.ERR_STREAM_PREMATURE_CLOSE;function vre(e){let t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function mre(){}function gre(e){return e.setHeader&&typeof e.abort=="function"}function mI(e,t,r){if(typeof t=="function")return mI(e,null,t);t||(t={}),r=vre(r||mre);let n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,o=()=>{e.writable||c()};var a=e._writableState&&e._writableState.finished;let c=()=>{i=!1,a=!0,n||r.call(e)};var v=e._readableState&&e._readableState.endEmitted;let y=()=>{n=!1,v=!0,i||r.call(e)},w=R=>{r.call(e,R)},M=()=>{let R;if(n&&!v)return(!e._readableState||!e._readableState.ended)&&(R=new vI),r.call(e,R);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(R=new vI),r.call(e,R)},S=()=>{e.req.on("finish",c)};return gre(e)?(e.on("complete",c),e.on("abort",M),e.req?S():e.on("request",S)):i&&!e._writableState&&(e.on("end",o),e.on("close",o)),e.on("end",y),e.on("finish",c),t.error!==!1&&e.on("error",w),e.on("close",M),function(){e.removeListener("complete",c),e.removeListener("abort",M),e.removeListener("request",S),e.req&&e.req.removeListener("finish",c),e.removeListener("end",o),e.removeListener("close",o),e.removeListener("finish",c),e.removeListener("end",y),e.removeListener("error",w),e.removeListener("close",M)}}gI.exports=mI});var yI=E((Hke,bI)=>{"use strict";var bre=Wv(),Os=Symbol("lastResolve"),Ua=Symbol("lastReject"),rh=Symbol("error"),zv=Symbol("ended"),Ha=Symbol("lastPromise"),n2=Symbol("handlePromise"),Wa=Symbol("stream");function Rs(e,t){return{value:e,done:t}}function yre(e){let t=e[Os];if(t!==null){let r=e[Wa].read();r!==null&&(e[Ha]=null,e[Os]=null,e[Ua]=null,t(Rs(r,!1)))}}function _re(e){process.nextTick(yre,e)}function wre(e,t){return(r,n)=>{e.then(()=>{if(t[zv]){r(Rs(void 0,!0));return}t[n2](r,n)},n)}}var xre=Object.getPrototypeOf(function(){}),Mre=Object.setPrototypeOf({get stream(){return this[Wa]},next(){let e=this[rh];if(e!==null)return Promise.reject(e);if(this[zv])return Promise.resolve(Rs(void 0,!0));if(this[Wa].destroyed)return new Promise((n,i)=>{process.nextTick(()=>{this[rh]?i(this[rh]):n(Rs(void 0,!0))})});let t=this[Ha],r;if(t)r=new Promise(wre(t,this));else{let n=this[Wa].read();if(n!==null)return Promise.resolve(Rs(n,!1));r=new Promise(this[n2])}return this[Ha]=r,r},[Symbol.asyncIterator](){return this},return(){return new Promise((e,t)=>{this[Wa].destroy(null,r=>{if(r){t(r);return}e(Rs(void 0,!0))})})}},xre),Sre=e=>{let t=Object.create(Mre,{[Wa]:{value:e,writable:!0},[Os]:{value:null,writable:!0},[Ua]:{value:null,writable:!0},[rh]:{value:null,writable:!0},[zv]:{value:e._readableState.endEmitted,writable:!0},[n2]:{value:(r,n)=>{let i=t[Wa].read();i?(t[Ha]=null,t[Os]=null,t[Ua]=null,r(Rs(i,!1))):(t[Os]=r,t[Ua]=n)},writable:!0}});return t[Ha]=null,bre(e,r=>{if(r&&r.code!=="ERR_STREAM_PREMATURE_CLOSE"){let i=t[Ua];i!==null&&(t[Ha]=null,t[Os]=null,t[Ua]=null,i(r)),t[rh]=r;return}let n=t[Os];n!==null&&(t[Ha]=null,t[Os]=null,t[Ua]=null,n(Rs(void 0,!0))),t[zv]=!0}),e.on("readable",_re.bind(null,t)),t};bI.exports=Sre});var wI=E((Wke,_I)=>{_I.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Qw=E((Vke,TI)=>{"use strict";TI.exports=Tt;var _f;Tt.ReadableState=EI;var zke=gf().EventEmitter,SI=function(t,r){return t.listeners(r).length},ih=Uw(),Vv=fi().Buffer,Ere=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Are(e){return Vv.from(e)}function Ore(e){return Vv.isBuffer(e)||e instanceof Ere}var i2=$o(),wt;i2&&i2.debuglog?wt=i2.debuglog("stream"):wt=function(){};var Rre=GR(),l2=zw(),Ire=Vw(),Cre=Ire.getHighWaterMark,$v=Da().codes,Tre=$v.ERR_INVALID_ARG_TYPE,kre=$v.ERR_STREAM_PUSH_AFTER_EOF,Pre=$v.ERR_METHOD_NOT_IMPLEMENTED,Nre=$v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,wf,o2,s2;Tr()(Tt,ih);var nh=l2.errorOrDestroy,a2=["error","close","destroy","pause","resume"];function qre(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function EI(e,t,r){_f=_f||ja(),e=e||{},typeof r!="boolean"&&(r=t instanceof _f),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Cre(this,e,"readableHighWaterMark",r),this.buffer=new Rre,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(wf||(wf=r2().StringDecoder),this.decoder=new wf(e.encoding),this.encoding=e.encoding)}function Tt(e){if(_f=_f||ja(),!(this instanceof Tt))return new Tt(e);let t=this instanceof _f;this._readableState=new EI(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),ih.call(this)}Object.defineProperty(Tt.prototype,"destroyed",{enumerable:!1,get(){return this._readableState===void 0?!1:this._readableState.destroyed},set(e){!this._readableState||(this._readableState.destroyed=e)}});Tt.prototype.destroy=l2.destroy;Tt.prototype._undestroy=l2.undestroy;Tt.prototype._destroy=function(e,t){t(e)};Tt.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Vv.from(e,t),t=""),n=!0),AI(this,e,t,!1,n)};Tt.prototype.unshift=function(e){return AI(this,e,null,!0,!1)};function AI(e,t,r,n,i){wt("readableAddChunk",t);var o=e._readableState;if(t===null)o.reading=!1,Dre(e,o);else{var a;if(i||(a=Lre(o,t)),a)nh(e,a);else if(o.objectMode||t&&t.length>0)if(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==Vv.prototype&&(t=Are(t)),n)o.endEmitted?nh(e,new Nre):u2(e,o,t,!0);else if(o.ended)nh(e,new kre);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?u2(e,o,t,!1):c2(e,o)):u2(e,o,t,!1)}else n||(o.reading=!1,c2(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function u2(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Kv(e)),c2(e,t)}function Lre(e,t){var r;return!Ore(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Tre("chunk",["string","Buffer","Uint8Array"],t)),r}Tt.prototype.isPaused=function(){return this._readableState.flowing===!1};Tt.prototype.setEncoding=function(e){wf||(wf=r2().StringDecoder);let t=new wf(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer.head,n="";for(;r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var xI=1073741824;function Bre(e){return e>=xI?e=xI:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function MI(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Bre(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Tt.prototype.read=function(e){wt("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return wt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?f2(this):Kv(this),null;if(e=MI(e,t),e===0&&t.ended)return t.length===0&&f2(this),null;var n=t.needReadable;wt("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,wt("length less than watermark",n)),t.ended||t.reading?(n=!1,wt("reading or ended",n)):n&&(wt("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=MI(r,t)));var i;return e>0?i=II(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&f2(this)),i!==null&&this.emit("data",i),i};function Dre(e,t){if(wt("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Kv(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,OI(e)))}}function Kv(e){var t=e._readableState;wt("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(wt("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(OI,e))}function OI(e){var t=e._readableState;wt("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,h2(e)}function c2(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(jre,e,t))}function jre(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(wt("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Tt.prototype._read=function(e){nh(this,new Pre("_read()"))};Tt.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,wt("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=i?c:B;n.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(N,q){wt("onunpipe"),N===r&&q&&q.hasUnpiped===!1&&(q.hasUnpiped=!0,w())}function c(){wt("onend"),e.end()}var v=Fre(r);e.on("drain",v);var y=!1;function w(){wt("cleanup"),e.removeListener("close",R),e.removeListener("finish",C),e.removeListener("drain",v),e.removeListener("error",S),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",B),r.removeListener("data",M),y=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&v()}r.on("data",M);function M(N){wt("ondata");var q=e.write(N);wt("dest.write",q),q===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&CI(n.pipes,e)!==-1)&&!y&&(wt("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function S(N){wt("onerror",N),B(),e.removeListener("error",S),SI(e,"error")===0&&nh(e,N)}qre(e,"error",S);function R(){e.removeListener("finish",C),B()}e.once("close",R);function C(){wt("onfinish"),e.removeListener("close",R),B()}e.once("finish",C);function B(){wt("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(wt("pipe resume"),r.resume()),e};function Fre(e){return function(){var r=e._readableState;wt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&SI(e,"data")&&(r.flowing=!0,h2(e))}}Tt.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=CI(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Tt.prototype.on=function(e,t){let r=ih.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,wt("on readable",n.length,n.reading),n.length?Kv(this):n.reading||process.nextTick(Ure,this)),r};Tt.prototype.addListener=Tt.prototype.on;Tt.prototype.removeListener=function(e,t){let r=ih.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(RI,this),r};Tt.prototype.removeAllListeners=function(e){let t=ih.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(RI,this),t};function RI(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Ure(e){wt("readable nexttick read 0"),e.read(0)}Tt.prototype.resume=function(){var e=this._readableState;return e.flowing||(wt("resume"),e.flowing=!e.readableListening,Hre(this,e)),e.paused=!1,this};function Hre(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Wre,e,t))}function Wre(e,t){wt("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),h2(e),t.flowing&&!t.reading&&e.read(0)}Tt.prototype.pause=function(){return wt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(wt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function h2(e){let t=e._readableState;for(wt("flow",t.flowing);t.flowing&&e.read()!==null;);}Tt.prototype.wrap=function(e){var t=this._readableState,r=!1;e.on("end",()=>{if(wt("wrapped end"),t.decoder&&!t.ended){var o=t.decoder.end();o&&o.length&&this.push(o)}this.push(null)}),e.on("data",o=>{if(wt("wrapped data"),t.decoder&&(o=t.decoder.write(o)),!(t.objectMode&&o==null)&&!(!t.objectMode&&(!o||!o.length))){var a=this.push(o);a||(r=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=function(a){return function(){return e[a].apply(e,arguments)}}(n));for(var i=0;i<a2.length;i++)e.on(a2[i],this.emit.bind(this,a2[i]));return this._read=o=>{wt("wrapped _read",o),r&&(r=!1,e.resume())},this};typeof Symbol=="function"&&(Tt.prototype[Symbol.asyncIterator]=function(){return o2===void 0&&(o2=yI()),o2(this)});Object.defineProperty(Tt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Tt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Tt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Tt._fromList=II;Object.defineProperty(Tt.prototype,"readableLength",{enumerable:!1,get(){return this._readableState.length}});function II(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function f2(e){var t=e._readableState;wt("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(zre,t,e))}function zre(e,t){if(wt("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){let r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Tt.from=function(e,t){return s2===void 0&&(s2=wI()),s2(Tt,e,t)});function CI(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var d2=E(($ke,PI)=>{"use strict";PI.exports=Ko;var Gv=Da().codes,Vre=Gv.ERR_METHOD_NOT_IMPLEMENTED,$re=Gv.ERR_MULTIPLE_CALLBACK,Kre=Gv.ERR_TRANSFORM_ALREADY_TRANSFORMING,Gre=Gv.ERR_TRANSFORM_WITH_LENGTH_0,Zv=ja();Tr()(Ko,Zv);function Zre(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new $re);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ko(e){if(!(this instanceof Ko))return new Ko(e);Zv.call(this,e),this._transformState={afterTransform:Zre.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Yre)}function Yre(){typeof this._flush=="function"&&!this._readableState.destroyed?this._flush((e,t)=>{kI(this,e,t)}):kI(this,null,null)}Ko.prototype.push=function(e,t){return this._transformState.needTransform=!1,Zv.prototype.push.call(this,e,t)};Ko.prototype._transform=function(e,t,r){r(new Vre("_transform()"))};Ko.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ko.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Ko.prototype._destroy=function(e,t){Zv.prototype._destroy.call(this,e,r=>{t(r)})};function kI(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Gre;if(e._transformState.transforming)throw new Kre;return e.push(null)}});var LI=E((Kke,qI)=>{"use strict";qI.exports=oh;var NI=d2();Tr()(oh,NI);function oh(e){if(!(this instanceof oh))return new oh(e);NI.call(this,e)}oh.prototype._transform=function(e,t,r){r(null,e)}});var UI=E((Gke,FI)=>{"use strict";var p2;function Jre(e){let t=!1;return function(){t||(t=!0,e(...arguments))}}var jI=Da().codes,Qre=jI.ERR_MISSING_ARGS,Xre=jI.ERR_STREAM_DESTROYED;function BI(e){if(e)throw e}function ene(e){return e.setHeader&&typeof e.abort=="function"}function tne(e,t,r,n){n=Jre(n);let i=!1;e.on("close",()=>{i=!0}),p2===void 0&&(p2=Wv()),p2(e,{readable:t,writable:r},a=>{if(a)return n(a);i=!0,n()});let o=!1;return a=>{if(!i&&!o){if(o=!0,ene(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new Xre("pipe"))}}}function DI(e){e()}function rne(e,t){return e.pipe(t)}function nne(e){return!e.length||typeof e[e.length-1]!="function"?BI:e.pop()}function ine(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=nne(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Qre("streams");let i,o=t.map(function(a,c){let v=c<t.length-1,y=c>0;return tne(a,v,y,function(w){i||(i=w),w&&o.forEach(DI),!v&&(o.forEach(DI),n(i))})});return t.reduce(rne)}FI.exports=ine});var Yv=E((mi,HI)=>{mi=HI.exports=Qw();mi.Stream=mi;mi.Readable=mi;mi.Writable=Yw();mi.Duplex=ja();mi.Transform=d2();mi.PassThrough=LI();mi.finished=Wv();mi.pipeline=UI()});var VI=E((Zke,zI)=>{var{Transform:one}=Yv();zI.exports=e=>class WI extends one{constructor(r,n,i,o,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=o,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(a){o=a}i(o)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new WI(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var GI=E((Yke,KI)=>{var{Transform:sne}=Yv();KI.exports=e=>class $I extends sne{constructor(r,n,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(a){o=a}i(o)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new $I(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var YI=E((Jke,ZI)=>{var ane=VI(),une=GI();ZI.exports=function(e){let t=ane(e),r=une(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}}});var XI=E(QI=>{var JI=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];QI.p1600=function(e){for(let t=0;t<24;++t){let r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],v=e[6]^e[16]^e[26]^e[36]^e[46],y=e[7]^e[17]^e[27]^e[37]^e[47],w=e[8]^e[18]^e[28]^e[38]^e[48],M=e[9]^e[19]^e[29]^e[39]^e[49],S=w^(i<<1|o>>>31),R=M^(o<<1|i>>>31),C=e[0]^S,B=e[1]^R,N=e[10]^S,q=e[11]^R,H=e[20]^S,D=e[21]^R,ee=e[30]^S,ge=e[31]^R,Z=e[40]^S,X=e[41]^R;S=r^(a<<1|c>>>31),R=n^(c<<1|a>>>31);let V=e[2]^S,k=e[3]^R,m=e[12]^S,s=e[13]^R,l=e[22]^S,d=e[23]^R,f=e[32]^S,p=e[33]^R,g=e[42]^S,b=e[43]^R;S=i^(v<<1|y>>>31),R=o^(y<<1|v>>>31);let h=e[4]^S,u=e[5]^R,_=e[14]^S,A=e[15]^R,x=e[24]^S,I=e[25]^R,j=e[34]^S,O=e[35]^R,L=e[44]^S,W=e[45]^R;S=a^(w<<1|M>>>31),R=c^(M<<1|w>>>31);let F=e[6]^S,K=e[7]^R,De=e[16]^S,Y=e[17]^R,Q=e[26]^S,Ve=e[27]^R,J=e[36]^S,be=e[37]^R,Ke=e[46]^S,ye=e[47]^R;S=v^(r<<1|n>>>31),R=y^(n<<1|r>>>31);let Re=e[8]^S,et=e[9]^R,oe=e[18]^S,xe=e[19]^R,it=e[28]^S,ce=e[29]^R,Ie=e[38]^S,ft=e[39]^R,le=e[48]^S,Ce=e[49]^R,ot=C,se=B,Me=q<<4|N>>>28,st=N<<4|q>>>28,ae=H<<3|D>>>29,Se=D<<3|H>>>29,at=ge<<9|ee>>>23,re=ee<<9|ge>>>23,Te=Z<<18|X>>>14,ct=X<<18|Z>>>14,ne=V<<1|k>>>31,Ee=k<<1|V>>>31,lt=s<<12|m>>>20,te=m<<12|s>>>20,ke=l<<10|d>>>22,ht=d<<10|l>>>22,ue=p<<13|f>>>19,Pe=f<<13|p>>>19,dt=g<<2|b>>>30,he=b<<2|g>>>30,Ne=u<<30|h>>>2,pt=h<<30|u>>>2,de=_<<6|A>>>26,qe=A<<6|_>>>26,vt=I<<11|x>>>21,pe=x<<11|I>>>21,Le=j<<15|O>>>17,ut=O<<15|j>>>17,ve=W<<29|L>>>3,Be=L<<29|W>>>3,mt=F<<28|K>>>4,me=K<<28|F>>>4,Ae=Y<<23|De>>>9,$t=De<<23|Y>>>9,Je=Q<<25|Ve>>>7,Qe=Ve<<25|Q>>>7,Lt=J<<21|be>>>11,Bt=be<<21|J>>>11,Dt=ye<<24|Ke>>>8,jt=Ke<<24|ye>>>8,Ft=Re<<27|et>>>5,hr=et<<27|Re>>>5,dr=oe<<20|xe>>>12,sr=xe<<20|oe>>>12,Kt=ce<<7|it>>>25,ar=it<<7|ce>>>25,Ut=Ie<<8|ft>>>24,pr=ft<<8|Ie>>>24,Jt=le<<14|Ce>>>18,tr=Ce<<14|le>>>18;e[0]=ot^~lt&vt,e[1]=se^~te&pe,e[10]=mt^~dr&ae,e[11]=me^~sr&Se,e[20]=ne^~de&Je,e[21]=Ee^~qe&Qe,e[30]=Ft^~Me&ke,e[31]=hr^~st&ht,e[40]=Ne^~Ae&Kt,e[41]=pt^~$t&ar,e[2]=lt^~vt&Lt,e[3]=te^~pe&Bt,e[12]=dr^~ae&ue,e[13]=sr^~Se&Pe,e[22]=de^~Je&Ut,e[23]=qe^~Qe&pr,e[32]=Me^~ke&Le,e[33]=st^~ht&ut,e[42]=Ae^~Kt&at,e[43]=$t^~ar&re,e[4]=vt^~Lt&Jt,e[5]=pe^~Bt&tr,e[14]=ae^~ue&ve,e[15]=Se^~Pe&Be,e[24]=Je^~Ut&Te,e[25]=Qe^~pr&ct,e[34]=ke^~Le&Dt,e[35]=ht^~ut&jt,e[44]=Kt^~at&dt,e[45]=ar^~re&he,e[6]=Lt^~Jt&ot,e[7]=Bt^~tr&se,e[16]=ue^~ve&mt,e[17]=Pe^~Be&me,e[26]=Ut^~Te&ne,e[27]=pr^~ct&Ee,e[36]=Le^~Dt&Ft,e[37]=ut^~jt&hr,e[46]=at^~dt&Ne,e[47]=re^~he&pt,e[8]=Jt^~ot<,e[9]=tr^~se&te,e[18]=ve^~mt&dr,e[19]=Be^~me&sr,e[28]=Te^~ne&de,e[29]=ct^~Ee&qe,e[38]=Dt^~Ft&Me,e[39]=jt^~hr&st,e[48]=dt^~Ne&Ae,e[49]=he^~pt&$t,e[0]^=JI[t*2],e[1]^=JI[t*2+1]}}});var tC=E((Xke,eC)=>{var Jv=XI();function xf(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}xf.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};xf.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Jv.p1600(this.state),this.count=0)};xf.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),(e&128)!==0&&this.count===this.blockSize-1&&Jv.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Jv.p1600(this.state),this.count=0,this.squeezing=!0};xf.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);let t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Jv.p1600(this.state),this.count=0);return t};xf.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};eC.exports=xf});var v2=E((ePe,rC)=>{rC.exports=YI()(tC())});var m2=E(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var Qv=WR(),Xv=v2();Mf.keccak224=Qv.createHashFunction(function(){return Xv("keccak224")});Mf.keccak256=Qv.createHashFunction(function(){return Xv("keccak256")});Mf.keccak384=Qv.createHashFunction(function(){return Xv("keccak384")});Mf.keccak512=Qv.createHashFunction(function(){return Xv("keccak512")})});var iC=E((rPe,nC)=>{var Nt={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function gi(e,t){if(!e)throw new Error(t)}function It(e,t,r){if(gi(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),r!==void 0)if(Array.isArray(r)){let n=r.join(", "),i=`Expected ${e} to be an Uint8Array with length [${n}]`;gi(r.includes(t.length),i)}else{let n=`Expected ${e} to be an Uint8Array with length ${r}`;gi(t.length===r,n)}}function za(e){gi(Sf(e)==="Boolean","Expected compressed to be a Boolean")}function Ni(e=r=>new Uint8Array(r),t){return typeof e=="function"&&(e=e(t)),It("output",e,t),e}function Sf(e){return Object.prototype.toString.call(e).slice(8,-1)}nC.exports=e=>({contextRandomize(t){switch(gi(t===null||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),t!==null&&It("seed",t,32),e.contextRandomize(t)){case 1:throw new Error(Nt.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(t){return It("private key",t,32),e.privateKeyVerify(t)===0},privateKeyNegate(t){switch(It("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(Nt.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(t,r){switch(It("private key",t,32),It("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t;case 1:throw new Error(Nt.TWEAK_ADD)}},privateKeyTweakMul(t,r){switch(It("private key",t,32),It("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(Nt.TWEAK_MUL)}},publicKeyVerify(t){return It("public key",t,[33,65]),e.publicKeyVerify(t)===0},publicKeyCreate(t,r=!0,n){switch(It("private key",t,32),za(r),n=Ni(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(Nt.SECKEY_INVALID);case 2:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyConvert(t,r=!0,n){switch(It("public key",t,[33,65]),za(r),n=Ni(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyNegate(t,r=!0,n){switch(It("public key",t,[33,65]),za(r),n=Ni(n,r?33:65),e.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.IMPOSSIBLE_CASE);case 3:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyCombine(t,r=!0,n){gi(Array.isArray(t),"Expected public keys to be an Array"),gi(t.length>0,"Expected public keys array will have more than zero items");for(let i of t)It("public key",i,[33,65]);switch(za(r),n=Ni(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.PUBKEY_COMBINE);case 3:throw new Error(Nt.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(t,r,n=!0,i){switch(It("public key",t,[33,65]),It("tweak",r,32),za(n),i=Ni(i,n?33:65),e.publicKeyTweakAdd(i,t,r)){case 0:return i;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.TWEAK_ADD)}},publicKeyTweakMul(t,r,n=!0,i){switch(It("public key",t,[33,65]),It("tweak",r,32),za(n),i=Ni(i,n?33:65),e.publicKeyTweakMul(i,t,r)){case 0:return i;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.TWEAK_MUL)}},signatureNormalize(t){switch(It("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(Nt.SIG_PARSE)}},signatureExport(t,r){It("signature",t,64),r=Ni(r,72);let n={output:r,outputlen:72};switch(e.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.IMPOSSIBLE_CASE)}},signatureImport(t,r){switch(It("signature",t),r=Ni(r,64),e.signatureImport(r,t)){case 0:return r;case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.IMPOSSIBLE_CASE)}},ecdsaSign(t,r,n={},i){It("message",t,32),It("private key",r,32),gi(Sf(n)==="Object","Expected options to be an Object"),n.data!==void 0&&It("options.data",n.data),n.noncefn!==void 0&&gi(Sf(n.noncefn)==="Function","Expected options.noncefn to be a Function"),i=Ni(i,64);let o={signature:i,recid:null};switch(e.ecdsaSign(o,t,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(Nt.SIGN);case 2:throw new Error(Nt.IMPOSSIBLE_CASE)}},ecdsaVerify(t,r,n){switch(It("signature",t,64),It("message",r,32),It("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.PUBKEY_PARSE)}},ecdsaRecover(t,r,n,i=!0,o){switch(It("signature",t,64),gi(Sf(r)==="Number"&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),It("message",n,32),za(i),o=Ni(o,i?33:65),e.ecdsaRecover(o,t,r,n)){case 0:return o;case 1:throw new Error(Nt.SIG_PARSE);case 2:throw new Error(Nt.RECOVER);case 3:throw new Error(Nt.IMPOSSIBLE_CASE)}},ecdh(t,r,n={},i){switch(It("public key",t,[33,65]),It("private key",r,32),gi(Sf(n)==="Object","Expected options to be an Object"),n.data!==void 0&&It("options.data",n.data),n.hashfn!==void 0?(gi(Sf(n.hashfn)==="Function","Expected options.hashfn to be a Function"),n.xbuf!==void 0&&It("options.xbuf",n.xbuf,32),n.ybuf!==void 0&&It("options.ybuf",n.ybuf,32),It("output",i)):i=Ni(i,32),e.ecdh(i,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(Nt.PUBKEY_PARSE);case 2:throw new Error(Nt.ECDH)}}})});var oC=E((nPe,fne)=>{fne.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var so=E((sC,g2)=>{(function(e,t){"use strict";function r(m,s){if(!m)throw new Error(s||"Assertion failed")}function n(m,s){m.super_=s;var l=function(){};l.prototype=s.prototype,m.prototype=new l,m.prototype.constructor=m}function i(m,s,l){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(m||0,s||10,l||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,l){return s.cmp(l)>0?s:l},i.min=function(s,l){return s.cmp(l)<0?s:l},i.prototype._init=function(s,l,d){if(typeof s=="number")return this._initNumber(s,l,d);if(typeof s=="object")return this._initArray(s,l,d);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f<s.length&&(l===16?this._parseHex(s,f,d):(this._parseBase(s,l,f),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(s,l,d){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(s,l,d){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p,g,b=0;if(d==="be")for(f=s.length-1,p=0;f>=0;f-=3)g=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);else if(d==="le")for(f=0,p=0;f<s.length;f+=3)g=s[f]|s[f+1]<<8|s[f+2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);return this.strip()};function a(m,s){var l=m.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function c(m,s,l){var d=a(m,l);return l-1>=s&&(d|=a(m,l-1)<<4),d}i.prototype._parseHex=function(s,l,d){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p=0,g=0,b;if(d==="be")for(f=s.length-1;f>=l;f-=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8;else{var h=s.length-l;for(f=h%2===0?l+1:l;f<s.length;f+=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8}this.strip()};function v(m,s,l,d){for(var f=0,p=Math.min(m.length,l),g=s;g<p;g++){var b=m.charCodeAt(g)-48;f*=d,b>=49?f+=b-49+10:b>=17?f+=b-17+10:f+=b}return f}i.prototype._parseBase=function(s,l,d){this.words=[0],this.length=1;for(var f=0,p=1;p<=67108863;p*=l)f++;f--,p=p/l|0;for(var g=s.length-d,b=g%f,h=Math.min(g,g-b)+d,u=0,_=d;_<h;_+=f)u=v(s,_,_+f,l),this.imuln(p),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(b!==0){var A=1;for(u=v(s,_,s.length,l),_=0;_<b;_++)A*=l;this.imuln(A),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var l=0;l<this.length;l++)s.words[l]=this.words[l];s.length=this.length,s.negative=this.negative,s.red=this.red},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,l){s=s||10,l=l|0||1;var d;if(s===16||s==="hex"){d="";for(var f=0,p=0,g=0;g<this.length;g++){var b=this.words[g],h=((b<<f|p)&16777215).toString(16);p=b>>>24-f&16777215,p!==0||g!==this.length-1?d=y[6-h.length]+h+d:d=h+d,f+=2,f>=26&&(f-=26,g--)}for(p!==0&&(d=p.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(s===(s|0)&&s>=2&&s<=36){var u=w[s],_=M[s];d="";var A=this.clone();for(A.negative=0;!A.isZero();){var x=A.modn(_).toString(s);A=A.idivn(_),A.isZero()?d=x+d:d=y[u-x.length]+x+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},i.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},i.prototype.toArrayLike=function(s,l,d){var f=this.byteLength(),p=d||Math.max(1,f);r(f<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var g=l==="le",b=new s(p),h,u,_=this.clone();if(g){for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[u]=h;for(;u<p;u++)b[u]=0}else{for(u=0;u<p-f;u++)b[u]=0;for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[p-u-1]=h}return b},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var l=s,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,d=0;return(l&8191)===0&&(d+=13,l>>>=13),(l&127)===0&&(d+=7,l>>>=7),(l&15)===0&&(d+=4,l>>>=4),(l&3)===0&&(d+=2,l>>>=2),(l&1)===0&&d++,d},i.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function S(m){for(var s=new Array(m.bitLength()),l=0;l<s.length;l++){var d=l/26|0,f=l%26;s[l]=(m.words[d]&1<<f)>>>f}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(s+=d,d!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]|s.words[l];return this.strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&s.words[d];return this.length=l.length,this.strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var l,d;this.length>s.length?(l=this,d=s):(l=s,d=this);for(var f=0;f<d.length;f++)this.words[f]=l.words[f]^d.words[f];if(this!==l)for(;f<l.length;f++)this.words[f]=l.words[f];return this.length=l.length,this.strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,d=s%26;this._expand(l),d>0&&l--;for(var f=0;f<l;f++)this.words[f]=~this.words[f]&67108863;return d>0&&(this.words[f]=~this.words[f]&67108863>>26-d),this.strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var d=s/26|0,f=s%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<f:this.words[d]=this.words[d]&~(1<<f),this.strip()},i.prototype.iadd=function(s){var l;if(this.negative!==0&&s.negative===0)return this.negative=0,l=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,l=this.isub(s),s.negative=1,l._normSign();var d,f;this.length>s.length?(d=this,f=s):(d=s,f=this);for(var p=0,g=0;g<f.length;g++)l=(d.words[g]|0)+(f.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;for(;p!==0&&g<d.length;g++)l=(d.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;if(this.length=d.length,p!==0)this.words[this.length]=p,this.length++;else if(d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this},i.prototype.add=function(s){var l;return s.negative!==0&&this.negative===0?(s.negative=0,l=this.sub(s),s.negative^=1,l):s.negative===0&&this.negative!==0?(this.negative=0,l=s.sub(this),this.negative=1,l):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var d=this.cmp(s);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,p;d>0?(f=this,p=s):(f=s,p=this);for(var g=0,b=0;b<p.length;b++)l=(f.words[b]|0)-(p.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;for(;g!==0&&b<f.length;b++)l=(f.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;if(g===0&&b<f.length&&f!==this)for(;b<f.length;b++)this.words[b]=f.words[b];return this.length=Math.max(this.length,b),f!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function R(m,s,l){l.negative=s.negative^m.negative;var d=m.length+s.length|0;l.length=d,d=d-1|0;var f=m.words[0]|0,p=s.words[0]|0,g=f*p,b=g&67108863,h=g/67108864|0;l.words[0]=b;for(var u=1;u<d;u++){for(var _=h>>>26,A=h&67108863,x=Math.min(u,s.length-1),I=Math.max(0,u-m.length+1);I<=x;I++){var j=u-I|0;f=m.words[j]|0,p=s.words[I]|0,g=f*p+A,_+=g/67108864|0,A=g&67108863}l.words[u]=A|0,h=_|0}return h!==0?l.words[u]=h|0:l.length--,l.strip()}var C=function(s,l,d){var f=s.words,p=l.words,g=d.words,b=0,h,u,_,A=f[0]|0,x=A&8191,I=A>>>13,j=f[1]|0,O=j&8191,L=j>>>13,W=f[2]|0,F=W&8191,K=W>>>13,De=f[3]|0,Y=De&8191,Q=De>>>13,Ve=f[4]|0,J=Ve&8191,be=Ve>>>13,Ke=f[5]|0,ye=Ke&8191,Re=Ke>>>13,et=f[6]|0,oe=et&8191,xe=et>>>13,it=f[7]|0,ce=it&8191,Ie=it>>>13,ft=f[8]|0,le=ft&8191,Ce=ft>>>13,ot=f[9]|0,se=ot&8191,Me=ot>>>13,st=p[0]|0,ae=st&8191,Se=st>>>13,at=p[1]|0,re=at&8191,Te=at>>>13,ct=p[2]|0,ne=ct&8191,Ee=ct>>>13,lt=p[3]|0,te=lt&8191,ke=lt>>>13,ht=p[4]|0,ue=ht&8191,Pe=ht>>>13,dt=p[5]|0,he=dt&8191,Ne=dt>>>13,pt=p[6]|0,de=pt&8191,qe=pt>>>13,vt=p[7]|0,pe=vt&8191,Le=vt>>>13,ut=p[8]|0,ve=ut&8191,Be=ut>>>13,mt=p[9]|0,me=mt&8191,Ae=mt>>>13;d.negative=s.negative^l.negative,d.length=19,h=Math.imul(x,ae),u=Math.imul(x,Se),u=u+Math.imul(I,ae)|0,_=Math.imul(I,Se);var $t=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+($t>>>26)|0,$t&=67108863,h=Math.imul(O,ae),u=Math.imul(O,Se),u=u+Math.imul(L,ae)|0,_=Math.imul(L,Se),h=h+Math.imul(x,re)|0,u=u+Math.imul(x,Te)|0,u=u+Math.imul(I,re)|0,_=_+Math.imul(I,Te)|0;var Je=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Je>>>26)|0,Je&=67108863,h=Math.imul(F,ae),u=Math.imul(F,Se),u=u+Math.imul(K,ae)|0,_=Math.imul(K,Se),h=h+Math.imul(O,re)|0,u=u+Math.imul(O,Te)|0,u=u+Math.imul(L,re)|0,_=_+Math.imul(L,Te)|0,h=h+Math.imul(x,ne)|0,u=u+Math.imul(x,Ee)|0,u=u+Math.imul(I,ne)|0,_=_+Math.imul(I,Ee)|0;var Qe=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,h=Math.imul(Y,ae),u=Math.imul(Y,Se),u=u+Math.imul(Q,ae)|0,_=Math.imul(Q,Se),h=h+Math.imul(F,re)|0,u=u+Math.imul(F,Te)|0,u=u+Math.imul(K,re)|0,_=_+Math.imul(K,Te)|0,h=h+Math.imul(O,ne)|0,u=u+Math.imul(O,Ee)|0,u=u+Math.imul(L,ne)|0,_=_+Math.imul(L,Ee)|0,h=h+Math.imul(x,te)|0,u=u+Math.imul(x,ke)|0,u=u+Math.imul(I,te)|0,_=_+Math.imul(I,ke)|0;var Lt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(J,ae),u=Math.imul(J,Se),u=u+Math.imul(be,ae)|0,_=Math.imul(be,Se),h=h+Math.imul(Y,re)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Q,re)|0,_=_+Math.imul(Q,Te)|0,h=h+Math.imul(F,ne)|0,u=u+Math.imul(F,Ee)|0,u=u+Math.imul(K,ne)|0,_=_+Math.imul(K,Ee)|0,h=h+Math.imul(O,te)|0,u=u+Math.imul(O,ke)|0,u=u+Math.imul(L,te)|0,_=_+Math.imul(L,ke)|0,h=h+Math.imul(x,ue)|0,u=u+Math.imul(x,Pe)|0,u=u+Math.imul(I,ue)|0,_=_+Math.imul(I,Pe)|0;var Bt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(ye,ae),u=Math.imul(ye,Se),u=u+Math.imul(Re,ae)|0,_=Math.imul(Re,Se),h=h+Math.imul(J,re)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(be,re)|0,_=_+Math.imul(be,Te)|0,h=h+Math.imul(Y,ne)|0,u=u+Math.imul(Y,Ee)|0,u=u+Math.imul(Q,ne)|0,_=_+Math.imul(Q,Ee)|0,h=h+Math.imul(F,te)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(K,te)|0,_=_+Math.imul(K,ke)|0,h=h+Math.imul(O,ue)|0,u=u+Math.imul(O,Pe)|0,u=u+Math.imul(L,ue)|0,_=_+Math.imul(L,Pe)|0,h=h+Math.imul(x,he)|0,u=u+Math.imul(x,Ne)|0,u=u+Math.imul(I,he)|0,_=_+Math.imul(I,Ne)|0;var Dt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,h=Math.imul(oe,ae),u=Math.imul(oe,Se),u=u+Math.imul(xe,ae)|0,_=Math.imul(xe,Se),h=h+Math.imul(ye,re)|0,u=u+Math.imul(ye,Te)|0,u=u+Math.imul(Re,re)|0,_=_+Math.imul(Re,Te)|0,h=h+Math.imul(J,ne)|0,u=u+Math.imul(J,Ee)|0,u=u+Math.imul(be,ne)|0,_=_+Math.imul(be,Ee)|0,h=h+Math.imul(Y,te)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Q,te)|0,_=_+Math.imul(Q,ke)|0,h=h+Math.imul(F,ue)|0,u=u+Math.imul(F,Pe)|0,u=u+Math.imul(K,ue)|0,_=_+Math.imul(K,Pe)|0,h=h+Math.imul(O,he)|0,u=u+Math.imul(O,Ne)|0,u=u+Math.imul(L,he)|0,_=_+Math.imul(L,Ne)|0,h=h+Math.imul(x,de)|0,u=u+Math.imul(x,qe)|0,u=u+Math.imul(I,de)|0,_=_+Math.imul(I,qe)|0;var jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(jt>>>26)|0,jt&=67108863,h=Math.imul(ce,ae),u=Math.imul(ce,Se),u=u+Math.imul(Ie,ae)|0,_=Math.imul(Ie,Se),h=h+Math.imul(oe,re)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(xe,re)|0,_=_+Math.imul(xe,Te)|0,h=h+Math.imul(ye,ne)|0,u=u+Math.imul(ye,Ee)|0,u=u+Math.imul(Re,ne)|0,_=_+Math.imul(Re,Ee)|0,h=h+Math.imul(J,te)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(be,te)|0,_=_+Math.imul(be,ke)|0,h=h+Math.imul(Y,ue)|0,u=u+Math.imul(Y,Pe)|0,u=u+Math.imul(Q,ue)|0,_=_+Math.imul(Q,Pe)|0,h=h+Math.imul(F,he)|0,u=u+Math.imul(F,Ne)|0,u=u+Math.imul(K,he)|0,_=_+Math.imul(K,Ne)|0,h=h+Math.imul(O,de)|0,u=u+Math.imul(O,qe)|0,u=u+Math.imul(L,de)|0,_=_+Math.imul(L,qe)|0,h=h+Math.imul(x,pe)|0,u=u+Math.imul(x,Le)|0,u=u+Math.imul(I,pe)|0,_=_+Math.imul(I,Le)|0;var Ft=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,h=Math.imul(le,ae),u=Math.imul(le,Se),u=u+Math.imul(Ce,ae)|0,_=Math.imul(Ce,Se),h=h+Math.imul(ce,re)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(Ie,re)|0,_=_+Math.imul(Ie,Te)|0,h=h+Math.imul(oe,ne)|0,u=u+Math.imul(oe,Ee)|0,u=u+Math.imul(xe,ne)|0,_=_+Math.imul(xe,Ee)|0,h=h+Math.imul(ye,te)|0,u=u+Math.imul(ye,ke)|0,u=u+Math.imul(Re,te)|0,_=_+Math.imul(Re,ke)|0,h=h+Math.imul(J,ue)|0,u=u+Math.imul(J,Pe)|0,u=u+Math.imul(be,ue)|0,_=_+Math.imul(be,Pe)|0,h=h+Math.imul(Y,he)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Q,he)|0,_=_+Math.imul(Q,Ne)|0,h=h+Math.imul(F,de)|0,u=u+Math.imul(F,qe)|0,u=u+Math.imul(K,de)|0,_=_+Math.imul(K,qe)|0,h=h+Math.imul(O,pe)|0,u=u+Math.imul(O,Le)|0,u=u+Math.imul(L,pe)|0,_=_+Math.imul(L,Le)|0,h=h+Math.imul(x,ve)|0,u=u+Math.imul(x,Be)|0,u=u+Math.imul(I,ve)|0,_=_+Math.imul(I,Be)|0;var hr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,h=Math.imul(se,ae),u=Math.imul(se,Se),u=u+Math.imul(Me,ae)|0,_=Math.imul(Me,Se),h=h+Math.imul(le,re)|0,u=u+Math.imul(le,Te)|0,u=u+Math.imul(Ce,re)|0,_=_+Math.imul(Ce,Te)|0,h=h+Math.imul(ce,ne)|0,u=u+Math.imul(ce,Ee)|0,u=u+Math.imul(Ie,ne)|0,_=_+Math.imul(Ie,Ee)|0,h=h+Math.imul(oe,te)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(xe,te)|0,_=_+Math.imul(xe,ke)|0,h=h+Math.imul(ye,ue)|0,u=u+Math.imul(ye,Pe)|0,u=u+Math.imul(Re,ue)|0,_=_+Math.imul(Re,Pe)|0,h=h+Math.imul(J,he)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(be,he)|0,_=_+Math.imul(be,Ne)|0,h=h+Math.imul(Y,de)|0,u=u+Math.imul(Y,qe)|0,u=u+Math.imul(Q,de)|0,_=_+Math.imul(Q,qe)|0,h=h+Math.imul(F,pe)|0,u=u+Math.imul(F,Le)|0,u=u+Math.imul(K,pe)|0,_=_+Math.imul(K,Le)|0,h=h+Math.imul(O,ve)|0,u=u+Math.imul(O,Be)|0,u=u+Math.imul(L,ve)|0,_=_+Math.imul(L,Be)|0,h=h+Math.imul(x,me)|0,u=u+Math.imul(x,Ae)|0,u=u+Math.imul(I,me)|0,_=_+Math.imul(I,Ae)|0;var dr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,h=Math.imul(se,re),u=Math.imul(se,Te),u=u+Math.imul(Me,re)|0,_=Math.imul(Me,Te),h=h+Math.imul(le,ne)|0,u=u+Math.imul(le,Ee)|0,u=u+Math.imul(Ce,ne)|0,_=_+Math.imul(Ce,Ee)|0,h=h+Math.imul(ce,te)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(Ie,te)|0,_=_+Math.imul(Ie,ke)|0,h=h+Math.imul(oe,ue)|0,u=u+Math.imul(oe,Pe)|0,u=u+Math.imul(xe,ue)|0,_=_+Math.imul(xe,Pe)|0,h=h+Math.imul(ye,he)|0,u=u+Math.imul(ye,Ne)|0,u=u+Math.imul(Re,he)|0,_=_+Math.imul(Re,Ne)|0,h=h+Math.imul(J,de)|0,u=u+Math.imul(J,qe)|0,u=u+Math.imul(be,de)|0,_=_+Math.imul(be,qe)|0,h=h+Math.imul(Y,pe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Q,pe)|0,_=_+Math.imul(Q,Le)|0,h=h+Math.imul(F,ve)|0,u=u+Math.imul(F,Be)|0,u=u+Math.imul(K,ve)|0,_=_+Math.imul(K,Be)|0,h=h+Math.imul(O,me)|0,u=u+Math.imul(O,Ae)|0,u=u+Math.imul(L,me)|0,_=_+Math.imul(L,Ae)|0;var sr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,h=Math.imul(se,ne),u=Math.imul(se,Ee),u=u+Math.imul(Me,ne)|0,_=Math.imul(Me,Ee),h=h+Math.imul(le,te)|0,u=u+Math.imul(le,ke)|0,u=u+Math.imul(Ce,te)|0,_=_+Math.imul(Ce,ke)|0,h=h+Math.imul(ce,ue)|0,u=u+Math.imul(ce,Pe)|0,u=u+Math.imul(Ie,ue)|0,_=_+Math.imul(Ie,Pe)|0,h=h+Math.imul(oe,he)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(xe,he)|0,_=_+Math.imul(xe,Ne)|0,h=h+Math.imul(ye,de)|0,u=u+Math.imul(ye,qe)|0,u=u+Math.imul(Re,de)|0,_=_+Math.imul(Re,qe)|0,h=h+Math.imul(J,pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(be,pe)|0,_=_+Math.imul(be,Le)|0,h=h+Math.imul(Y,ve)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Q,ve)|0,_=_+Math.imul(Q,Be)|0,h=h+Math.imul(F,me)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(K,me)|0,_=_+Math.imul(K,Ae)|0;var Kt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,h=Math.imul(se,te),u=Math.imul(se,ke),u=u+Math.imul(Me,te)|0,_=Math.imul(Me,ke),h=h+Math.imul(le,ue)|0,u=u+Math.imul(le,Pe)|0,u=u+Math.imul(Ce,ue)|0,_=_+Math.imul(Ce,Pe)|0,h=h+Math.imul(ce,he)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(Ie,he)|0,_=_+Math.imul(Ie,Ne)|0,h=h+Math.imul(oe,de)|0,u=u+Math.imul(oe,qe)|0,u=u+Math.imul(xe,de)|0,_=_+Math.imul(xe,qe)|0,h=h+Math.imul(ye,pe)|0,u=u+Math.imul(ye,Le)|0,u=u+Math.imul(Re,pe)|0,_=_+Math.imul(Re,Le)|0,h=h+Math.imul(J,ve)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(be,ve)|0,_=_+Math.imul(be,Be)|0,h=h+Math.imul(Y,me)|0,u=u+Math.imul(Y,Ae)|0,u=u+Math.imul(Q,me)|0,_=_+Math.imul(Q,Ae)|0;var ar=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,h=Math.imul(se,ue),u=Math.imul(se,Pe),u=u+Math.imul(Me,ue)|0,_=Math.imul(Me,Pe),h=h+Math.imul(le,he)|0,u=u+Math.imul(le,Ne)|0,u=u+Math.imul(Ce,he)|0,_=_+Math.imul(Ce,Ne)|0,h=h+Math.imul(ce,de)|0,u=u+Math.imul(ce,qe)|0,u=u+Math.imul(Ie,de)|0,_=_+Math.imul(Ie,qe)|0,h=h+Math.imul(oe,pe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(xe,pe)|0,_=_+Math.imul(xe,Le)|0,h=h+Math.imul(ye,ve)|0,u=u+Math.imul(ye,Be)|0,u=u+Math.imul(Re,ve)|0,_=_+Math.imul(Re,Be)|0,h=h+Math.imul(J,me)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(be,me)|0,_=_+Math.imul(be,Ae)|0;var Ut=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,h=Math.imul(se,he),u=Math.imul(se,Ne),u=u+Math.imul(Me,he)|0,_=Math.imul(Me,Ne),h=h+Math.imul(le,de)|0,u=u+Math.imul(le,qe)|0,u=u+Math.imul(Ce,de)|0,_=_+Math.imul(Ce,qe)|0,h=h+Math.imul(ce,pe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(Ie,pe)|0,_=_+Math.imul(Ie,Le)|0,h=h+Math.imul(oe,ve)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(xe,ve)|0,_=_+Math.imul(xe,Be)|0,h=h+Math.imul(ye,me)|0,u=u+Math.imul(ye,Ae)|0,u=u+Math.imul(Re,me)|0,_=_+Math.imul(Re,Ae)|0;var pr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,h=Math.imul(se,de),u=Math.imul(se,qe),u=u+Math.imul(Me,de)|0,_=Math.imul(Me,qe),h=h+Math.imul(le,pe)|0,u=u+Math.imul(le,Le)|0,u=u+Math.imul(Ce,pe)|0,_=_+Math.imul(Ce,Le)|0,h=h+Math.imul(ce,ve)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(Ie,ve)|0,_=_+Math.imul(Ie,Be)|0,h=h+Math.imul(oe,me)|0,u=u+Math.imul(oe,Ae)|0,u=u+Math.imul(xe,me)|0,_=_+Math.imul(xe,Ae)|0;var Jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,h=Math.imul(se,pe),u=Math.imul(se,Le),u=u+Math.imul(Me,pe)|0,_=Math.imul(Me,Le),h=h+Math.imul(le,ve)|0,u=u+Math.imul(le,Be)|0,u=u+Math.imul(Ce,ve)|0,_=_+Math.imul(Ce,Be)|0,h=h+Math.imul(ce,me)|0,u=u+Math.imul(ce,Ae)|0,u=u+Math.imul(Ie,me)|0,_=_+Math.imul(Ie,Ae)|0;var tr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,h=Math.imul(se,ve),u=Math.imul(se,Be),u=u+Math.imul(Me,ve)|0,_=Math.imul(Me,Be),h=h+Math.imul(le,me)|0,u=u+Math.imul(le,Ae)|0,u=u+Math.imul(Ce,me)|0,_=_+Math.imul(Ce,Ae)|0;var Rr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,h=Math.imul(se,me),u=Math.imul(se,Ae),u=u+Math.imul(Me,me)|0,_=Math.imul(Me,Ae);var Qr=(b+h|0)+((u&8191)<<13)|0;return b=(_+(u>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g[0]=$t,g[1]=Je,g[2]=Qe,g[3]=Lt,g[4]=Bt,g[5]=Dt,g[6]=jt,g[7]=Ft,g[8]=hr,g[9]=dr,g[10]=sr,g[11]=Kt,g[12]=ar,g[13]=Ut,g[14]=pr,g[15]=Jt,g[16]=tr,g[17]=Rr,g[18]=Qr,b!==0&&(g[19]=b,d.length++),d};Math.imul||(C=R);function B(m,s,l){l.negative=s.negative^m.negative,l.length=m.length+s.length;for(var d=0,f=0,p=0;p<l.length-1;p++){var g=f;f=0;for(var b=d&67108863,h=Math.min(p,s.length-1),u=Math.max(0,p-m.length+1);u<=h;u++){var _=p-u,A=m.words[_]|0,x=s.words[u]|0,I=A*x,j=I&67108863;g=g+(I/67108864|0)|0,j=j+b|0,b=j&67108863,g=g+(j>>>26)|0,f+=g>>>26,g&=67108863}l.words[p]=b,d=g,g=f}return d!==0?l.words[p]=d:l.length--,l.strip()}function N(m,s,l){var d=new q;return d.mulp(m,s,l)}i.prototype.mulTo=function(s,l){var d,f=this.length+s.length;return this.length===10&&s.length===10?d=C(this,s,l):f<63?d=R(this,s,l):f<1024?d=B(this,s,l):d=N(this,s,l),d};function q(m,s){this.x=m,this.y=s}q.prototype.makeRBT=function(s){for(var l=new Array(s),d=i.prototype._countBits(s)-1,f=0;f<s;f++)l[f]=this.revBin(f,d,s);return l},q.prototype.revBin=function(s,l,d){if(s===0||s===d-1)return s;for(var f=0,p=0;p<l;p++)f|=(s&1)<<l-p-1,s>>=1;return f},q.prototype.permute=function(s,l,d,f,p,g){for(var b=0;b<g;b++)f[b]=l[s[b]],p[b]=d[s[b]]},q.prototype.transform=function(s,l,d,f,p,g){this.permute(g,s,l,d,f,p);for(var b=1;b<p;b<<=1)for(var h=b<<1,u=Math.cos(2*Math.PI/h),_=Math.sin(2*Math.PI/h),A=0;A<p;A+=h)for(var x=u,I=_,j=0;j<b;j++){var O=d[A+j],L=f[A+j],W=d[A+j+b],F=f[A+j+b],K=x*W-I*F;F=x*F+I*W,W=K,d[A+j]=O+W,f[A+j]=L+F,d[A+j+b]=O-W,f[A+j+b]=L-F,j!==h&&(K=u*x-_*I,I=u*I+_*x,x=K)}},q.prototype.guessLen13b=function(s,l){var d=Math.max(l,s)|1,f=d&1,p=0;for(d=d/2|0;d;d=d>>>1)p++;return 1<<p+1+f},q.prototype.conjugate=function(s,l,d){if(!(d<=1))for(var f=0;f<d/2;f++){var p=s[f];s[f]=s[d-f-1],s[d-f-1]=p,p=l[f],l[f]=-l[d-f-1],l[d-f-1]=-p}},q.prototype.normalize13b=function(s,l){for(var d=0,f=0;f<l/2;f++){var p=Math.round(s[2*f+1]/l)*8192+Math.round(s[2*f]/l)+d;s[f]=p&67108863,p<67108864?d=0:d=p/67108864|0}return s},q.prototype.convert13b=function(s,l,d,f){for(var p=0,g=0;g<l;g++)p=p+(s[g]|0),d[2*g]=p&8191,p=p>>>13,d[2*g+1]=p&8191,p=p>>>13;for(g=2*l;g<f;++g)d[g]=0;r(p===0),r((p&-8192)===0)},q.prototype.stub=function(s){for(var l=new Array(s),d=0;d<s;d++)l[d]=0;return l},q.prototype.mulp=function(s,l,d){var f=2*this.guessLen13b(s.length,l.length),p=this.makeRBT(f),g=this.stub(f),b=new Array(f),h=new Array(f),u=new Array(f),_=new Array(f),A=new Array(f),x=new Array(f),I=d.words;I.length=f,this.convert13b(s.words,s.length,b,f),this.convert13b(l.words,l.length,_,f),this.transform(b,g,h,u,f,p),this.transform(_,g,A,x,f,p);for(var j=0;j<f;j++){var O=h[j]*A[j]-u[j]*x[j];u[j]=h[j]*x[j]+u[j]*A[j],h[j]=O}return this.conjugate(h,u,f),this.transform(h,u,I,g,f,p),this.conjugate(I,g,f),this.normalize13b(I,f),d.negative=s.negative^l.negative,d.length=s.length+l.length,d.strip()},i.prototype.mul=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),this.mulTo(s,l)},i.prototype.mulf=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),N(this,s,l)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){r(typeof s=="number"),r(s<67108864);for(var l=0,d=0;d<this.length;d++){var f=(this.words[d]|0)*s,p=(f&67108863)+(l&67108863);l>>=26,l+=f/67108864|0,l+=p>>>26,this.words[d]=p&67108863}return l!==0&&(this.words[d]=l,this.length++),this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var l=S(s);if(l.length===0)return new i(1);for(var d=this,f=0;f<l.length&&l[f]===0;f++,d=d.sqr());if(++f<l.length)for(var p=d.sqr();f<l.length;f++,p=p.sqr())l[f]!==0&&(d=d.mul(p));return d},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=67108863>>>26-l<<26-l,p;if(l!==0){var g=0;for(p=0;p<this.length;p++){var b=this.words[p]&f,h=(this.words[p]|0)-b<<l;this.words[p]=h|g,g=b>>>26-l}g&&(this.words[p]=g,this.length++)}if(d!==0){for(p=this.length-1;p>=0;p--)this.words[p+d]=this.words[p];for(p=0;p<d;p++)this.words[p]=0;this.length+=d}return this.strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,l,d){r(typeof s=="number"&&s>=0);var f;l?f=(l-l%26)/26:f=0;var p=s%26,g=Math.min((s-p)/26,this.length),b=67108863^67108863>>>p<<p,h=d;if(f-=g,f=Math.max(0,f),h){for(var u=0;u<g;u++)h.words[u]=this.words[u];h.length=g}if(g!==0)if(this.length>g)for(this.length-=g,u=0;u<this.length;u++)this.words[u]=this.words[u+g];else this.words[0]=0,this.length=1;var _=0;for(u=this.length-1;u>=0&&(_!==0||u>=f);u--){var A=this.words[u]|0;this.words[u]=_<<26-p|A>>>p,_=A&b}return h&&_!==0&&(h.words[h.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(s,l,d){return r(this.negative===0),this.iushrn(s,l,d)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return!1;var p=this.words[d];return!!(p&f)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var f=67108863^67108863>>>l<<l;this.words[this.length-1]&=f}return this.strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,l,d){var f=s.length+d,p;this._expand(f);var g,b=0;for(p=0;p<s.length;p++){g=(this.words[p+d]|0)+b;var h=(s.words[p]|0)*l;g-=h&67108863,b=(g>>26)-(h/67108864|0),this.words[p+d]=g&67108863}for(;p<this.length-d;p++)g=(this.words[p+d]|0)+b,b=g>>26,this.words[p+d]=g&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,p=0;p<this.length;p++)g=-(this.words[p]|0)+b,b=g>>26,this.words[p]=g&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(s,l){var d=this.length-s.length,f=this.clone(),p=s,g=p.words[p.length-1]|0,b=this._countBits(g);d=26-b,d!==0&&(p=p.ushln(d),f.iushln(d),g=p.words[p.length-1]|0);var h=f.length-p.length,u;if(l!=="mod"){u=new i(null),u.length=h+1,u.words=new Array(u.length);for(var _=0;_<u.length;_++)u.words[_]=0}var A=f.clone()._ishlnsubmul(p,1,h);A.negative===0&&(f=A,u&&(u.words[h]=1));for(var x=h-1;x>=0;x--){var I=(f.words[p.length+x]|0)*67108864+(f.words[p.length+x-1]|0);for(I=Math.min(I/g|0,67108863),f._ishlnsubmul(p,I,x);f.negative!==0;)I--,f.negative=0,f._ishlnsubmul(p,1,x),f.isZero()||(f.negative^=1);u&&(u.words[x]=I)}return u&&u.strip(),f.strip(),l!=="div"&&d!==0&&f.iushrn(d),{div:u||null,mod:f}},i.prototype.divmod=function(s,l,d){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var f,p,g;return this.negative!==0&&s.negative===0?(g=this.neg().divmod(s,l),l!=="mod"&&(f=g.div.neg()),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.iadd(s)),{div:f,mod:p}):this.negative===0&&s.negative!==0?(g=this.divmod(s.neg(),l),l!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):(this.negative&s.negative)!==0?(g=this.neg().divmod(s.neg(),l),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.isub(s)),{div:g.div,mod:p}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modn(s.words[0]))}:this._wordDiv(s,l)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),p=s.andln(1),g=d.cmp(f);return g<0||p===1&&g===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,d=0,f=this.length-1;f>=0;f--)d=(l*d+(this.words[f]|0))%s;return d},i.prototype.idivn=function(s){r(s<=67108863);for(var l=0,d=this.length-1;d>=0;d--){var f=(this.words[d]|0)+l*67108864;this.words[d]=f/s|0,l=f%s}return this.strip()},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=new i(0),b=new i(1),h=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++h;for(var u=d.clone(),_=l.clone();!l.isZero();){for(var A=0,x=1;(l.words[0]&x)===0&&A<26;++A,x<<=1);if(A>0)for(l.iushrn(A);A-- >0;)(f.isOdd()||p.isOdd())&&(f.iadd(u),p.isub(_)),f.iushrn(1),p.iushrn(1);for(var I=0,j=1;(d.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(d.iushrn(I);I-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(u),b.isub(_)),g.iushrn(1),b.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(g),p.isub(b)):(d.isub(l),g.isub(f),b.isub(p))}return{a:g,b,gcd:d.iushln(h)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var b=0,h=1;(l.words[0]&h)===0&&b<26;++b,h<<=1);if(b>0)for(l.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var u=0,_=1;(d.words[0]&_)===0&&u<26;++u,_<<=1);if(u>0)for(d.iushrn(u);u-- >0;)p.isOdd()&&p.iadd(g),p.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(p)):(d.isub(l),p.isub(f))}var A;return l.cmpn(1)===0?A=f:A=p,A.cmpn(0)<0&&A.iadd(s),A},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),d=s.clone();l.negative=0,d.negative=0;for(var f=0;l.isEven()&&d.isEven();f++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var p=l.cmp(d);if(p<0){var g=l;l=d,d=g}else if(p===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(f)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=f,this;for(var p=f,g=d;p!==0&&g<this.length;g++){var b=this.words[g]|0;b+=p,p=b>>>26,b&=67108863,this.words[g]=b}return p!==0&&(this.words[g]=p,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var d;if(this.length>1)d=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;d=f===s?0:f<s?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var l=this.ucmp(s);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var f=this.words[d]|0,p=s.words[d]|0;if(f!==p){f<p?l=-1:f>p&&(l=1);break}}return l},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new V(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var H={k256:null,p224:null,p192:null,p25519:null};function D(m,s){this.name=m,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},D.prototype.ireduce=function(s){var l=s,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var f=d<this.n?-1:l.ucmp(this.p);return f===0?(l.words[0]=0,l.length=1):f>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},D.prototype.split=function(s,l){s.iushrn(this.n,0,l)},D.prototype.imulK=function(s){return s.imul(this.k)};function ee(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(ee,D),ee.prototype.split=function(s,l){for(var d=4194303,f=Math.min(s.length,9),p=0;p<f;p++)l.words[p]=s.words[p];if(l.length=f,s.length<=9){s.words[0]=0,s.length=1;return}var g=s.words[9];for(l.words[l.length++]=g&d,p=10;p<s.length;p++){var b=s.words[p]|0;s.words[p-10]=(b&d)<<4|g>>>22,g=b}g>>>=22,s.words[p-10]=g,g===0&&s.length>10?s.length-=10:s.length-=9},ee.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,d=0;d<s.length;d++){var f=s.words[d]|0;l+=f*977,s.words[d]=l&67108863,l=f*64+(l/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function ge(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ge,D);function Z(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(Z,D);function X(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,D),X.prototype.imulK=function(s){for(var l=0,d=0;d<s.length;d++){var f=(s.words[d]|0)*19+l,p=f&67108863;f>>>=26,s.words[d]=p,l=f}return l!==0&&(s.words[s.length++]=l),s},i._prime=function(s){if(H[s])return H[s];var l;if(s==="k256")l=new ee;else if(s==="p224")l=new ge;else if(s==="p192")l=new Z;else if(s==="p25519")l=new X;else throw new Error("Unknown prime "+s);return H[s]=l,l};function V(m){if(typeof m=="string"){var s=i._prime(m);this.m=s.p,this.prime=s}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}V.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},V.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},V.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},V.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},V.prototype.add=function(s,l){this._verify2(s,l);var d=s.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},V.prototype.iadd=function(s,l){this._verify2(s,l);var d=s.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},V.prototype.sub=function(s,l){this._verify2(s,l);var d=s.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},V.prototype.isub=function(s,l){this._verify2(s,l);var d=s.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},V.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},V.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},V.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},V.prototype.isqr=function(s){return this.imul(s,s.clone())},V.prototype.sqr=function(s){return this.mul(s,s)},V.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(s,d)}for(var f=this.m.subn(1),p=0;!f.isZero()&&f.andln(1)===0;)p++,f.iushrn(1);r(!f.isZero());var g=new i(1).toRed(this),b=g.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,h).cmp(b)!==0;)u.redIAdd(b);for(var _=this.pow(u,f),A=this.pow(s,f.addn(1).iushrn(1)),x=this.pow(s,f),I=p;x.cmp(g)!==0;){for(var j=x,O=0;j.cmp(g)!==0;O++)j=j.redSqr();r(O<I);var L=this.pow(_,new i(1).iushln(I-O-1));A=A.redMul(L),_=L.redSqr(),x=x.redMul(_),I=O}return A},V.prototype.invm=function(s){var l=s._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},V.prototype.pow=function(s,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return s.clone();var d=4,f=new Array(1<<d);f[0]=new i(1).toRed(this),f[1]=s;for(var p=2;p<f.length;p++)f[p]=this.mul(f[p-1],s);var g=f[0],b=0,h=0,u=l.bitLength()%26;for(u===0&&(u=26),p=l.length-1;p>=0;p--){for(var _=l.words[p],A=u-1;A>=0;A--){var x=_>>A&1;if(g!==f[0]&&(g=this.sqr(g)),x===0&&b===0){h=0;continue}b<<=1,b|=x,h++,!(h!==d&&(p!==0||A!==0))&&(g=this.mul(g,f[b]),h=0,b=0)}u=26}return g},V.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},V.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},i.mont=function(s){return new k(s)};function k(m){V.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(k,V),k.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},k.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},k.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var d=s.imul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},k.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new i(0)._forceRed(this);var d=s.mul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},k.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof g2>"u"||g2,sC)});var Is=E((iPe,uC)=>{uC.exports=aC;function aC(e,t){if(!e)throw new Error(t||"Assertion failed")}aC.equal=function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)}});var b2=E(lC=>{"use strict";var e1=lC;function cne(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e!="string"){for(var n=0;n<e.length;n++)r[n]=e[n]|0;return r}if(t==="hex"){e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e);for(var n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=i&255;o?r.push(o,a):r.push(a)}return r}e1.toArray=cne;function fC(e){return e.length===1?"0"+e:e}e1.zero2=fC;function cC(e){for(var t="",r=0;r<e.length;r++)t+=fC(e[r].toString(16));return t}e1.toHex=cC;e1.encode=function(t,r){return r==="hex"?cC(t):t}});var ei=E(hC=>{"use strict";var qi=hC,lne=so(),hne=Is(),t1=b2();qi.assert=hne;qi.toArray=t1.toArray;qi.zero2=t1.zero2;qi.toHex=t1.toHex;qi.encode=t1.encode;function dne(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var c,v=o.andln(i-1);o.isOdd()?(v>(i>>1)-1?c=(i>>1)-v:c=v,o.isubn(c)):c=0,n[a]=c,o.iushrn(1)}return n}qi.getNAF=dne;function pne(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0,o;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a=e.andln(3)+n&3,c=t.andln(3)+i&3;a===3&&(a=-1),c===3&&(c=-1);var v;(a&1)===0?v=0:(o=e.andln(7)+n&7,(o===3||o===5)&&c===2?v=-a:v=a),r[0].push(v);var y;(c&1)===0?y=0:(o=t.andln(7)+i&7,(o===3||o===5)&&a===2?y=-c:y=c),r[1].push(y),2*n===v+1&&(n=1-n),2*i===y+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}qi.getJSF=pne;function vne(e,t,r){var n="_"+t;e.prototype[t]=function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)}}qi.cachedProperty=vne;function mne(e){return typeof e=="string"?qi.toArray(e,"hex"):e}qi.parseBytes=mne;function gne(e){return new lne(e,"hex","le")}qi.intFromLE=gne});var dC={};Sr(dC,{default:()=>bne});var bne,pC=_t(()=>{bne={}});var vC=E((aPe,r1)=>{var Va=(pC(),Pt(dC));if(Va&&Va.default){r1.exports=Va.default;for(let e in Va)r1.exports[e]=Va[e]}else Va&&(r1.exports=Va)});var x2=E((uPe,w2)=>{var y2;w2.exports=function(t){return y2||(y2=new Cs(null)),y2.generate(t)};function Cs(e){this.rand=e}w2.exports.Rand=Cs;Cs.prototype.generate=function(t){return this._rand(t)};Cs.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var r=new Uint8Array(t),n=0;n<r.length;n++)r[n]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Cs.prototype._rand=function(t){var r=new Uint8Array(t);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Cs.prototype._rand=function(t){var r=new Uint8Array(t);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Cs.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(_2=vC(),typeof _2.randomBytes!="function")throw new Error("Not supported");Cs.prototype._rand=function(t){return _2.randomBytes(t)}}catch{}var _2});var ah=E((fPe,mC)=>{"use strict";var $a=so(),sh=ei(),n1=sh.getNAF,yne=sh.getJSF,i1=sh.assert;function Ts(e,t){this.type=e,this.p=new $a(t.p,16),this.red=t.prime?$a.red(t.prime):$a.mont(this.p),this.zero=new $a(0).toRed(this.red),this.one=new $a(1).toRed(this.red),this.two=new $a(2).toRed(this.red),this.n=t.n&&new $a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}mC.exports=Ts;Ts.prototype.point=function(){throw new Error("Not implemented")};Ts.prototype.validate=function(){throw new Error("Not implemented")};Ts.prototype._fixedNafMul=function(t,r){i1(t.precomputed);var n=t._getDoubles(),i=n1(r,1,this._bitLength),o=(1<<n.step+1)-(n.step%2===0?2:1);o/=3;var a=[],c,v;for(c=0;c<i.length;c+=n.step){v=0;for(var y=c+n.step-1;y>=c;y--)v=(v<<1)+i[y];a.push(v)}for(var w=this.jpoint(null,null,null),M=this.jpoint(null,null,null),S=o;S>0;S--){for(c=0;c<a.length;c++)v=a[c],v===S?M=M.mixedAdd(n.points[c]):v===-S&&(M=M.mixedAdd(n.points[c].neg()));w=w.add(M)}return w.toP()};Ts.prototype._wnafMul=function(t,r){var n=4,i=t._getNAFPoints(n);n=i.wnd;for(var o=i.points,a=n1(r,n,this._bitLength),c=this.jpoint(null,null,null),v=a.length-1;v>=0;v--){for(var y=0;v>=0&&a[v]===0;v--)y++;if(v>=0&&y++,c=c.dblp(y),v<0)break;var w=a[v];i1(w!==0),t.type==="affine"?w>0?c=c.mixedAdd(o[w-1>>1]):c=c.mixedAdd(o[-w-1>>1].neg()):w>0?c=c.add(o[w-1>>1]):c=c.add(o[-w-1>>1].neg())}return t.type==="affine"?c.toP():c};Ts.prototype._wnafMulAdd=function(t,r,n,i,o){var a=this._wnafT1,c=this._wnafT2,v=this._wnafT3,y=0,w,M,S;for(w=0;w<i;w++){S=r[w];var R=S._getNAFPoints(t);a[w]=R.wnd,c[w]=R.points}for(w=i-1;w>=1;w-=2){var C=w-1,B=w;if(a[C]!==1||a[B]!==1){v[C]=n1(n[C],a[C],this._bitLength),v[B]=n1(n[B],a[B],this._bitLength),y=Math.max(v[C].length,y),y=Math.max(v[B].length,y);continue}var N=[r[C],null,null,r[B]];r[C].y.cmp(r[B].y)===0?(N[1]=r[C].add(r[B]),N[2]=r[C].toJ().mixedAdd(r[B].neg())):r[C].y.cmp(r[B].y.redNeg())===0?(N[1]=r[C].toJ().mixedAdd(r[B]),N[2]=r[C].add(r[B].neg())):(N[1]=r[C].toJ().mixedAdd(r[B]),N[2]=r[C].toJ().mixedAdd(r[B].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],H=yne(n[C],n[B]);for(y=Math.max(H[0].length,y),v[C]=new Array(y),v[B]=new Array(y),M=0;M<y;M++){var D=H[0][M]|0,ee=H[1][M]|0;v[C][M]=q[(D+1)*3+(ee+1)],v[B][M]=0,c[C]=N}}var ge=this.jpoint(null,null,null),Z=this._wnafT4;for(w=y;w>=0;w--){for(var X=0;w>=0;){var V=!0;for(M=0;M<i;M++)Z[M]=v[M][w]|0,Z[M]!==0&&(V=!1);if(!V)break;X++,w--}if(w>=0&&X++,ge=ge.dblp(X),w<0)break;for(M=0;M<i;M++){var k=Z[M];k!==0&&(k>0?S=c[M][k-1>>1]:k<0&&(S=c[M][-k-1>>1].neg()),S.type==="affine"?ge=ge.mixedAdd(S):ge=ge.add(S))}}for(w=0;w<i;w++)c[w]=null;return o?ge:ge.toP()};function bi(e,t){this.curve=e,this.type=t,this.precomputed=null}Ts.BasePoint=bi;bi.prototype.eq=function(){throw new Error("Not implemented")};bi.prototype.validate=function(){return this.curve.validate(this)};Ts.prototype.decodePoint=function(t,r){t=sh.toArray(t,r);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?i1(t[t.length-1]%2===0):t[0]===7&&i1(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return i}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};bi.prototype.encodeCompressed=function(t){return this.encode(t,!0)};bi.prototype._encode=function(t){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};bi.prototype.encode=function(t,r){return sh.encode(this._encode(r),t)};bi.prototype.precompute=function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this};bi.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1};bi.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,o=0;o<r;o+=t){for(var a=0;a<t;a++)i=i.dbl();n.push(i)}return{step:t,points:n}};bi.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,i=n===1?null:this.dbl(),o=1;o<n;o++)r[o]=r[o-1].add(i);return{wnd:t,points:r}};bi.prototype._getBeta=function(){return null};bi.prototype.dblp=function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r}});var bC=E((cPe,gC)=>{"use strict";var _ne=ei(),Ar=so(),M2=Tr(),Ef=ah(),wne=_ne.assert;function yi(e){Ef.call(this,"short",e),this.a=new Ar(e.a,16).toRed(this.red),this.b=new Ar(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}M2(yi,Ef);gC.exports=yi;yi.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new Ar(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(t.lambda)n=new Ar(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?n=o[0]:(n=o[1],wne(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var a;return t.basis?a=t.basis.map(function(c){return{a:new Ar(c.a,16),b:new Ar(c.b,16)}}):a=this._getEndoBasis(n),{beta:r,lambda:n,basis:a}}};yi.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:Ar.mont(t),n=new Ar(2).toRed(r).redInvm(),i=n.redNeg(),o=new Ar(3).toRed(r).redNeg().redSqrt().redMul(n),a=i.redAdd(o).fromRed(),c=i.redSub(o).fromRed();return[a,c]};yi.prototype._getEndoBasis=function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,i=this.n.clone(),o=new Ar(1),a=new Ar(0),c=new Ar(0),v=new Ar(1),y,w,M,S,R,C,B,N=0,q,H;n.cmpn(0)!==0;){var D=i.div(n);q=i.sub(D.mul(n)),H=c.sub(D.mul(o));var ee=v.sub(D.mul(a));if(!M&&q.cmp(r)<0)y=B.neg(),w=o,M=q.neg(),S=H;else if(M&&++N===2)break;B=q,i=n,n=q,c=o,o=H,v=a,a=ee}R=q.neg(),C=H;var ge=M.sqr().add(S.sqr()),Z=R.sqr().add(C.sqr());return Z.cmp(ge)>=0&&(R=y,C=w),M.negative&&(M=M.neg(),S=S.neg()),R.negative&&(R=R.neg(),C=C.neg()),[{a:M,b:S},{a:R,b:C}]};yi.prototype._endoSplit=function(t){var r=this.endo.basis,n=r[0],i=r[1],o=i.b.mul(t).divRound(this.n),a=n.b.neg().mul(t).divRound(this.n),c=o.mul(n.a),v=a.mul(i.a),y=o.mul(n.b),w=a.mul(i.b),M=t.sub(c).sub(v),S=y.add(w).neg();return{k1:M,k2:S}};yi.prototype.pointFromX=function(t,r){t=new Ar(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(t,i)};yi.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,n=t.y,i=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0};yi.prototype._endoWnafMulAdd=function(t,r,n){for(var i=this._endoWnafT1,o=this._endoWnafT2,a=0;a<t.length;a++){var c=this._endoSplit(r[a]),v=t[a],y=v._getBeta();c.k1.negative&&(c.k1.ineg(),v=v.neg(!0)),c.k2.negative&&(c.k2.ineg(),y=y.neg(!0)),i[a*2]=v,i[a*2+1]=y,o[a*2]=c.k1,o[a*2+1]=c.k2}for(var w=this._wnafMulAdd(1,i,o,a*2,n),M=0;M<a*2;M++)i[M]=null,o[M]=null;return w};function zr(e,t,r,n){Ef.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ar(t,16),this.y=new Ar(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}M2(zr,Ef.BasePoint);yi.prototype.point=function(t,r,n){return new zr(this,t,r,n)};yi.prototype.pointFromJSON=function(t,r){return zr.fromJSON(this,t,r)};zr.prototype._getBeta=function(){if(!!this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,i=function(o){return n.point(o.x.redMul(n.endo.beta),o.y)};t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return r}};zr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};zr.fromJSON=function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=t.point(r[0],r[1],n);if(!r[2])return i;function o(c){return t.point(c[0],c[1],n)}var a=r[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(o))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(o))}},i};zr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};zr.prototype.isInfinity=function(){return this.inf};zr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(t.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};zr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=t.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=o.redSqr().redISub(this.x.redAdd(this.x)),c=o.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,c)};zr.prototype.getX=function(){return this.x.fromRed()};zr.prototype.getY=function(){return this.y.fromRed()};zr.prototype.mul=function(t){return t=new Ar(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};zr.prototype.mulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};zr.prototype.jmulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};zr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};zr.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,i=function(o){return o.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};zr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function rn(e,t,r,n){Ef.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ar(0)):(this.x=new Ar(t,16),this.y=new Ar(r,16),this.z=new Ar(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}M2(rn,Ef.BasePoint);yi.prototype.jpoint=function(t,r,n){return new rn(this,t,r,n)};rn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(t);return this.curve.point(n,i)};rn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};rn.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),o=t.x.redMul(n),a=this.y.redMul(r.redMul(t.z)),c=t.y.redMul(n.redMul(this.z)),v=i.redSub(o),y=a.redSub(c);if(v.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=v.redSqr(),M=w.redMul(v),S=i.redMul(w),R=y.redSqr().redIAdd(M).redISub(S).redISub(S),C=y.redMul(S.redISub(R)).redISub(a.redMul(M)),B=this.z.redMul(t.z).redMul(v);return this.curve.jpoint(R,C,B)};rn.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=t.x.redMul(r),o=this.y,a=t.y.redMul(r).redMul(this.z),c=n.redSub(i),v=o.redSub(a);if(c.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=c.redSqr(),w=y.redMul(c),M=n.redMul(y),S=v.redSqr().redIAdd(w).redISub(M).redISub(M),R=v.redMul(M.redISub(S)).redISub(o.redMul(w)),C=this.z.redMul(c);return this.curve.jpoint(S,R,C)};rn.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<t;r++)n=n.dbl();return n}var i=this.curve.a,o=this.curve.tinv,a=this.x,c=this.y,v=this.z,y=v.redSqr().redSqr(),w=c.redAdd(c);for(r=0;r<t;r++){var M=a.redSqr(),S=w.redSqr(),R=S.redSqr(),C=M.redAdd(M).redIAdd(M).redIAdd(i.redMul(y)),B=a.redMul(S),N=C.redSqr().redISub(B.redAdd(B)),q=B.redISub(N),H=C.redMul(q);H=H.redIAdd(H).redISub(R);var D=w.redMul(v);r+1<t&&(y=y.redMul(R)),a=N,v=D,w=H}return this.curve.jpoint(a,w.redMul(o),v)};rn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};rn.prototype._zeroDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),c=this.x.redAdd(o).redSqr().redISub(i).redISub(a);c=c.redIAdd(c);var v=i.redAdd(i).redIAdd(i),y=v.redSqr().redISub(c).redISub(c),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),t=y,r=v.redMul(c.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),S=this.y.redSqr(),R=S.redSqr(),C=this.x.redAdd(S).redSqr().redISub(M).redISub(R);C=C.redIAdd(C);var B=M.redAdd(M).redIAdd(M),N=B.redSqr(),q=R.redIAdd(R);q=q.redIAdd(q),q=q.redIAdd(q),t=N.redISub(C).redISub(C),r=B.redMul(C.redISub(t)).redISub(q),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)};rn.prototype._threeDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),c=this.x.redAdd(o).redSqr().redISub(i).redISub(a);c=c.redIAdd(c);var v=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),y=v.redSqr().redISub(c).redISub(c);t=y;var w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),r=v.redMul(c.redISub(y)).redISub(w),n=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),S=this.y.redSqr(),R=this.x.redMul(S),C=this.x.redSub(M).redMul(this.x.redAdd(M));C=C.redAdd(C).redIAdd(C);var B=R.redIAdd(R);B=B.redIAdd(B);var N=B.redAdd(B);t=C.redSqr().redISub(N),n=this.y.redAdd(this.z).redSqr().redISub(S).redISub(M);var q=S.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),r=C.redMul(B.redISub(t)).redISub(q)}return this.curve.jpoint(t,r,n)};rn.prototype._dbl=function(){var t=this.curve.a,r=this.x,n=this.y,i=this.z,o=i.redSqr().redSqr(),a=r.redSqr(),c=n.redSqr(),v=a.redAdd(a).redIAdd(a).redIAdd(t.redMul(o)),y=r.redAdd(r);y=y.redIAdd(y);var w=y.redMul(c),M=v.redSqr().redISub(w.redAdd(w)),S=w.redISub(M),R=c.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var C=v.redMul(S).redISub(R),B=n.redAdd(n).redMul(i);return this.curve.jpoint(M,C,B)};rn.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),o=t.redAdd(t).redIAdd(t),a=o.redSqr(),c=this.x.redAdd(r).redSqr().redISub(t).redISub(i);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(a);var v=c.redSqr(),y=i.redIAdd(i);y=y.redIAdd(y),y=y.redIAdd(y),y=y.redIAdd(y);var w=o.redIAdd(c).redSqr().redISub(a).redISub(v).redISub(y),M=r.redMul(w);M=M.redIAdd(M),M=M.redIAdd(M);var S=this.x.redMul(v).redISub(M);S=S.redIAdd(S),S=S.redIAdd(S);var R=this.y.redMul(w.redMul(y.redISub(w)).redISub(c.redMul(v)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var C=this.z.redAdd(c).redSqr().redISub(n).redISub(v);return this.curve.jpoint(S,R,C)};rn.prototype.mul=function(t,r){return t=new Ar(t,r),this.curve._wnafMul(this,t)};rn.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),o=n.redMul(t.z);return this.y.redMul(o).redISub(t.y.redMul(i)).cmpn(0)===0};rn.prototype.eqXToP=function(t){var r=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=t.clone(),o=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}};rn.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};rn.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var wC=E((lPe,_C)=>{"use strict";var Af=so(),yC=Tr(),o1=ah(),xne=ei();function Of(e){o1.call(this,"mont",e),this.a=new Af(e.a,16).toRed(this.red),this.b=new Af(e.b,16).toRed(this.red),this.i4=new Af(4).toRed(this.red).redInvm(),this.two=new Af(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}yC(Of,o1);_C.exports=Of;Of.prototype.validate=function(t){var r=t.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),o=i.redSqrt();return o.redSqr().cmp(i)===0};function Vr(e,t,r){o1.BasePoint.call(this,e,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Af(t,16),this.z=new Af(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}yC(Vr,o1.BasePoint);Of.prototype.decodePoint=function(t,r){return this.point(xne.toArray(t,r),1)};Of.prototype.point=function(t,r){return new Vr(this,t,r)};Of.prototype.pointFromJSON=function(t){return Vr.fromJSON(this,t)};Vr.prototype.precompute=function(){};Vr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Vr.fromJSON=function(t,r){return new Vr(t,r[0],r[1]||t.one)};Vr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Vr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Vr.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),o=r.redSub(i),a=r.redMul(i),c=o.redMul(i.redAdd(this.curve.a24.redMul(o)));return this.curve.point(a,c)};Vr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.diffAdd=function(t,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),a=t.x.redSub(t.z),c=a.redMul(n),v=o.redMul(i),y=r.z.redMul(c.redAdd(v).redSqr()),w=r.x.redMul(c.redISub(v).redSqr());return this.curve.point(y,w)};Vr.prototype.mul=function(t){for(var r=t.clone(),n=this,i=this.curve.point(null,null),o=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var c=a.length-1;c>=0;c--)a[c]===0?(n=n.diffAdd(i,o),i=i.dbl()):(i=n.diffAdd(i,o),n=n.dbl());return i};Vr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};Vr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Vr.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var SC=E((hPe,MC)=>{"use strict";var Mne=ei(),Go=so(),xC=Tr(),s1=ah(),Sne=Mne.assert;function ao(e){this.twisted=(e.a|0)!==1,this.mOneA=this.twisted&&(e.a|0)===-1,this.extended=this.mOneA,s1.call(this,"edwards",e),this.a=new Go(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Go(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Go(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Sne(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(e.c|0)===1}xC(ao,s1);MC.exports=ao;ao.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};ao.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};ao.prototype.jpoint=function(t,r,n,i){return this.point(t,r,n,i)};ao.prototype.pointFromX=function(t,r){t=new Go(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(o.redInvm()),c=a.redSqrt();if(c.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var v=c.fromRed().isOdd();return(r&&!v||!r&&v)&&(c=c.redNeg()),this.point(t,c)};ao.prototype.pointFromY=function(t,r){t=new Go(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var c=a.redSqrt();if(c.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return c.fromRed().isOdd()!==r&&(c=c.redNeg()),this.point(c,t)};ao.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),n=t.y.redSqr(),i=r.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(o)===0};function lr(e,t,r,n,i){s1.BasePoint.call(this,e,"projective"),t===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Go(t,16),this.y=new Go(r,16),this.z=n?new Go(n,16):this.curve.one,this.t=i&&new Go(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}xC(lr,s1.BasePoint);ao.prototype.pointFromJSON=function(t){return lr.fromJSON(this,t)};ao.prototype.point=function(t,r,n,i){return new lr(this,t,r,n,i)};lr.fromJSON=function(t,r){return new lr(t,r[0],r[1],r[2])};lr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};lr.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};lr.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),a=i.redAdd(r),c=a.redSub(n),v=i.redSub(r),y=o.redMul(c),w=a.redMul(v),M=o.redMul(v),S=c.redMul(a);return this.curve.point(y,w,S,M)};lr.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,o,a,c,v,y;if(this.curve.twisted){c=this.curve._mulA(r);var w=c.redAdd(n);this.zOne?(i=t.redSub(r).redSub(n).redMul(w.redSub(this.curve.two)),o=w.redMul(c.redSub(n)),a=w.redSqr().redSub(w).redSub(w)):(v=this.z.redSqr(),y=w.redSub(v).redISub(v),i=t.redSub(r).redISub(n).redMul(y),o=w.redMul(c.redSub(n)),a=w.redMul(y))}else c=r.redAdd(n),v=this.curve._mulC(this.z).redSqr(),y=c.redSub(v).redSub(v),i=this.curve._mulC(t.redISub(c)).redMul(y),o=this.curve._mulC(c).redMul(r.redISub(n)),a=c.redMul(y);return this.curve.point(i,o,a)};lr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};lr.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),n=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),a=n.redSub(r),c=o.redSub(i),v=o.redAdd(i),y=n.redAdd(r),w=a.redMul(c),M=v.redMul(y),S=a.redMul(y),R=c.redMul(v);return this.curve.point(w,M,R,S)};lr.prototype._projAdd=function(t){var r=this.z.redMul(t.z),n=r.redSqr(),i=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(i).redMul(o),c=n.redSub(a),v=n.redAdd(a),y=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(o),w=r.redMul(c).redMul(y),M,S;return this.curve.twisted?(M=r.redMul(v).redMul(o.redSub(this.curve._mulA(i))),S=c.redMul(v)):(M=r.redMul(v).redMul(o.redSub(i)),S=this.curve._mulC(c).redMul(v)),this.curve.point(w,M,S)};lr.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};lr.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};lr.prototype.mulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!1)};lr.prototype.jmulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!0)};lr.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};lr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};lr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};lr.prototype.getY=function(){return this.normalize(),this.y.fromRed()};lr.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};lr.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=t.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};lr.prototype.toP=lr.prototype.normalize;lr.prototype.mixedAdd=lr.prototype.add});var S2=E(EC=>{"use strict";var a1=EC;a1.base=ah();a1.short=bC();a1.mont=wC();a1.edwards=SC()});var Li=E(nr=>{"use strict";var Ene=Is(),Ane=Tr();nr.inherits=Ane;function One(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function Rne(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):One(e,i)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i<e.length;i++)r[i]=e[i]|0;return r}nr.toArray=Rne;function Ine(e){for(var t="",r=0;r<e.length;r++)t+=OC(e[r].toString(16));return t}nr.toHex=Ine;function AC(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}nr.htonl=AC;function Cne(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];t==="little"&&(i=AC(i)),r+=RC(i.toString(16))}return r}nr.toHex32=Cne;function OC(e){return e.length===1?"0"+e:e}nr.zero2=OC;function RC(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}nr.zero8=RC;function Tne(e,t,r,n){var i=r-t;Ene(i%4===0);for(var o=new Array(i/4),a=0,c=t;a<o.length;a++,c+=4){var v;n==="big"?v=e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:v=e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],o[a]=v>>>0}return o}nr.join32=Tne;function kne(e,t){for(var r=new Array(e.length*4),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];t==="big"?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}nr.split32=kne;function Pne(e,t){return e>>>t|e<<32-t}nr.rotr32=Pne;function Nne(e,t){return e<<t|e>>>32-t}nr.rotl32=Nne;function qne(e,t){return e+t>>>0}nr.sum32=qne;function Lne(e,t,r){return e+t+r>>>0}nr.sum32_3=Lne;function Bne(e,t,r,n){return e+t+r+n>>>0}nr.sum32_4=Bne;function Dne(e,t,r,n,i){return e+t+r+n+i>>>0}nr.sum32_5=Dne;function jne(e,t,r,n){var i=e[t],o=e[t+1],a=n+o>>>0,c=(a<n?1:0)+r+i;e[t]=c>>>0,e[t+1]=a}nr.sum64=jne;function Fne(e,t,r,n){var i=t+n>>>0,o=(i<t?1:0)+e+r;return o>>>0}nr.sum64_hi=Fne;function Une(e,t,r,n){var i=t+n;return i>>>0}nr.sum64_lo=Une;function Hne(e,t,r,n,i,o,a,c){var v=0,y=t;y=y+n>>>0,v+=y<t?1:0,y=y+o>>>0,v+=y<o?1:0,y=y+c>>>0,v+=y<c?1:0;var w=e+r+i+a+v;return w>>>0}nr.sum64_4_hi=Hne;function Wne(e,t,r,n,i,o,a,c){var v=t+n+o+c;return v>>>0}nr.sum64_4_lo=Wne;function zne(e,t,r,n,i,o,a,c,v,y){var w=0,M=t;M=M+n>>>0,w+=M<t?1:0,M=M+o>>>0,w+=M<o?1:0,M=M+c>>>0,w+=M<c?1:0,M=M+y>>>0,w+=M<y?1:0;var S=e+r+i+a+v+w;return S>>>0}nr.sum64_5_hi=zne;function Vne(e,t,r,n,i,o,a,c,v,y){var w=t+n+o+c+y;return w>>>0}nr.sum64_5_lo=Vne;function $ne(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}nr.rotr64_hi=$ne;function Kne(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}nr.rotr64_lo=Kne;function Gne(e,t,r){return e>>>r}nr.shr64_hi=Gne;function Zne(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}nr.shr64_lo=Zne});var Rf=E(CC=>{"use strict";var IC=Li(),Yne=Is();function u1(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}CC.BlockHash=u1;u1.prototype.update=function(t,r){if(t=IC.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var n=t.length%this._delta8;this.pending=t.slice(t.length-n,t.length),this.pending.length===0&&(this.pending=null),t=IC.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this};u1.prototype.digest=function(t){return this.update(this._pad()),Yne(this.pending===null),this._digest(t)};u1.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,n=r-(t+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var o=1;o<n;o++)i[o]=0;if(t<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[o++]=0;i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=t>>>24&255,i[o++]=t>>>16&255,i[o++]=t>>>8&255,i[o++]=t&255}else for(i[o++]=t&255,i[o++]=t>>>8&255,i[o++]=t>>>16&255,i[o++]=t>>>24&255,i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=0,a=8;a<this.padLength;a++)i[o++]=0;return i}});var E2=E(Zo=>{"use strict";var Jne=Li(),uo=Jne.rotr32;function Qne(e,t,r,n){if(e===0)return TC(t,r,n);if(e===1||e===3)return PC(t,r,n);if(e===2)return kC(t,r,n)}Zo.ft_1=Qne;function TC(e,t,r){return e&t^~e&r}Zo.ch32=TC;function kC(e,t,r){return e&t^e&r^t&r}Zo.maj32=kC;function PC(e,t,r){return e^t^r}Zo.p32=PC;function Xne(e){return uo(e,2)^uo(e,13)^uo(e,22)}Zo.s0_256=Xne;function eie(e){return uo(e,6)^uo(e,11)^uo(e,25)}Zo.s1_256=eie;function tie(e){return uo(e,7)^uo(e,18)^e>>>3}Zo.g0_256=tie;function rie(e){return uo(e,17)^uo(e,19)^e>>>10}Zo.g1_256=rie});var LC=E((gPe,qC)=>{"use strict";var If=Li(),nie=Rf(),iie=E2(),A2=If.rotl32,uh=If.sum32,oie=If.sum32_5,sie=iie.ft_1,NC=nie.BlockHash,aie=[1518500249,1859775393,2400959708,3395469782];function fo(){if(!(this instanceof fo))return new fo;NC.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}If.inherits(fo,NC);qC.exports=fo;fo.blockSize=512;fo.outSize=160;fo.hmacStrength=80;fo.padLength=64;fo.prototype._update=function(t,r){for(var n=this.W,i=0;i<16;i++)n[i]=t[r+i];for(;i<n.length;i++)n[i]=A2(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var o=this.h[0],a=this.h[1],c=this.h[2],v=this.h[3],y=this.h[4];for(i=0;i<n.length;i++){var w=~~(i/20),M=oie(A2(o,5),sie(w,a,c,v),y,n[i],aie[w]);y=v,v=c,c=A2(a,30),a=o,o=M}this.h[0]=uh(this.h[0],o),this.h[1]=uh(this.h[1],a),this.h[2]=uh(this.h[2],c),this.h[3]=uh(this.h[3],v),this.h[4]=uh(this.h[4],y)};fo.prototype._digest=function(t){return t==="hex"?If.toHex32(this.h,"big"):If.split32(this.h,"big")}});var O2=E((bPe,DC)=>{"use strict";var Cf=Li(),uie=Rf(),Tf=E2(),fie=Is(),Bi=Cf.sum32,cie=Cf.sum32_4,lie=Cf.sum32_5,hie=Tf.ch32,die=Tf.maj32,pie=Tf.s0_256,vie=Tf.s1_256,mie=Tf.g0_256,gie=Tf.g1_256,BC=uie.BlockHash,bie=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function co(){if(!(this instanceof co))return new co;BC.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=bie,this.W=new Array(64)}Cf.inherits(co,BC);DC.exports=co;co.blockSize=512;co.outSize=256;co.hmacStrength=192;co.padLength=64;co.prototype._update=function(t,r){for(var n=this.W,i=0;i<16;i++)n[i]=t[r+i];for(;i<n.length;i++)n[i]=cie(gie(n[i-2]),n[i-7],mie(n[i-15]),n[i-16]);var o=this.h[0],a=this.h[1],c=this.h[2],v=this.h[3],y=this.h[4],w=this.h[5],M=this.h[6],S=this.h[7];for(fie(this.k.length===n.length),i=0;i<n.length;i++){var R=lie(S,vie(y),hie(y,w,M),this.k[i],n[i]),C=Bi(pie(o),die(o,a,c));S=M,M=w,w=y,y=Bi(v,R),v=c,c=a,a=o,o=Bi(R,C)}this.h[0]=Bi(this.h[0],o),this.h[1]=Bi(this.h[1],a),this.h[2]=Bi(this.h[2],c),this.h[3]=Bi(this.h[3],v),this.h[4]=Bi(this.h[4],y),this.h[5]=Bi(this.h[5],w),this.h[6]=Bi(this.h[6],M),this.h[7]=Bi(this.h[7],S)};co.prototype._digest=function(t){return t==="hex"?Cf.toHex32(this.h,"big"):Cf.split32(this.h,"big")}});var UC=E((yPe,FC)=>{"use strict";var R2=Li(),jC=O2();function Yo(){if(!(this instanceof Yo))return new Yo;jC.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}R2.inherits(Yo,jC);FC.exports=Yo;Yo.blockSize=512;Yo.outSize=224;Yo.hmacStrength=192;Yo.padLength=64;Yo.prototype._digest=function(t){return t==="hex"?R2.toHex32(this.h.slice(0,7),"big"):R2.split32(this.h.slice(0,7),"big")}});var T2=E((_Pe,VC)=>{"use strict";var Wn=Li(),yie=Rf(),_ie=Is(),lo=Wn.rotr64_hi,ho=Wn.rotr64_lo,HC=Wn.shr64_hi,WC=Wn.shr64_lo,ks=Wn.sum64,I2=Wn.sum64_hi,C2=Wn.sum64_lo,wie=Wn.sum64_4_hi,xie=Wn.sum64_4_lo,Mie=Wn.sum64_5_hi,Sie=Wn.sum64_5_lo,zC=yie.BlockHash,Eie=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Di(){if(!(this instanceof Di))return new Di;zC.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Eie,this.W=new Array(160)}Wn.inherits(Di,zC);VC.exports=Di;Di.blockSize=1024;Di.outSize=512;Di.hmacStrength=192;Di.padLength=128;Di.prototype._prepareBlock=function(t,r){for(var n=this.W,i=0;i<32;i++)n[i]=t[r+i];for(;i<n.length;i+=2){var o=Lie(n[i-4],n[i-3]),a=Bie(n[i-4],n[i-3]),c=n[i-14],v=n[i-13],y=Nie(n[i-30],n[i-29]),w=qie(n[i-30],n[i-29]),M=n[i-32],S=n[i-31];n[i]=wie(o,a,c,v,y,w,M,S),n[i+1]=xie(o,a,c,v,y,w,M,S)}};Di.prototype._update=function(t,r){this._prepareBlock(t,r);var n=this.W,i=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],v=this.h[4],y=this.h[5],w=this.h[6],M=this.h[7],S=this.h[8],R=this.h[9],C=this.h[10],B=this.h[11],N=this.h[12],q=this.h[13],H=this.h[14],D=this.h[15];_ie(this.k.length===n.length);for(var ee=0;ee<n.length;ee+=2){var ge=H,Z=D,X=kie(S,R),V=Pie(S,R),k=Aie(S,R,C,B,N,q),m=Oie(S,R,C,B,N,q),s=this.k[ee],l=this.k[ee+1],d=n[ee],f=n[ee+1],p=Mie(ge,Z,X,V,k,m,s,l,d,f),g=Sie(ge,Z,X,V,k,m,s,l,d,f);ge=Cie(i,o),Z=Tie(i,o),X=Rie(i,o,a,c,v,y),V=Iie(i,o,a,c,v,y);var b=I2(ge,Z,X,V),h=C2(ge,Z,X,V);H=N,D=q,N=C,q=B,C=S,B=R,S=I2(w,M,p,g),R=C2(M,M,p,g),w=v,M=y,v=a,y=c,a=i,c=o,i=I2(p,g,b,h),o=C2(p,g,b,h)}ks(this.h,0,i,o),ks(this.h,2,a,c),ks(this.h,4,v,y),ks(this.h,6,w,M),ks(this.h,8,S,R),ks(this.h,10,C,B),ks(this.h,12,N,q),ks(this.h,14,H,D)};Di.prototype._digest=function(t){return t==="hex"?Wn.toHex32(this.h,"big"):Wn.split32(this.h,"big")};function Aie(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function Oie(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function Rie(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function Iie(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function Cie(e,t){var r=lo(e,t,28),n=lo(t,e,2),i=lo(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function Tie(e,t){var r=ho(e,t,28),n=ho(t,e,2),i=ho(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function kie(e,t){var r=lo(e,t,14),n=lo(e,t,18),i=lo(t,e,9),o=r^n^i;return o<0&&(o+=4294967296),o}function Pie(e,t){var r=ho(e,t,14),n=ho(e,t,18),i=ho(t,e,9),o=r^n^i;return o<0&&(o+=4294967296),o}function Nie(e,t){var r=lo(e,t,1),n=lo(e,t,8),i=HC(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function qie(e,t){var r=ho(e,t,1),n=ho(e,t,8),i=WC(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function Lie(e,t){var r=lo(e,t,19),n=lo(t,e,29),i=HC(e,t,6),o=r^n^i;return o<0&&(o+=4294967296),o}function Bie(e,t){var r=ho(e,t,19),n=ho(t,e,29),i=WC(e,t,6),o=r^n^i;return o<0&&(o+=4294967296),o}});var GC=E((wPe,KC)=>{"use strict";var k2=Li(),$C=T2();function Jo(){if(!(this instanceof Jo))return new Jo;$C.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}k2.inherits(Jo,$C);KC.exports=Jo;Jo.blockSize=1024;Jo.outSize=384;Jo.hmacStrength=192;Jo.padLength=128;Jo.prototype._digest=function(t){return t==="hex"?k2.toHex32(this.h.slice(0,12),"big"):k2.split32(this.h.slice(0,12),"big")}});var ZC=E(kf=>{"use strict";kf.sha1=LC();kf.sha224=UC();kf.sha256=O2();kf.sha384=GC();kf.sha512=T2()});var tT=E(eT=>{"use strict";var Ka=Li(),Die=Rf(),f1=Ka.rotl32,YC=Ka.sum32,fh=Ka.sum32_3,JC=Ka.sum32_4,XC=Die.BlockHash;function po(){if(!(this instanceof po))return new po;XC.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ka.inherits(po,XC);eT.ripemd160=po;po.blockSize=512;po.outSize=160;po.hmacStrength=192;po.padLength=64;po.prototype._update=function(t,r){for(var n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],v=n,y=i,w=o,M=a,S=c,R=0;R<80;R++){var C=YC(f1(JC(n,QC(R,i,o,a),t[Uie[R]+r],jie(R)),Wie[R]),c);n=c,c=a,a=f1(o,10),o=i,i=C,C=YC(f1(JC(v,QC(79-R,y,w,M),t[Hie[R]+r],Fie(R)),zie[R]),S),v=S,S=M,M=f1(w,10),w=y,y=C}C=fh(this.h[1],o,M),this.h[1]=fh(this.h[2],a,S),this.h[2]=fh(this.h[3],c,v),this.h[3]=fh(this.h[4],n,y),this.h[4]=fh(this.h[0],i,w),this.h[0]=C};po.prototype._digest=function(t){return t==="hex"?Ka.toHex32(this.h,"little"):Ka.split32(this.h,"little")};function QC(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function jie(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Fie(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var Uie=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Hie=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Wie=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],zie=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var nT=E((SPe,rT)=>{"use strict";var Vie=Li(),$ie=Is();function Pf(e,t,r){if(!(this instanceof Pf))return new Pf(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(Vie.toArray(t,r))}rT.exports=Pf;Pf.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),$ie(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};Pf.prototype.update=function(t,r){return this.inner.update(t,r),this};Pf.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}});var c1=E(iT=>{var nn=iT;nn.utils=Li();nn.common=Rf();nn.sha=ZC();nn.ripemd=tT();nn.hmac=nT();nn.sha1=nn.sha.sha1;nn.sha256=nn.sha.sha256;nn.sha224=nn.sha.sha224;nn.sha384=nn.sha.sha384;nn.sha512=nn.sha.sha512;nn.ripemd160=nn.ripemd.ripemd160});var sT=E((APe,oT)=>{oT.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var l1=E(fT=>{"use strict";var N2=fT,Ps=c1(),P2=S2(),Kie=ei(),aT=Kie.assert;function uT(e){e.type==="short"?this.curve=new P2.short(e):e.type==="edwards"?this.curve=new P2.edwards(e):this.curve=new P2.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,aT(this.g.validate(),"Invalid curve"),aT(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}N2.PresetCurve=uT;function Ns(e,t){Object.defineProperty(N2,e,{configurable:!0,enumerable:!0,get:function(){var r=new uT(t);return Object.defineProperty(N2,e,{configurable:!0,enumerable:!0,value:r}),r}})}Ns("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ps.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Ns("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ps.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Ns("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ps.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Ns("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ps.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Ns("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ps.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Ns("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ps.sha256,gRed:!1,g:["9"]});Ns("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ps.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var q2;try{q2=sT()}catch{q2=void 0}Ns("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ps.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",q2]})});var hT=E((RPe,lT)=>{"use strict";var Gie=c1(),Ga=b2(),cT=Is();function qs(e){if(!(this instanceof qs))return new qs(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ga.toArray(e.entropy,e.entropyEnc||"hex"),r=Ga.toArray(e.nonce,e.nonceEnc||"hex"),n=Ga.toArray(e.pers,e.persEnc||"hex");cT(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}lT.exports=qs;qs.prototype._init=function(t,r,n){var i=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};qs.prototype._hmac=function(){return new Gie.hmac(this.hash,this.K)};qs.prototype._update=function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};qs.prototype.reseed=function(t,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),t=Ga.toArray(t,r),n=Ga.toArray(n,i),cT(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};qs.prototype.generate=function(t,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Ga.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(n),this._reseed++,Ga.encode(a,r)}});var pT=E((IPe,dT)=>{"use strict";var Zie=so(),Yie=ei(),L2=Yie.assert;function pn(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}dT.exports=pn;pn.fromPublic=function(t,r,n){return r instanceof pn?r:new pn(t,{pub:r,pubEnc:n})};pn.fromPrivate=function(t,r,n){return r instanceof pn?r:new pn(t,{priv:r,privEnc:n})};pn.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};pn.prototype.getPublic=function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub};pn.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};pn.prototype._importPrivate=function(t,r){this.priv=new Zie(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)};pn.prototype._importPublic=function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?L2(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&L2(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)};pn.prototype.derive=function(t){return t.validate()||L2(t.validate(),"public point not validated"),t.mul(this.priv).getX()};pn.prototype.sign=function(t,r,n){return this.ec.sign(t,this,r,n)};pn.prototype.verify=function(t,r){return this.ec.verify(t,r,this)};pn.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var gT=E((CPe,mT)=>{"use strict";var h1=so(),j2=ei(),Jie=j2.assert;function d1(e,t){if(e instanceof d1)return e;this._importDER(e,t)||(Jie(e.r&&e.s,"Signature without r or s"),this.r=new h1(e.r,16),this.s=new h1(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}mT.exports=d1;function Qie(){this.place=0}function B2(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return i<=127?!1:(t.place=a,i)}function vT(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}d1.prototype._importDER=function(t,r){t=j2.toArray(t,r);var n=new Qie;if(t[n.place++]!==48)return!1;var i=B2(t,n);if(i===!1||i+n.place!==t.length||t[n.place++]!==2)return!1;var o=B2(t,n);if(o===!1)return!1;var a=t.slice(n.place,o+n.place);if(n.place+=o,t[n.place++]!==2)return!1;var c=B2(t,n);if(c===!1||t.length!==c+n.place)return!1;var v=t.slice(n.place,c+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(v[0]===0)if(v[1]&128)v=v.slice(1);else return!1;return this.r=new h1(a),this.s=new h1(v),this.recoveryParam=null,!0};function D2(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}d1.prototype.toDER=function(t){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=vT(r),n=vT(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];D2(i,r.length),i=i.concat(r),i.push(2),D2(i,n.length);var o=i.concat(n),a=[48];return D2(a,o.length),a=a.concat(o),j2.encode(a,t)}});var wT=E((TPe,_T)=>{"use strict";var Za=so(),bT=hT(),Xie=ei(),F2=l1(),eoe=x2(),yT=Xie.assert,U2=pT(),p1=gT();function _i(e){if(!(this instanceof _i))return new _i(e);typeof e=="string"&&(yT(Object.prototype.hasOwnProperty.call(F2,e),"Unknown curve "+e),e=F2[e]),e instanceof F2.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}_T.exports=_i;_i.prototype.keyPair=function(t){return new U2(this,t)};_i.prototype.keyFromPrivate=function(t,r){return U2.fromPrivate(this,t,r)};_i.prototype.keyFromPublic=function(t,r){return U2.fromPublic(this,t,r)};_i.prototype.genKeyPair=function(t){t||(t={});for(var r=new bT({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||eoe(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Za(2));;){var o=new Za(r.generate(n));if(!(o.cmp(i)>0))return o.iaddn(1),this.keyFromPrivate(o)}};_i.prototype._truncateToN=function(t,r){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};_i.prototype.sign=function(t,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),t=this._truncateToN(new Za(t,16));for(var o=this.n.byteLength(),a=r.getPrivate().toArray("be",o),c=t.toArray("be",o),v=new bT({hash:this.hash,entropy:a,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),y=this.n.sub(new Za(1)),w=0;;w++){var M=i.k?i.k(w):new Za(v.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(y)>=0)){var S=this.g.mul(M);if(!S.isInfinity()){var R=S.getX(),C=R.umod(this.n);if(C.cmpn(0)!==0){var B=M.invm(this.n).mul(C.mul(r.getPrivate()).iadd(t));if(B=B.umod(this.n),B.cmpn(0)!==0){var N=(S.getY().isOdd()?1:0)|(R.cmp(C)!==0?2:0);return i.canonical&&B.cmp(this.nh)>0&&(B=this.n.sub(B),N^=1),new p1({r:C,s:B,recoveryParam:N})}}}}}};_i.prototype.verify=function(t,r,n,i){t=this._truncateToN(new Za(t,16)),n=this.keyFromPublic(n,i),r=new p1(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),v=c.mul(t).umod(this.n),y=c.mul(o).umod(this.n),w;return this.curve._maxwellTrick?(w=this.g.jmulAdd(v,n.getPublic(),y),w.isInfinity()?!1:w.eqXToP(o)):(w=this.g.mulAdd(v,n.getPublic(),y),w.isInfinity()?!1:w.getX().umod(this.n).cmp(o)===0)};_i.prototype.recoverPubKey=function(e,t,r,n){yT((3&r)===r,"The recovery param is more than two bits"),t=new p1(t,n);var i=this.n,o=new Za(e),a=t.r,c=t.s,v=r&1,y=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&y)throw new Error("Unable to find sencond key candinate");y?a=this.curve.pointFromX(a.add(this.curve.n),v):a=this.curve.pointFromX(a,v);var w=t.r.invm(i),M=i.sub(o).mul(w).umod(i),S=c.mul(w).umod(i);return this.g.mulAdd(M,a,S)};_i.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new p1(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var ET=E((kPe,ST)=>{"use strict";var ch=ei(),MT=ch.assert,xT=ch.parseBytes,Nf=ch.cachedProperty;function $r(e,t){this.eddsa=e,this._secret=xT(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=xT(t.pub)}$r.fromPublic=function(t,r){return r instanceof $r?r:new $r(t,{pub:r})};$r.fromSecret=function(t,r){return r instanceof $r?r:new $r(t,{secret:r})};$r.prototype.secret=function(){return this._secret};Nf($r,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Nf($r,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Nf($r,"privBytes",function(){var t=this.eddsa,r=this.hash(),n=t.encodingLength-1,i=r.slice(0,t.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Nf($r,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Nf($r,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Nf($r,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});$r.prototype.sign=function(t){return MT(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};$r.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};$r.prototype.getSecret=function(t){return MT(this._secret,"KeyPair is public only"),ch.encode(this.secret(),t)};$r.prototype.getPublic=function(t){return ch.encode(this.pubBytes(),t)};ST.exports=$r});var OT=E((PPe,AT)=>{"use strict";var toe=so(),v1=ei(),roe=v1.assert,m1=v1.cachedProperty,noe=v1.parseBytes;function Ya(e,t){this.eddsa=e,typeof t!="object"&&(t=noe(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),roe(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof toe&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}m1(Ya,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});m1(Ya,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});m1(Ya,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});m1(Ya,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Ya.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Ya.prototype.toHex=function(){return v1.encode(this.toBytes(),"hex").toUpperCase()};AT.exports=Ya});var kT=E((NPe,TT)=>{"use strict";var ioe=c1(),ooe=l1(),qf=ei(),soe=qf.assert,IT=qf.parseBytes,CT=ET(),RT=OT();function zn(e){if(soe(e==="ed25519","only tested with ed25519 so far"),!(this instanceof zn))return new zn(e);e=ooe[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=ioe.sha512}TT.exports=zn;zn.prototype.sign=function(t,r){t=IT(t);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),t),o=this.g.mul(i),a=this.encodePoint(o),c=this.hashInt(a,n.pubBytes(),t).mul(n.priv()),v=i.add(c).umod(this.curve.n);return this.makeSignature({R:o,S:v,Rencoded:a})};zn.prototype.verify=function(t,r,n){t=IT(t),r=this.makeSignature(r);var i=this.keyFromPublic(n),o=this.hashInt(r.Rencoded(),i.pubBytes(),t),a=this.g.mul(r.S()),c=r.R().add(i.pub().mul(o));return c.eq(a)};zn.prototype.hashInt=function(){for(var t=this.hash(),r=0;r<arguments.length;r++)t.update(arguments[r]);return qf.intFromLE(t.digest()).umod(this.curve.n)};zn.prototype.keyFromPublic=function(t){return CT.fromPublic(this,t)};zn.prototype.keyFromSecret=function(t){return CT.fromSecret(this,t)};zn.prototype.makeSignature=function(t){return t instanceof RT?t:new RT(this,t)};zn.prototype.encodePoint=function(t){var r=t.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=t.getX().isOdd()?128:0,r};zn.prototype.decodePoint=function(t){t=qf.parseBytes(t);var r=t.length-1,n=t.slice(0,r).concat(t[r]&-129),i=(t[r]&128)!==0,o=qf.intFromLE(n);return this.curve.pointFromY(o,i)};zn.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)};zn.prototype.decodeInt=function(t){return qf.intFromLE(t)};zn.prototype.isPoint=function(t){return t instanceof this.pointClass}});var g1=E(PT=>{"use strict";var Ja=PT;Ja.version=oC().version;Ja.utils=ei();Ja.rand=x2();Ja.curve=S2();Ja.curves=l1();Ja.ec=wT();Ja.eddsa=kT()});var qT=E((LPe,NT)=>{var aoe=g1().ec,vo=new aoe("secp256k1"),Ot=vo.curve,ir=Ot.n.constructor;function uoe(e,t){let r=new ir(t);if(r.cmp(Ot.p)>=0)return null;r=r.toRed(Ot.red);let n=r.redSqr().redIMul(r).redIAdd(Ot.b).redSqrt();return e===3!==n.isOdd()&&(n=n.redNeg()),vo.keyPair({pub:{x:r,y:n}})}function foe(e,t,r){let n=new ir(t),i=new ir(r);if(n.cmp(Ot.p)>=0||i.cmp(Ot.p)>=0||(n=n.toRed(Ot.red),i=i.toRed(Ot.red),(e===6||e===7)&&i.isOdd()!==(e===7)))return null;let o=n.redSqr().redIMul(n);return i.redSqr().redISub(o.redIAdd(Ot.b)).isZero()?vo.keyPair({pub:{x:n,y:i}}):null}function Ls(e){let t=e[0];switch(t){case 2:case 3:return e.length!==33?null:uoe(t,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:foe(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function Qa(e,t){let r=t.encode(null,e.length===33);for(let n=0;n<e.length;++n)e[n]=r[n]}NT.exports={contextRandomize(){return 0},privateKeyVerify(e){let t=new ir(e);return t.cmp(Ot.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){let t=new ir(e),r=Ot.n.sub(t).umod(Ot.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){let r=new ir(t);if(r.cmp(Ot.n)>=0||(r.iadd(new ir(e)),r.cmp(Ot.n)>=0&&r.isub(Ot.n),r.isZero()))return 1;let n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new ir(t);if(r.cmp(Ot.n)>=0||r.isZero())return 1;r.imul(new ir(e)),r.cmp(Ot.n)>=0&&(r=r.umod(Ot.n));let n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify(e){return Ls(e)===null?1:0},publicKeyCreate(e,t){let r=new ir(t);if(r.cmp(Ot.n)>=0||r.isZero())return 1;let n=vo.keyFromPrivate(t).getPublic();return Qa(e,n),0},publicKeyConvert(e,t){let r=Ls(t);if(r===null)return 1;let n=r.getPublic();return Qa(e,n),0},publicKeyNegate(e,t){let r=Ls(t);if(r===null)return 1;let n=r.getPublic();return n.y=n.y.redNeg(),Qa(e,n),0},publicKeyCombine(e,t){let r=new Array(t.length);for(let i=0;i<t.length;++i)if(r[i]=Ls(t[i]),r[i]===null)return 1;let n=r[0].getPublic();for(let i=1;i<r.length;++i)n=n.add(r[i].pub);return n.isInfinity()?2:(Qa(e,n),0)},publicKeyTweakAdd(e,t,r){let n=Ls(t);if(n===null)return 1;if(r=new ir(r),r.cmp(Ot.n)>=0)return 2;let i=n.getPublic().add(Ot.g.mul(r));return i.isInfinity()?2:(Qa(e,i),0)},publicKeyTweakMul(e,t,r){let n=Ls(t);if(n===null)return 1;if(r=new ir(r),r.cmp(Ot.n)>=0||r.isZero())return 2;let i=n.getPublic().mul(r);return Qa(e,i),0},signatureNormalize(e){let t=new ir(e.subarray(0,32)),r=new ir(e.subarray(32,64));return t.cmp(Ot.n)>=0||r.cmp(Ot.n)>=0?1:(r.cmp(vo.nh)===1&&e.set(Ot.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){let r=t.subarray(0,32),n=t.subarray(32,64);if(new ir(r).cmp(Ot.n)>=0||new ir(n).cmp(Ot.n)>=0)return 1;let{output:i}=e,o=i.subarray(4,4+33);o[0]=0,o.set(r,1);let a=33,c=0;for(;a>1&&o[c]===0&&!(o[c+1]&128);--a,++c);if(o=o.subarray(c),o[0]&128||a>1&&o[0]===0&&!(o[1]&128))return 1;let v=i.subarray(6+33,6+33+33);v[0]=0,v.set(n,1);let y=33,w=0;for(;y>1&&v[w]===0&&!(v[w+1]&128);--y,++w);return v=v.subarray(w),v[0]&128||y>1&&v[0]===0&&!(v[1]&128)?1:(e.outputlen=6+a+y,i[0]=48,i[1]=e.outputlen-2,i[2]=2,i[3]=o.length,i.set(o,4),i[4+a]=2,i[5+a]=v.length,i.set(v,6+a),0)},signatureImport(e,t){if(t.length<8||t.length>72||t[0]!==48||t[1]!==t.length-2||t[2]!==2)return 1;let r=t[3];if(r===0||5+r>=t.length||t[4+r]!==2)return 1;let n=t[5+r];if(n===0||6+r+n!==t.length||t[4]&128||r>1&&t[4]===0&&!(t[5]&128)||t[r+6]&128||n>1&&t[r+6]===0&&!(t[r+7]&128))return 1;let i=t.subarray(4,4+r);if(i.length===33&&i[0]===0&&(i=i.subarray(1)),i.length>32)return 1;let o=t.subarray(6+r);if(o.length===33&&o[0]===0&&(o=o.slice(1)),o.length>32)throw new Error("S length is too long");let a=new ir(i);a.cmp(Ot.n)>=0&&(a=new ir(0));let c=new ir(t.subarray(6+r));return c.cmp(Ot.n)>=0&&(c=new ir(0)),e.set(a.toArrayLike(Uint8Array,"be",32),0),e.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,n,i){if(i){let c=i;i=v=>{let y=c(t,r,null,n,v);if(!(y instanceof Uint8Array&&y.length===32))throw new Error("This is the way");return new ir(y)}}let o=new ir(r);if(o.cmp(Ot.n)>=0||o.isZero())return 1;let a;try{a=vo.sign(t,r,{canonical:!0,k:i,pers:n})}catch{return 1}return e.signature.set(a.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(a.s.toArrayLike(Uint8Array,"be",32),32),e.recid=a.recoveryParam,0},ecdsaVerify(e,t,r){let n={r:e.subarray(0,32),s:e.subarray(32,64)},i=new ir(n.r),o=new ir(n.s);if(i.cmp(Ot.n)>=0||o.cmp(Ot.n)>=0)return 1;if(o.cmp(vo.nh)===1||i.isZero()||o.isZero())return 3;let a=Ls(r);if(a===null)return 2;let c=a.getPublic();return vo.verify(t,n,c)?0:3},ecdsaRecover(e,t,r,n){let i={r:t.slice(0,32),s:t.slice(32,64)},o=new ir(i.r),a=new ir(i.s);if(o.cmp(Ot.n)>=0||a.cmp(Ot.n)>=0)return 1;if(o.isZero()||a.isZero())return 2;let c;try{c=vo.recoverPubKey(n,i,r)}catch{return 2}return Qa(e,c),0},ecdh(e,t,r,n,i,o,a){let c=Ls(t);if(c===null)return 1;let v=new ir(r);if(v.cmp(Ot.n)>=0||v.isZero())return 2;let y=c.getPublic().mul(v);if(i===void 0){let w=y.encode(null,!0),M=vo.hash().update(w).digest();for(let S=0;S<32;++S)e[S]=M[S]}else{o||(o=new Uint8Array(32));let w=y.getX().toArray("be",32);for(let C=0;C<32;++C)o[C]=w[C];a||(a=new Uint8Array(32));let M=y.getY().toArray("be",32);for(let C=0;C<32;++C)a[C]=M[C];let S=i(o,a,n);if(!(S instanceof Uint8Array&&S.length===e.length))return 2;e.set(S)}return 0}}});var H2=E((BPe,LT)=>{LT.exports=iC()(qT())});var BT=E((DPe,z2)=>{"use strict";var W2=65536,coe=4294967295;function loe(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
535
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var hoe=Hn().Buffer,b1=globalThis.crypto||globalThis.msCrypto;b1&&b1.getRandomValues?z2.exports=doe:z2.exports=loe;function doe(e,t){if(e>coe)throw new RangeError("requested too many random bytes");var r=hoe.allocUnsafe(e);if(e>0)if(e>W2)for(var n=0;n<e;n+=W2)b1.getRandomValues(r.slice(n,n+W2));else b1.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}});var jT=E(y1=>{"use strict";Object.defineProperty(y1,"__esModule",{value:!0});var DT=BT();function poe(e){return new Promise(function(t,r){DT(e,function(n,i){if(n){r(n);return}t(i)})})}y1.getRandomBytes=poe;function voe(e){return DT(e)}y1.getRandomBytesSync=voe});var V2=E(mo=>{"use strict";var moe=mo&&mo.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function c(w){try{y(n.next(w))}catch(M){a(M)}}function v(w){try{y(n.throw(w))}catch(M){a(M)}}function y(w){w.done?o(w.value):i(w.value).then(c,v)}y((n=n.apply(e,t||[])).next())})},goe=mo&&mo.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(y){return function(w){return v([y,w])}}function v(y){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=y[0]&2?i.return:y[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,y[1])).done)return o;switch(i=0,o&&(y=[y[0]&2,o.value]),y[0]){case 0:case 1:o=y;break;case 4:return r.label++,{value:y[1],done:!1};case 5:r.label++,i=y[1],y=[0];continue;case 7:y=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(y[0]===6||y[0]===2)){r=0;continue}if(y[0]===3&&(!o||y[1]>o[0]&&y[1]<o[3])){r.label=y[1];break}if(y[0]===6&&r.label<o[1]){r.label=o[1],o=y;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(y);break}o[2]&&r.ops.pop(),r.trys.pop();continue}y=t.call(e,r)}catch(w){y=[6,w],i=0}finally{n=o=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}};function boe(e){for(var t in e)mo.hasOwnProperty(t)||(mo[t]=e[t])}Object.defineProperty(mo,"__esModule",{value:!0});var FT=H2(),UT=jT(),HT=32;function yoe(){return moe(this,void 0,void 0,function(){var e;return goe(this,function(t){switch(t.label){case 0:return[4,UT.getRandomBytes(HT)];case 1:return e=t.sent(),FT.privateKeyVerify(e)?[2,e]:[3,0];case 2:return[2]}})})}mo.createPrivateKey=yoe;function _oe(){for(;;){var e=UT.getRandomBytesSync(HT);if(FT.privateKeyVerify(e))return e}}mo.createPrivateKeySync=_oe;boe(H2())});var K2=E((WT,$2)=>{(function(e,t){"use strict";function r(m,s){if(!m)throw new Error(s||"Assertion failed")}function n(m,s){m.super_=s;var l=function(){};l.prototype=s.prototype,m.prototype=new l,m.prototype.constructor=m}function i(m,s,l){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(m||0,s||10,l||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,l){return s.cmp(l)>0?s:l},i.min=function(s,l){return s.cmp(l)<0?s:l},i.prototype._init=function(s,l,d){if(typeof s=="number")return this._initNumber(s,l,d);if(typeof s=="object")return this._initArray(s,l,d);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f<s.length&&(l===16?this._parseHex(s,f,d):(this._parseBase(s,l,f),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(s,l,d){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(s,l,d){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p,g,b=0;if(d==="be")for(f=s.length-1,p=0;f>=0;f-=3)g=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);else if(d==="le")for(f=0,p=0;f<s.length;f+=3)g=s[f]|s[f+1]<<8|s[f+2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);return this.strip()};function a(m,s){var l=m.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function c(m,s,l){var d=a(m,l);return l-1>=s&&(d|=a(m,l-1)<<4),d}i.prototype._parseHex=function(s,l,d){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p=0,g=0,b;if(d==="be")for(f=s.length-1;f>=l;f-=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8;else{var h=s.length-l;for(f=h%2===0?l+1:l;f<s.length;f+=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8}this.strip()};function v(m,s,l,d){for(var f=0,p=Math.min(m.length,l),g=s;g<p;g++){var b=m.charCodeAt(g)-48;f*=d,b>=49?f+=b-49+10:b>=17?f+=b-17+10:f+=b}return f}i.prototype._parseBase=function(s,l,d){this.words=[0],this.length=1;for(var f=0,p=1;p<=67108863;p*=l)f++;f--,p=p/l|0;for(var g=s.length-d,b=g%f,h=Math.min(g,g-b)+d,u=0,_=d;_<h;_+=f)u=v(s,_,_+f,l),this.imuln(p),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(b!==0){var A=1;for(u=v(s,_,s.length,l),_=0;_<b;_++)A*=l;this.imuln(A),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var l=0;l<this.length;l++)s.words[l]=this.words[l];s.length=this.length,s.negative=this.negative,s.red=this.red},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,l){s=s||10,l=l|0||1;var d;if(s===16||s==="hex"){d="";for(var f=0,p=0,g=0;g<this.length;g++){var b=this.words[g],h=((b<<f|p)&16777215).toString(16);p=b>>>24-f&16777215,p!==0||g!==this.length-1?d=y[6-h.length]+h+d:d=h+d,f+=2,f>=26&&(f-=26,g--)}for(p!==0&&(d=p.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(s===(s|0)&&s>=2&&s<=36){var u=w[s],_=M[s];d="";var A=this.clone();for(A.negative=0;!A.isZero();){var x=A.modn(_).toString(s);A=A.idivn(_),A.isZero()?d=x+d:d=y[u-x.length]+x+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},i.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},i.prototype.toArrayLike=function(s,l,d){var f=this.byteLength(),p=d||Math.max(1,f);r(f<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var g=l==="le",b=new s(p),h,u,_=this.clone();if(g){for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[u]=h;for(;u<p;u++)b[u]=0}else{for(u=0;u<p-f;u++)b[u]=0;for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[p-u-1]=h}return b},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var l=s,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,d=0;return(l&8191)===0&&(d+=13,l>>>=13),(l&127)===0&&(d+=7,l>>>=7),(l&15)===0&&(d+=4,l>>>=4),(l&3)===0&&(d+=2,l>>>=2),(l&1)===0&&d++,d},i.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function S(m){for(var s=new Array(m.bitLength()),l=0;l<s.length;l++){var d=l/26|0,f=l%26;s[l]=(m.words[d]&1<<f)>>>f}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(s+=d,d!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]|s.words[l];return this.strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&s.words[d];return this.length=l.length,this.strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var l,d;this.length>s.length?(l=this,d=s):(l=s,d=this);for(var f=0;f<d.length;f++)this.words[f]=l.words[f]^d.words[f];if(this!==l)for(;f<l.length;f++)this.words[f]=l.words[f];return this.length=l.length,this.strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,d=s%26;this._expand(l),d>0&&l--;for(var f=0;f<l;f++)this.words[f]=~this.words[f]&67108863;return d>0&&(this.words[f]=~this.words[f]&67108863>>26-d),this.strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var d=s/26|0,f=s%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<f:this.words[d]=this.words[d]&~(1<<f),this.strip()},i.prototype.iadd=function(s){var l;if(this.negative!==0&&s.negative===0)return this.negative=0,l=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,l=this.isub(s),s.negative=1,l._normSign();var d,f;this.length>s.length?(d=this,f=s):(d=s,f=this);for(var p=0,g=0;g<f.length;g++)l=(d.words[g]|0)+(f.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;for(;p!==0&&g<d.length;g++)l=(d.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;if(this.length=d.length,p!==0)this.words[this.length]=p,this.length++;else if(d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this},i.prototype.add=function(s){var l;return s.negative!==0&&this.negative===0?(s.negative=0,l=this.sub(s),s.negative^=1,l):s.negative===0&&this.negative!==0?(this.negative=0,l=s.sub(this),this.negative=1,l):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var d=this.cmp(s);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,p;d>0?(f=this,p=s):(f=s,p=this);for(var g=0,b=0;b<p.length;b++)l=(f.words[b]|0)-(p.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;for(;g!==0&&b<f.length;b++)l=(f.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;if(g===0&&b<f.length&&f!==this)for(;b<f.length;b++)this.words[b]=f.words[b];return this.length=Math.max(this.length,b),f!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function R(m,s,l){l.negative=s.negative^m.negative;var d=m.length+s.length|0;l.length=d,d=d-1|0;var f=m.words[0]|0,p=s.words[0]|0,g=f*p,b=g&67108863,h=g/67108864|0;l.words[0]=b;for(var u=1;u<d;u++){for(var _=h>>>26,A=h&67108863,x=Math.min(u,s.length-1),I=Math.max(0,u-m.length+1);I<=x;I++){var j=u-I|0;f=m.words[j]|0,p=s.words[I]|0,g=f*p+A,_+=g/67108864|0,A=g&67108863}l.words[u]=A|0,h=_|0}return h!==0?l.words[u]=h|0:l.length--,l.strip()}var C=function(s,l,d){var f=s.words,p=l.words,g=d.words,b=0,h,u,_,A=f[0]|0,x=A&8191,I=A>>>13,j=f[1]|0,O=j&8191,L=j>>>13,W=f[2]|0,F=W&8191,K=W>>>13,De=f[3]|0,Y=De&8191,Q=De>>>13,Ve=f[4]|0,J=Ve&8191,be=Ve>>>13,Ke=f[5]|0,ye=Ke&8191,Re=Ke>>>13,et=f[6]|0,oe=et&8191,xe=et>>>13,it=f[7]|0,ce=it&8191,Ie=it>>>13,ft=f[8]|0,le=ft&8191,Ce=ft>>>13,ot=f[9]|0,se=ot&8191,Me=ot>>>13,st=p[0]|0,ae=st&8191,Se=st>>>13,at=p[1]|0,re=at&8191,Te=at>>>13,ct=p[2]|0,ne=ct&8191,Ee=ct>>>13,lt=p[3]|0,te=lt&8191,ke=lt>>>13,ht=p[4]|0,ue=ht&8191,Pe=ht>>>13,dt=p[5]|0,he=dt&8191,Ne=dt>>>13,pt=p[6]|0,de=pt&8191,qe=pt>>>13,vt=p[7]|0,pe=vt&8191,Le=vt>>>13,ut=p[8]|0,ve=ut&8191,Be=ut>>>13,mt=p[9]|0,me=mt&8191,Ae=mt>>>13;d.negative=s.negative^l.negative,d.length=19,h=Math.imul(x,ae),u=Math.imul(x,Se),u=u+Math.imul(I,ae)|0,_=Math.imul(I,Se);var $t=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+($t>>>26)|0,$t&=67108863,h=Math.imul(O,ae),u=Math.imul(O,Se),u=u+Math.imul(L,ae)|0,_=Math.imul(L,Se),h=h+Math.imul(x,re)|0,u=u+Math.imul(x,Te)|0,u=u+Math.imul(I,re)|0,_=_+Math.imul(I,Te)|0;var Je=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Je>>>26)|0,Je&=67108863,h=Math.imul(F,ae),u=Math.imul(F,Se),u=u+Math.imul(K,ae)|0,_=Math.imul(K,Se),h=h+Math.imul(O,re)|0,u=u+Math.imul(O,Te)|0,u=u+Math.imul(L,re)|0,_=_+Math.imul(L,Te)|0,h=h+Math.imul(x,ne)|0,u=u+Math.imul(x,Ee)|0,u=u+Math.imul(I,ne)|0,_=_+Math.imul(I,Ee)|0;var Qe=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,h=Math.imul(Y,ae),u=Math.imul(Y,Se),u=u+Math.imul(Q,ae)|0,_=Math.imul(Q,Se),h=h+Math.imul(F,re)|0,u=u+Math.imul(F,Te)|0,u=u+Math.imul(K,re)|0,_=_+Math.imul(K,Te)|0,h=h+Math.imul(O,ne)|0,u=u+Math.imul(O,Ee)|0,u=u+Math.imul(L,ne)|0,_=_+Math.imul(L,Ee)|0,h=h+Math.imul(x,te)|0,u=u+Math.imul(x,ke)|0,u=u+Math.imul(I,te)|0,_=_+Math.imul(I,ke)|0;var Lt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(J,ae),u=Math.imul(J,Se),u=u+Math.imul(be,ae)|0,_=Math.imul(be,Se),h=h+Math.imul(Y,re)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Q,re)|0,_=_+Math.imul(Q,Te)|0,h=h+Math.imul(F,ne)|0,u=u+Math.imul(F,Ee)|0,u=u+Math.imul(K,ne)|0,_=_+Math.imul(K,Ee)|0,h=h+Math.imul(O,te)|0,u=u+Math.imul(O,ke)|0,u=u+Math.imul(L,te)|0,_=_+Math.imul(L,ke)|0,h=h+Math.imul(x,ue)|0,u=u+Math.imul(x,Pe)|0,u=u+Math.imul(I,ue)|0,_=_+Math.imul(I,Pe)|0;var Bt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(ye,ae),u=Math.imul(ye,Se),u=u+Math.imul(Re,ae)|0,_=Math.imul(Re,Se),h=h+Math.imul(J,re)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(be,re)|0,_=_+Math.imul(be,Te)|0,h=h+Math.imul(Y,ne)|0,u=u+Math.imul(Y,Ee)|0,u=u+Math.imul(Q,ne)|0,_=_+Math.imul(Q,Ee)|0,h=h+Math.imul(F,te)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(K,te)|0,_=_+Math.imul(K,ke)|0,h=h+Math.imul(O,ue)|0,u=u+Math.imul(O,Pe)|0,u=u+Math.imul(L,ue)|0,_=_+Math.imul(L,Pe)|0,h=h+Math.imul(x,he)|0,u=u+Math.imul(x,Ne)|0,u=u+Math.imul(I,he)|0,_=_+Math.imul(I,Ne)|0;var Dt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,h=Math.imul(oe,ae),u=Math.imul(oe,Se),u=u+Math.imul(xe,ae)|0,_=Math.imul(xe,Se),h=h+Math.imul(ye,re)|0,u=u+Math.imul(ye,Te)|0,u=u+Math.imul(Re,re)|0,_=_+Math.imul(Re,Te)|0,h=h+Math.imul(J,ne)|0,u=u+Math.imul(J,Ee)|0,u=u+Math.imul(be,ne)|0,_=_+Math.imul(be,Ee)|0,h=h+Math.imul(Y,te)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Q,te)|0,_=_+Math.imul(Q,ke)|0,h=h+Math.imul(F,ue)|0,u=u+Math.imul(F,Pe)|0,u=u+Math.imul(K,ue)|0,_=_+Math.imul(K,Pe)|0,h=h+Math.imul(O,he)|0,u=u+Math.imul(O,Ne)|0,u=u+Math.imul(L,he)|0,_=_+Math.imul(L,Ne)|0,h=h+Math.imul(x,de)|0,u=u+Math.imul(x,qe)|0,u=u+Math.imul(I,de)|0,_=_+Math.imul(I,qe)|0;var jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(jt>>>26)|0,jt&=67108863,h=Math.imul(ce,ae),u=Math.imul(ce,Se),u=u+Math.imul(Ie,ae)|0,_=Math.imul(Ie,Se),h=h+Math.imul(oe,re)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(xe,re)|0,_=_+Math.imul(xe,Te)|0,h=h+Math.imul(ye,ne)|0,u=u+Math.imul(ye,Ee)|0,u=u+Math.imul(Re,ne)|0,_=_+Math.imul(Re,Ee)|0,h=h+Math.imul(J,te)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(be,te)|0,_=_+Math.imul(be,ke)|0,h=h+Math.imul(Y,ue)|0,u=u+Math.imul(Y,Pe)|0,u=u+Math.imul(Q,ue)|0,_=_+Math.imul(Q,Pe)|0,h=h+Math.imul(F,he)|0,u=u+Math.imul(F,Ne)|0,u=u+Math.imul(K,he)|0,_=_+Math.imul(K,Ne)|0,h=h+Math.imul(O,de)|0,u=u+Math.imul(O,qe)|0,u=u+Math.imul(L,de)|0,_=_+Math.imul(L,qe)|0,h=h+Math.imul(x,pe)|0,u=u+Math.imul(x,Le)|0,u=u+Math.imul(I,pe)|0,_=_+Math.imul(I,Le)|0;var Ft=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,h=Math.imul(le,ae),u=Math.imul(le,Se),u=u+Math.imul(Ce,ae)|0,_=Math.imul(Ce,Se),h=h+Math.imul(ce,re)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(Ie,re)|0,_=_+Math.imul(Ie,Te)|0,h=h+Math.imul(oe,ne)|0,u=u+Math.imul(oe,Ee)|0,u=u+Math.imul(xe,ne)|0,_=_+Math.imul(xe,Ee)|0,h=h+Math.imul(ye,te)|0,u=u+Math.imul(ye,ke)|0,u=u+Math.imul(Re,te)|0,_=_+Math.imul(Re,ke)|0,h=h+Math.imul(J,ue)|0,u=u+Math.imul(J,Pe)|0,u=u+Math.imul(be,ue)|0,_=_+Math.imul(be,Pe)|0,h=h+Math.imul(Y,he)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Q,he)|0,_=_+Math.imul(Q,Ne)|0,h=h+Math.imul(F,de)|0,u=u+Math.imul(F,qe)|0,u=u+Math.imul(K,de)|0,_=_+Math.imul(K,qe)|0,h=h+Math.imul(O,pe)|0,u=u+Math.imul(O,Le)|0,u=u+Math.imul(L,pe)|0,_=_+Math.imul(L,Le)|0,h=h+Math.imul(x,ve)|0,u=u+Math.imul(x,Be)|0,u=u+Math.imul(I,ve)|0,_=_+Math.imul(I,Be)|0;var hr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,h=Math.imul(se,ae),u=Math.imul(se,Se),u=u+Math.imul(Me,ae)|0,_=Math.imul(Me,Se),h=h+Math.imul(le,re)|0,u=u+Math.imul(le,Te)|0,u=u+Math.imul(Ce,re)|0,_=_+Math.imul(Ce,Te)|0,h=h+Math.imul(ce,ne)|0,u=u+Math.imul(ce,Ee)|0,u=u+Math.imul(Ie,ne)|0,_=_+Math.imul(Ie,Ee)|0,h=h+Math.imul(oe,te)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(xe,te)|0,_=_+Math.imul(xe,ke)|0,h=h+Math.imul(ye,ue)|0,u=u+Math.imul(ye,Pe)|0,u=u+Math.imul(Re,ue)|0,_=_+Math.imul(Re,Pe)|0,h=h+Math.imul(J,he)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(be,he)|0,_=_+Math.imul(be,Ne)|0,h=h+Math.imul(Y,de)|0,u=u+Math.imul(Y,qe)|0,u=u+Math.imul(Q,de)|0,_=_+Math.imul(Q,qe)|0,h=h+Math.imul(F,pe)|0,u=u+Math.imul(F,Le)|0,u=u+Math.imul(K,pe)|0,_=_+Math.imul(K,Le)|0,h=h+Math.imul(O,ve)|0,u=u+Math.imul(O,Be)|0,u=u+Math.imul(L,ve)|0,_=_+Math.imul(L,Be)|0,h=h+Math.imul(x,me)|0,u=u+Math.imul(x,Ae)|0,u=u+Math.imul(I,me)|0,_=_+Math.imul(I,Ae)|0;var dr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,h=Math.imul(se,re),u=Math.imul(se,Te),u=u+Math.imul(Me,re)|0,_=Math.imul(Me,Te),h=h+Math.imul(le,ne)|0,u=u+Math.imul(le,Ee)|0,u=u+Math.imul(Ce,ne)|0,_=_+Math.imul(Ce,Ee)|0,h=h+Math.imul(ce,te)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(Ie,te)|0,_=_+Math.imul(Ie,ke)|0,h=h+Math.imul(oe,ue)|0,u=u+Math.imul(oe,Pe)|0,u=u+Math.imul(xe,ue)|0,_=_+Math.imul(xe,Pe)|0,h=h+Math.imul(ye,he)|0,u=u+Math.imul(ye,Ne)|0,u=u+Math.imul(Re,he)|0,_=_+Math.imul(Re,Ne)|0,h=h+Math.imul(J,de)|0,u=u+Math.imul(J,qe)|0,u=u+Math.imul(be,de)|0,_=_+Math.imul(be,qe)|0,h=h+Math.imul(Y,pe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Q,pe)|0,_=_+Math.imul(Q,Le)|0,h=h+Math.imul(F,ve)|0,u=u+Math.imul(F,Be)|0,u=u+Math.imul(K,ve)|0,_=_+Math.imul(K,Be)|0,h=h+Math.imul(O,me)|0,u=u+Math.imul(O,Ae)|0,u=u+Math.imul(L,me)|0,_=_+Math.imul(L,Ae)|0;var sr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,h=Math.imul(se,ne),u=Math.imul(se,Ee),u=u+Math.imul(Me,ne)|0,_=Math.imul(Me,Ee),h=h+Math.imul(le,te)|0,u=u+Math.imul(le,ke)|0,u=u+Math.imul(Ce,te)|0,_=_+Math.imul(Ce,ke)|0,h=h+Math.imul(ce,ue)|0,u=u+Math.imul(ce,Pe)|0,u=u+Math.imul(Ie,ue)|0,_=_+Math.imul(Ie,Pe)|0,h=h+Math.imul(oe,he)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(xe,he)|0,_=_+Math.imul(xe,Ne)|0,h=h+Math.imul(ye,de)|0,u=u+Math.imul(ye,qe)|0,u=u+Math.imul(Re,de)|0,_=_+Math.imul(Re,qe)|0,h=h+Math.imul(J,pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(be,pe)|0,_=_+Math.imul(be,Le)|0,h=h+Math.imul(Y,ve)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Q,ve)|0,_=_+Math.imul(Q,Be)|0,h=h+Math.imul(F,me)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(K,me)|0,_=_+Math.imul(K,Ae)|0;var Kt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,h=Math.imul(se,te),u=Math.imul(se,ke),u=u+Math.imul(Me,te)|0,_=Math.imul(Me,ke),h=h+Math.imul(le,ue)|0,u=u+Math.imul(le,Pe)|0,u=u+Math.imul(Ce,ue)|0,_=_+Math.imul(Ce,Pe)|0,h=h+Math.imul(ce,he)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(Ie,he)|0,_=_+Math.imul(Ie,Ne)|0,h=h+Math.imul(oe,de)|0,u=u+Math.imul(oe,qe)|0,u=u+Math.imul(xe,de)|0,_=_+Math.imul(xe,qe)|0,h=h+Math.imul(ye,pe)|0,u=u+Math.imul(ye,Le)|0,u=u+Math.imul(Re,pe)|0,_=_+Math.imul(Re,Le)|0,h=h+Math.imul(J,ve)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(be,ve)|0,_=_+Math.imul(be,Be)|0,h=h+Math.imul(Y,me)|0,u=u+Math.imul(Y,Ae)|0,u=u+Math.imul(Q,me)|0,_=_+Math.imul(Q,Ae)|0;var ar=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,h=Math.imul(se,ue),u=Math.imul(se,Pe),u=u+Math.imul(Me,ue)|0,_=Math.imul(Me,Pe),h=h+Math.imul(le,he)|0,u=u+Math.imul(le,Ne)|0,u=u+Math.imul(Ce,he)|0,_=_+Math.imul(Ce,Ne)|0,h=h+Math.imul(ce,de)|0,u=u+Math.imul(ce,qe)|0,u=u+Math.imul(Ie,de)|0,_=_+Math.imul(Ie,qe)|0,h=h+Math.imul(oe,pe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(xe,pe)|0,_=_+Math.imul(xe,Le)|0,h=h+Math.imul(ye,ve)|0,u=u+Math.imul(ye,Be)|0,u=u+Math.imul(Re,ve)|0,_=_+Math.imul(Re,Be)|0,h=h+Math.imul(J,me)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(be,me)|0,_=_+Math.imul(be,Ae)|0;var Ut=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,h=Math.imul(se,he),u=Math.imul(se,Ne),u=u+Math.imul(Me,he)|0,_=Math.imul(Me,Ne),h=h+Math.imul(le,de)|0,u=u+Math.imul(le,qe)|0,u=u+Math.imul(Ce,de)|0,_=_+Math.imul(Ce,qe)|0,h=h+Math.imul(ce,pe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(Ie,pe)|0,_=_+Math.imul(Ie,Le)|0,h=h+Math.imul(oe,ve)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(xe,ve)|0,_=_+Math.imul(xe,Be)|0,h=h+Math.imul(ye,me)|0,u=u+Math.imul(ye,Ae)|0,u=u+Math.imul(Re,me)|0,_=_+Math.imul(Re,Ae)|0;var pr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,h=Math.imul(se,de),u=Math.imul(se,qe),u=u+Math.imul(Me,de)|0,_=Math.imul(Me,qe),h=h+Math.imul(le,pe)|0,u=u+Math.imul(le,Le)|0,u=u+Math.imul(Ce,pe)|0,_=_+Math.imul(Ce,Le)|0,h=h+Math.imul(ce,ve)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(Ie,ve)|0,_=_+Math.imul(Ie,Be)|0,h=h+Math.imul(oe,me)|0,u=u+Math.imul(oe,Ae)|0,u=u+Math.imul(xe,me)|0,_=_+Math.imul(xe,Ae)|0;var Jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,h=Math.imul(se,pe),u=Math.imul(se,Le),u=u+Math.imul(Me,pe)|0,_=Math.imul(Me,Le),h=h+Math.imul(le,ve)|0,u=u+Math.imul(le,Be)|0,u=u+Math.imul(Ce,ve)|0,_=_+Math.imul(Ce,Be)|0,h=h+Math.imul(ce,me)|0,u=u+Math.imul(ce,Ae)|0,u=u+Math.imul(Ie,me)|0,_=_+Math.imul(Ie,Ae)|0;var tr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,h=Math.imul(se,ve),u=Math.imul(se,Be),u=u+Math.imul(Me,ve)|0,_=Math.imul(Me,Be),h=h+Math.imul(le,me)|0,u=u+Math.imul(le,Ae)|0,u=u+Math.imul(Ce,me)|0,_=_+Math.imul(Ce,Ae)|0;var Rr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,h=Math.imul(se,me),u=Math.imul(se,Ae),u=u+Math.imul(Me,me)|0,_=Math.imul(Me,Ae);var Qr=(b+h|0)+((u&8191)<<13)|0;return b=(_+(u>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g[0]=$t,g[1]=Je,g[2]=Qe,g[3]=Lt,g[4]=Bt,g[5]=Dt,g[6]=jt,g[7]=Ft,g[8]=hr,g[9]=dr,g[10]=sr,g[11]=Kt,g[12]=ar,g[13]=Ut,g[14]=pr,g[15]=Jt,g[16]=tr,g[17]=Rr,g[18]=Qr,b!==0&&(g[19]=b,d.length++),d};Math.imul||(C=R);function B(m,s,l){l.negative=s.negative^m.negative,l.length=m.length+s.length;for(var d=0,f=0,p=0;p<l.length-1;p++){var g=f;f=0;for(var b=d&67108863,h=Math.min(p,s.length-1),u=Math.max(0,p-m.length+1);u<=h;u++){var _=p-u,A=m.words[_]|0,x=s.words[u]|0,I=A*x,j=I&67108863;g=g+(I/67108864|0)|0,j=j+b|0,b=j&67108863,g=g+(j>>>26)|0,f+=g>>>26,g&=67108863}l.words[p]=b,d=g,g=f}return d!==0?l.words[p]=d:l.length--,l.strip()}function N(m,s,l){var d=new q;return d.mulp(m,s,l)}i.prototype.mulTo=function(s,l){var d,f=this.length+s.length;return this.length===10&&s.length===10?d=C(this,s,l):f<63?d=R(this,s,l):f<1024?d=B(this,s,l):d=N(this,s,l),d};function q(m,s){this.x=m,this.y=s}q.prototype.makeRBT=function(s){for(var l=new Array(s),d=i.prototype._countBits(s)-1,f=0;f<s;f++)l[f]=this.revBin(f,d,s);return l},q.prototype.revBin=function(s,l,d){if(s===0||s===d-1)return s;for(var f=0,p=0;p<l;p++)f|=(s&1)<<l-p-1,s>>=1;return f},q.prototype.permute=function(s,l,d,f,p,g){for(var b=0;b<g;b++)f[b]=l[s[b]],p[b]=d[s[b]]},q.prototype.transform=function(s,l,d,f,p,g){this.permute(g,s,l,d,f,p);for(var b=1;b<p;b<<=1)for(var h=b<<1,u=Math.cos(2*Math.PI/h),_=Math.sin(2*Math.PI/h),A=0;A<p;A+=h)for(var x=u,I=_,j=0;j<b;j++){var O=d[A+j],L=f[A+j],W=d[A+j+b],F=f[A+j+b],K=x*W-I*F;F=x*F+I*W,W=K,d[A+j]=O+W,f[A+j]=L+F,d[A+j+b]=O-W,f[A+j+b]=L-F,j!==h&&(K=u*x-_*I,I=u*I+_*x,x=K)}},q.prototype.guessLen13b=function(s,l){var d=Math.max(l,s)|1,f=d&1,p=0;for(d=d/2|0;d;d=d>>>1)p++;return 1<<p+1+f},q.prototype.conjugate=function(s,l,d){if(!(d<=1))for(var f=0;f<d/2;f++){var p=s[f];s[f]=s[d-f-1],s[d-f-1]=p,p=l[f],l[f]=-l[d-f-1],l[d-f-1]=-p}},q.prototype.normalize13b=function(s,l){for(var d=0,f=0;f<l/2;f++){var p=Math.round(s[2*f+1]/l)*8192+Math.round(s[2*f]/l)+d;s[f]=p&67108863,p<67108864?d=0:d=p/67108864|0}return s},q.prototype.convert13b=function(s,l,d,f){for(var p=0,g=0;g<l;g++)p=p+(s[g]|0),d[2*g]=p&8191,p=p>>>13,d[2*g+1]=p&8191,p=p>>>13;for(g=2*l;g<f;++g)d[g]=0;r(p===0),r((p&-8192)===0)},q.prototype.stub=function(s){for(var l=new Array(s),d=0;d<s;d++)l[d]=0;return l},q.prototype.mulp=function(s,l,d){var f=2*this.guessLen13b(s.length,l.length),p=this.makeRBT(f),g=this.stub(f),b=new Array(f),h=new Array(f),u=new Array(f),_=new Array(f),A=new Array(f),x=new Array(f),I=d.words;I.length=f,this.convert13b(s.words,s.length,b,f),this.convert13b(l.words,l.length,_,f),this.transform(b,g,h,u,f,p),this.transform(_,g,A,x,f,p);for(var j=0;j<f;j++){var O=h[j]*A[j]-u[j]*x[j];u[j]=h[j]*x[j]+u[j]*A[j],h[j]=O}return this.conjugate(h,u,f),this.transform(h,u,I,g,f,p),this.conjugate(I,g,f),this.normalize13b(I,f),d.negative=s.negative^l.negative,d.length=s.length+l.length,d.strip()},i.prototype.mul=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),this.mulTo(s,l)},i.prototype.mulf=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),N(this,s,l)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){r(typeof s=="number"),r(s<67108864);for(var l=0,d=0;d<this.length;d++){var f=(this.words[d]|0)*s,p=(f&67108863)+(l&67108863);l>>=26,l+=f/67108864|0,l+=p>>>26,this.words[d]=p&67108863}return l!==0&&(this.words[d]=l,this.length++),this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var l=S(s);if(l.length===0)return new i(1);for(var d=this,f=0;f<l.length&&l[f]===0;f++,d=d.sqr());if(++f<l.length)for(var p=d.sqr();f<l.length;f++,p=p.sqr())l[f]!==0&&(d=d.mul(p));return d},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=67108863>>>26-l<<26-l,p;if(l!==0){var g=0;for(p=0;p<this.length;p++){var b=this.words[p]&f,h=(this.words[p]|0)-b<<l;this.words[p]=h|g,g=b>>>26-l}g&&(this.words[p]=g,this.length++)}if(d!==0){for(p=this.length-1;p>=0;p--)this.words[p+d]=this.words[p];for(p=0;p<d;p++)this.words[p]=0;this.length+=d}return this.strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,l,d){r(typeof s=="number"&&s>=0);var f;l?f=(l-l%26)/26:f=0;var p=s%26,g=Math.min((s-p)/26,this.length),b=67108863^67108863>>>p<<p,h=d;if(f-=g,f=Math.max(0,f),h){for(var u=0;u<g;u++)h.words[u]=this.words[u];h.length=g}if(g!==0)if(this.length>g)for(this.length-=g,u=0;u<this.length;u++)this.words[u]=this.words[u+g];else this.words[0]=0,this.length=1;var _=0;for(u=this.length-1;u>=0&&(_!==0||u>=f);u--){var A=this.words[u]|0;this.words[u]=_<<26-p|A>>>p,_=A&b}return h&&_!==0&&(h.words[h.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(s,l,d){return r(this.negative===0),this.iushrn(s,l,d)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return!1;var p=this.words[d];return!!(p&f)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var f=67108863^67108863>>>l<<l;this.words[this.length-1]&=f}return this.strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,l,d){var f=s.length+d,p;this._expand(f);var g,b=0;for(p=0;p<s.length;p++){g=(this.words[p+d]|0)+b;var h=(s.words[p]|0)*l;g-=h&67108863,b=(g>>26)-(h/67108864|0),this.words[p+d]=g&67108863}for(;p<this.length-d;p++)g=(this.words[p+d]|0)+b,b=g>>26,this.words[p+d]=g&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,p=0;p<this.length;p++)g=-(this.words[p]|0)+b,b=g>>26,this.words[p]=g&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(s,l){var d=this.length-s.length,f=this.clone(),p=s,g=p.words[p.length-1]|0,b=this._countBits(g);d=26-b,d!==0&&(p=p.ushln(d),f.iushln(d),g=p.words[p.length-1]|0);var h=f.length-p.length,u;if(l!=="mod"){u=new i(null),u.length=h+1,u.words=new Array(u.length);for(var _=0;_<u.length;_++)u.words[_]=0}var A=f.clone()._ishlnsubmul(p,1,h);A.negative===0&&(f=A,u&&(u.words[h]=1));for(var x=h-1;x>=0;x--){var I=(f.words[p.length+x]|0)*67108864+(f.words[p.length+x-1]|0);for(I=Math.min(I/g|0,67108863),f._ishlnsubmul(p,I,x);f.negative!==0;)I--,f.negative=0,f._ishlnsubmul(p,1,x),f.isZero()||(f.negative^=1);u&&(u.words[x]=I)}return u&&u.strip(),f.strip(),l!=="div"&&d!==0&&f.iushrn(d),{div:u||null,mod:f}},i.prototype.divmod=function(s,l,d){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var f,p,g;return this.negative!==0&&s.negative===0?(g=this.neg().divmod(s,l),l!=="mod"&&(f=g.div.neg()),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.iadd(s)),{div:f,mod:p}):this.negative===0&&s.negative!==0?(g=this.divmod(s.neg(),l),l!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):(this.negative&s.negative)!==0?(g=this.neg().divmod(s.neg(),l),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.isub(s)),{div:g.div,mod:p}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modn(s.words[0]))}:this._wordDiv(s,l)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),p=s.andln(1),g=d.cmp(f);return g<0||p===1&&g===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,d=0,f=this.length-1;f>=0;f--)d=(l*d+(this.words[f]|0))%s;return d},i.prototype.idivn=function(s){r(s<=67108863);for(var l=0,d=this.length-1;d>=0;d--){var f=(this.words[d]|0)+l*67108864;this.words[d]=f/s|0,l=f%s}return this.strip()},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=new i(0),b=new i(1),h=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++h;for(var u=d.clone(),_=l.clone();!l.isZero();){for(var A=0,x=1;(l.words[0]&x)===0&&A<26;++A,x<<=1);if(A>0)for(l.iushrn(A);A-- >0;)(f.isOdd()||p.isOdd())&&(f.iadd(u),p.isub(_)),f.iushrn(1),p.iushrn(1);for(var I=0,j=1;(d.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(d.iushrn(I);I-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(u),b.isub(_)),g.iushrn(1),b.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(g),p.isub(b)):(d.isub(l),g.isub(f),b.isub(p))}return{a:g,b,gcd:d.iushln(h)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var b=0,h=1;(l.words[0]&h)===0&&b<26;++b,h<<=1);if(b>0)for(l.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var u=0,_=1;(d.words[0]&_)===0&&u<26;++u,_<<=1);if(u>0)for(d.iushrn(u);u-- >0;)p.isOdd()&&p.iadd(g),p.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(p)):(d.isub(l),p.isub(f))}var A;return l.cmpn(1)===0?A=f:A=p,A.cmpn(0)<0&&A.iadd(s),A},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),d=s.clone();l.negative=0,d.negative=0;for(var f=0;l.isEven()&&d.isEven();f++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var p=l.cmp(d);if(p<0){var g=l;l=d,d=g}else if(p===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(f)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=f,this;for(var p=f,g=d;p!==0&&g<this.length;g++){var b=this.words[g]|0;b+=p,p=b>>>26,b&=67108863,this.words[g]=b}return p!==0&&(this.words[g]=p,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var d;if(this.length>1)d=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;d=f===s?0:f<s?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var l=this.ucmp(s);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var f=this.words[d]|0,p=s.words[d]|0;if(f!==p){f<p?l=-1:f>p&&(l=1);break}}return l},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new V(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var H={k256:null,p224:null,p192:null,p25519:null};function D(m,s){this.name=m,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},D.prototype.ireduce=function(s){var l=s,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var f=d<this.n?-1:l.ucmp(this.p);return f===0?(l.words[0]=0,l.length=1):f>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},D.prototype.split=function(s,l){s.iushrn(this.n,0,l)},D.prototype.imulK=function(s){return s.imul(this.k)};function ee(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(ee,D),ee.prototype.split=function(s,l){for(var d=4194303,f=Math.min(s.length,9),p=0;p<f;p++)l.words[p]=s.words[p];if(l.length=f,s.length<=9){s.words[0]=0,s.length=1;return}var g=s.words[9];for(l.words[l.length++]=g&d,p=10;p<s.length;p++){var b=s.words[p]|0;s.words[p-10]=(b&d)<<4|g>>>22,g=b}g>>>=22,s.words[p-10]=g,g===0&&s.length>10?s.length-=10:s.length-=9},ee.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,d=0;d<s.length;d++){var f=s.words[d]|0;l+=f*977,s.words[d]=l&67108863,l=f*64+(l/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function ge(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ge,D);function Z(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(Z,D);function X(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,D),X.prototype.imulK=function(s){for(var l=0,d=0;d<s.length;d++){var f=(s.words[d]|0)*19+l,p=f&67108863;f>>>=26,s.words[d]=p,l=f}return l!==0&&(s.words[s.length++]=l),s},i._prime=function(s){if(H[s])return H[s];var l;if(s==="k256")l=new ee;else if(s==="p224")l=new ge;else if(s==="p192")l=new Z;else if(s==="p25519")l=new X;else throw new Error("Unknown prime "+s);return H[s]=l,l};function V(m){if(typeof m=="string"){var s=i._prime(m);this.m=s.p,this.prime=s}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}V.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},V.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},V.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},V.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},V.prototype.add=function(s,l){this._verify2(s,l);var d=s.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},V.prototype.iadd=function(s,l){this._verify2(s,l);var d=s.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},V.prototype.sub=function(s,l){this._verify2(s,l);var d=s.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},V.prototype.isub=function(s,l){this._verify2(s,l);var d=s.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},V.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},V.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},V.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},V.prototype.isqr=function(s){return this.imul(s,s.clone())},V.prototype.sqr=function(s){return this.mul(s,s)},V.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(s,d)}for(var f=this.m.subn(1),p=0;!f.isZero()&&f.andln(1)===0;)p++,f.iushrn(1);r(!f.isZero());var g=new i(1).toRed(this),b=g.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,h).cmp(b)!==0;)u.redIAdd(b);for(var _=this.pow(u,f),A=this.pow(s,f.addn(1).iushrn(1)),x=this.pow(s,f),I=p;x.cmp(g)!==0;){for(var j=x,O=0;j.cmp(g)!==0;O++)j=j.redSqr();r(O<I);var L=this.pow(_,new i(1).iushln(I-O-1));A=A.redMul(L),_=L.redSqr(),x=x.redMul(_),I=O}return A},V.prototype.invm=function(s){var l=s._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},V.prototype.pow=function(s,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return s.clone();var d=4,f=new Array(1<<d);f[0]=new i(1).toRed(this),f[1]=s;for(var p=2;p<f.length;p++)f[p]=this.mul(f[p-1],s);var g=f[0],b=0,h=0,u=l.bitLength()%26;for(u===0&&(u=26),p=l.length-1;p>=0;p--){for(var _=l.words[p],A=u-1;A>=0;A--){var x=_>>A&1;if(g!==f[0]&&(g=this.sqr(g)),x===0&&b===0){h=0;continue}b<<=1,b|=x,h++,!(h!==d&&(p!==0||A!==0))&&(g=this.mul(g,f[b]),h=0,b=0)}u=26}return g},V.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},V.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},i.mont=function(s){return new k(s)};function k(m){V.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(k,V),k.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},k.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},k.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var d=s.imul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},k.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new i(0)._forceRed(this);var d=s.mul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},k.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof $2>"u"||$2,WT)});var VT=E(lh=>{"use strict";var Xa=K2(),woe=g1().ec,G2=new woe("secp256k1"),Lf=G2.curve;lh.privateKeyExport=function(e,t){var r=new Xa(e);if(r.ucmp(Lf.n)>=0)throw new Error("couldn't export to DER format");var n=G2.g.mul(r);return zT(n.getX(),n.getY(),t)};lh.privateKeyModInverse=function(e){var t=new Xa(e);if(t.ucmp(Lf.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(Lf.n).toArrayLike(Buffer,"be",32)};lh.signatureImport=function(e){var t=new Xa(e.r);t.ucmp(Lf.n)>=0&&(t=new Xa(0));var r=new Xa(e.s);return r.ucmp(Lf.n)>=0&&(r=new Xa(0)),Buffer.concat([t.toArrayLike(Buffer,"be",32),r.toArrayLike(Buffer,"be",32)])};lh.ecdhUnsafe=function(e,t,r){var n=G2.keyFromPublic(e),i=new Xa(t);if(i.ucmp(Lf.n)>=0||i.isZero())throw new Error("scalar was invalid (zero or overflow)");var o=n.pub.mul(i);return zT(o.getX(),o.getY(),r)};var zT=function(t,r,n){var i=void 0;return n?(i=Buffer.alloc(33),i[0]=r.isOdd()?3:2,t.toArrayLike(Buffer,"be",32).copy(i,1)):(i=Buffer.alloc(65),i[0]=4,t.toArrayLike(Buffer,"be",32).copy(i,1),r.toArrayLike(Buffer,"be",32).copy(i,33)),i}});var $T=E(_1=>{"use strict";var xoe=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Moe=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);_1.privateKeyExport=function(e,t,r){var n=Buffer.from(r?xoe:Moe);return e.copy(n,r?8:9),t.copy(n,r?181:214),n};_1.privateKeyImport=function(e){var t=e.length,r=0;if(t<r+1||e[r]!==48||(r+=1,t<r+1||!(e[r]&128)))return null;var n=e[r]&127;if(r+=1,n<1||n>2||t<r+n)return null;var i=e[r+n-1]|(n>1?e[r+n-2]<<8:0);return r+=n,t<r+i||t<r+3||e[r]!==2||e[r+1]!==1||e[r+2]!==1||(r+=3,t<r+2||e[r]!==4||e[r+1]>32||t<r+2+e[r+1])?null:e.slice(r+2,r+2+e[r+1])};_1.signatureImportLax=function(e){var t=Buffer.alloc(32,0),r=Buffer.alloc(32,0),n=e.length,i=0;if(e[i++]!==48)return null;var o=e[i++];if(o&128&&(i+=o-128,i>n)||e[i++]!==2)return null;var a=e[i++];if(a&128){if(o=a-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(a=0;o>0;i+=1,o-=1)a=(a<<8)+e[i]}if(a>n-i)return null;var c=i;if(i+=a,e[i++]!==2)return null;var v=e[i++];if(v&128){if(o=v-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(v=0;o>0;i+=1,o-=1)v=(v<<8)+e[i]}if(v>n-i)return null;var y=i;for(i+=v;a>0&&e[c]===0;a-=1,c+=1);if(a>32)return null;var w=e.slice(c,c+a);for(w.copy(t,32-w.length);v>0&&e[y]===0;v-=1,y+=1);if(v>32)return null;var M=e.slice(y,y+v);return M.copy(r,32-M.length),{r:t,s:r}}});var ZT=E((WPe,GT)=>{"use strict";var on=V2(),w1=VT(),Z2=$T(),KT=function(t){return t.length!==32?!1:on.privateKeyVerify(Uint8Array.from(t))},Soe=function(t,r){if(t.length!==32)throw new RangeError("private key length is invalid");var n=w1.privateKeyExport(t,r);return Z2.privateKeyExport(t,n,r)},Eoe=function(t){if(t=Z2.privateKeyImport(t),t!==null&&t.length===32&&KT(t))return t;throw new Error("couldn't import from DER format")},Aoe=function(t){return Buffer.from(on.privateKeyNegate(Uint8Array.from(t)))},Ooe=function(t){if(t.length!==32)throw new Error("private key length is invalid");return Buffer.from(w1.privateKeyModInverse(Uint8Array.from(t)))},Roe=function(t,r){return Buffer.from(on.privateKeyTweakAdd(Uint8Array.from(t),r))},Ioe=function(t,r){return Buffer.from(on.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(r)))},Coe=function(t,r){return Buffer.from(on.publicKeyCreate(Uint8Array.from(t),r))},Toe=function(t,r){return Buffer.from(on.publicKeyConvert(Uint8Array.from(t),r))},koe=function(t){return t.length!==33&&t.length!==65?!1:on.publicKeyVerify(Uint8Array.from(t))},Poe=function(t,r,n){return Buffer.from(on.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(r),n))},Noe=function(t,r,n){return Buffer.from(on.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(r),n))},qoe=function(t,r){var n=[];return t.forEach(function(i){n.push(Uint8Array.from(i))}),Buffer.from(on.publicKeyCombine(n,r))},Loe=function(t){return Buffer.from(on.signatureNormalize(Uint8Array.from(t)))},Boe=function(t){return Buffer.from(on.signatureExport(Uint8Array.from(t)))},Doe=function(t){return Buffer.from(on.signatureImport(Uint8Array.from(t)))},joe=function(t){if(t.length===0)throw new RangeError("signature length is invalid");var r=Z2.signatureImportLax(t);if(r===null)throw new Error("couldn't parse DER signature");return w1.signatureImport(r)},Foe=function(t,r,n){if(n===null)throw new TypeError("options should be an Object");var i=void 0;if(n){if(i={},n.data===null)throw new TypeError("options.data should be a Buffer");if(n.data){if(n.data.length!==32)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(n.data)}if(n.noncefn===null)throw new TypeError("options.noncefn should be a Function");n.noncefn&&(i.noncefn=function(a,c,v,y,w){var M=v!=null?Buffer.from(v):null,S=y!=null?Buffer.from(y):null,R=Buffer.from("");return n.noncefn&&(R=n.noncefn(Buffer.from(a),Buffer.from(c),M,S,w)),Uint8Array.from(R)})}var o=on.ecdsaSign(Uint8Array.from(t),Uint8Array.from(r),i);return{signature:Buffer.from(o.signature),recovery:o.recid}},Uoe=function(t,r,n){return on.ecdsaVerify(Uint8Array.from(r),Uint8Array.from(t),n)},Hoe=function(t,r,n,i){return Buffer.from(on.ecdsaRecover(Uint8Array.from(r),n,Uint8Array.from(t),i))},Woe=function(t,r){return Buffer.from(on.ecdh(Uint8Array.from(t),Uint8Array.from(r),{}))},zoe=function(t,r,n){if(t.length!==33&&t.length!==65)throw new RangeError("public key length is invalid");if(r.length!==32)throw new RangeError("private key length is invalid");return Buffer.from(w1.ecdhUnsafe(Uint8Array.from(t),Uint8Array.from(r),n))};GT.exports={privateKeyVerify:KT,privateKeyExport:Soe,privateKeyImport:Eoe,privateKeyNegate:Aoe,privateKeyModInverse:Ooe,privateKeyTweakAdd:Roe,privateKeyTweakMul:Ioe,publicKeyCreate:Coe,publicKeyConvert:Toe,publicKeyVerify:koe,publicKeyTweakAdd:Poe,publicKeyTweakMul:Noe,publicKeyCombine:qoe,signatureNormalize:Loe,signatureExport:Boe,signatureImport:Doe,signatureImportLax:joe,sign:Foe,verify:Uoe,recover:Hoe,ecdh:Woe,ecdhUnsafe:zoe}});var lk={};Sr(lk,{AssertionError:()=>x1,assert:()=>M1,deepEqual:()=>X2,deepStrictEqual:()=>ex,default:()=>$oe,doesNotThrow:()=>fk,equal:()=>J2,fail:()=>kn,ifError:()=>ck,notDeepEqual:()=>tx,notDeepStrictEqual:()=>rx,notEqual:()=>Q2,notStrictEqual:()=>ix,ok:()=>M1,strictEqual:()=>nx,throws:()=>uk});function YT(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function ok(){return typeof Y2<"u"?Y2:Y2=function(){return function(){}.name==="foo"}()}function XT(e){return Object.prototype.toString.call(e)}function ek(e){return Qi(e)||typeof globalThis.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e?!!(e instanceof DataView||e.buffer&&e.buffer instanceof ArrayBuffer):!1}function Pn(e,t){e||kn(e,!0,t,"==",M1)}function sk(e){if(!!xs(e)){if(ok())return e.name;var t=e.toString(),r=t.match(Koe);return r&&r[1]}}function x1(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=Goe(this),this.generatedMessage=!0);var t=e.stackStartFunction||kn;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=sk(t),o=n.indexOf(`
|
|
536
|
+
`+i);if(o>=0){var a=n.indexOf(`
|
|
537
|
+
`,o+1);n=n.substring(a+1)}this.stack=n}}}function tk(e,t){return typeof e=="string"?e.length<t?e:e.slice(0,t):e}function rk(e){if(ok()||!xs(e))return di(e);var t=sk(e),r=t?": "+t:"";return"[Function"+r+"]"}function Goe(e){return tk(rk(e.actual),128)+" "+e.operator+" "+tk(rk(e.expected),128)}function kn(e,t,r,n,i){throw new x1({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function M1(e,t){e||kn(e,!0,t,"==",M1)}function J2(e,t,r){e!=t&&kn(e,t,r,"==",J2)}function Q2(e,t,r){e==t&&kn(e,t,r,"!=",Q2)}function X2(e,t,r){Bf(e,t,!1)||kn(e,t,r,"deepEqual",X2)}function ex(e,t,r){Bf(e,t,!0)||kn(e,t,r,"deepStrictEqual",ex)}function Bf(e,t,r,n){if(e===t)return!0;if(Qi(e)&&Qi(t))return YT(e,t)===0;if(Oa(e)&&Oa(t))return e.getTime()===t.getTime();if(ws(e)&&ws(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if((e===null||typeof e!="object")&&(t===null||typeof t!="object"))return r?e===t:e==t;if(ek(e)&&ek(t)&&XT(e)===XT(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return YT(new Uint8Array(e.buffer),new Uint8Array(t.buffer))===0;if(Qi(e)!==Qi(t))return!1;n=n||{actual:[],expected:[]};var i=n.actual.indexOf(e);return i!==-1&&i===n.expected.indexOf(t)?!0:(n.actual.push(e),n.expected.push(t),Zoe(e,t,r,n))}function nk(e){return Object.prototype.toString.call(e)=="[object Arguments]"}function Zoe(e,t,r,n){if(e==null||t===null||t===void 0)return!1;if(zl(e)||zl(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=nk(e),o=nk(t);if(i&&!o||!i&&o)return!1;if(i)return e=QT.call(e),t=QT.call(t),Bf(e,t,r);var a=JT(e),c=JT(t),v,y;if(a.length!==c.length)return!1;for(a.sort(),c.sort(),y=a.length-1;y>=0;y--)if(a[y]!==c[y])return!1;for(y=a.length-1;y>=0;y--)if(v=a[y],!Bf(e[v],t[v],r,n))return!1;return!0}function tx(e,t,r){Bf(e,t,!1)&&kn(e,t,r,"notDeepEqual",tx)}function rx(e,t,r){Bf(e,t,!0)&&kn(e,t,r,"notDeepStrictEqual",rx)}function nx(e,t,r){e!==t&&kn(e,t,r,"===",nx)}function ix(e,t,r){e===t&&kn(e,t,r,"!==",ix)}function ik(e,t){if(!e||!t)return!1;if(Object.prototype.toString.call(t)=="[object RegExp]")return t.test(e);try{if(e instanceof t)return!0}catch{}return Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function Yoe(e){var t;try{e()}catch(r){t=r}return t}function ak(e,t,r,n){var i;if(typeof t!="function")throw new TypeError('"block" argument must be a function');typeof r=="string"&&(n=r,r=null),i=Yoe(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&kn(i,r,"Missing expected exception"+n);var o=typeof n=="string",a=!e&&Aa(i),c=!e&&i&&!r;if((a&&o&&ik(i,r)||c)&&kn(i,r,"Got unwanted exception"+n),e&&i&&r&&!ik(i,r)||!e&&i)throw i}function uk(e,t,r){ak(!0,e,t,r)}function fk(e,t,r){ak(!1,e,t,r)}function ck(e){if(e)throw e}var Voe,JT,QT,Y2,$oe,Koe,hk=_t(()=>{ha();pi();Voe=Object.prototype.hasOwnProperty,JT=Object.keys||function(e){var t=[];for(var r in e)Voe.call(e,r)&&t.push(r);return t},QT=Array.prototype.slice;$oe=Pn,Koe=/\s*function\s+([^\(\s]*)\s*/;Pn.AssertionError=x1;Cr(x1,Error);Pn.fail=kn;Pn.ok=M1;Pn.equal=J2;Pn.notEqual=Q2;Pn.deepEqual=X2;Pn.deepStrictEqual=ex;Pn.notDeepEqual=tx;Pn.notDeepStrictEqual=rx;Pn.strictEqual=nx;Pn.notStrictEqual=ix;Pn.throws=uk;Pn.doesNotThrow=fk;Pn.ifError=ck});var E1=E(($Pe,S1)=>{var eu=(hk(),Pt(lk));if(eu&&eu.default){S1.exports=eu.default;for(let e in eu)S1.exports[e]=eu[e]}else eu&&(S1.exports=eu)});var Df=E((dk,ox)=>{(function(e,t){"use strict";function r(d,f){if(!d)throw new Error(f||"Assertion failed")}function n(d,f){d.super_=f;var p=function(){};p.prototype=f.prototype,d.prototype=new p,d.prototype.constructor=d}function i(d,f,p){if(i.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((f==="le"||f==="be")&&(p=f,f=10),this._init(d||0,f||10,p||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(f){return f instanceof i?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===i.wordSize&&Array.isArray(f.words)},i.max=function(f,p){return f.cmp(p)>0?f:p},i.min=function(f,p){return f.cmp(p)<0?f:p},i.prototype._init=function(f,p,g){if(typeof f=="number")return this._initNumber(f,p,g);if(typeof f=="object")return this._initArray(f,p,g);p==="hex"&&(p=16),r(p===(p|0)&&p>=2&&p<=36),f=f.toString().replace(/\s+/g,"");var b=0;f[0]==="-"&&(b++,this.negative=1),b<f.length&&(p===16?this._parseHex(f,b,g):(this._parseBase(f,p,b),g==="le"&&this._initArray(this.toArray(),p,g)))},i.prototype._initNumber=function(f,p,g){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),p,g)},i.prototype._initArray=function(f,p,g){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var h,u,_=0;if(g==="be")for(b=f.length-1,h=0;b>=0;b-=3)u=f[b]|f[b-1]<<8|f[b-2]<<16,this.words[h]|=u<<_&67108863,this.words[h+1]=u>>>26-_&67108863,_+=24,_>=26&&(_-=26,h++);else if(g==="le")for(b=0,h=0;b<f.length;b+=3)u=f[b]|f[b+1]<<8|f[b+2]<<16,this.words[h]|=u<<_&67108863,this.words[h+1]=u>>>26-_&67108863,_+=24,_>=26&&(_-=26,h++);return this._strip()};function a(d,f){var p=d.charCodeAt(f);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;r(!1,"Invalid character in "+d)}function c(d,f,p){var g=a(d,p);return p-1>=f&&(g|=a(d,p-1)<<4),g}i.prototype._parseHex=function(f,p,g){this.length=Math.ceil((f.length-p)/6),this.words=new Array(this.length);for(var b=0;b<this.length;b++)this.words[b]=0;var h=0,u=0,_;if(g==="be")for(b=f.length-1;b>=p;b-=2)_=c(f,p,b)<<h,this.words[u]|=_&67108863,h>=18?(h-=18,u+=1,this.words[u]|=_>>>26):h+=8;else{var A=f.length-p;for(b=A%2===0?p+1:p;b<f.length;b+=2)_=c(f,p,b)<<h,this.words[u]|=_&67108863,h>=18?(h-=18,u+=1,this.words[u]|=_>>>26):h+=8}this._strip()};function v(d,f,p,g){for(var b=0,h=0,u=Math.min(d.length,p),_=f;_<u;_++){var A=d.charCodeAt(_)-48;b*=g,A>=49?h=A-49+10:A>=17?h=A-17+10:h=A,r(A>=0&&h<g,"Invalid character"),b+=h}return b}i.prototype._parseBase=function(f,p,g){this.words=[0],this.length=1;for(var b=0,h=1;h<=67108863;h*=p)b++;b--,h=h/p|0;for(var u=f.length-g,_=u%b,A=Math.min(u,u-_)+g,x=0,I=g;I<A;I+=b)x=v(f,I,I+b,p),this.imuln(h),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(_!==0){var j=1;for(x=v(f,I,f.length,p),I=0;I<_;I++)j*=p;this.imuln(j),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this._strip()},i.prototype.copy=function(f){f.words=new Array(this.length);for(var p=0;p<this.length;p++)f.words[p]=this.words[p];f.length=this.length,f.negative=this.negative,f.red=this.red};function y(d,f){d.words=f.words,d.length=f.length,d.negative=f.negative,d.red=f.red}if(i.prototype._move=function(f){y(f,this)},i.prototype.clone=function(){var f=new i(null);return this.copy(f),f},i.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{i.prototype.inspect=w}else i.prototype.inspect=w;function w(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],R=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(f,p){f=f||10,p=p|0||1;var g;if(f===16||f==="hex"){g="";for(var b=0,h=0,u=0;u<this.length;u++){var _=this.words[u],A=((_<<b|h)&16777215).toString(16);h=_>>>24-b&16777215,b+=2,b>=26&&(b-=26,u--),h!==0||u!==this.length-1?g=M[6-A.length]+A+g:g=A+g}for(h!==0&&(g=h.toString(16)+g);g.length%p!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(f===(f|0)&&f>=2&&f<=36){var x=S[f],I=R[f];g="";var j=this.clone();for(j.negative=0;!j.isZero();){var O=j.modrn(I).toString(f);j=j.idivn(I),j.isZero()?g=O+g:g=M[x-O.length]+O+g}for(this.isZero()&&(g="0"+g);g.length%p!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(f,p){return this.toArrayLike(o,f,p)}),i.prototype.toArray=function(f,p){return this.toArrayLike(Array,f,p)};var C=function(f,p){return f.allocUnsafe?f.allocUnsafe(p):new f(p)};i.prototype.toArrayLike=function(f,p,g){this._strip();var b=this.byteLength(),h=g||Math.max(1,b);r(b<=h,"byte array longer than desired length"),r(h>0,"Requested array length <= 0");var u=C(f,h),_=p==="le"?"LE":"BE";return this["_toArrayLike"+_](u,b),u},i.prototype._toArrayLikeLE=function(f,p){for(var g=0,b=0,h=0,u=0;h<this.length;h++){var _=this.words[h]<<u|b;f[g++]=_&255,g<f.length&&(f[g++]=_>>8&255),g<f.length&&(f[g++]=_>>16&255),u===6?(g<f.length&&(f[g++]=_>>24&255),b=0,u=0):(b=_>>>24,u+=2)}if(g<f.length)for(f[g++]=b;g<f.length;)f[g++]=0},i.prototype._toArrayLikeBE=function(f,p){for(var g=f.length-1,b=0,h=0,u=0;h<this.length;h++){var _=this.words[h]<<u|b;f[g--]=_&255,g>=0&&(f[g--]=_>>8&255),g>=0&&(f[g--]=_>>16&255),u===6?(g>=0&&(f[g--]=_>>24&255),b=0,u=0):(b=_>>>24,u+=2)}if(g>=0)for(f[g--]=b;g>=0;)f[g--]=0},Math.clz32?i.prototype._countBits=function(f){return 32-Math.clz32(f)}:i.prototype._countBits=function(f){var p=f,g=0;return p>=4096&&(g+=13,p>>>=13),p>=64&&(g+=7,p>>>=7),p>=8&&(g+=4,p>>>=4),p>=2&&(g+=2,p>>>=2),g+p},i.prototype._zeroBits=function(f){if(f===0)return 26;var p=f,g=0;return(p&8191)===0&&(g+=13,p>>>=13),(p&127)===0&&(g+=7,p>>>=7),(p&15)===0&&(g+=4,p>>>=4),(p&3)===0&&(g+=2,p>>>=2),(p&1)===0&&g++,g},i.prototype.bitLength=function(){var f=this.words[this.length-1],p=this._countBits(f);return(this.length-1)*26+p};function B(d){for(var f=new Array(d.bitLength()),p=0;p<f.length;p++){var g=p/26|0,b=p%26;f[p]=d.words[g]>>>b&1}return f}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,p=0;p<this.length;p++){var g=this._zeroBits(this.words[p]);if(f+=g,g!==26)break}return f},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},i.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var p=0;p<f.length;p++)this.words[p]=this.words[p]|f.words[p];return this._strip()},i.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},i.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},i.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},i.prototype.iuand=function(f){var p;this.length>f.length?p=f:p=this;for(var g=0;g<p.length;g++)this.words[g]=this.words[g]&f.words[g];return this.length=p.length,this._strip()},i.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},i.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},i.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},i.prototype.iuxor=function(f){var p,g;this.length>f.length?(p=this,g=f):(p=f,g=this);for(var b=0;b<g.length;b++)this.words[b]=p.words[b]^g.words[b];if(this!==p)for(;b<p.length;b++)this.words[b]=p.words[b];return this.length=p.length,this._strip()},i.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},i.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},i.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},i.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var p=Math.ceil(f/26)|0,g=f%26;this._expand(p),g>0&&p--;for(var b=0;b<p;b++)this.words[b]=~this.words[b]&67108863;return g>0&&(this.words[b]=~this.words[b]&67108863>>26-g),this._strip()},i.prototype.notn=function(f){return this.clone().inotn(f)},i.prototype.setn=function(f,p){r(typeof f=="number"&&f>=0);var g=f/26|0,b=f%26;return this._expand(g+1),p?this.words[g]=this.words[g]|1<<b:this.words[g]=this.words[g]&~(1<<b),this._strip()},i.prototype.iadd=function(f){var p;if(this.negative!==0&&f.negative===0)return this.negative=0,p=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,p=this.isub(f),f.negative=1,p._normSign();var g,b;this.length>f.length?(g=this,b=f):(g=f,b=this);for(var h=0,u=0;u<b.length;u++)p=(g.words[u]|0)+(b.words[u]|0)+h,this.words[u]=p&67108863,h=p>>>26;for(;h!==0&&u<g.length;u++)p=(g.words[u]|0)+h,this.words[u]=p&67108863,h=p>>>26;if(this.length=g.length,h!==0)this.words[this.length]=h,this.length++;else if(g!==this)for(;u<g.length;u++)this.words[u]=g.words[u];return this},i.prototype.add=function(f){var p;return f.negative!==0&&this.negative===0?(f.negative=0,p=this.sub(f),f.negative^=1,p):f.negative===0&&this.negative!==0?(this.negative=0,p=f.sub(this),this.negative=1,p):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},i.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var p=this.iadd(f);return f.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var g=this.cmp(f);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var b,h;g>0?(b=this,h=f):(b=f,h=this);for(var u=0,_=0;_<h.length;_++)p=(b.words[_]|0)-(h.words[_]|0)+u,u=p>>26,this.words[_]=p&67108863;for(;u!==0&&_<b.length;_++)p=(b.words[_]|0)+u,u=p>>26,this.words[_]=p&67108863;if(u===0&&_<b.length&&b!==this)for(;_<b.length;_++)this.words[_]=b.words[_];return this.length=Math.max(this.length,_),b!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(f){return this.clone().isub(f)};function N(d,f,p){p.negative=f.negative^d.negative;var g=d.length+f.length|0;p.length=g,g=g-1|0;var b=d.words[0]|0,h=f.words[0]|0,u=b*h,_=u&67108863,A=u/67108864|0;p.words[0]=_;for(var x=1;x<g;x++){for(var I=A>>>26,j=A&67108863,O=Math.min(x,f.length-1),L=Math.max(0,x-d.length+1);L<=O;L++){var W=x-L|0;b=d.words[W]|0,h=f.words[L]|0,u=b*h+j,I+=u/67108864|0,j=u&67108863}p.words[x]=j|0,A=I|0}return A!==0?p.words[x]=A|0:p.length--,p._strip()}var q=function(f,p,g){var b=f.words,h=p.words,u=g.words,_=0,A,x,I,j=b[0]|0,O=j&8191,L=j>>>13,W=b[1]|0,F=W&8191,K=W>>>13,De=b[2]|0,Y=De&8191,Q=De>>>13,Ve=b[3]|0,J=Ve&8191,be=Ve>>>13,Ke=b[4]|0,ye=Ke&8191,Re=Ke>>>13,et=b[5]|0,oe=et&8191,xe=et>>>13,it=b[6]|0,ce=it&8191,Ie=it>>>13,ft=b[7]|0,le=ft&8191,Ce=ft>>>13,ot=b[8]|0,se=ot&8191,Me=ot>>>13,st=b[9]|0,ae=st&8191,Se=st>>>13,at=h[0]|0,re=at&8191,Te=at>>>13,ct=h[1]|0,ne=ct&8191,Ee=ct>>>13,lt=h[2]|0,te=lt&8191,ke=lt>>>13,ht=h[3]|0,ue=ht&8191,Pe=ht>>>13,dt=h[4]|0,he=dt&8191,Ne=dt>>>13,pt=h[5]|0,de=pt&8191,qe=pt>>>13,vt=h[6]|0,pe=vt&8191,Le=vt>>>13,ut=h[7]|0,ve=ut&8191,Be=ut>>>13,mt=h[8]|0,me=mt&8191,Ae=mt>>>13,$t=h[9]|0,Je=$t&8191,Qe=$t>>>13;g.negative=f.negative^p.negative,g.length=19,A=Math.imul(O,re),x=Math.imul(O,Te),x=x+Math.imul(L,re)|0,I=Math.imul(L,Te);var Lt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,A=Math.imul(F,re),x=Math.imul(F,Te),x=x+Math.imul(K,re)|0,I=Math.imul(K,Te),A=A+Math.imul(O,ne)|0,x=x+Math.imul(O,Ee)|0,x=x+Math.imul(L,ne)|0,I=I+Math.imul(L,Ee)|0;var Bt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,A=Math.imul(Y,re),x=Math.imul(Y,Te),x=x+Math.imul(Q,re)|0,I=Math.imul(Q,Te),A=A+Math.imul(F,ne)|0,x=x+Math.imul(F,Ee)|0,x=x+Math.imul(K,ne)|0,I=I+Math.imul(K,Ee)|0,A=A+Math.imul(O,te)|0,x=x+Math.imul(O,ke)|0,x=x+Math.imul(L,te)|0,I=I+Math.imul(L,ke)|0;var Dt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,A=Math.imul(J,re),x=Math.imul(J,Te),x=x+Math.imul(be,re)|0,I=Math.imul(be,Te),A=A+Math.imul(Y,ne)|0,x=x+Math.imul(Y,Ee)|0,x=x+Math.imul(Q,ne)|0,I=I+Math.imul(Q,Ee)|0,A=A+Math.imul(F,te)|0,x=x+Math.imul(F,ke)|0,x=x+Math.imul(K,te)|0,I=I+Math.imul(K,ke)|0,A=A+Math.imul(O,ue)|0,x=x+Math.imul(O,Pe)|0,x=x+Math.imul(L,ue)|0,I=I+Math.imul(L,Pe)|0;var jt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(jt>>>26)|0,jt&=67108863,A=Math.imul(ye,re),x=Math.imul(ye,Te),x=x+Math.imul(Re,re)|0,I=Math.imul(Re,Te),A=A+Math.imul(J,ne)|0,x=x+Math.imul(J,Ee)|0,x=x+Math.imul(be,ne)|0,I=I+Math.imul(be,Ee)|0,A=A+Math.imul(Y,te)|0,x=x+Math.imul(Y,ke)|0,x=x+Math.imul(Q,te)|0,I=I+Math.imul(Q,ke)|0,A=A+Math.imul(F,ue)|0,x=x+Math.imul(F,Pe)|0,x=x+Math.imul(K,ue)|0,I=I+Math.imul(K,Pe)|0,A=A+Math.imul(O,he)|0,x=x+Math.imul(O,Ne)|0,x=x+Math.imul(L,he)|0,I=I+Math.imul(L,Ne)|0;var Ft=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,A=Math.imul(oe,re),x=Math.imul(oe,Te),x=x+Math.imul(xe,re)|0,I=Math.imul(xe,Te),A=A+Math.imul(ye,ne)|0,x=x+Math.imul(ye,Ee)|0,x=x+Math.imul(Re,ne)|0,I=I+Math.imul(Re,Ee)|0,A=A+Math.imul(J,te)|0,x=x+Math.imul(J,ke)|0,x=x+Math.imul(be,te)|0,I=I+Math.imul(be,ke)|0,A=A+Math.imul(Y,ue)|0,x=x+Math.imul(Y,Pe)|0,x=x+Math.imul(Q,ue)|0,I=I+Math.imul(Q,Pe)|0,A=A+Math.imul(F,he)|0,x=x+Math.imul(F,Ne)|0,x=x+Math.imul(K,he)|0,I=I+Math.imul(K,Ne)|0,A=A+Math.imul(O,de)|0,x=x+Math.imul(O,qe)|0,x=x+Math.imul(L,de)|0,I=I+Math.imul(L,qe)|0;var hr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(hr>>>26)|0,hr&=67108863,A=Math.imul(ce,re),x=Math.imul(ce,Te),x=x+Math.imul(Ie,re)|0,I=Math.imul(Ie,Te),A=A+Math.imul(oe,ne)|0,x=x+Math.imul(oe,Ee)|0,x=x+Math.imul(xe,ne)|0,I=I+Math.imul(xe,Ee)|0,A=A+Math.imul(ye,te)|0,x=x+Math.imul(ye,ke)|0,x=x+Math.imul(Re,te)|0,I=I+Math.imul(Re,ke)|0,A=A+Math.imul(J,ue)|0,x=x+Math.imul(J,Pe)|0,x=x+Math.imul(be,ue)|0,I=I+Math.imul(be,Pe)|0,A=A+Math.imul(Y,he)|0,x=x+Math.imul(Y,Ne)|0,x=x+Math.imul(Q,he)|0,I=I+Math.imul(Q,Ne)|0,A=A+Math.imul(F,de)|0,x=x+Math.imul(F,qe)|0,x=x+Math.imul(K,de)|0,I=I+Math.imul(K,qe)|0,A=A+Math.imul(O,pe)|0,x=x+Math.imul(O,Le)|0,x=x+Math.imul(L,pe)|0,I=I+Math.imul(L,Le)|0;var dr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(dr>>>26)|0,dr&=67108863,A=Math.imul(le,re),x=Math.imul(le,Te),x=x+Math.imul(Ce,re)|0,I=Math.imul(Ce,Te),A=A+Math.imul(ce,ne)|0,x=x+Math.imul(ce,Ee)|0,x=x+Math.imul(Ie,ne)|0,I=I+Math.imul(Ie,Ee)|0,A=A+Math.imul(oe,te)|0,x=x+Math.imul(oe,ke)|0,x=x+Math.imul(xe,te)|0,I=I+Math.imul(xe,ke)|0,A=A+Math.imul(ye,ue)|0,x=x+Math.imul(ye,Pe)|0,x=x+Math.imul(Re,ue)|0,I=I+Math.imul(Re,Pe)|0,A=A+Math.imul(J,he)|0,x=x+Math.imul(J,Ne)|0,x=x+Math.imul(be,he)|0,I=I+Math.imul(be,Ne)|0,A=A+Math.imul(Y,de)|0,x=x+Math.imul(Y,qe)|0,x=x+Math.imul(Q,de)|0,I=I+Math.imul(Q,qe)|0,A=A+Math.imul(F,pe)|0,x=x+Math.imul(F,Le)|0,x=x+Math.imul(K,pe)|0,I=I+Math.imul(K,Le)|0,A=A+Math.imul(O,ve)|0,x=x+Math.imul(O,Be)|0,x=x+Math.imul(L,ve)|0,I=I+Math.imul(L,Be)|0;var sr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(sr>>>26)|0,sr&=67108863,A=Math.imul(se,re),x=Math.imul(se,Te),x=x+Math.imul(Me,re)|0,I=Math.imul(Me,Te),A=A+Math.imul(le,ne)|0,x=x+Math.imul(le,Ee)|0,x=x+Math.imul(Ce,ne)|0,I=I+Math.imul(Ce,Ee)|0,A=A+Math.imul(ce,te)|0,x=x+Math.imul(ce,ke)|0,x=x+Math.imul(Ie,te)|0,I=I+Math.imul(Ie,ke)|0,A=A+Math.imul(oe,ue)|0,x=x+Math.imul(oe,Pe)|0,x=x+Math.imul(xe,ue)|0,I=I+Math.imul(xe,Pe)|0,A=A+Math.imul(ye,he)|0,x=x+Math.imul(ye,Ne)|0,x=x+Math.imul(Re,he)|0,I=I+Math.imul(Re,Ne)|0,A=A+Math.imul(J,de)|0,x=x+Math.imul(J,qe)|0,x=x+Math.imul(be,de)|0,I=I+Math.imul(be,qe)|0,A=A+Math.imul(Y,pe)|0,x=x+Math.imul(Y,Le)|0,x=x+Math.imul(Q,pe)|0,I=I+Math.imul(Q,Le)|0,A=A+Math.imul(F,ve)|0,x=x+Math.imul(F,Be)|0,x=x+Math.imul(K,ve)|0,I=I+Math.imul(K,Be)|0,A=A+Math.imul(O,me)|0,x=x+Math.imul(O,Ae)|0,x=x+Math.imul(L,me)|0,I=I+Math.imul(L,Ae)|0;var Kt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,A=Math.imul(ae,re),x=Math.imul(ae,Te),x=x+Math.imul(Se,re)|0,I=Math.imul(Se,Te),A=A+Math.imul(se,ne)|0,x=x+Math.imul(se,Ee)|0,x=x+Math.imul(Me,ne)|0,I=I+Math.imul(Me,Ee)|0,A=A+Math.imul(le,te)|0,x=x+Math.imul(le,ke)|0,x=x+Math.imul(Ce,te)|0,I=I+Math.imul(Ce,ke)|0,A=A+Math.imul(ce,ue)|0,x=x+Math.imul(ce,Pe)|0,x=x+Math.imul(Ie,ue)|0,I=I+Math.imul(Ie,Pe)|0,A=A+Math.imul(oe,he)|0,x=x+Math.imul(oe,Ne)|0,x=x+Math.imul(xe,he)|0,I=I+Math.imul(xe,Ne)|0,A=A+Math.imul(ye,de)|0,x=x+Math.imul(ye,qe)|0,x=x+Math.imul(Re,de)|0,I=I+Math.imul(Re,qe)|0,A=A+Math.imul(J,pe)|0,x=x+Math.imul(J,Le)|0,x=x+Math.imul(be,pe)|0,I=I+Math.imul(be,Le)|0,A=A+Math.imul(Y,ve)|0,x=x+Math.imul(Y,Be)|0,x=x+Math.imul(Q,ve)|0,I=I+Math.imul(Q,Be)|0,A=A+Math.imul(F,me)|0,x=x+Math.imul(F,Ae)|0,x=x+Math.imul(K,me)|0,I=I+Math.imul(K,Ae)|0,A=A+Math.imul(O,Je)|0,x=x+Math.imul(O,Qe)|0,x=x+Math.imul(L,Je)|0,I=I+Math.imul(L,Qe)|0;var ar=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(ar>>>26)|0,ar&=67108863,A=Math.imul(ae,ne),x=Math.imul(ae,Ee),x=x+Math.imul(Se,ne)|0,I=Math.imul(Se,Ee),A=A+Math.imul(se,te)|0,x=x+Math.imul(se,ke)|0,x=x+Math.imul(Me,te)|0,I=I+Math.imul(Me,ke)|0,A=A+Math.imul(le,ue)|0,x=x+Math.imul(le,Pe)|0,x=x+Math.imul(Ce,ue)|0,I=I+Math.imul(Ce,Pe)|0,A=A+Math.imul(ce,he)|0,x=x+Math.imul(ce,Ne)|0,x=x+Math.imul(Ie,he)|0,I=I+Math.imul(Ie,Ne)|0,A=A+Math.imul(oe,de)|0,x=x+Math.imul(oe,qe)|0,x=x+Math.imul(xe,de)|0,I=I+Math.imul(xe,qe)|0,A=A+Math.imul(ye,pe)|0,x=x+Math.imul(ye,Le)|0,x=x+Math.imul(Re,pe)|0,I=I+Math.imul(Re,Le)|0,A=A+Math.imul(J,ve)|0,x=x+Math.imul(J,Be)|0,x=x+Math.imul(be,ve)|0,I=I+Math.imul(be,Be)|0,A=A+Math.imul(Y,me)|0,x=x+Math.imul(Y,Ae)|0,x=x+Math.imul(Q,me)|0,I=I+Math.imul(Q,Ae)|0,A=A+Math.imul(F,Je)|0,x=x+Math.imul(F,Qe)|0,x=x+Math.imul(K,Je)|0,I=I+Math.imul(K,Qe)|0;var Ut=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,A=Math.imul(ae,te),x=Math.imul(ae,ke),x=x+Math.imul(Se,te)|0,I=Math.imul(Se,ke),A=A+Math.imul(se,ue)|0,x=x+Math.imul(se,Pe)|0,x=x+Math.imul(Me,ue)|0,I=I+Math.imul(Me,Pe)|0,A=A+Math.imul(le,he)|0,x=x+Math.imul(le,Ne)|0,x=x+Math.imul(Ce,he)|0,I=I+Math.imul(Ce,Ne)|0,A=A+Math.imul(ce,de)|0,x=x+Math.imul(ce,qe)|0,x=x+Math.imul(Ie,de)|0,I=I+Math.imul(Ie,qe)|0,A=A+Math.imul(oe,pe)|0,x=x+Math.imul(oe,Le)|0,x=x+Math.imul(xe,pe)|0,I=I+Math.imul(xe,Le)|0,A=A+Math.imul(ye,ve)|0,x=x+Math.imul(ye,Be)|0,x=x+Math.imul(Re,ve)|0,I=I+Math.imul(Re,Be)|0,A=A+Math.imul(J,me)|0,x=x+Math.imul(J,Ae)|0,x=x+Math.imul(be,me)|0,I=I+Math.imul(be,Ae)|0,A=A+Math.imul(Y,Je)|0,x=x+Math.imul(Y,Qe)|0,x=x+Math.imul(Q,Je)|0,I=I+Math.imul(Q,Qe)|0;var pr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(pr>>>26)|0,pr&=67108863,A=Math.imul(ae,ue),x=Math.imul(ae,Pe),x=x+Math.imul(Se,ue)|0,I=Math.imul(Se,Pe),A=A+Math.imul(se,he)|0,x=x+Math.imul(se,Ne)|0,x=x+Math.imul(Me,he)|0,I=I+Math.imul(Me,Ne)|0,A=A+Math.imul(le,de)|0,x=x+Math.imul(le,qe)|0,x=x+Math.imul(Ce,de)|0,I=I+Math.imul(Ce,qe)|0,A=A+Math.imul(ce,pe)|0,x=x+Math.imul(ce,Le)|0,x=x+Math.imul(Ie,pe)|0,I=I+Math.imul(Ie,Le)|0,A=A+Math.imul(oe,ve)|0,x=x+Math.imul(oe,Be)|0,x=x+Math.imul(xe,ve)|0,I=I+Math.imul(xe,Be)|0,A=A+Math.imul(ye,me)|0,x=x+Math.imul(ye,Ae)|0,x=x+Math.imul(Re,me)|0,I=I+Math.imul(Re,Ae)|0,A=A+Math.imul(J,Je)|0,x=x+Math.imul(J,Qe)|0,x=x+Math.imul(be,Je)|0,I=I+Math.imul(be,Qe)|0;var Jt=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,A=Math.imul(ae,he),x=Math.imul(ae,Ne),x=x+Math.imul(Se,he)|0,I=Math.imul(Se,Ne),A=A+Math.imul(se,de)|0,x=x+Math.imul(se,qe)|0,x=x+Math.imul(Me,de)|0,I=I+Math.imul(Me,qe)|0,A=A+Math.imul(le,pe)|0,x=x+Math.imul(le,Le)|0,x=x+Math.imul(Ce,pe)|0,I=I+Math.imul(Ce,Le)|0,A=A+Math.imul(ce,ve)|0,x=x+Math.imul(ce,Be)|0,x=x+Math.imul(Ie,ve)|0,I=I+Math.imul(Ie,Be)|0,A=A+Math.imul(oe,me)|0,x=x+Math.imul(oe,Ae)|0,x=x+Math.imul(xe,me)|0,I=I+Math.imul(xe,Ae)|0,A=A+Math.imul(ye,Je)|0,x=x+Math.imul(ye,Qe)|0,x=x+Math.imul(Re,Je)|0,I=I+Math.imul(Re,Qe)|0;var tr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(tr>>>26)|0,tr&=67108863,A=Math.imul(ae,de),x=Math.imul(ae,qe),x=x+Math.imul(Se,de)|0,I=Math.imul(Se,qe),A=A+Math.imul(se,pe)|0,x=x+Math.imul(se,Le)|0,x=x+Math.imul(Me,pe)|0,I=I+Math.imul(Me,Le)|0,A=A+Math.imul(le,ve)|0,x=x+Math.imul(le,Be)|0,x=x+Math.imul(Ce,ve)|0,I=I+Math.imul(Ce,Be)|0,A=A+Math.imul(ce,me)|0,x=x+Math.imul(ce,Ae)|0,x=x+Math.imul(Ie,me)|0,I=I+Math.imul(Ie,Ae)|0,A=A+Math.imul(oe,Je)|0,x=x+Math.imul(oe,Qe)|0,x=x+Math.imul(xe,Je)|0,I=I+Math.imul(xe,Qe)|0;var Rr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,A=Math.imul(ae,pe),x=Math.imul(ae,Le),x=x+Math.imul(Se,pe)|0,I=Math.imul(Se,Le),A=A+Math.imul(se,ve)|0,x=x+Math.imul(se,Be)|0,x=x+Math.imul(Me,ve)|0,I=I+Math.imul(Me,Be)|0,A=A+Math.imul(le,me)|0,x=x+Math.imul(le,Ae)|0,x=x+Math.imul(Ce,me)|0,I=I+Math.imul(Ce,Ae)|0,A=A+Math.imul(ce,Je)|0,x=x+Math.imul(ce,Qe)|0,x=x+Math.imul(Ie,Je)|0,I=I+Math.imul(Ie,Qe)|0;var Qr=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,A=Math.imul(ae,ve),x=Math.imul(ae,Be),x=x+Math.imul(Se,ve)|0,I=Math.imul(Se,Be),A=A+Math.imul(se,me)|0,x=x+Math.imul(se,Ae)|0,x=x+Math.imul(Me,me)|0,I=I+Math.imul(Me,Ae)|0,A=A+Math.imul(le,Je)|0,x=x+Math.imul(le,Qe)|0,x=x+Math.imul(Ce,Je)|0,I=I+Math.imul(Ce,Qe)|0;var aa=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(aa>>>26)|0,aa&=67108863,A=Math.imul(ae,me),x=Math.imul(ae,Ae),x=x+Math.imul(Se,me)|0,I=Math.imul(Se,Ae),A=A+Math.imul(se,Je)|0,x=x+Math.imul(se,Qe)|0,x=x+Math.imul(Me,Je)|0,I=I+Math.imul(Me,Qe)|0;var fl=(_+A|0)+((x&8191)<<13)|0;_=(I+(x>>>13)|0)+(fl>>>26)|0,fl&=67108863,A=Math.imul(ae,Je),x=Math.imul(ae,Qe),x=x+Math.imul(Se,Je)|0,I=Math.imul(Se,Qe);var cl=(_+A|0)+((x&8191)<<13)|0;return _=(I+(x>>>13)|0)+(cl>>>26)|0,cl&=67108863,u[0]=Lt,u[1]=Bt,u[2]=Dt,u[3]=jt,u[4]=Ft,u[5]=hr,u[6]=dr,u[7]=sr,u[8]=Kt,u[9]=ar,u[10]=Ut,u[11]=pr,u[12]=Jt,u[13]=tr,u[14]=Rr,u[15]=Qr,u[16]=aa,u[17]=fl,u[18]=cl,_!==0&&(u[19]=_,g.length++),g};Math.imul||(q=N);function H(d,f,p){p.negative=f.negative^d.negative,p.length=d.length+f.length;for(var g=0,b=0,h=0;h<p.length-1;h++){var u=b;b=0;for(var _=g&67108863,A=Math.min(h,f.length-1),x=Math.max(0,h-d.length+1);x<=A;x++){var I=h-x,j=d.words[I]|0,O=f.words[x]|0,L=j*O,W=L&67108863;u=u+(L/67108864|0)|0,W=W+_|0,_=W&67108863,u=u+(W>>>26)|0,b+=u>>>26,u&=67108863}p.words[h]=_,g=u,u=b}return g!==0?p.words[h]=g:p.length--,p._strip()}function D(d,f,p){return H(d,f,p)}i.prototype.mulTo=function(f,p){var g,b=this.length+f.length;return this.length===10&&f.length===10?g=q(this,f,p):b<63?g=N(this,f,p):b<1024?g=H(this,f,p):g=D(this,f,p),g};function ee(d,f){this.x=d,this.y=f}ee.prototype.makeRBT=function(f){for(var p=new Array(f),g=i.prototype._countBits(f)-1,b=0;b<f;b++)p[b]=this.revBin(b,g,f);return p},ee.prototype.revBin=function(f,p,g){if(f===0||f===g-1)return f;for(var b=0,h=0;h<p;h++)b|=(f&1)<<p-h-1,f>>=1;return b},ee.prototype.permute=function(f,p,g,b,h,u){for(var _=0;_<u;_++)b[_]=p[f[_]],h[_]=g[f[_]]},ee.prototype.transform=function(f,p,g,b,h,u){this.permute(u,f,p,g,b,h);for(var _=1;_<h;_<<=1)for(var A=_<<1,x=Math.cos(2*Math.PI/A),I=Math.sin(2*Math.PI/A),j=0;j<h;j+=A)for(var O=x,L=I,W=0;W<_;W++){var F=g[j+W],K=b[j+W],De=g[j+W+_],Y=b[j+W+_],Q=O*De-L*Y;Y=O*Y+L*De,De=Q,g[j+W]=F+De,b[j+W]=K+Y,g[j+W+_]=F-De,b[j+W+_]=K-Y,W!==A&&(Q=x*O-I*L,L=x*L+I*O,O=Q)}},ee.prototype.guessLen13b=function(f,p){var g=Math.max(p,f)|1,b=g&1,h=0;for(g=g/2|0;g;g=g>>>1)h++;return 1<<h+1+b},ee.prototype.conjugate=function(f,p,g){if(!(g<=1))for(var b=0;b<g/2;b++){var h=f[b];f[b]=f[g-b-1],f[g-b-1]=h,h=p[b],p[b]=-p[g-b-1],p[g-b-1]=-h}},ee.prototype.normalize13b=function(f,p){for(var g=0,b=0;b<p/2;b++){var h=Math.round(f[2*b+1]/p)*8192+Math.round(f[2*b]/p)+g;f[b]=h&67108863,h<67108864?g=0:g=h/67108864|0}return f},ee.prototype.convert13b=function(f,p,g,b){for(var h=0,u=0;u<p;u++)h=h+(f[u]|0),g[2*u]=h&8191,h=h>>>13,g[2*u+1]=h&8191,h=h>>>13;for(u=2*p;u<b;++u)g[u]=0;r(h===0),r((h&-8192)===0)},ee.prototype.stub=function(f){for(var p=new Array(f),g=0;g<f;g++)p[g]=0;return p},ee.prototype.mulp=function(f,p,g){var b=2*this.guessLen13b(f.length,p.length),h=this.makeRBT(b),u=this.stub(b),_=new Array(b),A=new Array(b),x=new Array(b),I=new Array(b),j=new Array(b),O=new Array(b),L=g.words;L.length=b,this.convert13b(f.words,f.length,_,b),this.convert13b(p.words,p.length,I,b),this.transform(_,u,A,x,b,h),this.transform(I,u,j,O,b,h);for(var W=0;W<b;W++){var F=A[W]*j[W]-x[W]*O[W];x[W]=A[W]*O[W]+x[W]*j[W],A[W]=F}return this.conjugate(A,x,b),this.transform(A,x,L,u,b,h),this.conjugate(L,u,b),this.normalize13b(L,b),g.negative=f.negative^p.negative,g.length=f.length+p.length,g._strip()},i.prototype.mul=function(f){var p=new i(null);return p.words=new Array(this.length+f.length),this.mulTo(f,p)},i.prototype.mulf=function(f){var p=new i(null);return p.words=new Array(this.length+f.length),D(this,f,p)},i.prototype.imul=function(f){return this.clone().mulTo(f,this)},i.prototype.imuln=function(f){var p=f<0;p&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var g=0,b=0;b<this.length;b++){var h=(this.words[b]|0)*f,u=(h&67108863)+(g&67108863);g>>=26,g+=h/67108864|0,g+=u>>>26,this.words[b]=u&67108863}return g!==0&&(this.words[b]=g,this.length++),p?this.ineg():this},i.prototype.muln=function(f){return this.clone().imuln(f)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(f){var p=B(f);if(p.length===0)return new i(1);for(var g=this,b=0;b<p.length&&p[b]===0;b++,g=g.sqr());if(++b<p.length)for(var h=g.sqr();b<p.length;b++,h=h.sqr())p[b]!==0&&(g=g.mul(h));return g},i.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var p=f%26,g=(f-p)/26,b=67108863>>>26-p<<26-p,h;if(p!==0){var u=0;for(h=0;h<this.length;h++){var _=this.words[h]&b,A=(this.words[h]|0)-_<<p;this.words[h]=A|u,u=_>>>26-p}u&&(this.words[h]=u,this.length++)}if(g!==0){for(h=this.length-1;h>=0;h--)this.words[h+g]=this.words[h];for(h=0;h<g;h++)this.words[h]=0;this.length+=g}return this._strip()},i.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},i.prototype.iushrn=function(f,p,g){r(typeof f=="number"&&f>=0);var b;p?b=(p-p%26)/26:b=0;var h=f%26,u=Math.min((f-h)/26,this.length),_=67108863^67108863>>>h<<h,A=g;if(b-=u,b=Math.max(0,b),A){for(var x=0;x<u;x++)A.words[x]=this.words[x];A.length=u}if(u!==0)if(this.length>u)for(this.length-=u,x=0;x<this.length;x++)this.words[x]=this.words[x+u];else this.words[0]=0,this.length=1;var I=0;for(x=this.length-1;x>=0&&(I!==0||x>=b);x--){var j=this.words[x]|0;this.words[x]=I<<26-h|j>>>h,I=j&_}return A&&I!==0&&(A.words[A.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(f,p,g){return r(this.negative===0),this.iushrn(f,p,g)},i.prototype.shln=function(f){return this.clone().ishln(f)},i.prototype.ushln=function(f){return this.clone().iushln(f)},i.prototype.shrn=function(f){return this.clone().ishrn(f)},i.prototype.ushrn=function(f){return this.clone().iushrn(f)},i.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var p=f%26,g=(f-p)/26,b=1<<p;if(this.length<=g)return!1;var h=this.words[g];return!!(h&b)},i.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var p=f%26,g=(f-p)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(p!==0&&g++,this.length=Math.min(g,this.length),p!==0){var b=67108863^67108863>>>p<<p;this.words[this.length-1]&=b}return this._strip()},i.prototype.maskn=function(f){return this.clone().imaskn(f)},i.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},i.prototype._iaddn=function(f){this.words[0]+=f;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},i.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this._strip()},i.prototype.addn=function(f){return this.clone().iaddn(f)},i.prototype.subn=function(f){return this.clone().isubn(f)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(f,p,g){var b=f.length+g,h;this._expand(b);var u,_=0;for(h=0;h<f.length;h++){u=(this.words[h+g]|0)+_;var A=(f.words[h]|0)*p;u-=A&67108863,_=(u>>26)-(A/67108864|0),this.words[h+g]=u&67108863}for(;h<this.length-g;h++)u=(this.words[h+g]|0)+_,_=u>>26,this.words[h+g]=u&67108863;if(_===0)return this._strip();for(r(_===-1),_=0,h=0;h<this.length;h++)u=-(this.words[h]|0)+_,_=u>>26,this.words[h]=u&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(f,p){var g=this.length-f.length,b=this.clone(),h=f,u=h.words[h.length-1]|0,_=this._countBits(u);g=26-_,g!==0&&(h=h.ushln(g),b.iushln(g),u=h.words[h.length-1]|0);var A=b.length-h.length,x;if(p!=="mod"){x=new i(null),x.length=A+1,x.words=new Array(x.length);for(var I=0;I<x.length;I++)x.words[I]=0}var j=b.clone()._ishlnsubmul(h,1,A);j.negative===0&&(b=j,x&&(x.words[A]=1));for(var O=A-1;O>=0;O--){var L=(b.words[h.length+O]|0)*67108864+(b.words[h.length+O-1]|0);for(L=Math.min(L/u|0,67108863),b._ishlnsubmul(h,L,O);b.negative!==0;)L--,b.negative=0,b._ishlnsubmul(h,1,O),b.isZero()||(b.negative^=1);x&&(x.words[O]=L)}return x&&x._strip(),b._strip(),p!=="div"&&g!==0&&b.iushrn(g),{div:x||null,mod:b}},i.prototype.divmod=function(f,p,g){if(r(!f.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var b,h,u;return this.negative!==0&&f.negative===0?(u=this.neg().divmod(f,p),p!=="mod"&&(b=u.div.neg()),p!=="div"&&(h=u.mod.neg(),g&&h.negative!==0&&h.iadd(f)),{div:b,mod:h}):this.negative===0&&f.negative!==0?(u=this.divmod(f.neg(),p),p!=="mod"&&(b=u.div.neg()),{div:b,mod:u.mod}):(this.negative&f.negative)!==0?(u=this.neg().divmod(f.neg(),p),p!=="div"&&(h=u.mod.neg(),g&&h.negative!==0&&h.isub(f)),{div:u.div,mod:h}):f.length>this.length||this.cmp(f)<0?{div:new i(0),mod:this}:f.length===1?p==="div"?{div:this.divn(f.words[0]),mod:null}:p==="mod"?{div:null,mod:new i(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new i(this.modrn(f.words[0]))}:this._wordDiv(f,p)},i.prototype.div=function(f){return this.divmod(f,"div",!1).div},i.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},i.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},i.prototype.divRound=function(f){var p=this.divmod(f);if(p.mod.isZero())return p.div;var g=p.div.negative!==0?p.mod.isub(f):p.mod,b=f.ushrn(1),h=f.andln(1),u=g.cmp(b);return u<0||h===1&&u===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},i.prototype.modrn=function(f){var p=f<0;p&&(f=-f),r(f<=67108863);for(var g=(1<<26)%f,b=0,h=this.length-1;h>=0;h--)b=(g*b+(this.words[h]|0))%f;return p?-b:b},i.prototype.modn=function(f){return this.modrn(f)},i.prototype.idivn=function(f){var p=f<0;p&&(f=-f),r(f<=67108863);for(var g=0,b=this.length-1;b>=0;b--){var h=(this.words[b]|0)+g*67108864;this.words[b]=h/f|0,g=h%f}return this._strip(),p?this.ineg():this},i.prototype.divn=function(f){return this.clone().idivn(f)},i.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var p=this,g=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var b=new i(1),h=new i(0),u=new i(0),_=new i(1),A=0;p.isEven()&&g.isEven();)p.iushrn(1),g.iushrn(1),++A;for(var x=g.clone(),I=p.clone();!p.isZero();){for(var j=0,O=1;(p.words[0]&O)===0&&j<26;++j,O<<=1);if(j>0)for(p.iushrn(j);j-- >0;)(b.isOdd()||h.isOdd())&&(b.iadd(x),h.isub(I)),b.iushrn(1),h.iushrn(1);for(var L=0,W=1;(g.words[0]&W)===0&&L<26;++L,W<<=1);if(L>0)for(g.iushrn(L);L-- >0;)(u.isOdd()||_.isOdd())&&(u.iadd(x),_.isub(I)),u.iushrn(1),_.iushrn(1);p.cmp(g)>=0?(p.isub(g),b.isub(u),h.isub(_)):(g.isub(p),u.isub(b),_.isub(h))}return{a:u,b:_,gcd:g.iushln(A)}},i.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var p=this,g=f.clone();p.negative!==0?p=p.umod(f):p=p.clone();for(var b=new i(1),h=new i(0),u=g.clone();p.cmpn(1)>0&&g.cmpn(1)>0;){for(var _=0,A=1;(p.words[0]&A)===0&&_<26;++_,A<<=1);if(_>0)for(p.iushrn(_);_-- >0;)b.isOdd()&&b.iadd(u),b.iushrn(1);for(var x=0,I=1;(g.words[0]&I)===0&&x<26;++x,I<<=1);if(x>0)for(g.iushrn(x);x-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);p.cmp(g)>=0?(p.isub(g),b.isub(h)):(g.isub(p),h.isub(b))}var j;return p.cmpn(1)===0?j=b:j=h,j.cmpn(0)<0&&j.iadd(f),j},i.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var p=this.clone(),g=f.clone();p.negative=0,g.negative=0;for(var b=0;p.isEven()&&g.isEven();b++)p.iushrn(1),g.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;g.isEven();)g.iushrn(1);var h=p.cmp(g);if(h<0){var u=p;p=g,g=u}else if(h===0||g.cmpn(1)===0)break;p.isub(g)}while(!0);return g.iushln(b)},i.prototype.invm=function(f){return this.egcd(f).a.umod(f)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(f){return this.words[0]&f},i.prototype.bincn=function(f){r(typeof f=="number");var p=f%26,g=(f-p)/26,b=1<<p;if(this.length<=g)return this._expand(g+1),this.words[g]|=b,this;for(var h=b,u=g;h!==0&&u<this.length;u++){var _=this.words[u]|0;_+=h,h=_>>>26,_&=67108863,this.words[u]=_}return h!==0&&(this.words[u]=h,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(f){var p=f<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var g;if(this.length>1)g=1;else{p&&(f=-f),r(f<=67108863,"Number is too big");var b=this.words[0]|0;g=b===f?0:b<f?-1:1}return this.negative!==0?-g|0:g},i.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var p=this.ucmp(f);return this.negative!==0?-p|0:p},i.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var p=0,g=this.length-1;g>=0;g--){var b=this.words[g]|0,h=f.words[g]|0;if(b!==h){b<h?p=-1:b>h&&(p=1);break}}return p},i.prototype.gtn=function(f){return this.cmpn(f)===1},i.prototype.gt=function(f){return this.cmp(f)===1},i.prototype.gten=function(f){return this.cmpn(f)>=0},i.prototype.gte=function(f){return this.cmp(f)>=0},i.prototype.ltn=function(f){return this.cmpn(f)===-1},i.prototype.lt=function(f){return this.cmp(f)===-1},i.prototype.lten=function(f){return this.cmpn(f)<=0},i.prototype.lte=function(f){return this.cmp(f)<=0},i.prototype.eqn=function(f){return this.cmpn(f)===0},i.prototype.eq=function(f){return this.cmp(f)===0},i.red=function(f){return new s(f)},i.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(f){return this.red=f,this},i.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},i.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},i.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},i.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},i.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},i.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},i.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},i.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var ge={k256:null,p224:null,p192:null,p25519:null};function Z(d,f){this.name=d,this.p=new i(f,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Z.prototype._tmp=function(){var f=new i(null);return f.words=new Array(Math.ceil(this.n/13)),f},Z.prototype.ireduce=function(f){var p=f,g;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),g=p.bitLength();while(g>this.n);var b=g<this.n?-1:p.ucmp(this.p);return b===0?(p.words[0]=0,p.length=1):b>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},Z.prototype.split=function(f,p){f.iushrn(this.n,0,p)},Z.prototype.imulK=function(f){return f.imul(this.k)};function X(){Z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(X,Z),X.prototype.split=function(f,p){for(var g=4194303,b=Math.min(f.length,9),h=0;h<b;h++)p.words[h]=f.words[h];if(p.length=b,f.length<=9){f.words[0]=0,f.length=1;return}var u=f.words[9];for(p.words[p.length++]=u&g,h=10;h<f.length;h++){var _=f.words[h]|0;f.words[h-10]=(_&g)<<4|u>>>22,u=_}u>>>=22,f.words[h-10]=u,u===0&&f.length>10?f.length-=10:f.length-=9},X.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var p=0,g=0;g<f.length;g++){var b=f.words[g]|0;p+=b*977,f.words[g]=p&67108863,p=b*64+(p/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function V(){Z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(V,Z);function k(){Z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(k,Z);function m(){Z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(m,Z),m.prototype.imulK=function(f){for(var p=0,g=0;g<f.length;g++){var b=(f.words[g]|0)*19+p,h=b&67108863;b>>>=26,f.words[g]=h,p=b}return p!==0&&(f.words[f.length++]=p),f},i._prime=function(f){if(ge[f])return ge[f];var p;if(f==="k256")p=new X;else if(f==="p224")p=new V;else if(f==="p192")p=new k;else if(f==="p25519")p=new m;else throw new Error("Unknown prime "+f);return ge[f]=p,p};function s(d){if(typeof d=="string"){var f=i._prime(d);this.m=f.p,this.prime=f}else r(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}s.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},s.prototype._verify2=function(f,p){r((f.negative|p.negative)===0,"red works only with positives"),r(f.red&&f.red===p.red,"red works only with red numbers")},s.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(y(f,f.umod(this.m)._forceRed(this)),f)},s.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},s.prototype.add=function(f,p){this._verify2(f,p);var g=f.add(p);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},s.prototype.iadd=function(f,p){this._verify2(f,p);var g=f.iadd(p);return g.cmp(this.m)>=0&&g.isub(this.m),g},s.prototype.sub=function(f,p){this._verify2(f,p);var g=f.sub(p);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},s.prototype.isub=function(f,p){this._verify2(f,p);var g=f.isub(p);return g.cmpn(0)<0&&g.iadd(this.m),g},s.prototype.shl=function(f,p){return this._verify1(f),this.imod(f.ushln(p))},s.prototype.imul=function(f,p){return this._verify2(f,p),this.imod(f.imul(p))},s.prototype.mul=function(f,p){return this._verify2(f,p),this.imod(f.mul(p))},s.prototype.isqr=function(f){return this.imul(f,f.clone())},s.prototype.sqr=function(f){return this.mul(f,f)},s.prototype.sqrt=function(f){if(f.isZero())return f.clone();var p=this.m.andln(3);if(r(p%2===1),p===3){var g=this.m.add(new i(1)).iushrn(2);return this.pow(f,g)}for(var b=this.m.subn(1),h=0;!b.isZero()&&b.andln(1)===0;)h++,b.iushrn(1);r(!b.isZero());var u=new i(1).toRed(this),_=u.redNeg(),A=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new i(2*x*x).toRed(this);this.pow(x,A).cmp(_)!==0;)x.redIAdd(_);for(var I=this.pow(x,b),j=this.pow(f,b.addn(1).iushrn(1)),O=this.pow(f,b),L=h;O.cmp(u)!==0;){for(var W=O,F=0;W.cmp(u)!==0;F++)W=W.redSqr();r(F<L);var K=this.pow(I,new i(1).iushln(L-F-1));j=j.redMul(K),I=K.redSqr(),O=O.redMul(I),L=F}return j},s.prototype.invm=function(f){var p=f._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},s.prototype.pow=function(f,p){if(p.isZero())return new i(1).toRed(this);if(p.cmpn(1)===0)return f.clone();var g=4,b=new Array(1<<g);b[0]=new i(1).toRed(this),b[1]=f;for(var h=2;h<b.length;h++)b[h]=this.mul(b[h-1],f);var u=b[0],_=0,A=0,x=p.bitLength()%26;for(x===0&&(x=26),h=p.length-1;h>=0;h--){for(var I=p.words[h],j=x-1;j>=0;j--){var O=I>>j&1;if(u!==b[0]&&(u=this.sqr(u)),O===0&&_===0){A=0;continue}_<<=1,_|=O,A++,!(A!==g&&(h!==0||j!==0))&&(u=this.mul(u,b[_]),A=0,_=0)}x=26}return u},s.prototype.convertTo=function(f){var p=f.umod(this.m);return p===f?p.clone():p},s.prototype.convertFrom=function(f){var p=f.clone();return p.red=null,p},i.mont=function(f){return new l(f)};function l(d){s.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(l,s),l.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},l.prototype.convertFrom=function(f){var p=this.imod(f.mul(this.rinv));return p.red=null,p},l.prototype.imul=function(f,p){if(f.isZero()||p.isZero())return f.words[0]=0,f.length=1,f;var g=f.imul(p),b=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=g.isub(b).iushrn(this.shift),u=h;return h.cmp(this.m)>=0?u=h.isub(this.m):h.cmpn(0)<0&&(u=h.iadd(this.m)),u._forceRed(this)},l.prototype.mul=function(f,p){if(f.isZero()||p.isZero())return new i(0)._forceRed(this);var g=f.mul(p),b=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=g.isub(b).iushrn(this.shift),u=h;return h.cmp(this.m)>=0?u=h.isub(this.m):h.cmpn(0)<0&&(u=h.iadd(this.m)),u._forceRed(this)},l.prototype.invm=function(f){var p=this.imod(f._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof ox>"u"||ox,dk)});var hh=E(go=>{"use strict";var Joe=go&&go.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(go,"__esModule",{value:!0});go.getLength=go.decode=go.encode=void 0;var Qoe=Joe(Df());function vk(e){if(Array.isArray(e)){for(var t=[],r=0;r<e.length;r++)t.push(vk(e[r]));var n=Buffer.concat(t);return Buffer.concat([pk(n.length,192),n])}else{var i=fx(e);return i.length===1&&i[0]<128?i:Buffer.concat([pk(i.length,128),i])}}go.encode=vk;function sx(e,t){if(e[0]==="0"&&e[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function pk(e,t){if(e<56)return Buffer.from([e+t]);var r=ux(e),n=r.length/2,i=ux(t+55+n);return Buffer.from(i+r,"hex")}function Xoe(e,t){if(t===void 0&&(t=!1),!e||e.length===0)return Buffer.from([]);var r=fx(e),n=ax(r);if(t)return n;if(n.remainder.length!==0)throw new Error("invalid remainder");return n.data}go.decode=Xoe;function ese(e){if(!e||e.length===0)return Buffer.from([]);var t=fx(e),r=t[0];if(r<=127)return t.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;var n=r-246,i=sx(t.slice(1,n).toString("hex"),16);return n+i}go.getLength=ese;function ax(e){var t,r,n,i,o,a=[],c=e[0];if(c<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(c<=183){if(t=c-127,c===128?n=Buffer.from([]):n=e.slice(1,t),t===2&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}else if(c<=191){if(r=c-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=sx(e.slice(1,r).toString("hex"),16),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(n=e.slice(r,t+r),n.length<t)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:e.slice(t+r)}}else if(c<=247){for(t=c-191,i=e.slice(1,t);i.length;)o=ax(i),a.push(o.data),i=o.remainder;return{data:a,remainder:e.slice(t)}}else{r=c-246,t=sx(e.slice(1,r).toString("hex"),16);var v=r+t;if(v>e.length)throw new Error("invalid rlp: total length is larger than the data");if(i=e.slice(r,v),i.length===0)throw new Error("invalid rlp, List has a invalid length");for(;i.length;)o=ax(i),a.push(o.data),i=o.remainder;return{data:a,remainder:e.slice(v)}}}function mk(e){return e.slice(0,2)==="0x"}function tse(e){return typeof e!="string"?e:mk(e)?e.slice(2):e}function ux(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function rse(e){return e.length%2?"0"+e:e}function nse(e){var t=ux(e);return Buffer.from(t,"hex")}function fx(e){if(!Buffer.isBuffer(e)){if(typeof e=="string")return mk(e)?Buffer.from(rse(tse(e)),"hex"):Buffer.from(e);if(typeof e=="number"||typeof e=="bigint")return e?nse(e):Buffer.from([]);if(e==null)return Buffer.from([]);if(e instanceof Uint8Array)return Buffer.from(e);if(Qoe.default.isBN(e))return Buffer.from(e.toArray());throw new Error("invalid type")}return e}});var cx=E((GPe,bk)=>{"use strict";var A1=Hn().Buffer,gk=Yv().Transform,ise=Tr();function ose(e,t){if(!A1.isBuffer(e)&&typeof e!="string")throw new TypeError(t+" must be a string or a buffer")}function Bs(e){gk.call(this),this._block=A1.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}ise(Bs,gk);Bs.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(i){n=i}r(n)};Bs.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};Bs.prototype.update=function(e,t){if(ose(e,"Data"),this._finalized)throw new Error("Digest already called");A1.isBuffer(e)||(e=A1.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,a=e.length*8;a>0;++o)this._length[o]+=a,a=this._length[o]/4294967296|0,a>0&&(this._length[o]-=4294967296*a);return this};Bs.prototype._update=function(){throw new Error("_update is not implemented")};Bs.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};Bs.prototype._digest=function(){throw new Error("_digest is not implemented")};bk.exports=Bs});var wk=E((ZPe,_k)=>{"use strict";var sse=Tr(),yk=cx(),ase=Hn().Buffer,use=new Array(16);function O1(){yk.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}sse(O1,yk);O1.prototype._update=function(){for(var e=use,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,n=this._b,i=this._c,o=this._d;r=vn(r,n,i,o,e[0],3614090360,7),o=vn(o,r,n,i,e[1],3905402710,12),i=vn(i,o,r,n,e[2],606105819,17),n=vn(n,i,o,r,e[3],3250441966,22),r=vn(r,n,i,o,e[4],4118548399,7),o=vn(o,r,n,i,e[5],1200080426,12),i=vn(i,o,r,n,e[6],2821735955,17),n=vn(n,i,o,r,e[7],4249261313,22),r=vn(r,n,i,o,e[8],1770035416,7),o=vn(o,r,n,i,e[9],2336552879,12),i=vn(i,o,r,n,e[10],4294925233,17),n=vn(n,i,o,r,e[11],2304563134,22),r=vn(r,n,i,o,e[12],1804603682,7),o=vn(o,r,n,i,e[13],4254626195,12),i=vn(i,o,r,n,e[14],2792965006,17),n=vn(n,i,o,r,e[15],1236535329,22),r=mn(r,n,i,o,e[1],4129170786,5),o=mn(o,r,n,i,e[6],3225465664,9),i=mn(i,o,r,n,e[11],643717713,14),n=mn(n,i,o,r,e[0],3921069994,20),r=mn(r,n,i,o,e[5],3593408605,5),o=mn(o,r,n,i,e[10],38016083,9),i=mn(i,o,r,n,e[15],3634488961,14),n=mn(n,i,o,r,e[4],3889429448,20),r=mn(r,n,i,o,e[9],568446438,5),o=mn(o,r,n,i,e[14],3275163606,9),i=mn(i,o,r,n,e[3],4107603335,14),n=mn(n,i,o,r,e[8],1163531501,20),r=mn(r,n,i,o,e[13],2850285829,5),o=mn(o,r,n,i,e[2],4243563512,9),i=mn(i,o,r,n,e[7],1735328473,14),n=mn(n,i,o,r,e[12],2368359562,20),r=gn(r,n,i,o,e[5],4294588738,4),o=gn(o,r,n,i,e[8],2272392833,11),i=gn(i,o,r,n,e[11],1839030562,16),n=gn(n,i,o,r,e[14],4259657740,23),r=gn(r,n,i,o,e[1],2763975236,4),o=gn(o,r,n,i,e[4],1272893353,11),i=gn(i,o,r,n,e[7],4139469664,16),n=gn(n,i,o,r,e[10],3200236656,23),r=gn(r,n,i,o,e[13],681279174,4),o=gn(o,r,n,i,e[0],3936430074,11),i=gn(i,o,r,n,e[3],3572445317,16),n=gn(n,i,o,r,e[6],76029189,23),r=gn(r,n,i,o,e[9],3654602809,4),o=gn(o,r,n,i,e[12],3873151461,11),i=gn(i,o,r,n,e[15],530742520,16),n=gn(n,i,o,r,e[2],3299628645,23),r=bn(r,n,i,o,e[0],4096336452,6),o=bn(o,r,n,i,e[7],1126891415,10),i=bn(i,o,r,n,e[14],2878612391,15),n=bn(n,i,o,r,e[5],4237533241,21),r=bn(r,n,i,o,e[12],1700485571,6),o=bn(o,r,n,i,e[3],2399980690,10),i=bn(i,o,r,n,e[10],4293915773,15),n=bn(n,i,o,r,e[1],2240044497,21),r=bn(r,n,i,o,e[8],1873313359,6),o=bn(o,r,n,i,e[15],4264355552,10),i=bn(i,o,r,n,e[6],2734768916,15),n=bn(n,i,o,r,e[13],1309151649,21),r=bn(r,n,i,o,e[4],4149444226,6),o=bn(o,r,n,i,e[11],3174756917,10),i=bn(i,o,r,n,e[2],718787259,15),n=bn(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0};O1.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=ase.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function R1(e,t){return e<<t|e>>>32-t}function vn(e,t,r,n,i,o,a){return R1(e+(t&r|~t&n)+i+o|0,a)+t|0}function mn(e,t,r,n,i,o,a){return R1(e+(t&n|r&~n)+i+o|0,a)+t|0}function gn(e,t,r,n,i,o,a){return R1(e+(t^r^n)+i+o|0,a)+t|0}function bn(e,t,r,n,i,o,a){return R1(e+(r^(t|~n))+i+o|0,a)+t|0}_k.exports=O1});var Ik=E((YPe,Rk)=>{"use strict";var lx=fi().Buffer,fse=Tr(),Ok=cx(),cse=new Array(16),dh=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],ph=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],vh=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],mh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],gh=[0,1518500249,1859775393,2400959708,2840853838],bh=[1352829926,1548603684,1836072691,2053994217,0];function I1(){Ok.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}fse(I1,Ok);I1.prototype._update=function(){for(var e=cse,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=this._a|0,v=this._b|0,y=this._c|0,w=this._d|0,M=this._e|0,S=0;S<80;S+=1){var R,C;S<16?(R=xk(r,n,i,o,a,e[dh[S]],gh[0],vh[S]),C=Ak(c,v,y,w,M,e[ph[S]],bh[0],mh[S])):S<32?(R=Mk(r,n,i,o,a,e[dh[S]],gh[1],vh[S]),C=Ek(c,v,y,w,M,e[ph[S]],bh[1],mh[S])):S<48?(R=Sk(r,n,i,o,a,e[dh[S]],gh[2],vh[S]),C=Sk(c,v,y,w,M,e[ph[S]],bh[2],mh[S])):S<64?(R=Ek(r,n,i,o,a,e[dh[S]],gh[3],vh[S]),C=Mk(c,v,y,w,M,e[ph[S]],bh[3],mh[S])):(R=Ak(r,n,i,o,a,e[dh[S]],gh[4],vh[S]),C=xk(c,v,y,w,M,e[ph[S]],bh[4],mh[S])),r=a,a=o,o=tu(i,10),i=n,n=R,c=M,M=w,w=tu(y,10),y=v,v=C}var B=this._b+i+w|0;this._b=this._c+o+M|0,this._c=this._d+a+c|0,this._d=this._e+r+v|0,this._e=this._a+n+y|0,this._a=B};I1.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=lx.alloc?lx.alloc(20):new lx(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};function tu(e,t){return e<<t|e>>>32-t}function xk(e,t,r,n,i,o,a,c){return tu(e+(t^r^n)+o+a|0,c)+i|0}function Mk(e,t,r,n,i,o,a,c){return tu(e+(t&r|~t&n)+o+a|0,c)+i|0}function Sk(e,t,r,n,i,o,a,c){return tu(e+((t|~r)^n)+o+a|0,c)+i|0}function Ek(e,t,r,n,i,o,a,c){return tu(e+(t&n|r&~n)+o+a|0,c)+i|0}function Ak(e,t,r,n,i,o,a,c){return tu(e+(t^(r|~n))+o+a|0,c)+i|0}Rk.exports=I1});var ru=E((JPe,Tk)=>{var Ck=Hn().Buffer;function C1(e,t){this._block=Ck.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}C1.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Ck.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var c=o%n,v=Math.min(i-a,n-c),y=0;y<v;y++)r[c+y]=e[a+y];o+=v,a+=v,o%n===0&&this._update(r)}return this._len+=i,this};C1.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o};C1.prototype._update=function(){throw new Error("_update must be implemented by subclass")};Tk.exports=C1});var Nk=E((QPe,Pk)=>{var lse=Tr(),kk=ru(),hse=Hn().Buffer,dse=[1518500249,1859775393,-1894007588,-899497514],pse=new Array(80);function yh(){this.init(),this._w=pse,kk.call(this,64,56)}lse(yh,kk);yh.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vse(e){return e<<5|e>>>27}function mse(e){return e<<30|e>>>2}function gse(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}yh.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var v=0;v<80;++v){var y=~~(v/20),w=vse(r)+gse(y,n,i,o)+a+t[v]+dse[y]|0;a=o,o=i,i=mse(n),n=r,r=w}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};yh.prototype._hash=function(){var e=hse.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};Pk.exports=yh});var Bk=E((XPe,Lk)=>{var bse=Tr(),qk=ru(),yse=Hn().Buffer,_se=[1518500249,1859775393,-1894007588,-899497514],wse=new Array(80);function _h(){this.init(),this._w=wse,qk.call(this,64,56)}bse(_h,qk);_h.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function xse(e){return e<<1|e>>>31}function Mse(e){return e<<5|e>>>27}function Sse(e){return e<<30|e>>>2}function Ese(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}_h.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=xse(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var v=0;v<80;++v){var y=~~(v/20),w=Mse(r)+Ese(y,n,i,o)+a+t[v]+_se[y]|0;a=o,o=i,i=Sse(n),n=r,r=w}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};_h.prototype._hash=function(){var e=yse.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};Lk.exports=_h});var hx=E((eNe,jk)=>{var Ase=Tr(),Dk=ru(),Ose=Hn().Buffer,Rse=[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],Ise=new Array(64);function wh(){this.init(),this._w=Ise,Dk.call(this,64,56)}Ase(wh,Dk);wh.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Cse(e,t,r){return r^e&(t^r)}function Tse(e,t,r){return e&t|r&(e|t)}function kse(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Pse(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Nse(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function qse(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}wh.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,c=this._f|0,v=this._g|0,y=this._h|0,w=0;w<16;++w)t[w]=e.readInt32BE(w*4);for(;w<64;++w)t[w]=qse(t[w-2])+t[w-7]+Nse(t[w-15])+t[w-16]|0;for(var M=0;M<64;++M){var S=y+Pse(a)+Cse(a,c,v)+Rse[M]+t[M]|0,R=kse(r)+Tse(r,n,i)|0;y=v,v=c,c=a,a=o+S|0,o=i,i=n,n=r,r=S+R|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=c+this._f|0,this._g=v+this._g|0,this._h=y+this._h|0};wh.prototype._hash=function(){var e=Ose.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};jk.exports=wh});var Uk=E((tNe,Fk)=>{var Lse=Tr(),Bse=hx(),Dse=ru(),jse=Hn().Buffer,Fse=new Array(64);function T1(){this.init(),this._w=Fse,Dse.call(this,64,56)}Lse(T1,Bse);T1.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};T1.prototype._hash=function(){var e=jse.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};Fk.exports=T1});var dx=E((rNe,Gk)=>{var Use=Tr(),Kk=ru(),Hse=Hn().Buffer,Hk=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Wse=new Array(160);function xh(){this.init(),this._w=Wse,Kk.call(this,128,112)}Use(xh,Kk);xh.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Wk(e,t,r){return r^e&(t^r)}function zk(e,t,r){return e&t|r&(e|t)}function Vk(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function $k(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function zse(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Vse(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function $se(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Kse(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Kr(e,t){return e>>>0<t>>>0?1:0}xh.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,o=this._dh|0,a=this._eh|0,c=this._fh|0,v=this._gh|0,y=this._hh|0,w=this._al|0,M=this._bl|0,S=this._cl|0,R=this._dl|0,C=this._el|0,B=this._fl|0,N=this._gl|0,q=this._hl|0,H=0;H<32;H+=2)t[H]=e.readInt32BE(H*4),t[H+1]=e.readInt32BE(H*4+4);for(;H<160;H+=2){var D=t[H-30],ee=t[H-15*2+1],ge=zse(D,ee),Z=Vse(ee,D);D=t[H-2*2],ee=t[H-2*2+1];var X=$se(D,ee),V=Kse(ee,D),k=t[H-7*2],m=t[H-7*2+1],s=t[H-16*2],l=t[H-16*2+1],d=Z+m|0,f=ge+k+Kr(d,Z)|0;d=d+V|0,f=f+X+Kr(d,V)|0,d=d+l|0,f=f+s+Kr(d,l)|0,t[H]=f,t[H+1]=d}for(var p=0;p<160;p+=2){f=t[p],d=t[p+1];var g=zk(r,n,i),b=zk(w,M,S),h=Vk(r,w),u=Vk(w,r),_=$k(a,C),A=$k(C,a),x=Hk[p],I=Hk[p+1],j=Wk(a,c,v),O=Wk(C,B,N),L=q+A|0,W=y+_+Kr(L,q)|0;L=L+O|0,W=W+j+Kr(L,O)|0,L=L+I|0,W=W+x+Kr(L,I)|0,L=L+d|0,W=W+f+Kr(L,d)|0;var F=u+b|0,K=h+g+Kr(F,u)|0;y=v,q=N,v=c,N=B,c=a,B=C,C=R+L|0,a=o+W+Kr(C,R)|0,o=i,R=S,i=n,S=M,n=r,M=w,w=L+F|0,r=W+K+Kr(w,L)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+S|0,this._dl=this._dl+R|0,this._el=this._el+C|0,this._fl=this._fl+B|0,this._gl=this._gl+N|0,this._hl=this._hl+q|0,this._ah=this._ah+r+Kr(this._al,w)|0,this._bh=this._bh+n+Kr(this._bl,M)|0,this._ch=this._ch+i+Kr(this._cl,S)|0,this._dh=this._dh+o+Kr(this._dl,R)|0,this._eh=this._eh+a+Kr(this._el,C)|0,this._fh=this._fh+c+Kr(this._fl,B)|0,this._gh=this._gh+v+Kr(this._gl,N)|0,this._hh=this._hh+y+Kr(this._hl,q)|0};xh.prototype._hash=function(){var e=Hse.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};Gk.exports=xh});var Yk=E((nNe,Zk)=>{var Gse=Tr(),Zse=dx(),Yse=ru(),Jse=Hn().Buffer,Qse=new Array(160);function k1(){this.init(),this._w=Qse,Yse.call(this,128,112)}Gse(k1,Zse);k1.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};k1.prototype._hash=function(){var e=Jse.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};Zk.exports=k1});var px=E((Qo,Jk)=>{var Qo=Jk.exports=function(t){t=t.toLowerCase();var r=Qo[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};Qo.sha=Nk();Qo.sha1=Bk();Qo.sha224=Uk();Qo.sha256=hx();Qo.sha384=Yk();Qo.sha512=dx()});var Qk=E((iNe,P1)=>{var nu=(xv(),Pt(kO));if(nu&&nu.default){P1.exports=nu.default;for(let e in nu)P1.exports[e]=nu[e]}else nu&&(P1.exports=nu)});var Xk=E((oNe,N1)=>{var iu=(dw(),Pt(vO));if(iu&&iu.default){N1.exports=iu.default;for(let e in iu)N1.exports[e]=iu[e]}else iu&&(N1.exports=iu)});var nP=E((sNe,rP)=>{var eP=Hn().Buffer,tP=Qk().Transform,Xse=Xk().StringDecoder,eae=Tr();function ji(e){tP.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}eae(ji,tP);ji.prototype.update=function(e,t,r){typeof e=="string"&&(e=eP.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)};ji.prototype.setAutoPadding=function(){};ji.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};ji.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};ji.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};ji.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){n=i}finally{r(n)}};ji.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};ji.prototype._finalOrDigest=function(e){var t=this.__final()||eP.alloc(0);return e&&(t=this._toString(t,e,!0)),t};ji.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new Xse(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};rP.exports=ji});var vx=E((aNe,oP)=>{"use strict";var tae=Tr(),rae=wk(),nae=Ik(),iae=px(),iP=nP();function q1(e){iP.call(this,"digest"),this._hash=e}tae(q1,iP);q1.prototype._update=function(e){this._hash.update(e)};q1.prototype._final=function(){return this._hash.digest()};oP.exports=function(t){return t=t.toLowerCase(),t==="md5"?new rae:t==="rmd160"||t==="ripemd160"?new nae:new q1(iae(t))}});var mx=E((uNe,sP)=>{sP.exports=function(t){if(typeof t!="string")throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.slice(0,2)==="0x"}});var uP=E((fNe,aP)=>{var oae=mx();aP.exports=function(t){return typeof t!="string"?t:oae(t)?t.slice(2):t}});var ou=E((cNe,lP)=>{"use strict";var sae=mx(),fP=uP();function L1(e){var t=e;if(typeof t!="string")throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function cP(e){var t=e.toString(16);return"0x"+t}function aae(e){var t=cP(e);return new Buffer(L1(t.slice(2)),"hex")}function uae(e){if(typeof e!="string")throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return Buffer.byteLength(e,"utf8")}function fae(e,t,r){if(Array.isArray(e)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(Array.isArray(t)!==!0)throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)&&"some"||"every"](function(n){return e.indexOf(n)>=0})}function cae(e){var t=new Buffer(L1(fP(e).replace(/^0+|0+$/g,"")),"hex");return t.toString("utf8")}function lae(e){var t="",r=0,n=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<n;r+=2){var i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t}function hae(e){var t=new Buffer(e,"utf8");return"0x"+L1(t.toString("hex")).replace(/^0+|0+$/g,"")}function dae(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r),i=n.toString(16);t+=i.length<2?"0"+i:i}return"0x"+t}function pae(e,t,r){if(!Array.isArray(e))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof e+"'");if(typeof t!="string")throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof t+"'.");for(var n=[],i=0;i<e.length;i++){var o=e[i][t];if(r&&!o)o="";else if(typeof o!="string")throw new Error("invalid abi");n.push(o)}return n}function vae(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}lP.exports={arrayContainsArray:fae,intToBuffer:aae,getBinarySize:uae,isHexPrefixed:sae,stripHexPrefix:fP,padToEven:L1,intToHex:cP,fromAscii:dae,fromUtf8:hae,toAscii:lae,toUtf8:cae,getKeys:pae,isHexString:vae}});var jf=E(ie=>{"use strict";var mae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D1=m2(),gae=D1.keccak224,bae=D1.keccak384,yae=D1.keccak256,_ae=D1.keccak512,bo=ZT(),gx=E1(),B1=hh(),wi=K2(),hP=vx(),Or=Hn().Buffer;Object.assign(ie,ou());ie.MAX_INTEGER=new wi("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16);ie.TWO_POW256=new wi("10000000000000000000000000000000000000000000000000000000000000000",16);ie.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";ie.SHA3_NULL_S=ie.KECCAK256_NULL_S;ie.KECCAK256_NULL=Or.from(ie.KECCAK256_NULL_S,"hex");ie.SHA3_NULL=ie.KECCAK256_NULL;ie.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";ie.SHA3_RLP_ARRAY_S=ie.KECCAK256_RLP_ARRAY_S;ie.KECCAK256_RLP_ARRAY=Or.from(ie.KECCAK256_RLP_ARRAY_S,"hex");ie.SHA3_RLP_ARRAY=ie.KECCAK256_RLP_ARRAY;ie.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";ie.SHA3_RLP_S=ie.KECCAK256_RLP_S;ie.KECCAK256_RLP=Or.from(ie.KECCAK256_RLP_S,"hex");ie.SHA3_RLP=ie.KECCAK256_RLP;ie.BN=wi;ie.rlp=B1;ie.secp256k1=bo;ie.zeros=function(e){return Or.allocUnsafe(e).fill(0)};ie.zeroAddress=function(){var e=20,t=ie.zeros(e);return ie.bufferToHex(t)};ie.setLengthLeft=ie.setLength=function(e,t,r){var n=ie.zeros(t);return e=ie.toBuffer(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)};ie.setLengthRight=function(e,t){return ie.setLength(e,t,!0)};ie.unpad=ie.stripZeros=function(e){e=ie.stripHexPrefix(e);for(var t=e[0];e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e};ie.toBuffer=function(e){if(!Or.isBuffer(e))if(Array.isArray(e))e=Or.from(e);else if(typeof e=="string")ie.isHexString(e)?e=Or.from(ie.padToEven(ie.stripHexPrefix(e)),"hex"):e=Or.from(e);else if(typeof e=="number")e=ie.intToBuffer(e);else if(e==null)e=Or.allocUnsafe(0);else if(wi.isBN(e))e=e.toArrayLike(Or);else if(e.toArray)e=Or.from(e.toArray());else throw new Error("invalid type");return e};ie.bufferToInt=function(e){return new wi(ie.toBuffer(e)).toNumber()};ie.bufferToHex=function(e){return e=ie.toBuffer(e),"0x"+e.toString("hex")};ie.fromSigned=function(e){return new wi(e).fromTwos(256)};ie.toUnsigned=function(e){return Or.from(e.toTwos(256).toArray())};ie.keccak=function(e,t){switch(e=ie.toBuffer(e),t||(t=256),t){case 224:return gae(e);case 256:return yae(e);case 384:return bae(e);case 512:return _ae(e);default:throw new Error("Invald algorithm: keccak"+t)}};ie.keccak256=function(e){return ie.keccak(e)};ie.sha3=ie.keccak;ie.sha256=function(e){return e=ie.toBuffer(e),hP("sha256").update(e).digest()};ie.ripemd160=function(e,t){e=ie.toBuffer(e);var r=hP("rmd160").update(e).digest();return t===!0?ie.setLength(r,32):r};ie.rlphash=function(e){return ie.keccak(B1.encode(e))};ie.isValidPrivate=function(e){return bo.privateKeyVerify(e)};ie.isValidPublic=function(e,t){return e.length===64?bo.publicKeyVerify(Or.concat([Or.from([4]),e])):t?bo.publicKeyVerify(e):!1};ie.pubToAddress=ie.publicToAddress=function(e,t){return e=ie.toBuffer(e),t&&e.length!==64&&(e=bo.publicKeyConvert(e,!1).slice(1)),gx(e.length===64),ie.keccak(e).slice(-20)};var wae=ie.privateToPublic=function(e){return e=ie.toBuffer(e),bo.publicKeyCreate(e,!1).slice(1)};ie.importPublic=function(e){return e=ie.toBuffer(e),e.length!==64&&(e=bo.publicKeyConvert(e,!1).slice(1)),e};ie.ecsign=function(e,t){var r=bo.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n};ie.hashPersonalMessage=function(e){var t=ie.toBuffer(`Ethereum Signed Message:
|
|
538
|
+
`+e.length.toString());return ie.keccak(Or.concat([t,e]))};ie.ecrecover=function(e,t,r,n){var i=Or.concat([ie.setLength(r,32),ie.setLength(n,32)],64),o=t-27;if(o!==0&&o!==1)throw new Error("Invalid signature v value");var a=bo.recover(e,i,o);return bo.publicKeyConvert(a,!1).slice(1)};ie.toRpcSig=function(e,t,r){if(e!==27&&e!==28)throw new Error("Invalid recovery id");return ie.bufferToHex(Or.concat([ie.setLengthLeft(t,32),ie.setLengthLeft(r,32),ie.toBuffer(e-27)]))};ie.fromRpcSig=function(e){if(e=ie.toBuffer(e),e.length!==65)throw new Error("Invalid signature length");var t=e[64];return t<27&&(t+=27),{v:t,r:e.slice(0,32),s:e.slice(32,64)}};ie.privateToAddress=function(e){return ie.publicToAddress(wae(e))};ie.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)};ie.isZeroAddress=function(e){var t=ie.zeroAddress();return t===ie.addHexPrefix(e)};ie.toChecksumAddress=function(e){e=ie.stripHexPrefix(e).toLowerCase();for(var t=ie.keccak(e).toString("hex"),r="0x",n=0;n<e.length;n++)parseInt(t[n],16)>=8?r+=e[n].toUpperCase():r+=e[n];return r};ie.isValidChecksumAddress=function(e){return ie.isValidAddress(e)&&ie.toChecksumAddress(e)===e};ie.generateAddress=function(e,t){return e=ie.toBuffer(e),t=new wi(t),t.isZero()?t=null:t=Or.from(t.toArray()),ie.rlphash([e,t]).slice(-20)};ie.isPrecompiled=function(e){var t=ie.unpad(e);return t.length===1&&t[0]>=1&&t[0]<=8};ie.addHexPrefix=function(e){return typeof e!="string"||ie.isHexPrefixed(e)?e:"0x"+e};ie.isValidSignature=function(e,t,r,n){var i=new wi("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new wi("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return!(t.length!==32||r.length!==32||e!==27&&e!==28||(t=new wi(t),r=new wi(r),t.isZero()||t.gt(o)||r.isZero()||r.gt(o))||n===!1&&new wi(r).cmp(i)===1)};ie.baToJSON=function(e){if(Or.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var t=[],r=0;r<e.length;r++)t.push(ie.baToJSON(e[r]));return t}};ie.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(i){if(i){var o={};return e._fields.forEach(function(a){o[a]="0x"+e[a].toString("hex")}),o}return ie.baToJSON(this.raw)},e.serialize=function(){return B1.encode(e.raw)},t.forEach(function(i,o){e._fields.push(i.name);function a(){return e.raw[o]}function c(v){v=ie.toBuffer(v),v.toString("hex")==="00"&&!i.allowZero&&(v=Or.allocUnsafe(0)),i.allowLess&&i.length?(v=ie.stripZeros(v),gx(i.length>=v.length,"The field "+i.name+" must not have more "+i.length+" bytes")):!(i.allowZero&&v.length===0)&&i.length&&gx(i.length===v.length,"The field "+i.name+" must have byte length of "+i.length),e.raw[o]=v}Object.defineProperty(e,i.name,{enumerable:!0,configurable:!0,get:a,set:c}),i.default&&(e[i.name]=i.default),i.alias&&Object.defineProperty(e,i.alias,{enumerable:!1,configurable:!0,set:c,get:a})}),r)if(typeof r=="string"&&(r=Or.from(ie.stripHexPrefix(r),"hex")),Or.isBuffer(r)&&(r=B1.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach(function(i,o){e[e._fields[o]]=ie.toBuffer(i)})}else if((typeof r>"u"?"undefined":mae(r))==="object"){var n=Object.keys(r);t.forEach(function(i){n.indexOf(i.name)!==-1&&(e[i.name]=r[i.name]),n.indexOf(i.alias)!==-1&&(e[i.alias]=r[i.alias])})}else throw new Error("invalid data")}});var bx=E((hNe,pP)=>{"use strict";var dP=(e,t)=>function(){let r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,o)=>{t.errorFirst?n.push(function(a,c){if(t.multiArgs){let v=new Array(arguments.length-1);for(let y=1;y<arguments.length;y++)v[y-1]=arguments[y];a?(v.unshift(a),o(v)):i(v)}else a?o(a):i(c)}):n.push(function(a){if(t.multiArgs){let c=new Array(arguments.length-1);for(let v=0;v<arguments.length;v++)c[v]=arguments[v];i(c)}else i(a)}),e.apply(this,n)})};pP.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=i=>{let o=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(o):!t.exclude.some(o)},n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):dP(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(let i in e){let o=e[i];n[i]=typeof o=="function"&&r(i)?dP(o,t):o}return n}});var j1=E((dNe,vP)=>{vP.exports=Mae;var xae=Object.prototype.hasOwnProperty;function Mae(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)xae.call(r,n)&&(e[n]=r[n])}return e}});var gP=E((pNe,mP)=>{mP.exports=Sae;function Sae(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}});var yx=E((vNe,bP)=>{var Eae=j1(),Aae=gP()();bP.exports=tt;function tt(e){let t=this;t.currentProvider=e}tt.prototype.getBalance=Mh(2,"eth_getBalance");tt.prototype.getCode=Mh(2,"eth_getCode");tt.prototype.getTransactionCount=Mh(2,"eth_getTransactionCount");tt.prototype.getStorageAt=Mh(3,"eth_getStorageAt");tt.prototype.call=Mh(2,"eth_call");tt.prototype.protocolVersion=xt("eth_protocolVersion");tt.prototype.syncing=xt("eth_syncing");tt.prototype.coinbase=xt("eth_coinbase");tt.prototype.mining=xt("eth_mining");tt.prototype.hashrate=xt("eth_hashrate");tt.prototype.gasPrice=xt("eth_gasPrice");tt.prototype.accounts=xt("eth_accounts");tt.prototype.blockNumber=xt("eth_blockNumber");tt.prototype.getBlockTransactionCountByHash=xt("eth_getBlockTransactionCountByHash");tt.prototype.getBlockTransactionCountByNumber=xt("eth_getBlockTransactionCountByNumber");tt.prototype.getUncleCountByBlockHash=xt("eth_getUncleCountByBlockHash");tt.prototype.getUncleCountByBlockNumber=xt("eth_getUncleCountByBlockNumber");tt.prototype.sign=xt("eth_sign");tt.prototype.sendTransaction=xt("eth_sendTransaction");tt.prototype.sendRawTransaction=xt("eth_sendRawTransaction");tt.prototype.estimateGas=xt("eth_estimateGas");tt.prototype.getBlockByHash=xt("eth_getBlockByHash");tt.prototype.getBlockByNumber=xt("eth_getBlockByNumber");tt.prototype.getTransactionByHash=xt("eth_getTransactionByHash");tt.prototype.getTransactionByBlockHashAndIndex=xt("eth_getTransactionByBlockHashAndIndex");tt.prototype.getTransactionByBlockNumberAndIndex=xt("eth_getTransactionByBlockNumberAndIndex");tt.prototype.getTransactionReceipt=xt("eth_getTransactionReceipt");tt.prototype.getUncleByBlockHashAndIndex=xt("eth_getUncleByBlockHashAndIndex");tt.prototype.getUncleByBlockNumberAndIndex=xt("eth_getUncleByBlockNumberAndIndex");tt.prototype.getCompilers=xt("eth_getCompilers");tt.prototype.compileLLL=xt("eth_compileLLL");tt.prototype.compileSolidity=xt("eth_compileSolidity");tt.prototype.compileSerpent=xt("eth_compileSerpent");tt.prototype.newFilter=xt("eth_newFilter");tt.prototype.newBlockFilter=xt("eth_newBlockFilter");tt.prototype.newPendingTransactionFilter=xt("eth_newPendingTransactionFilter");tt.prototype.uninstallFilter=xt("eth_uninstallFilter");tt.prototype.getFilterChanges=xt("eth_getFilterChanges");tt.prototype.getFilterLogs=xt("eth_getFilterLogs");tt.prototype.getLogs=xt("eth_getLogs");tt.prototype.getWork=xt("eth_getWork");tt.prototype.submitWork=xt("eth_submitWork");tt.prototype.submitHashrate=xt("eth_submitHashrate");tt.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(Oae(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function xt(e){return function(){let t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function Mh(e,t){return function(){let r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function Oae(e){return Eae({id:Aae(),jsonrpc:"2.0",params:[]},e)}});var IP=E((mNe,_x)=>{"use strict";var Ff=typeof Reflect=="object"?Reflect:null,yP=Ff&&typeof Ff.apply=="function"?Ff.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},F1;Ff&&typeof Ff.ownKeys=="function"?F1=Ff.ownKeys:Object.getOwnPropertySymbols?F1=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:F1=function(t){return Object.getOwnPropertyNames(t)};function Rae(e){console&&console.warn&&console.warn(e)}var wP=Number.isNaN||function(t){return t!==t};function Xt(){Xt.init.call(this)}_x.exports=Xt;_x.exports.once=kae;Xt.EventEmitter=Xt;Xt.prototype._events=void 0;Xt.prototype._eventsCount=0;Xt.prototype._maxListeners=void 0;var _P=10;function U1(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Xt,"defaultMaxListeners",{enumerable:!0,get:function(){return _P},set:function(e){if(typeof e!="number"||e<0||wP(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");_P=e}});Xt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Xt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||wP(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function xP(e){return e._maxListeners===void 0?Xt.defaultMaxListeners:e._maxListeners}Xt.prototype.getMaxListeners=function(){return xP(this)};Xt.prototype.emit=function(t){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=t==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var v=o[t];if(v===void 0)return!1;if(typeof v=="function")yP(v,this,r);else for(var y=v.length,w=OP(v,y),n=0;n<y;++n)yP(w[n],this,r);return!0};function MP(e,t,r,n){var i,o,a;if(U1(r),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),a===void 0)a=o[t]=r,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),i=xP(e),i>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,Rae(c)}return e}Xt.prototype.addListener=function(t,r){return MP(this,t,r,!1)};Xt.prototype.on=Xt.prototype.addListener;Xt.prototype.prependListener=function(t,r){return MP(this,t,r,!0)};function Iae(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function SP(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=Iae.bind(n);return i.listener=r,n.wrapFn=i,i}Xt.prototype.once=function(t,r){return U1(r),this.on(t,SP(this,t,r)),this};Xt.prototype.prependOnceListener=function(t,r){return U1(r),this.prependListener(t,SP(this,t,r)),this};Xt.prototype.removeListener=function(t,r){var n,i,o,a,c;if(U1(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){c=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():Cae(n,o),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,c||r)}return this};Xt.prototype.off=Xt.prototype.removeListener;Xt.prototype.removeAllListeners=function(t){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(i=0;i<o.length;++i)a=o[i],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(t,r[i]);return this};function EP(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Tae(i):OP(i,i.length)}Xt.prototype.listeners=function(t){return EP(this,t,!0)};Xt.prototype.rawListeners=function(t){return EP(this,t,!1)};Xt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):AP.call(e,t)};Xt.prototype.listenerCount=AP;function AP(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Xt.prototype.eventNames=function(){return this._eventsCount>0?F1(this._events):[]};function OP(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function Cae(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Tae(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function kae(e,t){return new Promise(function(r,n){function i(a){e.removeListener(t,o),n(a)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",i),r([].slice.call(arguments))}RP(e,t,o,{once:!0}),t!=="error"&&Pae(e,i,{once:!0})})}function Pae(e,t,r){typeof e.on=="function"&&RP(e,"error",t,r)}function RP(e,t,r,n){if(typeof e.on=="function")n.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}});var PP=E((gNe,kP)=>{var Nae=$o(),TP=IP(),wx=typeof Reflect=="object"?Reflect:null,qae=wx&&typeof wx.apply=="function"?wx.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)};kP.exports=xx;function xx(){TP.call(this)}Nae.inherits(xx,TP);xx.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n=e==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[e];if(c===void 0)return!1;if(typeof c=="function")CP(c,this,t);else for(var v=c.length,y=Lae(c,v),r=0;r<v;++r)CP(y[r],this,t);return!0};function CP(e,t,r){try{qae(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Lae(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}});var BP=E((_Ne,LP)=>{var bNe=yx(),yNe=bx(),Bae=PP(),Dae=1e3,jae=(e,t)=>e+t,NP=["sync","latest"],Mx=class extends Bae{constructor(t={}){super(),this._blockResetDuration=t.blockResetDuration||20*Dae,this._blockResetTimeout,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t,r){!NP.includes(t)||this._maybeStart()}_onRemoveListener(t,r){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){!this._isRunning||(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return NP.map(t=>this.listenerCount(t)).reduce(jae)}_newPotentialLatest(t){let r=this._currentBlock;r&&qP(t)<=qP(r)||this._setCurrentBlock(t)}_setCurrentBlock(t){let r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}};LP.exports=Mx;function qP(e){return Number.parseInt(e,16)}});var Ex=E((wNe,jP)=>{var Fae=bx(),Uae=BP(),Hae=1e3,Sx=class extends Uae{constructor(t={}){if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");let r=t.pollingInterval||20*Hae,n=t.retryTimeout||r/10,i=t.keepEventLoopActive!==void 0?t.keepEventLoopActive:!0,o=t.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:r},t)),this._provider=t.provider,this._pollingInterval=r,this._retryTimeout=n,this._keepEventLoopActive=i,this._setSkipCacheFlag=o}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch(t=>this.emit("error",t))}async _performSync(){for(;this._isRunning;)try{await this._updateLatestBlock(),await DP(this._pollingInterval,!this._keepEventLoopActive)}catch(t){let r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
539
|
+
${t.stack}`);try{this.emit("error",r)}catch{console.error(r)}await DP(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){let t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){let t={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0);let r=await Fae(n=>this._provider.sendAsync(t,n))();if(r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
540
|
+
${r.error}`);return r.result}};jP.exports=Sx;function DP(e,t){return new Promise(r=>{let n=setTimeout(r,e);n.unref&&t&&n.unref()})}});var Ax=E((xNe,FP)=>{var Wae=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis;FP.exports=Wae});var Ox=E((MNe,UP)=>{var zae=Ax(),Vae=typeof self=="object"&&self&&self.Object===Object&&self,$ae=zae||Vae||Function("return this")();UP.exports=$ae});var Rx=E((SNe,HP)=>{var Kae=Ox(),Gae=Kae.Symbol;HP.exports=Gae});var $P=E((ENe,VP)=>{var WP=Rx(),zP=Object.prototype,Zae=zP.hasOwnProperty,Yae=zP.toString,Sh=WP?WP.toStringTag:void 0;function Jae(e){var t=Zae.call(e,Sh),r=e[Sh];try{e[Sh]=void 0;var n=!0}catch{}var i=Yae.call(e);return n&&(t?e[Sh]=r:delete e[Sh]),i}VP.exports=Jae});var GP=E((ANe,KP)=>{var Qae=Object.prototype,Xae=Qae.toString;function eue(e){return Xae.call(e)}KP.exports=eue});var H1=E((ONe,JP)=>{var ZP=Rx(),tue=$P(),rue=GP(),nue="[object Null]",iue="[object Undefined]",YP=ZP?ZP.toStringTag:void 0;function oue(e){return e==null?e===void 0?iue:nue:YP&&YP in Object(e)?tue(e):rue(e)}JP.exports=oue});var Ix=E((RNe,QP)=>{function sue(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}QP.exports=sue});var eN=E((INe,XP)=>{var aue=H1(),uue=Ix(),fue="[object AsyncFunction]",cue="[object Function]",lue="[object GeneratorFunction]",hue="[object Proxy]";function due(e){if(!uue(e))return!1;var t=aue(e);return t==cue||t==lue||t==fue||t==hue}XP.exports=due});var Cx=E((CNe,tN)=>{var pue=9007199254740991;function vue(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pue}tN.exports=vue});var Eh=E((TNe,rN)=>{var mue=eN(),gue=Cx();function bue(e){return e!=null&&gue(e.length)&&!mue(e)}rN.exports=bue});var Tx=E((W1,nN)=>{"use strict";Object.defineProperty(W1,"__esModule",{value:!0});W1.default={};nN.exports=W1.default});var Uf=E((kNe,iN)=>{function yue(){}iN.exports=yue});var V1=E((z1,oN)=>{"use strict";Object.defineProperty(z1,"__esModule",{value:!0});z1.default=_ue;function _ue(e){return function(){if(e!==null){var t=e;e=null,t.apply(this,arguments)}}}oN.exports=z1.default});var aN=E(($1,sN)=>{"use strict";Object.defineProperty($1,"__esModule",{value:!0});$1.default=function(e){return kx&&e[kx]&&e[kx]()};var kx=typeof Symbol=="function"&&Symbol.iterator;sN.exports=$1.default});var fN=E((PNe,uN)=>{function wue(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}uN.exports=wue});var K1=E((NNe,cN)=>{function xue(e){return e!=null&&typeof e=="object"}cN.exports=xue});var hN=E((qNe,lN)=>{var Mue=H1(),Sue=K1(),Eue="[object Arguments]";function Aue(e){return Sue(e)&&Mue(e)==Eue}lN.exports=Aue});var mN=E((LNe,vN)=>{var dN=hN(),Oue=K1(),pN=Object.prototype,Rue=pN.hasOwnProperty,Iue=pN.propertyIsEnumerable,Cue=dN(function(){return arguments}())?dN:function(e){return Oue(e)&&Rue.call(e,"callee")&&!Iue.call(e,"callee")};vN.exports=Cue});var Px=E((BNe,gN)=>{var Tue=Array.isArray;gN.exports=Tue});var yN=E((DNe,bN)=>{function kue(){return!1}bN.exports=kue});var MN=E((Ah,Hf)=>{var Pue=Ox(),Nue=yN(),xN=typeof Ah=="object"&&Ah&&!Ah.nodeType&&Ah,_N=xN&&typeof Hf=="object"&&Hf&&!Hf.nodeType&&Hf,que=_N&&_N.exports===xN,wN=que?Pue.Buffer:void 0,Lue=wN?wN.isBuffer:void 0,Bue=Lue||Nue;Hf.exports=Bue});var EN=E((jNe,SN)=>{var Due=9007199254740991,jue=/^(?:0|[1-9]\d*)$/;function Fue(e,t){var r=typeof e;return t=t??Due,!!t&&(r=="number"||r!="symbol"&&jue.test(e))&&e>-1&&e%1==0&&e<t}SN.exports=Fue});var ON=E((FNe,AN)=>{var Uue=H1(),Hue=Cx(),Wue=K1(),zue="[object Arguments]",Vue="[object Array]",$ue="[object Boolean]",Kue="[object Date]",Gue="[object Error]",Zue="[object Function]",Yue="[object Map]",Jue="[object Number]",Que="[object Object]",Xue="[object RegExp]",efe="[object Set]",tfe="[object String]",rfe="[object WeakMap]",nfe="[object ArrayBuffer]",ife="[object DataView]",ofe="[object Float32Array]",sfe="[object Float64Array]",afe="[object Int8Array]",ufe="[object Int16Array]",ffe="[object Int32Array]",cfe="[object Uint8Array]",lfe="[object Uint8ClampedArray]",hfe="[object Uint16Array]",dfe="[object Uint32Array]",vr={};vr[ofe]=vr[sfe]=vr[afe]=vr[ufe]=vr[ffe]=vr[cfe]=vr[lfe]=vr[hfe]=vr[dfe]=!0;vr[zue]=vr[Vue]=vr[nfe]=vr[$ue]=vr[ife]=vr[Kue]=vr[Gue]=vr[Zue]=vr[Yue]=vr[Jue]=vr[Que]=vr[Xue]=vr[efe]=vr[tfe]=vr[rfe]=!1;function pfe(e){return Wue(e)&&Hue(e.length)&&!!vr[Uue(e)]}AN.exports=pfe});var IN=E((UNe,RN)=>{function vfe(e){return function(t){return e(t)}}RN.exports=vfe});var TN=E((Oh,Wf)=>{var mfe=Ax(),CN=typeof Oh=="object"&&Oh&&!Oh.nodeType&&Oh,Rh=CN&&typeof Wf=="object"&&Wf&&!Wf.nodeType&&Wf,gfe=Rh&&Rh.exports===CN,Nx=gfe&&mfe.process,bfe=function(){try{var e=Rh&&Rh.require&&Rh.require("util").types;return e||Nx&&Nx.binding&&Nx.binding("util")}catch{}}();Wf.exports=bfe});var qN=E((HNe,NN)=>{var yfe=ON(),_fe=IN(),kN=TN(),PN=kN&&kN.isTypedArray,wfe=PN?_fe(PN):yfe;NN.exports=wfe});var BN=E((WNe,LN)=>{var xfe=fN(),Mfe=mN(),Sfe=Px(),Efe=MN(),Afe=EN(),Ofe=qN(),Rfe=Object.prototype,Ife=Rfe.hasOwnProperty;function Cfe(e,t){var r=Sfe(e),n=!r&&Mfe(e),i=!r&&!n&&Efe(e),o=!r&&!n&&!i&&Ofe(e),a=r||n||i||o,c=a?xfe(e.length,String):[],v=c.length;for(var y in e)(t||Ife.call(e,y))&&!(a&&(y=="length"||i&&(y=="offset"||y=="parent")||o&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||Afe(y,v)))&&c.push(y);return c}LN.exports=Cfe});var jN=E((zNe,DN)=>{var Tfe=Object.prototype;function kfe(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Tfe;return e===r}DN.exports=kfe});var UN=E((VNe,FN)=>{function Pfe(e,t){return function(r){return e(t(r))}}FN.exports=Pfe});var WN=E(($Ne,HN)=>{var Nfe=UN(),qfe=Nfe(Object.keys,Object);HN.exports=qfe});var VN=E((KNe,zN)=>{var Lfe=jN(),Bfe=WN(),Dfe=Object.prototype,jfe=Dfe.hasOwnProperty;function Ffe(e){if(!Lfe(e))return Bfe(e);var t=[];for(var r in Object(e))jfe.call(e,r)&&r!="constructor"&&t.push(r);return t}zN.exports=Ffe});var KN=E((GNe,$N)=>{var Ufe=BN(),Hfe=VN(),Wfe=Eh();function zfe(e){return Wfe(e)?Ufe(e):Hfe(e)}$N.exports=zfe});var ZN=E((G1,GN)=>{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});G1.default=ece;var Vfe=Eh(),$fe=qx(Vfe),Kfe=aN(),Gfe=qx(Kfe),Zfe=KN(),Yfe=qx(Zfe);function qx(e){return e&&e.__esModule?e:{default:e}}function Jfe(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}function Qfe(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}function Xfe(e){var t=(0,Yfe.default)(e),r=-1,n=t.length;return function i(){var o=t[++r];return o==="__proto__"?i():r<n?{value:e[o],key:o}:null}}function ece(e){if((0,$fe.default)(e))return Jfe(e);var t=(0,Gfe.default)(e);return t?Qfe(t):Xfe(e)}GN.exports=G1.default});var Y1=E((Z1,YN)=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.default=tce;function tce(e){return function(){if(e===null)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,arguments)}}YN.exports=Z1.default});var Lx=E((J1,JN)=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});J1.default=hce;var rce=Uf(),nce=Ih(rce),ice=V1(),oce=Ih(ice),sce=ZN(),ace=Ih(sce),uce=Y1(),fce=Ih(uce),cce=Tx(),lce=Ih(cce);function Ih(e){return e&&e.__esModule?e:{default:e}}function hce(e){return function(t,r,n){if(n=(0,oce.default)(n||nce.default),e<=0||!t)return n(null);var i=(0,ace.default)(t),o=!1,a=0,c=!1;function v(w,M){if(a-=1,w)o=!0,n(w);else{if(M===lce.default||o&&a<=0)return o=!0,n(null);c||y()}}function y(){for(c=!0;a<e&&!o;){var w=i();if(w===null){o=!0,a<=0&&n(null);return}a+=1,r(w.value,w.key,(0,fce.default)(v))}c=!1}y()}}JN.exports=J1.default});var Ch=E((Q1,QN)=>{"use strict";Object.defineProperty(Q1,"__esModule",{value:!0});Q1.default=dce;function dce(e,t){t=t|0;for(var r=Math.max(e.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=e[t+i];return n}QN.exports=Q1.default});var eq=E((X1,XN)=>{"use strict";Object.defineProperty(X1,"__esModule",{value:!0});X1.default=function(e){return function(){var t=(0,vce.default)(arguments),r=t.pop();e.call(this,t,r)}};var pce=Ch(),vce=mce(pce);function mce(e){return e&&e.__esModule?e:{default:e}}XN.exports=X1.default});var nq=E(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.hasNextTick=Xo.hasSetImmediate=void 0;Xo.fallback=tq;Xo.wrap=rq;var gce=Ch(),bce=yce(gce);function yce(e){return e&&e.__esModule?e:{default:e}}var _ce=Xo.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,wce=Xo.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function tq(e){setTimeout(e,0)}function rq(e){return function(t){var r=(0,bce.default)(arguments,1);e(function(){t.apply(null,r)})}}var em;_ce?em=setImmediate:wce?em=process.nextTick:em=tq;Xo.default=rq(em)});var sq=E((tm,oq)=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.default=Rce;var xce=Ix(),Mce=Bx(xce),Sce=eq(),Ece=Bx(Sce),Ace=nq(),Oce=Bx(Ace);function Bx(e){return e&&e.__esModule?e:{default:e}}function Rce(e){return(0,Ece.default)(function(t,r){var n;try{n=e.apply(this,t)}catch(i){return r(i)}(0,Mce.default)(n)&&typeof n.then=="function"?n.then(function(i){iq(r,null,i)},function(i){iq(r,i.message?i:new Error(i))}):r(null,n)})}function iq(e,t,r){try{e(t,r)}catch(n){(0,Oce.default)(Ice,n)}}function Ice(e){throw e}oq.exports=tm.default});var Ds=E(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.isAsync=void 0;var Cce=sq(),Tce=kce(Cce);function kce(e){return e&&e.__esModule?e:{default:e}}var Pce=typeof Symbol=="function";function aq(e){return Pce&&e[Symbol.toStringTag]==="AsyncFunction"}function Nce(e){return aq(e)?(0,Tce.default)(e):e}Th.default=Nce;Th.isAsync=aq});var cq=E((rm,fq)=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.default=jce;var qce=Lx(),Lce=uq(qce),Bce=Ds(),Dce=uq(Bce);function uq(e){return e&&e.__esModule?e:{default:e}}function jce(e,t,r,n){(0,Lce.default)(t)(e,(0,Dce.default)(r),n)}fq.exports=rm.default});var Dx=E((nm,lq)=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.default=Fce;function Fce(e,t){return function(r,n,i){return e(r,t,n,i)}}lq.exports=nm.default});var jx=E((im,hq)=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.default=function(e,t,r){var n=(0,Hce.default)(e)?nle:ile;n(e,(0,rle.default)(t),r)};var Uce=Eh(),Hce=js(Uce),Wce=Tx(),zce=js(Wce),Vce=cq(),$ce=js(Vce),Kce=Dx(),Gce=js(Kce),Zce=Uf(),Yce=js(Zce),Jce=V1(),Qce=js(Jce),Xce=Y1(),ele=js(Xce),tle=Ds(),rle=js(tle);function js(e){return e&&e.__esModule?e:{default:e}}function nle(e,t,r){r=(0,Qce.default)(r||Yce.default);var n=0,i=0,o=e.length;o===0&&r(null);function a(c,v){c?r(c):(++i===o||v===zce.default)&&r(null)}for(;n<o;n++)t(e[n],n,(0,ele.default)(a))}var ile=(0,Gce.default)($ce.default,1/0);hq.exports=im.default});var vq=E((om,pq)=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.default=fle;var ole=jx(),sle=dq(ole),ale=Ds(),ule=dq(ale);function dq(e){return e&&e.__esModule?e:{default:e}}function fle(e){return function(t,r,n){return e(sle.default,t,(0,ule.default)(r),n)}}pq.exports=om.default});var bq=E((sm,gq)=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.default=ple;var cle=Uf(),lle=mq(cle),hle=Ds(),dle=mq(hle);function mq(e){return e&&e.__esModule?e:{default:e}}function ple(e,t,r,n){n=n||lle.default,t=t||[];var i=[],o=0,a=(0,dle.default)(r);e(t,function(c,v,y){var w=o++;a(c,function(M,S){i[w]=S,y(M)})},function(c){n(c,i)})}gq.exports=sm.default});var wq=E((am,_q)=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var vle=vq(),mle=yq(vle),gle=bq(),ble=yq(gle);function yq(e){return e&&e.__esModule?e:{default:e}}am.default=(0,mle.default)(ble.default);_q.exports=am.default});var Mq=E((um,xq)=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.default=yle;function yle(e){return function(t,r,n){return e(t,n)}}xq.exports=um.default});var Eq=E((fm,Sq)=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.default=Ale;var _le=Lx(),wle=Fx(_le),xle=Mq(),Mle=Fx(xle),Sle=Ds(),Ele=Fx(Sle);function Fx(e){return e&&e.__esModule?e:{default:e}}function Ale(e,t,r,n){(0,wle.default)(t)(e,(0,Mle.default)((0,Ele.default)(r)),n)}Sq.exports=fm.default});var Rq=E((cm,Oq)=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var Ole=Eq(),Rle=Aq(Ole),Ile=Dx(),Cle=Aq(Ile);function Aq(e){return e&&e.__esModule?e:{default:e}}cm.default=(0,Cle.default)(Rle.default,1);Oq.exports=cm.default});var Tq=E((JNe,Cq)=>{var Iq=gf().EventEmitter,Tle=$o().inherits;Cq.exports=kh;Tle(kh,Iq);function kh(){let e=this;Iq.call(e),e.isLocked=!0}kh.prototype.go=function(){let e=this;e.isLocked=!1,e.emit("unlock")};kh.prototype.stop=function(){let e=this;e.isLocked=!0,e.emit("lock")};kh.prototype.await=function(e){let t=this;t.isLocked?t.once("unlock",e):setTimeout(e)}});var Lq=E((QNe,qq)=>{"use strict";var lm,rt,kq={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
541
|
+
`,r:"\r",t:" "},Ux;function Fs(e){throw{name:"SyntaxError",message:e,at:lm,text:Ux}}function kt(e){return e&&e!==rt&&Fs("Expected '"+e+"' instead of '"+rt+"'"),rt=Ux.charAt(lm),lm+=1,rt}function Pq(){var e,t="";for(rt==="-"&&(t="-",kt("-"));rt>="0"&&rt<="9";)t+=rt,kt();if(rt===".")for(t+=".";kt()&&rt>="0"&&rt<="9";)t+=rt;if(rt==="e"||rt==="E")for(t+=rt,kt(),(rt==="-"||rt==="+")&&(t+=rt,kt());rt>="0"&&rt<="9";)t+=rt,kt();return e=Number(t),isFinite(e)||Fs("Bad number"),e}function Nq(){var e,t,r="",n;if(rt==='"')for(;kt();){if(rt==='"')return kt(),r;if(rt==="\\")if(kt(),rt==="u"){for(n=0,t=0;t<4&&(e=parseInt(kt(),16),!!isFinite(e));t+=1)n=n*16+e;r+=String.fromCharCode(n)}else if(typeof kq[rt]=="string")r+=kq[rt];else break;else r+=rt}Fs("Bad string")}function es(){for(;rt&&rt<=" ";)kt()}function kle(){switch(rt){case"t":return kt("t"),kt("r"),kt("u"),kt("e"),!0;case"f":return kt("f"),kt("a"),kt("l"),kt("s"),kt("e"),!1;case"n":return kt("n"),kt("u"),kt("l"),kt("l"),null;default:Fs("Unexpected '"+rt+"'")}}function Ple(){var e=[];if(rt==="["){if(kt("["),es(),rt==="]")return kt("]"),e;for(;rt;){if(e.push(hm()),es(),rt==="]")return kt("]"),e;kt(","),es()}}Fs("Bad array")}function Nle(){var e,t={};if(rt==="{"){if(kt("{"),es(),rt==="}")return kt("}"),t;for(;rt;){if(e=Nq(),es(),kt(":"),Object.prototype.hasOwnProperty.call(t,e)&&Fs('Duplicate key "'+e+'"'),t[e]=hm(),es(),rt==="}")return kt("}"),t;kt(","),es()}}Fs("Bad object")}function hm(){switch(es(),rt){case"{":return Nle();case"[":return Ple();case'"':return Nq();case"-":return Pq();default:return rt>="0"&&rt<="9"?Pq():kle()}}qq.exports=function(e,t){var r;return Ux=e,lm=0,rt=" ",r=hm(),es(),rt&&Fs("Syntax error"),typeof t=="function"?function n(i,o){var a,c,v=i[o];if(v&&typeof v=="object")for(a in hm)Object.prototype.hasOwnProperty.call(v,a)&&(c=n(v,a),typeof c>"u"?delete v[a]:v[a]=c);return t.call(i,o,v)}({"":r},""):r}});var Dq=E((XNe,Bq)=>{"use strict";var Hx=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,ti,dm,qle={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},su;function Wx(e){return Hx.lastIndex=0,Hx.test(e)?'"'+e.replace(Hx,function(t){var r=qle[t];return typeof r=="string"?r:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function pm(e,t){var r,n,i,o,a=ti,c,v=t[e];switch(v&&typeof v=="object"&&typeof v.toJSON=="function"&&(v=v.toJSON(e)),typeof su=="function"&&(v=su.call(t,e,v)),typeof v){case"string":return Wx(v);case"number":return isFinite(v)?String(v):"null";case"boolean":case"null":return String(v);case"object":if(!v)return"null";if(ti+=dm,c=[],Object.prototype.toString.apply(v)==="[object Array]"){for(o=v.length,r=0;r<o;r+=1)c[r]=pm(r,v)||"null";return i=c.length===0?"[]":ti?`[
|
|
542
|
+
`+ti+c.join(`,
|
|
543
|
+
`+ti)+`
|
|
544
|
+
`+a+"]":"["+c.join(",")+"]",ti=a,i}if(su&&typeof su=="object")for(o=su.length,r=0;r<o;r+=1)n=su[r],typeof n=="string"&&(i=pm(n,v),i&&c.push(Wx(n)+(ti?": ":":")+i));else for(n in v)Object.prototype.hasOwnProperty.call(v,n)&&(i=pm(n,v),i&&c.push(Wx(n)+(ti?": ":":")+i));return i=c.length===0?"{}":ti?`{
|
|
545
|
+
`+ti+c.join(`,
|
|
546
|
+
`+ti)+`
|
|
547
|
+
`+a+"}":"{"+c.join(",")+"}",ti=a,i;default:}}Bq.exports=function(e,t,r){var n;if(ti="",dm="",typeof r=="number")for(n=0;n<r;n+=1)dm+=" ";else typeof r=="string"&&(dm=r);if(su=t,t&&typeof t!="function"&&(typeof t!="object"||typeof t.length!="number"))throw new Error("JSON.stringify");return pm("",{"":e})}});var jq=E(zx=>{"use strict";zx.parse=Lq();zx.stringify=Dq()});var Vx=E((tqe,Fq)=>{"use strict";var vm=typeof JSON<"u"?JSON:jq(),Lle=Array.isArray||function(e){return{}.toString.call(e)==="[object Array]"},Ble=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r};Fq.exports=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var r=t.space||"";typeof r=="number"&&(r=Array(r+1).join(" "));var n=typeof t.cycles=="boolean"?t.cycles:!1,i=t.replacer||function(c,v){return v},o=t.cmp&&function(c){return function(v){return function(y,w){var M={key:y,value:v[y]},S={key:w,value:v[w]};return c(M,S)}}}(t.cmp),a=[];return function c(v,y,w,M){var S=r?`
|
|
548
|
+
`+new Array(M+1).join(r):"",R=r?": ":":";if(w&&w.toJSON&&typeof w.toJSON=="function"&&(w=w.toJSON()),w=i.call(v,y,w),w!==void 0){if(typeof w!="object"||w===null)return vm.stringify(w);if(Lle(w)){for(var q=[],C=0;C<w.length;C++){var B=c(w,C,w[C],M+1)||vm.stringify(null);q.push(S+r+B)}return"["+q.join(",")+S+"]"}if(a.indexOf(w)!==-1){if(n)return vm.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}else a.push(w);for(var N=Ble(w).sort(o&&o(w)),q=[],C=0;C<N.length;C++){var y=N[C],H=c(w,y,w[y],M+1);if(!!H){var D=vm.stringify(y)+R+H;q.push(S+r+D)}}return a.splice(a.indexOf(w),1),"{"+q.join(",")+S+"}"}}({"":e},"",e,0)}});var Kx=E((rqe,zq)=>{var Dle=Vx();zq.exports={cacheIdentifierForPayload:jle,canCache:Uq,blockTagForPayload:Fle,paramsWithoutBlockTag:Hq,blockTagParamIndex:$x,cacheTypeForPayload:Wq};function jle(e,t={}){if(!Uq(e))return null;let{includeBlockRef:r}=t,n=r?e.params:Hq(e);return e.method+":"+Dle(n)}function Uq(e){return Wq(e)!=="never"}function Fle(e){var t=$x(e);return t>=e.params.length?null:e.params[t]}function Hq(e){var t=$x(e);return t>=e.params.length?e.params:e.method==="eth_getBlockByNumber"?e.params.slice(1):e.params.slice(0,t)}function $x(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function Wq(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}});var $q=E((nqe,Vq)=>{Vq.exports=Ule;function Ule(){return Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}});var mm=E((iqe,Kq)=>{var Hle=$q(),Wle=j1();Kq.exports=zle;function zle(e){return Wle({id:Hle(),jsonrpc:"2.0",params:[]},e)}});var Yq=E((sqe,Zq)=>{var Gq=gf().EventEmitter,Vle=$o().inherits,Gr=jf(),$le=Ex(),Kle=wq(),Gle=Rq(),Zle=Tq(),oqe=Kx(),Yle=mm(),Jle=function(){};Zq.exports=ri;Vle(ri,Gq);function ri(e){let t=this;Gq.call(t),t.setMaxListeners(30),e=e||{};let r={sendAsync:t._handleAsync.bind(t)},n=e.blockTrackerProvider||r;t._blockTracker=e.blockTracker||new $le({provider:n,pollingInterval:e.pollingInterval||4e3,setSkipCacheFlag:!0}),t._ready=new Zle,t.currentBlock=null,t._providers=[]}ri.prototype.start=function(e=Jle){let t=this;t._ready.go(),t._blockTracker.on("latest",r=>{t._getBlockByNumberWithRetry(r,(n,i)=>{if(n){this.emit("error",n);return}if(!i){console.log(i),this.emit("error",new Error("Could not find block"));return}let o=Qle(i);t._setCurrentBlock(o),t.emit("rawBlock",i),t.emit("latest",i)})}),t._blockTracker.on("sync",t.emit.bind(t,"sync")),t._blockTracker.on("error",t.emit.bind(t,"error")),t._running=!0,t.emit("start")};ri.prototype.stop=function(){let e=this;e._blockTracker.removeAllListeners(),e._running=!1,e.emit("stop")};ri.prototype.isRunning=function(){return this._running};ri.prototype.addProvider=function(e,t){let r=this;typeof t=="number"?r._providers.splice(t,0,e):r._providers.push(e),e.setEngine(this)};ri.prototype.removeProvider=function(e){let t=this,r=t._providers.indexOf(e);if(r<0)throw new Error("Provider not found.");t._providers.splice(r,1)};ri.prototype.send=function(e){throw new Error("Web3ProviderEngine does not support synchronous requests.")};ri.prototype.sendAsync=function(e,t){let r=this;r._ready.await(function(){Array.isArray(e)?Kle(e,r._handleAsync.bind(r),t):r._handleAsync(e,t)})};ri.prototype._getBlockByNumberWithRetry=function(e,t){let r=this,n=5;i();return;function i(){r._getBlockByNumber(e,o)}function o(a,c){if(a)return t(a);if(!c)if(n>0){n--,setTimeout(function(){i()},1e3);return}else{t(null,null);return}t(null,c)}};ri.prototype._getBlockByNumber=function(e,t){let r=Yle({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,(n,i)=>n?t(n):t(null,i.result))};ri.prototype._handleAsync=function(e,t){var r=this,n=-1,i=null,o=null,a=[];c();function c(y){if(n+=1,a.unshift(y),n>=r._providers.length)v(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{var w=r._providers[n];w.handleRequest(e,c,v)}catch(M){v(M)}}function v(y,w){o=y,i=w,Gle(a,function(M,S){M?M(o,i,S):S()},function(){var M={id:e.id,jsonrpc:e.jsonrpc,result:i};o!=null?(M.error={message:o.stack||o.message||o,code:-32e3},t(o,M)):t(null,M)})}};ri.prototype._setCurrentBlock=function(e){let t=this;t.currentBlock=e,t.emit("block",e)};function Qle(e){return{number:Gr.toBuffer(e.number),hash:Gr.toBuffer(e.hash),parentHash:Gr.toBuffer(e.parentHash),nonce:Gr.toBuffer(e.nonce),mixHash:Gr.toBuffer(e.mixHash),sha3Uncles:Gr.toBuffer(e.sha3Uncles),logsBloom:Gr.toBuffer(e.logsBloom),transactionsRoot:Gr.toBuffer(e.transactionsRoot),stateRoot:Gr.toBuffer(e.stateRoot),receiptsRoot:Gr.toBuffer(e.receiptRoot||e.receiptsRoot),miner:Gr.toBuffer(e.miner),difficulty:Gr.toBuffer(e.difficulty),totalDifficulty:Gr.toBuffer(e.totalDifficulty),size:Gr.toBuffer(e.size),extraData:Gr.toBuffer(e.extraData),gasLimit:Gr.toBuffer(e.gasLimit),gasUsed:Gr.toBuffer(e.gasUsed),timestamp:Gr.toBuffer(e.timestamp),transactions:e.transactions}}});var Ph=E((aqe,Jq)=>{var Xle=mm();Jq.exports=zf;function zf(){}zf.prototype.setEngine=function(e){let t=this;t.engine||(t.engine=e,e.on("block",function(r){t.currentBlock=r}),e.on("start",function(){t.start()}),e.on("stop",function(){t.stop()}))};zf.prototype.handleRequest=function(e,t,r){throw new Error("Subproviders should override `handleRequest`.")};zf.prototype.emitPayload=function(e,t){this.engine.sendAsync(Xle(e),t)};zf.prototype.stop=function(){};zf.prototype.start=function(){}});var gm=E((uqe,Qq)=>{var ehe=Ph(),Gx=class extends ehe{constructor(t){if(super(),!t)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");this._constructorFn=t}setEngine(t){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");let r=t._blockTracker,n=this._constructorFn({engine:t,provider:t,blockTracker:r});if(!n)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if(typeof n!="function")throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=n}handleRequest(t,r,n){let i={id:t.id};this.middleware(t,i,o,a);function o(c){r((v,y,w)=>{v?(delete i.result,i.error={message:v.message||v}):i.result=y,c?c(w):w()})}function a(c){if(c)return n(c);n(null,i.result)}}};Qq.exports=Gx});var nL=E((fqe,rL)=>{var the=Vx();rL.exports={cacheIdentifierForPayload:rhe,canCache:Xq,blockTagForPayload:nhe,paramsWithoutBlockTag:eL,blockTagParamIndex:Zx,cacheTypeForPayload:tL};function rhe(e,t){let r=t?eL(e):e.params;return Xq(e)?e.method+":"+the(r):null}function Xq(e){return tL(e)!=="never"}function nhe(e){let t=Zx(e);return t>=e.params.length?null:e.params[t]}function eL(e){let t=Zx(e);return t>=e.params.length?e.params:e.method==="eth_getBlockByNumber"?e.params.slice(1):e.params.slice(0,t)}function Zx(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function tL(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}});var oL=E((cqe,iL)=>{iL.exports=function(t){return(r,n,i,o)=>{let a,c=new Promise(M=>{a=M}),v,y;t(r,n,async()=>{y=!0,i(M=>{v=M,a()}),await c}).then(async()=>{y?(await c,v(null)):o(null)}).catch(M=>{v?v(M):o(M)})}}});var aL=E((lqe,sL)=>{var Vf=nL(),ihe=oL(),ohe=[void 0,null,"<nil>"];sL.exports=she;function she(e={}){let{blockTracker:t}=e;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");let r=new Yx,n={perma:r,block:r,fork:r};return ihe(async(i,o,a)=>{if(i.skipCache)return a();let c=Vf.cacheTypeForPayload(i),v=n[c];if(!v||!v.canCacheRequest(i))return a();let y=Vf.blockTagForPayload(i);y||(y="latest");let w;if(y==="earliest")w="0x00";else if(y==="latest"){let S=await t.getLatestBlock();r.clearBefore(S),w=S}else w=y;let M=await v.get(i,w);M===void 0?(await a(),await v.set(i,w,o.result)):o.result=M})}var Yx=class{constructor(){this.cache={}}getBlockCacheForPayload(t,r){let n=Number.parseInt(r,16),i=this.cache[n];if(!i){let o={};this.cache[n]=o,i=o}return i}async get(t,r){let n=this.getBlockCacheForPayload(t,r);if(!n)return;let i=Vf.cacheIdentifierForPayload(t,!0);return n[i]}async set(t,r,n){if(!this.canCacheResult(t,n))return;let o=this.getBlockCacheForPayload(t,r),a=Vf.cacheIdentifierForPayload(t,!0);o[a]=n}canCacheRequest(t){return!(!Vf.canCache(t)||Vf.blockTagForPayload(t)==="pending")}canCacheResult(t,r){if(!ohe.includes(r))return!(["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(t.method)&&(!r||!r.blockHash||r.blockHash==="0x0000000000000000000000000000000000000000000000000000000000000000"))}clearBefore(t){let r=this,n=Number.parseInt(t,16);Object.keys(r.cache).map(Number).filter(i=>i<n).forEach(i=>delete r.cache[i])}}});var fL=E((hqe,uL)=>{var ahe=gm(),uhe=aL(),Jx=class extends ahe{constructor(t){super(({blockTracker:r})=>uhe(Object.assign({blockTracker:r},t)))}};uL.exports=Jx});var lL=E((dqe,cL)=>{var fhe=$o().inherits,che=Ph();cL.exports=Qx;fhe(Qx,che);function Qx(e){let t=this;e=e||{},t.staticResponses=e}Qx.prototype.handleRequest=function(e,t,r){var i=this.staticResponses[e.method];typeof i=="function"?i(e,t,r):i!==void 0?setTimeout(()=>r(null,i)):t()}});var wm=E((pqe,_m)=>{var hL,dL,pL,vL,mL,gL,bL,yL,_L,wL,xL,ML,SL,bm,Xx,EL,AL,OL,$f,RL,IL,CL,TL,kL,PL,NL,qL,LL,ym;(function(e){var t=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof _m=="object"&&typeof _m.exports=="object"?e(r(t,r(_m.exports))):e(r(t));function r(n,i){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,a){return n[o]=i?i(o,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])};hL=function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(n,i);function o(){this.constructor=n}n.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)},dL=Object.assign||function(n){for(var i,o=1,a=arguments.length;o<a;o++){i=arguments[o];for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(n[c]=i[c])}return n},pL=function(n,i){var o={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.indexOf(a)<0&&(o[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)i.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(o[a[c]]=n[a[c]]);return o},vL=function(n,i,o,a){var c=arguments.length,v=c<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,o):a,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(n,i,o,a);else for(var w=n.length-1;w>=0;w--)(y=n[w])&&(v=(c<3?y(v):c>3?y(i,o,v):y(i,o))||v);return c>3&&v&&Object.defineProperty(i,o,v),v},mL=function(n,i){return function(o,a){i(o,a,n)}},gL=function(n,i,o,a,c,v){function y(ee){if(ee!==void 0&&typeof ee!="function")throw new TypeError("Function expected");return ee}for(var w=a.kind,M=w==="getter"?"get":w==="setter"?"set":"value",S=!i&&n?a.static?n:n.prototype:null,R=i||(S?Object.getOwnPropertyDescriptor(S,a.name):{}),C,B=!1,N=o.length-1;N>=0;N--){var q={};for(var H in a)q[H]=H==="access"?{}:a[H];for(var H in a.access)q.access[H]=a.access[H];q.addInitializer=function(ee){if(B)throw new TypeError("Cannot add initializers after decoration has completed");v.push(y(ee||null))};var D=(0,o[N])(w==="accessor"?{get:R.get,set:R.set}:R[M],q);if(w==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(C=y(D.get))&&(R.get=C),(C=y(D.set))&&(R.set=C),(C=y(D.init))&&c.push(C)}else(C=y(D))&&(w==="field"?c.push(C):R[M]=C)}S&&Object.defineProperty(S,a.name,R),B=!0},bL=function(n,i,o){for(var a=arguments.length>2,c=0;c<i.length;c++)o=a?i[c].call(n,o):i[c].call(n);return a?o:void 0},yL=function(n){return typeof n=="symbol"?n:"".concat(n)},_L=function(n,i,o){return typeof i=="symbol"&&(i=i.description?"[".concat(i.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:o?"".concat(o," ",i):i})},wL=function(n,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,i)},xL=function(n,i,o,a){function c(v){return v instanceof o?v:new o(function(y){y(v)})}return new(o||(o=Promise))(function(v,y){function w(R){try{S(a.next(R))}catch(C){y(C)}}function M(R){try{S(a.throw(R))}catch(C){y(C)}}function S(R){R.done?v(R.value):c(R.value).then(w,M)}S((a=a.apply(n,i||[])).next())})},ML=function(n,i){var o={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},a,c,v,y;return y={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function w(S){return function(R){return M([S,R])}}function M(S){if(a)throw new TypeError("Generator is already executing.");for(;y&&(y=0,S[0]&&(o=0)),o;)try{if(a=1,c&&(v=S[0]&2?c.return:S[0]?c.throw||((v=c.return)&&v.call(c),0):c.next)&&!(v=v.call(c,S[1])).done)return v;switch(c=0,v&&(S=[S[0]&2,v.value]),S[0]){case 0:case 1:v=S;break;case 4:return o.label++,{value:S[1],done:!1};case 5:o.label++,c=S[1],S=[0];continue;case 7:S=o.ops.pop(),o.trys.pop();continue;default:if(v=o.trys,!(v=v.length>0&&v[v.length-1])&&(S[0]===6||S[0]===2)){o=0;continue}if(S[0]===3&&(!v||S[1]>v[0]&&S[1]<v[3])){o.label=S[1];break}if(S[0]===6&&o.label<v[1]){o.label=v[1],v=S;break}if(v&&o.label<v[2]){o.label=v[2],o.ops.push(S);break}v[2]&&o.ops.pop(),o.trys.pop();continue}S=i.call(n,o)}catch(R){S=[6,R],c=0}finally{a=v=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},SL=function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&ym(i,n,o)},ym=Object.create?function(n,i,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(i,o);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,c)}:function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]},bm=function(n){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&n[i],a=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Xx=function(n,i){var o=typeof Symbol=="function"&&n[Symbol.iterator];if(!o)return n;var a=o.call(n),c,v=[],y;try{for(;(i===void 0||i-- >0)&&!(c=a.next()).done;)v.push(c.value)}catch(w){y={error:w}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(y)throw y.error}}return v},EL=function(){for(var n=[],i=0;i<arguments.length;i++)n=n.concat(Xx(arguments[i]));return n},AL=function(){for(var n=0,i=0,o=arguments.length;i<o;i++)n+=arguments[i].length;for(var a=Array(n),c=0,i=0;i<o;i++)for(var v=arguments[i],y=0,w=v.length;y<w;y++,c++)a[c]=v[y];return a},OL=function(n,i,o){if(o||arguments.length===2)for(var a=0,c=i.length,v;a<c;a++)(v||!(a in i))&&(v||(v=Array.prototype.slice.call(i,0,a)),v[a]=i[a]);return n.concat(v||Array.prototype.slice.call(i))},$f=function(n){return this instanceof $f?(this.v=n,this):new $f(n)},RL=function(n,i,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(n,i||[]),c,v=[];return c={},y("next"),y("throw"),y("return"),c[Symbol.asyncIterator]=function(){return this},c;function y(B){a[B]&&(c[B]=function(N){return new Promise(function(q,H){v.push([B,N,q,H])>1||w(B,N)})})}function w(B,N){try{M(a[B](N))}catch(q){C(v[0][3],q)}}function M(B){B.value instanceof $f?Promise.resolve(B.value.v).then(S,R):C(v[0][2],B)}function S(B){w("next",B)}function R(B){w("throw",B)}function C(B,N){B(N),v.shift(),v.length&&w(v[0][0],v[0][1])}},IL=function(n){var i,o;return i={},a("next"),a("throw",function(c){throw c}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(c,v){i[c]=n[c]?function(y){return(o=!o)?{value:$f(n[c](y)),done:!1}:v?v(y):y}:v}},CL=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n[Symbol.asyncIterator],o;return i?i.call(n):(n=typeof bm=="function"?bm(n):n[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(v){o[v]=n[v]&&function(y){return new Promise(function(w,M){y=n[v](y),c(w,M,y.done,y.value)})}}function c(v,y,w,M){Promise.resolve(M).then(function(S){v({value:S,done:w})},y)}},TL=function(n,i){return Object.defineProperty?Object.defineProperty(n,"raw",{value:i}):n.raw=i,n};var r=Object.create?function(n,i){Object.defineProperty(n,"default",{enumerable:!0,value:i})}:function(n,i){n.default=i};kL=function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var o in n)o!=="default"&&Object.prototype.hasOwnProperty.call(n,o)&&ym(i,n,o);return r(i,n),i},PL=function(n){return n&&n.__esModule?n:{default:n}},NL=function(n,i,o,a){if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?n!==i||!a:!i.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?a:o==="a"?a.call(n):a?a.value:i.get(n)},qL=function(n,i,o,a,c){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?n!==i||!c:!i.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?c.call(n,o):c?c.value=o:i.set(n,o),o},LL=function(n,i){if(i===null||typeof i!="object"&&typeof i!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?i===n:n.has(i)},e("__extends",hL),e("__assign",dL),e("__rest",pL),e("__decorate",vL),e("__param",mL),e("__esDecorate",gL),e("__runInitializers",bL),e("__propKey",yL),e("__setFunctionName",_L),e("__metadata",wL),e("__awaiter",xL),e("__generator",ML),e("__exportStar",SL),e("__createBinding",ym),e("__values",bm),e("__read",Xx),e("__spread",EL),e("__spreadArrays",AL),e("__spreadArray",OL),e("__await",$f),e("__asyncGenerator",RL),e("__asyncDelegator",IL),e("__asyncValues",CL),e("__makeTemplateObject",TL),e("__importStar",kL),e("__importDefault",PL),e("__classPrivateFieldGet",NL),e("__classPrivateFieldSet",qL),e("__classPrivateFieldIn",LL)})});var t3=E(e3=>{"use strict";Object.defineProperty(e3,"__esModule",{value:!0});var BL=wm(),lhe=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return BL.__awaiter(this,void 0,void 0,function(){var r,n,i;return BL.__generator(this,function(o){switch(o.label){case 0:return[4,this.acquire()];case 1:r=o.sent(),n=r[0],i=r[1],o.label=2;case 2:return o.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,o.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(!!r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();e3.default=lhe});var jL=E(r3=>{"use strict";Object.defineProperty(r3,"__esModule",{value:!0});var DL=wm(),hhe=t3(),dhe=function(){function e(){this._semaphore=new hhe.default(1)}return e.prototype.acquire=function(){return DL.__awaiter(this,void 0,void 0,function(){var t,r;return DL.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();r3.default=dhe});var FL=E(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});Mm.withTimeout=void 0;var xm=wm();function phe(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,o){return xm.__awaiter(n,void 0,void 0,function(){var a,c,v;return xm.__generator(this,function(y){switch(y.label){case 0:return a=!1,setTimeout(function(){a=!0,o(r)},t),[4,e.acquire()];case 1:return c=y.sent(),a?(v=Array.isArray(c)?c[1]:c,v()):i(c),[2]}})})})},runExclusive:function(i){return xm.__awaiter(this,void 0,void 0,function(){var o,a;return xm.__generator(this,function(c){switch(c.label){case 0:o=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=c.sent(),Array.isArray(a)?(o=a[1],[4,i(a[0])]):[3,4];case 3:return[2,c.sent()];case 4:return o=a,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return o(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Mm.withTimeout=phe});var UL=E(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.withTimeout=Us.Semaphore=Us.Mutex=void 0;var vhe=jL();Object.defineProperty(Us,"Mutex",{enumerable:!0,get:function(){return vhe.default}});var mhe=t3();Object.defineProperty(Us,"Semaphore",{enumerable:!0,get:function(){return mhe.default}});var ghe=FL();Object.defineProperty(Us,"withTimeout",{enumerable:!0,get:function(){return ghe.withTimeout}})});var i3=E(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.getUniqueId=void 0;var HL=4294967295,n3=Math.floor(Math.random()*HL);function bhe(){return n3=(n3+1)%HL,n3}Sm.getUniqueId=bhe});var WL=E(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.createIdRemapMiddleware=void 0;var yhe=i3();function _he(){return(e,t,r,n)=>{let i=e.id,o=yhe.getUniqueId();e.id=o,t.id=o,r(a=>{e.id=i,t.id=i,a()})}}Em.createIdRemapMiddleware=_he});var zL=E(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.createAsyncMiddleware=void 0;function whe(e){return async(t,r,n,i)=>{let o,a=new Promise(w=>{o=w}),c=null,v=!1,y=async()=>{v=!0,n(w=>{c=w,o()}),await a};try{await e(t,r,y),v?(await a,c(null)):i(null)}catch(w){c?c(w):i(w)}}}Am.createAsyncMiddleware=whe});var VL=E(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.createScaffoldMiddleware=void 0;function xhe(e){return(t,r,n,i)=>{let o=e[t.method];return o===void 0?n():typeof o=="function"?o(t,r,n,i):(r.result=o,i())}}Om.createScaffoldMiddleware=xhe});var Nh=E(s3=>{"use strict";Object.defineProperty(s3,"__esModule",{value:!0});var Mhe=gf();function $L(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function She(e){let t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}var o3=class extends Mhe.EventEmitter{emit(t,...r){let n=t==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;let c=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw c.context=a,c}let o=i[t];if(o===void 0)return!1;if(typeof o=="function")$L(o,this,r);else{let a=o.length,c=She(o);for(let v=0;v<a;v+=1)$L(c[v],this,r)}return!0}};s3.default=o3});var f3=E((Sqe,JL)=>{JL.exports=qh;qh.default=qh;qh.stable=ZL;qh.stableStringify=ZL;var Rm="[...]",KL="[Circular]",uu=[],au=[];function GL(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function qh(e,t,r,n){typeof n>"u"&&(n=GL()),a3(e,"",0,[],void 0,0,n);var i;try{au.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,YL(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;uu.length!==0;){var o=uu.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Kf(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),uu.push([n,r,t,i])):au.push([t,r,e]):(n[r]=e,uu.push([n,r,t]))}function a3(e,t,r,n,i,o,a){o+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Kf(KL,e,t,i);return}if(typeof a.depthLimit<"u"&&o>a.depthLimit){Kf(Rm,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Kf(Rm,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)a3(e[c],c,c,n,e,o,a);else{var v=Object.keys(e);for(c=0;c<v.length;c++){var y=v[c];a3(e[y],y,c,n,e,o,a)}}n.pop()}}function Ehe(e,t){return e<t?-1:e>t?1:0}function ZL(e,t,r,n){typeof n>"u"&&(n=GL());var i=u3(e,"",0,[],void 0,0,n)||e,o;try{au.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,YL(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;uu.length!==0;){var a=uu.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return o}function u3(e,t,r,n,i,o,a){o+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;c<n.length;c++)if(n[c]===e){Kf(KL,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof a.depthLimit<"u"&&o>a.depthLimit){Kf(Rm,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Kf(Rm,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c<e.length;c++)u3(e[c],c,c,n,e,o,a);else{var v={},y=Object.keys(e).sort(Ehe);for(c=0;c<y.length;c++){var w=y[c];u3(e[w],w,c,n,e,o,a),v[w]=e[w]}if(typeof i<"u")uu.push([i,t,e]),i[t]=v;else return v}n.pop()}}function YL(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(au.length>0)for(var n=0;n<au.length;n++){var i=au[n];if(i[1]===t&&i[0]===r){r=i[2],au.splice(n,1);break}}return e.call(this,t,r)}}});var Cm=E(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.EthereumProviderError=Gf.EthereumRpcError=void 0;var Ahe=f3(),Im=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Ahe.default(this.serialize(),Rhe,2)}};Gf.EthereumRpcError=Im;var c3=class extends Im{constructor(t,r,n){if(!Ohe(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};Gf.EthereumProviderError=c3;function Ohe(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Rhe(e,t){if(t!=="[Circular]")return t}});var Tm=E(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.errorValues=Zf.errorCodes=void 0;Zf.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Zf.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}});var d3=E(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.serializeError=Fi.isValidCode=Fi.getMessageFromCode=Fi.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var km=Tm(),Ihe=Cm(),QL=km.errorCodes.rpc.internal,Che="Unspecified error message. This is a bug, please report it.",The={code:QL,message:h3(QL)};Fi.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function h3(e,t=Che){if(Number.isInteger(e)){let r=e.toString();if(l3(km.errorValues,r))return km.errorValues[r].message;if(tB(e))return Fi.JSON_RPC_SERVER_ERROR_MESSAGE}return t}Fi.getMessageFromCode=h3;function eB(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(km.errorValues[t]||tB(e))}Fi.isValidCode=eB;function khe(e,{fallbackError:t=The,shouldIncludeStack:r=!1}={}){var n,i;if(!t||!Number.isInteger(t.code)||typeof t.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof Ihe.EthereumRpcError)return e.serialize();let o={};if(e&&typeof e=="object"&&!Array.isArray(e)&&l3(e,"code")&&eB(e.code)){let c=e;o.code=c.code,c.message&&typeof c.message=="string"?(o.message=c.message,l3(c,"data")&&(o.data=c.data)):(o.message=h3(o.code),o.data={originalError:XL(e)})}else{o.code=t.code;let c=(n=e)===null||n===void 0?void 0:n.message;o.message=c&&typeof c=="string"?c:t.message,o.data={originalError:XL(e)}}let a=(i=e)===null||i===void 0?void 0:i.stack;return r&&e&&a&&typeof a=="string"&&(o.stack=a),o}Fi.serializeError=khe;function tB(e){return e>=-32099&&e<=-32e3}function XL(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.assign({},e):e}function l3(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var iB=E(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.ethErrors=void 0;var p3=Cm(),rB=d3(),yn=Tm();Pm.ethErrors={rpc:{parse:e=>xi(yn.errorCodes.rpc.parse,e),invalidRequest:e=>xi(yn.errorCodes.rpc.invalidRequest,e),invalidParams:e=>xi(yn.errorCodes.rpc.invalidParams,e),methodNotFound:e=>xi(yn.errorCodes.rpc.methodNotFound,e),internal:e=>xi(yn.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return xi(t,e)},invalidInput:e=>xi(yn.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>xi(yn.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>xi(yn.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>xi(yn.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>xi(yn.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>xi(yn.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Lh(yn.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Lh(yn.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Lh(yn.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Lh(yn.errorCodes.provider.disconnected,e),chainDisconnected:e=>Lh(yn.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new p3.EthereumProviderError(t,r,n)}}};function xi(e,t){let[r,n]=nB(t);return new p3.EthereumRpcError(e,r||rB.getMessageFromCode(e),n)}function Lh(e,t){let[r,n]=nB(t);return new p3.EthereumProviderError(e,r||rB.getMessageFromCode(e),n)}function nB(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}});var aB=E(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getMessageFromCode=Vn.serializeError=Vn.EthereumProviderError=Vn.EthereumRpcError=Vn.ethErrors=Vn.errorCodes=void 0;var oB=Cm();Object.defineProperty(Vn,"EthereumRpcError",{enumerable:!0,get:function(){return oB.EthereumRpcError}});Object.defineProperty(Vn,"EthereumProviderError",{enumerable:!0,get:function(){return oB.EthereumProviderError}});var sB=d3();Object.defineProperty(Vn,"serializeError",{enumerable:!0,get:function(){return sB.serializeError}});Object.defineProperty(Vn,"getMessageFromCode",{enumerable:!0,get:function(){return sB.getMessageFromCode}});var Phe=iB();Object.defineProperty(Vn,"ethErrors",{enumerable:!0,get:function(){return Phe.ethErrors}});var Nhe=Tm();Object.defineProperty(Vn,"errorCodes",{enumerable:!0,get:function(){return Nhe.errorCodes}})});var m3=E(Yf=>{"use strict";var qhe=Yf&&Yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yf,"__esModule",{value:!0});Yf.JsonRpcEngine=void 0;var Lhe=qhe(Nh()),Mi=aB(),Ui=class extends Lhe.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{let[o,a,c]=await Ui._runAllMiddleware(t,r,this._middleware);return a?(await Ui._runReturnHandlers(c),i(o)):n(async v=>{try{await Ui._runReturnHandlers(c)}catch(y){return v(y)}return v()})}catch(o){return i(o)}}}async _handleBatch(t,r){try{let n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){let a=new Mi.EthereumRpcError(Mi.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){let a=new Mi.EthereumRpcError(Mi.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}let n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc},o=null;try{await this._processRequest(n,i)}catch(a){o=a}return o&&(delete i.result,i.error||(i.error=Mi.serializeError(o))),r(o,i)}async _processRequest(t,r){let[n,i,o]=await Ui._runAllMiddleware(t,r,this._middleware);if(Ui._checkForCompletion(t,r,i),await Ui._runReturnHandlers(o),n)throw n}static async _runAllMiddleware(t,r,n){let i=[],o=null,a=!1;for(let c of n)if([o,a]=await Ui._runMiddleware(t,r,c,i),a)break;return[o,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(o=>{let a=v=>{let y=v||r.error;y&&(r.error=Mi.serializeError(y)),o([y,!0])},c=v=>{r.error?a(r.error):(v&&(typeof v!="function"&&a(new Mi.EthereumRpcError(Mi.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof v}" for request:
|
|
549
|
+
${v3(t)}`,{request:t})),i.push(v)),o([null,!1]))};try{n(t,r,c,a)}catch(v){a(v)}})}static async _runReturnHandlers(t){for(let r of t)await new Promise((n,i)=>{r(o=>o?i(o):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new Mi.EthereumRpcError(Mi.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
550
|
+
${v3(t)}`,{request:t});if(!n)throw new Mi.EthereumRpcError(Mi.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
551
|
+
${v3(t)}`,{request:t})}};Yf.JsonRpcEngine=Ui;function v3(e){return JSON.stringify(e,null,2)}});var uB=E(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.mergeMiddleware=void 0;var Bhe=m3();function Dhe(e){let t=new Bhe.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Nm.mergeMiddleware=Dhe});var g3=E(Si=>{"use strict";var jhe=Si&&Si.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Jf=Si&&Si.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&jhe(t,e,r)};Object.defineProperty(Si,"__esModule",{value:!0});Jf(WL(),Si);Jf(zL(),Si);Jf(VL(),Si);Jf(i3(),Si);Jf(m3(),Si);Jf(uB(),Si)});var cB=E((Pqe,fB)=>{fB.exports=function(t){return(r,n,i,o)=>{let a=t[r.method];return a===void 0?i():typeof a=="function"?a(r,n,i,o):(n.result=a,o())}}});var b3=E((Nqe,lB)=>{lB.exports=cB()});var vB=E((qqe,pB)=>{"use strict";var hB=(e,t,r,n)=>function(...i){let o=t.promiseModule;return new o((a,c)=>{t.multiArgs?i.push((...y)=>{t.errorFirst?y[0]?c(y):(y.shift(),a(y)):a(y)}):t.errorFirst?i.push((y,w)=>{y?c(y):a(w)}):i.push(a),Reflect.apply(e,this===r?n:this,i)})},dB=new WeakMap;pB.exports=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};let r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);let n=(a,c)=>{let v=dB.get(a);if(v||(v={},dB.set(a,v)),c in v)return v[c];let y=C=>typeof C=="string"||typeof c=="symbol"?c===C:C.test(c),w=Reflect.getOwnPropertyDescriptor(a,c),M=w===void 0||w.writable||w.configurable,R=(t.include?t.include.some(y):!t.exclude.some(y))&&M;return v[c]=R,R},i=new WeakMap,o=new Proxy(e,{apply(a,c,v){let y=i.get(a);if(y)return Reflect.apply(y,c,v);let w=t.excludeMain?a:hB(a,t,o,a);return i.set(a,w),Reflect.apply(w,c,v)},get(a,c){let v=a[c];if(!n(a,c)||v===Function.prototype[c])return v;let y=i.get(v);if(y)return y;if(typeof v=="function"){let w=hB(v,t,o,a);return i.set(v,w),w}return v}});return o}});var qm=E((Lqe,mB)=>{var Fhe=Nh().default,y3=class extends Fhe{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){let t=this.updates;return this.updates=[],t}};mB.exports=y3});var bB=E((Bqe,gB)=>{var Uhe=qm(),_3=class extends Uhe{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};gB.exports=_3});var Qf=E((Dqe,wB)=>{wB.exports={minBlockRef:Hhe,maxBlockRef:Whe,sortBlockRefs:w3,bnToHex:zhe,blockRefIsNumber:Vhe,hexToInt:Lm,incrementHexInt:$he,intToHex:_B,unsafeRandomBytes:Khe};function Hhe(...e){return w3(e)[0]}function Whe(...e){let t=w3(e);return t[t.length-1]}function w3(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Lm(t)-Lm(r))}function zhe(e){return"0x"+e.toString(16)}function Vhe(e){return e&&!["earliest","latest","pending"].includes(e)}function Lm(e){return e==null?e:Number.parseInt(e,16)}function $he(e){if(e==null)return e;let t=Lm(e);return _B(t+1)}function _B(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function Khe(e){let t="0x";for(let r=0;r<e;r++)t+=yB(),t+=yB();return t}function yB(){return Math.floor(Math.random()*16).toString(16)}});var MB=E((Fqe,xB)=>{var Ghe=yx(),Zhe=vB(),Yhe=bB(),{bnToHex:jqe,hexToInt:Bm,incrementHexInt:Jhe,minBlockRef:Qhe,blockRefIsNumber:Xhe}=Qf(),x3=class extends Yhe{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new Ghe(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;let n=Qhe(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),o=await this._fetchLogs(i);this.addInitialResults(o)}async update({oldBlock:t,newBlock:r}){let n=r,i;t?i=Jhe(t):i=r;let o=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(o)).filter(v=>this.matchLog(v));this.addResults(c)}async _fetchLogs(t){return await Zhe(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Bm(this.params.fromBlock)>=Bm(t.blockNumber)||Xhe(this.params.toBlock)&&Bm(this.params.toBlock)<=Bm(t.blockNumber))return!1;let r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,o)=>{let a=t.topics[o];if(!a)return!1;a=a.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(w=>w.toLowerCase()),c.includes(a))})}};xB.exports=x3});var Dm=E((Uqe,EB)=>{EB.exports=e0e;async function e0e({provider:e,fromBlock:t,toBlock:r}){t||(t=r);let n=SB(t),o=SB(r)-n+1,a=Array(o).fill().map((v,y)=>n+y).map(t0e);return await Promise.all(a.map(v=>r0e(e,"eth_getBlockByNumber",[v,!1])))}function SB(e){return e==null?e:Number.parseInt(e,16)}function t0e(e){if(e==null)return e;let t=e.toString(16);return"0x"+t}function r0e(e,t,r){return new Promise((n,i)=>{e.sendAsync({id:1,jsonrpc:"2.0",method:t,params:r},(o,a)=>{if(o)return i(o);n(a.result)})})}});var OB=E((Hqe,AB)=>{var n0e=qm(),i0e=Dm(),{incrementHexInt:o0e}=Qf(),M3=class extends n0e{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){let n=r,i=o0e(t),a=(await i0e({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(a)}};AB.exports=M3});var IB=E((Wqe,RB)=>{var s0e=qm(),a0e=Dm(),{incrementHexInt:u0e}=Qf(),S3=class extends s0e{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){let r=t,n=u0e(t),i=await a0e({provider:this.provider,fromBlock:n,toBlock:r}),o=[];for(let a of i)o.push(...a.transactions);this.addResults(o)}};RB.exports=S3});var O3=E((zqe,TB)=>{var f0e=UL().Mutex,{createAsyncMiddleware:c0e}=g3(),l0e=b3(),h0e=MB(),d0e=OB(),p0e=IB(),{intToHex:CB,hexToInt:E3}=Qf();TB.exports=v0e;function v0e({blockTracker:e,provider:t}){let r=0,n={},i=new f0e,o=m0e({mutex:i}),a=l0e({eth_newFilter:o(A3(v)),eth_newBlockFilter:o(A3(y)),eth_newPendingTransactionFilter:o(A3(w)),eth_uninstallFilter:o(jm(R)),eth_getFilterChanges:o(jm(M)),eth_getFilterLogs:o(jm(S))}),c=async({oldBlock:H,newBlock:D})=>{if(n.length===0)return;let ee=await i.acquire();try{await Promise.all(Xf(n).map(async ge=>{try{await ge.update({oldBlock:H,newBlock:D})}catch(Z){console.error(Z)}}))}catch(ge){console.error(ge)}ee()};return a.newLogFilter=v,a.newBlockFilter=y,a.newPendingTransactionFilter=w,a.uninstallFilter=R,a.getFilterChanges=M,a.getFilterLogs=S,a.destroy=()=>{N()},a;async function v(H){let D=new h0e({provider:t,params:H}),ee=await C(D);return D}async function y(){let H=new d0e({provider:t}),D=await C(H);return H}async function w(){let H=new p0e({provider:t}),D=await C(H);return H}async function M(H){let D=E3(H),ee=n[D];if(!ee)throw new Error(`No filter for index "${D}"`);return ee.getChangesAndClear()}async function S(H){let D=E3(H),ee=n[D];if(!ee)throw new Error(`No filter for index "${D}"`);return ee.type==="log"?results=ee.getAllResults():results=[],results}async function R(H){let D=E3(H),ee=n[D],ge=Boolean(ee);return ge&&await B(D),ge}async function C(H){let D=Xf(n).length,ee=await e.getLatestBlock();await H.initialize({currentBlock:ee}),r++,n[r]=H,H.id=r,H.idHex=CB(r);let ge=Xf(n).length;return q({prevFilterCount:D,newFilterCount:ge}),r}async function B(H){let D=Xf(n).length;delete n[H];let ee=Xf(n).length;q({prevFilterCount:D,newFilterCount:ee})}async function N(){let H=Xf(n).length;n={},q({prevFilterCount:H,newFilterCount:0})}function q({prevFilterCount:H,newFilterCount:D}){if(H===0&&D>0){e.on("sync",c);return}if(H>0&&D===0){e.removeListener("sync",c);return}}}function A3(e){return jm(async(...t)=>{let r=await e(...t);return CB(r.id)})}function jm(e){return c0e(async(t,r)=>{let n=await e.apply(null,t.params);r.result=n})}function m0e({mutex:e}){return t=>async(r,n,i,o)=>{(await e.acquire())(),t(r,n,i,o)}}function Xf(e,t){let r=[];for(let n in e)r.push(e[n]);return r}});var PB=E((Vqe,kB)=>{var g0e=gm(),b0e=O3(),R3=class extends g0e{constructor(){super(({blockTracker:t,provider:r,engine:n})=>b0e({blockTracker:t,provider:r}))}};kB.exports=R3});var qB=E((Fm,NB)=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.default=function(e,t){if(t=(0,S0e.default)(t||x0e.default),!(0,_0e.default)(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(o){var a=(0,C0e.default)(e[r++]);o.push((0,R0e.default)(i)),a.apply(null,o)}function i(o){if(o||r===e.length)return t.apply(null,arguments);n((0,A0e.default)(arguments,1))}n([])};var y0e=Px(),_0e=ec(y0e),w0e=Uf(),x0e=ec(w0e),M0e=V1(),S0e=ec(M0e),E0e=Ch(),A0e=ec(E0e),O0e=Y1(),R0e=ec(O0e),I0e=Ds(),C0e=ec(I0e);function ec(e){return e&&e.__esModule?e:{default:e}}NB.exports=Fm.default});var BB=E((Hm,LB)=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.default=j0e;var T0e=Uf(),k0e=Um(T0e),P0e=Eh(),N0e=Um(P0e),q0e=Ch(),L0e=Um(q0e),B0e=Ds(),D0e=Um(B0e);function Um(e){return e&&e.__esModule?e:{default:e}}function j0e(e,t,r){r=r||k0e.default;var n=(0,N0e.default)(t)?[]:{};e(t,function(i,o,a){(0,D0e.default)(i)(function(c,v){arguments.length>2&&(v=(0,L0e.default)(arguments,1)),n[o]=v,a(c)})},function(i){r(i,n)})}LB.exports=Hm.default});var FB=E((Wm,jB)=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.default=z0e;var F0e=jx(),U0e=DB(F0e),H0e=BB(),W0e=DB(H0e);function DB(e){return e&&e.__esModule?e:{default:e}}function z0e(e,t){(0,W0e.default)(U0e.default,e,t)}jB.exports=Wm.default});var Hs=E((UB,I3)=>{(function(e,t){"use strict";function r(m,s){if(!m)throw new Error(s||"Assertion failed")}function n(m,s){m.super_=s;var l=function(){};l.prototype=s.prototype,m.prototype=new l,m.prototype.constructor=m}function i(m,s,l){if(i.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(m||0,s||10,l||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=fi().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,l){return s.cmp(l)>0?s:l},i.min=function(s,l){return s.cmp(l)<0?s:l},i.prototype._init=function(s,l,d){if(typeof s=="number")return this._initNumber(s,l,d);if(typeof s=="object")return this._initArray(s,l,d);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var f=0;s[0]==="-"&&(f++,this.negative=1),f<s.length&&(l===16?this._parseHex(s,f,d):(this._parseBase(s,l,f),d==="le"&&this._initArray(this.toArray(),l,d)))},i.prototype._initNumber=function(s,l,d){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),l,d)},i.prototype._initArray=function(s,l,d){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p,g,b=0;if(d==="be")for(f=s.length-1,p=0;f>=0;f-=3)g=s[f]|s[f-1]<<8|s[f-2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);else if(d==="le")for(f=0,p=0;f<s.length;f+=3)g=s[f]|s[f+1]<<8|s[f+2]<<16,this.words[p]|=g<<b&67108863,this.words[p+1]=g>>>26-b&67108863,b+=24,b>=26&&(b-=26,p++);return this.strip()};function a(m,s){var l=m.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function c(m,s,l){var d=a(m,l);return l-1>=s&&(d|=a(m,l-1)<<4),d}i.prototype._parseHex=function(s,l,d){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var p=0,g=0,b;if(d==="be")for(f=s.length-1;f>=l;f-=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8;else{var h=s.length-l;for(f=h%2===0?l+1:l;f<s.length;f+=2)b=c(s,l,f)<<p,this.words[g]|=b&67108863,p>=18?(p-=18,g+=1,this.words[g]|=b>>>26):p+=8}this.strip()};function v(m,s,l,d){for(var f=0,p=Math.min(m.length,l),g=s;g<p;g++){var b=m.charCodeAt(g)-48;f*=d,b>=49?f+=b-49+10:b>=17?f+=b-17+10:f+=b}return f}i.prototype._parseBase=function(s,l,d){this.words=[0],this.length=1;for(var f=0,p=1;p<=67108863;p*=l)f++;f--,p=p/l|0;for(var g=s.length-d,b=g%f,h=Math.min(g,g-b)+d,u=0,_=d;_<h;_+=f)u=v(s,_,_+f,l),this.imuln(p),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(b!==0){var A=1;for(u=v(s,_,s.length,l),_=0;_<b;_++)A*=l;this.imuln(A),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var l=0;l<this.length;l++)s.words[l]=this.words[l];s.length=this.length,s.negative=this.negative,s.red=this.red},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,l){s=s||10,l=l|0||1;var d;if(s===16||s==="hex"){d="";for(var f=0,p=0,g=0;g<this.length;g++){var b=this.words[g],h=((b<<f|p)&16777215).toString(16);p=b>>>24-f&16777215,p!==0||g!==this.length-1?d=y[6-h.length]+h+d:d=h+d,f+=2,f>=26&&(f-=26,g--)}for(p!==0&&(d=p.toString(16)+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(s===(s|0)&&s>=2&&s<=36){var u=w[s],_=M[s];d="";var A=this.clone();for(A.negative=0;!A.isZero();){var x=A.modn(_).toString(s);A=A.idivn(_),A.isZero()?d=x+d:d=y[u-x.length]+x+d}for(this.isZero()&&(d="0"+d);d.length%l!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},i.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},i.prototype.toArrayLike=function(s,l,d){var f=this.byteLength(),p=d||Math.max(1,f);r(f<=p,"byte array longer than desired length"),r(p>0,"Requested array length <= 0"),this.strip();var g=l==="le",b=new s(p),h,u,_=this.clone();if(g){for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[u]=h;for(;u<p;u++)b[u]=0}else{for(u=0;u<p-f;u++)b[u]=0;for(u=0;!_.isZero();u++)h=_.andln(255),_.iushrn(8),b[p-u-1]=h}return b},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var l=s,d=0;return l>=4096&&(d+=13,l>>>=13),l>=64&&(d+=7,l>>>=7),l>=8&&(d+=4,l>>>=4),l>=2&&(d+=2,l>>>=2),d+l},i.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,d=0;return(l&8191)===0&&(d+=13,l>>>=13),(l&127)===0&&(d+=7,l>>>=7),(l&15)===0&&(d+=4,l>>>=4),(l&3)===0&&(d+=2,l>>>=2),(l&1)===0&&d++,d},i.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function S(m){for(var s=new Array(m.bitLength()),l=0;l<s.length;l++){var d=l/26|0,f=l%26;s[l]=(m.words[d]&1<<f)>>>f}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;l<this.length;l++){var d=this._zeroBits(this.words[l]);if(s+=d,d!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]|s.words[l];return this.strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]&s.words[d];return this.length=l.length,this.strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var l,d;this.length>s.length?(l=this,d=s):(l=s,d=this);for(var f=0;f<d.length;f++)this.words[f]=l.words[f]^d.words[f];if(this!==l)for(;f<l.length;f++)this.words[f]=l.words[f];return this.length=l.length,this.strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,d=s%26;this._expand(l),d>0&&l--;for(var f=0;f<l;f++)this.words[f]=~this.words[f]&67108863;return d>0&&(this.words[f]=~this.words[f]&67108863>>26-d),this.strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var d=s/26|0,f=s%26;return this._expand(d+1),l?this.words[d]=this.words[d]|1<<f:this.words[d]=this.words[d]&~(1<<f),this.strip()},i.prototype.iadd=function(s){var l;if(this.negative!==0&&s.negative===0)return this.negative=0,l=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,l=this.isub(s),s.negative=1,l._normSign();var d,f;this.length>s.length?(d=this,f=s):(d=s,f=this);for(var p=0,g=0;g<f.length;g++)l=(d.words[g]|0)+(f.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;for(;p!==0&&g<d.length;g++)l=(d.words[g]|0)+p,this.words[g]=l&67108863,p=l>>>26;if(this.length=d.length,p!==0)this.words[this.length]=p,this.length++;else if(d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this},i.prototype.add=function(s){var l;return s.negative!==0&&this.negative===0?(s.negative=0,l=this.sub(s),s.negative^=1,l):s.negative===0&&this.negative!==0?(this.negative=0,l=s.sub(this),this.negative=1,l):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var d=this.cmp(s);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var f,p;d>0?(f=this,p=s):(f=s,p=this);for(var g=0,b=0;b<p.length;b++)l=(f.words[b]|0)-(p.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;for(;g!==0&&b<f.length;b++)l=(f.words[b]|0)+g,g=l>>26,this.words[b]=l&67108863;if(g===0&&b<f.length&&f!==this)for(;b<f.length;b++)this.words[b]=f.words[b];return this.length=Math.max(this.length,b),f!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function R(m,s,l){l.negative=s.negative^m.negative;var d=m.length+s.length|0;l.length=d,d=d-1|0;var f=m.words[0]|0,p=s.words[0]|0,g=f*p,b=g&67108863,h=g/67108864|0;l.words[0]=b;for(var u=1;u<d;u++){for(var _=h>>>26,A=h&67108863,x=Math.min(u,s.length-1),I=Math.max(0,u-m.length+1);I<=x;I++){var j=u-I|0;f=m.words[j]|0,p=s.words[I]|0,g=f*p+A,_+=g/67108864|0,A=g&67108863}l.words[u]=A|0,h=_|0}return h!==0?l.words[u]=h|0:l.length--,l.strip()}var C=function(s,l,d){var f=s.words,p=l.words,g=d.words,b=0,h,u,_,A=f[0]|0,x=A&8191,I=A>>>13,j=f[1]|0,O=j&8191,L=j>>>13,W=f[2]|0,F=W&8191,K=W>>>13,De=f[3]|0,Y=De&8191,Q=De>>>13,Ve=f[4]|0,J=Ve&8191,be=Ve>>>13,Ke=f[5]|0,ye=Ke&8191,Re=Ke>>>13,et=f[6]|0,oe=et&8191,xe=et>>>13,it=f[7]|0,ce=it&8191,Ie=it>>>13,ft=f[8]|0,le=ft&8191,Ce=ft>>>13,ot=f[9]|0,se=ot&8191,Me=ot>>>13,st=p[0]|0,ae=st&8191,Se=st>>>13,at=p[1]|0,re=at&8191,Te=at>>>13,ct=p[2]|0,ne=ct&8191,Ee=ct>>>13,lt=p[3]|0,te=lt&8191,ke=lt>>>13,ht=p[4]|0,ue=ht&8191,Pe=ht>>>13,dt=p[5]|0,he=dt&8191,Ne=dt>>>13,pt=p[6]|0,de=pt&8191,qe=pt>>>13,vt=p[7]|0,pe=vt&8191,Le=vt>>>13,ut=p[8]|0,ve=ut&8191,Be=ut>>>13,mt=p[9]|0,me=mt&8191,Ae=mt>>>13;d.negative=s.negative^l.negative,d.length=19,h=Math.imul(x,ae),u=Math.imul(x,Se),u=u+Math.imul(I,ae)|0,_=Math.imul(I,Se);var $t=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+($t>>>26)|0,$t&=67108863,h=Math.imul(O,ae),u=Math.imul(O,Se),u=u+Math.imul(L,ae)|0,_=Math.imul(L,Se),h=h+Math.imul(x,re)|0,u=u+Math.imul(x,Te)|0,u=u+Math.imul(I,re)|0,_=_+Math.imul(I,Te)|0;var Je=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Je>>>26)|0,Je&=67108863,h=Math.imul(F,ae),u=Math.imul(F,Se),u=u+Math.imul(K,ae)|0,_=Math.imul(K,Se),h=h+Math.imul(O,re)|0,u=u+Math.imul(O,Te)|0,u=u+Math.imul(L,re)|0,_=_+Math.imul(L,Te)|0,h=h+Math.imul(x,ne)|0,u=u+Math.imul(x,Ee)|0,u=u+Math.imul(I,ne)|0,_=_+Math.imul(I,Ee)|0;var Qe=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,h=Math.imul(Y,ae),u=Math.imul(Y,Se),u=u+Math.imul(Q,ae)|0,_=Math.imul(Q,Se),h=h+Math.imul(F,re)|0,u=u+Math.imul(F,Te)|0,u=u+Math.imul(K,re)|0,_=_+Math.imul(K,Te)|0,h=h+Math.imul(O,ne)|0,u=u+Math.imul(O,Ee)|0,u=u+Math.imul(L,ne)|0,_=_+Math.imul(L,Ee)|0,h=h+Math.imul(x,te)|0,u=u+Math.imul(x,ke)|0,u=u+Math.imul(I,te)|0,_=_+Math.imul(I,ke)|0;var Lt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(J,ae),u=Math.imul(J,Se),u=u+Math.imul(be,ae)|0,_=Math.imul(be,Se),h=h+Math.imul(Y,re)|0,u=u+Math.imul(Y,Te)|0,u=u+Math.imul(Q,re)|0,_=_+Math.imul(Q,Te)|0,h=h+Math.imul(F,ne)|0,u=u+Math.imul(F,Ee)|0,u=u+Math.imul(K,ne)|0,_=_+Math.imul(K,Ee)|0,h=h+Math.imul(O,te)|0,u=u+Math.imul(O,ke)|0,u=u+Math.imul(L,te)|0,_=_+Math.imul(L,ke)|0,h=h+Math.imul(x,ue)|0,u=u+Math.imul(x,Pe)|0,u=u+Math.imul(I,ue)|0,_=_+Math.imul(I,Pe)|0;var Bt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(ye,ae),u=Math.imul(ye,Se),u=u+Math.imul(Re,ae)|0,_=Math.imul(Re,Se),h=h+Math.imul(J,re)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(be,re)|0,_=_+Math.imul(be,Te)|0,h=h+Math.imul(Y,ne)|0,u=u+Math.imul(Y,Ee)|0,u=u+Math.imul(Q,ne)|0,_=_+Math.imul(Q,Ee)|0,h=h+Math.imul(F,te)|0,u=u+Math.imul(F,ke)|0,u=u+Math.imul(K,te)|0,_=_+Math.imul(K,ke)|0,h=h+Math.imul(O,ue)|0,u=u+Math.imul(O,Pe)|0,u=u+Math.imul(L,ue)|0,_=_+Math.imul(L,Pe)|0,h=h+Math.imul(x,he)|0,u=u+Math.imul(x,Ne)|0,u=u+Math.imul(I,he)|0,_=_+Math.imul(I,Ne)|0;var Dt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,h=Math.imul(oe,ae),u=Math.imul(oe,Se),u=u+Math.imul(xe,ae)|0,_=Math.imul(xe,Se),h=h+Math.imul(ye,re)|0,u=u+Math.imul(ye,Te)|0,u=u+Math.imul(Re,re)|0,_=_+Math.imul(Re,Te)|0,h=h+Math.imul(J,ne)|0,u=u+Math.imul(J,Ee)|0,u=u+Math.imul(be,ne)|0,_=_+Math.imul(be,Ee)|0,h=h+Math.imul(Y,te)|0,u=u+Math.imul(Y,ke)|0,u=u+Math.imul(Q,te)|0,_=_+Math.imul(Q,ke)|0,h=h+Math.imul(F,ue)|0,u=u+Math.imul(F,Pe)|0,u=u+Math.imul(K,ue)|0,_=_+Math.imul(K,Pe)|0,h=h+Math.imul(O,he)|0,u=u+Math.imul(O,Ne)|0,u=u+Math.imul(L,he)|0,_=_+Math.imul(L,Ne)|0,h=h+Math.imul(x,de)|0,u=u+Math.imul(x,qe)|0,u=u+Math.imul(I,de)|0,_=_+Math.imul(I,qe)|0;var jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(jt>>>26)|0,jt&=67108863,h=Math.imul(ce,ae),u=Math.imul(ce,Se),u=u+Math.imul(Ie,ae)|0,_=Math.imul(Ie,Se),h=h+Math.imul(oe,re)|0,u=u+Math.imul(oe,Te)|0,u=u+Math.imul(xe,re)|0,_=_+Math.imul(xe,Te)|0,h=h+Math.imul(ye,ne)|0,u=u+Math.imul(ye,Ee)|0,u=u+Math.imul(Re,ne)|0,_=_+Math.imul(Re,Ee)|0,h=h+Math.imul(J,te)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(be,te)|0,_=_+Math.imul(be,ke)|0,h=h+Math.imul(Y,ue)|0,u=u+Math.imul(Y,Pe)|0,u=u+Math.imul(Q,ue)|0,_=_+Math.imul(Q,Pe)|0,h=h+Math.imul(F,he)|0,u=u+Math.imul(F,Ne)|0,u=u+Math.imul(K,he)|0,_=_+Math.imul(K,Ne)|0,h=h+Math.imul(O,de)|0,u=u+Math.imul(O,qe)|0,u=u+Math.imul(L,de)|0,_=_+Math.imul(L,qe)|0,h=h+Math.imul(x,pe)|0,u=u+Math.imul(x,Le)|0,u=u+Math.imul(I,pe)|0,_=_+Math.imul(I,Le)|0;var Ft=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,h=Math.imul(le,ae),u=Math.imul(le,Se),u=u+Math.imul(Ce,ae)|0,_=Math.imul(Ce,Se),h=h+Math.imul(ce,re)|0,u=u+Math.imul(ce,Te)|0,u=u+Math.imul(Ie,re)|0,_=_+Math.imul(Ie,Te)|0,h=h+Math.imul(oe,ne)|0,u=u+Math.imul(oe,Ee)|0,u=u+Math.imul(xe,ne)|0,_=_+Math.imul(xe,Ee)|0,h=h+Math.imul(ye,te)|0,u=u+Math.imul(ye,ke)|0,u=u+Math.imul(Re,te)|0,_=_+Math.imul(Re,ke)|0,h=h+Math.imul(J,ue)|0,u=u+Math.imul(J,Pe)|0,u=u+Math.imul(be,ue)|0,_=_+Math.imul(be,Pe)|0,h=h+Math.imul(Y,he)|0,u=u+Math.imul(Y,Ne)|0,u=u+Math.imul(Q,he)|0,_=_+Math.imul(Q,Ne)|0,h=h+Math.imul(F,de)|0,u=u+Math.imul(F,qe)|0,u=u+Math.imul(K,de)|0,_=_+Math.imul(K,qe)|0,h=h+Math.imul(O,pe)|0,u=u+Math.imul(O,Le)|0,u=u+Math.imul(L,pe)|0,_=_+Math.imul(L,Le)|0,h=h+Math.imul(x,ve)|0,u=u+Math.imul(x,Be)|0,u=u+Math.imul(I,ve)|0,_=_+Math.imul(I,Be)|0;var hr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,h=Math.imul(se,ae),u=Math.imul(se,Se),u=u+Math.imul(Me,ae)|0,_=Math.imul(Me,Se),h=h+Math.imul(le,re)|0,u=u+Math.imul(le,Te)|0,u=u+Math.imul(Ce,re)|0,_=_+Math.imul(Ce,Te)|0,h=h+Math.imul(ce,ne)|0,u=u+Math.imul(ce,Ee)|0,u=u+Math.imul(Ie,ne)|0,_=_+Math.imul(Ie,Ee)|0,h=h+Math.imul(oe,te)|0,u=u+Math.imul(oe,ke)|0,u=u+Math.imul(xe,te)|0,_=_+Math.imul(xe,ke)|0,h=h+Math.imul(ye,ue)|0,u=u+Math.imul(ye,Pe)|0,u=u+Math.imul(Re,ue)|0,_=_+Math.imul(Re,Pe)|0,h=h+Math.imul(J,he)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(be,he)|0,_=_+Math.imul(be,Ne)|0,h=h+Math.imul(Y,de)|0,u=u+Math.imul(Y,qe)|0,u=u+Math.imul(Q,de)|0,_=_+Math.imul(Q,qe)|0,h=h+Math.imul(F,pe)|0,u=u+Math.imul(F,Le)|0,u=u+Math.imul(K,pe)|0,_=_+Math.imul(K,Le)|0,h=h+Math.imul(O,ve)|0,u=u+Math.imul(O,Be)|0,u=u+Math.imul(L,ve)|0,_=_+Math.imul(L,Be)|0,h=h+Math.imul(x,me)|0,u=u+Math.imul(x,Ae)|0,u=u+Math.imul(I,me)|0,_=_+Math.imul(I,Ae)|0;var dr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,h=Math.imul(se,re),u=Math.imul(se,Te),u=u+Math.imul(Me,re)|0,_=Math.imul(Me,Te),h=h+Math.imul(le,ne)|0,u=u+Math.imul(le,Ee)|0,u=u+Math.imul(Ce,ne)|0,_=_+Math.imul(Ce,Ee)|0,h=h+Math.imul(ce,te)|0,u=u+Math.imul(ce,ke)|0,u=u+Math.imul(Ie,te)|0,_=_+Math.imul(Ie,ke)|0,h=h+Math.imul(oe,ue)|0,u=u+Math.imul(oe,Pe)|0,u=u+Math.imul(xe,ue)|0,_=_+Math.imul(xe,Pe)|0,h=h+Math.imul(ye,he)|0,u=u+Math.imul(ye,Ne)|0,u=u+Math.imul(Re,he)|0,_=_+Math.imul(Re,Ne)|0,h=h+Math.imul(J,de)|0,u=u+Math.imul(J,qe)|0,u=u+Math.imul(be,de)|0,_=_+Math.imul(be,qe)|0,h=h+Math.imul(Y,pe)|0,u=u+Math.imul(Y,Le)|0,u=u+Math.imul(Q,pe)|0,_=_+Math.imul(Q,Le)|0,h=h+Math.imul(F,ve)|0,u=u+Math.imul(F,Be)|0,u=u+Math.imul(K,ve)|0,_=_+Math.imul(K,Be)|0,h=h+Math.imul(O,me)|0,u=u+Math.imul(O,Ae)|0,u=u+Math.imul(L,me)|0,_=_+Math.imul(L,Ae)|0;var sr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,h=Math.imul(se,ne),u=Math.imul(se,Ee),u=u+Math.imul(Me,ne)|0,_=Math.imul(Me,Ee),h=h+Math.imul(le,te)|0,u=u+Math.imul(le,ke)|0,u=u+Math.imul(Ce,te)|0,_=_+Math.imul(Ce,ke)|0,h=h+Math.imul(ce,ue)|0,u=u+Math.imul(ce,Pe)|0,u=u+Math.imul(Ie,ue)|0,_=_+Math.imul(Ie,Pe)|0,h=h+Math.imul(oe,he)|0,u=u+Math.imul(oe,Ne)|0,u=u+Math.imul(xe,he)|0,_=_+Math.imul(xe,Ne)|0,h=h+Math.imul(ye,de)|0,u=u+Math.imul(ye,qe)|0,u=u+Math.imul(Re,de)|0,_=_+Math.imul(Re,qe)|0,h=h+Math.imul(J,pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(be,pe)|0,_=_+Math.imul(be,Le)|0,h=h+Math.imul(Y,ve)|0,u=u+Math.imul(Y,Be)|0,u=u+Math.imul(Q,ve)|0,_=_+Math.imul(Q,Be)|0,h=h+Math.imul(F,me)|0,u=u+Math.imul(F,Ae)|0,u=u+Math.imul(K,me)|0,_=_+Math.imul(K,Ae)|0;var Kt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,h=Math.imul(se,te),u=Math.imul(se,ke),u=u+Math.imul(Me,te)|0,_=Math.imul(Me,ke),h=h+Math.imul(le,ue)|0,u=u+Math.imul(le,Pe)|0,u=u+Math.imul(Ce,ue)|0,_=_+Math.imul(Ce,Pe)|0,h=h+Math.imul(ce,he)|0,u=u+Math.imul(ce,Ne)|0,u=u+Math.imul(Ie,he)|0,_=_+Math.imul(Ie,Ne)|0,h=h+Math.imul(oe,de)|0,u=u+Math.imul(oe,qe)|0,u=u+Math.imul(xe,de)|0,_=_+Math.imul(xe,qe)|0,h=h+Math.imul(ye,pe)|0,u=u+Math.imul(ye,Le)|0,u=u+Math.imul(Re,pe)|0,_=_+Math.imul(Re,Le)|0,h=h+Math.imul(J,ve)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(be,ve)|0,_=_+Math.imul(be,Be)|0,h=h+Math.imul(Y,me)|0,u=u+Math.imul(Y,Ae)|0,u=u+Math.imul(Q,me)|0,_=_+Math.imul(Q,Ae)|0;var ar=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,h=Math.imul(se,ue),u=Math.imul(se,Pe),u=u+Math.imul(Me,ue)|0,_=Math.imul(Me,Pe),h=h+Math.imul(le,he)|0,u=u+Math.imul(le,Ne)|0,u=u+Math.imul(Ce,he)|0,_=_+Math.imul(Ce,Ne)|0,h=h+Math.imul(ce,de)|0,u=u+Math.imul(ce,qe)|0,u=u+Math.imul(Ie,de)|0,_=_+Math.imul(Ie,qe)|0,h=h+Math.imul(oe,pe)|0,u=u+Math.imul(oe,Le)|0,u=u+Math.imul(xe,pe)|0,_=_+Math.imul(xe,Le)|0,h=h+Math.imul(ye,ve)|0,u=u+Math.imul(ye,Be)|0,u=u+Math.imul(Re,ve)|0,_=_+Math.imul(Re,Be)|0,h=h+Math.imul(J,me)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(be,me)|0,_=_+Math.imul(be,Ae)|0;var Ut=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,h=Math.imul(se,he),u=Math.imul(se,Ne),u=u+Math.imul(Me,he)|0,_=Math.imul(Me,Ne),h=h+Math.imul(le,de)|0,u=u+Math.imul(le,qe)|0,u=u+Math.imul(Ce,de)|0,_=_+Math.imul(Ce,qe)|0,h=h+Math.imul(ce,pe)|0,u=u+Math.imul(ce,Le)|0,u=u+Math.imul(Ie,pe)|0,_=_+Math.imul(Ie,Le)|0,h=h+Math.imul(oe,ve)|0,u=u+Math.imul(oe,Be)|0,u=u+Math.imul(xe,ve)|0,_=_+Math.imul(xe,Be)|0,h=h+Math.imul(ye,me)|0,u=u+Math.imul(ye,Ae)|0,u=u+Math.imul(Re,me)|0,_=_+Math.imul(Re,Ae)|0;var pr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,h=Math.imul(se,de),u=Math.imul(se,qe),u=u+Math.imul(Me,de)|0,_=Math.imul(Me,qe),h=h+Math.imul(le,pe)|0,u=u+Math.imul(le,Le)|0,u=u+Math.imul(Ce,pe)|0,_=_+Math.imul(Ce,Le)|0,h=h+Math.imul(ce,ve)|0,u=u+Math.imul(ce,Be)|0,u=u+Math.imul(Ie,ve)|0,_=_+Math.imul(Ie,Be)|0,h=h+Math.imul(oe,me)|0,u=u+Math.imul(oe,Ae)|0,u=u+Math.imul(xe,me)|0,_=_+Math.imul(xe,Ae)|0;var Jt=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,h=Math.imul(se,pe),u=Math.imul(se,Le),u=u+Math.imul(Me,pe)|0,_=Math.imul(Me,Le),h=h+Math.imul(le,ve)|0,u=u+Math.imul(le,Be)|0,u=u+Math.imul(Ce,ve)|0,_=_+Math.imul(Ce,Be)|0,h=h+Math.imul(ce,me)|0,u=u+Math.imul(ce,Ae)|0,u=u+Math.imul(Ie,me)|0,_=_+Math.imul(Ie,Ae)|0;var tr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,h=Math.imul(se,ve),u=Math.imul(se,Be),u=u+Math.imul(Me,ve)|0,_=Math.imul(Me,Be),h=h+Math.imul(le,me)|0,u=u+Math.imul(le,Ae)|0,u=u+Math.imul(Ce,me)|0,_=_+Math.imul(Ce,Ae)|0;var Rr=(b+h|0)+((u&8191)<<13)|0;b=(_+(u>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,h=Math.imul(se,me),u=Math.imul(se,Ae),u=u+Math.imul(Me,me)|0,_=Math.imul(Me,Ae);var Qr=(b+h|0)+((u&8191)<<13)|0;return b=(_+(u>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g[0]=$t,g[1]=Je,g[2]=Qe,g[3]=Lt,g[4]=Bt,g[5]=Dt,g[6]=jt,g[7]=Ft,g[8]=hr,g[9]=dr,g[10]=sr,g[11]=Kt,g[12]=ar,g[13]=Ut,g[14]=pr,g[15]=Jt,g[16]=tr,g[17]=Rr,g[18]=Qr,b!==0&&(g[19]=b,d.length++),d};Math.imul||(C=R);function B(m,s,l){l.negative=s.negative^m.negative,l.length=m.length+s.length;for(var d=0,f=0,p=0;p<l.length-1;p++){var g=f;f=0;for(var b=d&67108863,h=Math.min(p,s.length-1),u=Math.max(0,p-m.length+1);u<=h;u++){var _=p-u,A=m.words[_]|0,x=s.words[u]|0,I=A*x,j=I&67108863;g=g+(I/67108864|0)|0,j=j+b|0,b=j&67108863,g=g+(j>>>26)|0,f+=g>>>26,g&=67108863}l.words[p]=b,d=g,g=f}return d!==0?l.words[p]=d:l.length--,l.strip()}function N(m,s,l){var d=new q;return d.mulp(m,s,l)}i.prototype.mulTo=function(s,l){var d,f=this.length+s.length;return this.length===10&&s.length===10?d=C(this,s,l):f<63?d=R(this,s,l):f<1024?d=B(this,s,l):d=N(this,s,l),d};function q(m,s){this.x=m,this.y=s}q.prototype.makeRBT=function(s){for(var l=new Array(s),d=i.prototype._countBits(s)-1,f=0;f<s;f++)l[f]=this.revBin(f,d,s);return l},q.prototype.revBin=function(s,l,d){if(s===0||s===d-1)return s;for(var f=0,p=0;p<l;p++)f|=(s&1)<<l-p-1,s>>=1;return f},q.prototype.permute=function(s,l,d,f,p,g){for(var b=0;b<g;b++)f[b]=l[s[b]],p[b]=d[s[b]]},q.prototype.transform=function(s,l,d,f,p,g){this.permute(g,s,l,d,f,p);for(var b=1;b<p;b<<=1)for(var h=b<<1,u=Math.cos(2*Math.PI/h),_=Math.sin(2*Math.PI/h),A=0;A<p;A+=h)for(var x=u,I=_,j=0;j<b;j++){var O=d[A+j],L=f[A+j],W=d[A+j+b],F=f[A+j+b],K=x*W-I*F;F=x*F+I*W,W=K,d[A+j]=O+W,f[A+j]=L+F,d[A+j+b]=O-W,f[A+j+b]=L-F,j!==h&&(K=u*x-_*I,I=u*I+_*x,x=K)}},q.prototype.guessLen13b=function(s,l){var d=Math.max(l,s)|1,f=d&1,p=0;for(d=d/2|0;d;d=d>>>1)p++;return 1<<p+1+f},q.prototype.conjugate=function(s,l,d){if(!(d<=1))for(var f=0;f<d/2;f++){var p=s[f];s[f]=s[d-f-1],s[d-f-1]=p,p=l[f],l[f]=-l[d-f-1],l[d-f-1]=-p}},q.prototype.normalize13b=function(s,l){for(var d=0,f=0;f<l/2;f++){var p=Math.round(s[2*f+1]/l)*8192+Math.round(s[2*f]/l)+d;s[f]=p&67108863,p<67108864?d=0:d=p/67108864|0}return s},q.prototype.convert13b=function(s,l,d,f){for(var p=0,g=0;g<l;g++)p=p+(s[g]|0),d[2*g]=p&8191,p=p>>>13,d[2*g+1]=p&8191,p=p>>>13;for(g=2*l;g<f;++g)d[g]=0;r(p===0),r((p&-8192)===0)},q.prototype.stub=function(s){for(var l=new Array(s),d=0;d<s;d++)l[d]=0;return l},q.prototype.mulp=function(s,l,d){var f=2*this.guessLen13b(s.length,l.length),p=this.makeRBT(f),g=this.stub(f),b=new Array(f),h=new Array(f),u=new Array(f),_=new Array(f),A=new Array(f),x=new Array(f),I=d.words;I.length=f,this.convert13b(s.words,s.length,b,f),this.convert13b(l.words,l.length,_,f),this.transform(b,g,h,u,f,p),this.transform(_,g,A,x,f,p);for(var j=0;j<f;j++){var O=h[j]*A[j]-u[j]*x[j];u[j]=h[j]*x[j]+u[j]*A[j],h[j]=O}return this.conjugate(h,u,f),this.transform(h,u,I,g,f,p),this.conjugate(I,g,f),this.normalize13b(I,f),d.negative=s.negative^l.negative,d.length=s.length+l.length,d.strip()},i.prototype.mul=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),this.mulTo(s,l)},i.prototype.mulf=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),N(this,s,l)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){r(typeof s=="number"),r(s<67108864);for(var l=0,d=0;d<this.length;d++){var f=(this.words[d]|0)*s,p=(f&67108863)+(l&67108863);l>>=26,l+=f/67108864|0,l+=p>>>26,this.words[d]=p&67108863}return l!==0&&(this.words[d]=l,this.length++),this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var l=S(s);if(l.length===0)return new i(1);for(var d=this,f=0;f<l.length&&l[f]===0;f++,d=d.sqr());if(++f<l.length)for(var p=d.sqr();f<l.length;f++,p=p.sqr())l[f]!==0&&(d=d.mul(p));return d},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=67108863>>>26-l<<26-l,p;if(l!==0){var g=0;for(p=0;p<this.length;p++){var b=this.words[p]&f,h=(this.words[p]|0)-b<<l;this.words[p]=h|g,g=b>>>26-l}g&&(this.words[p]=g,this.length++)}if(d!==0){for(p=this.length-1;p>=0;p--)this.words[p+d]=this.words[p];for(p=0;p<d;p++)this.words[p]=0;this.length+=d}return this.strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,l,d){r(typeof s=="number"&&s>=0);var f;l?f=(l-l%26)/26:f=0;var p=s%26,g=Math.min((s-p)/26,this.length),b=67108863^67108863>>>p<<p,h=d;if(f-=g,f=Math.max(0,f),h){for(var u=0;u<g;u++)h.words[u]=this.words[u];h.length=g}if(g!==0)if(this.length>g)for(this.length-=g,u=0;u<this.length;u++)this.words[u]=this.words[u+g];else this.words[0]=0,this.length=1;var _=0;for(u=this.length-1;u>=0&&(_!==0||u>=f);u--){var A=this.words[u]|0;this.words[u]=_<<26-p|A>>>p,_=A&b}return h&&_!==0&&(h.words[h.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(s,l,d){return r(this.negative===0),this.iushrn(s,l,d)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return!1;var p=this.words[d];return!!(p&f)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,d=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(l!==0&&d++,this.length=Math.min(d,this.length),l!==0){var f=67108863^67108863>>>l<<l;this.words[this.length-1]&=f}return this.strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,l,d){var f=s.length+d,p;this._expand(f);var g,b=0;for(p=0;p<s.length;p++){g=(this.words[p+d]|0)+b;var h=(s.words[p]|0)*l;g-=h&67108863,b=(g>>26)-(h/67108864|0),this.words[p+d]=g&67108863}for(;p<this.length-d;p++)g=(this.words[p+d]|0)+b,b=g>>26,this.words[p+d]=g&67108863;if(b===0)return this.strip();for(r(b===-1),b=0,p=0;p<this.length;p++)g=-(this.words[p]|0)+b,b=g>>26,this.words[p]=g&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(s,l){var d=this.length-s.length,f=this.clone(),p=s,g=p.words[p.length-1]|0,b=this._countBits(g);d=26-b,d!==0&&(p=p.ushln(d),f.iushln(d),g=p.words[p.length-1]|0);var h=f.length-p.length,u;if(l!=="mod"){u=new i(null),u.length=h+1,u.words=new Array(u.length);for(var _=0;_<u.length;_++)u.words[_]=0}var A=f.clone()._ishlnsubmul(p,1,h);A.negative===0&&(f=A,u&&(u.words[h]=1));for(var x=h-1;x>=0;x--){var I=(f.words[p.length+x]|0)*67108864+(f.words[p.length+x-1]|0);for(I=Math.min(I/g|0,67108863),f._ishlnsubmul(p,I,x);f.negative!==0;)I--,f.negative=0,f._ishlnsubmul(p,1,x),f.isZero()||(f.negative^=1);u&&(u.words[x]=I)}return u&&u.strip(),f.strip(),l!=="div"&&d!==0&&f.iushrn(d),{div:u||null,mod:f}},i.prototype.divmod=function(s,l,d){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var f,p,g;return this.negative!==0&&s.negative===0?(g=this.neg().divmod(s,l),l!=="mod"&&(f=g.div.neg()),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.iadd(s)),{div:f,mod:p}):this.negative===0&&s.negative!==0?(g=this.divmod(s.neg(),l),l!=="mod"&&(f=g.div.neg()),{div:f,mod:g.mod}):(this.negative&s.negative)!==0?(g=this.neg().divmod(s.neg(),l),l!=="div"&&(p=g.mod.neg(),d&&p.negative!==0&&p.isub(s)),{div:g.div,mod:p}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modn(s.words[0]))}:this._wordDiv(s,l)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var d=l.div.negative!==0?l.mod.isub(s):l.mod,f=s.ushrn(1),p=s.andln(1),g=d.cmp(f);return g<0||p===1&&g===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,d=0,f=this.length-1;f>=0;f--)d=(l*d+(this.words[f]|0))%s;return d},i.prototype.idivn=function(s){r(s<=67108863);for(var l=0,d=this.length-1;d>=0;d--){var f=(this.words[d]|0)+l*67108864;this.words[d]=f/s|0,l=f%s}return this.strip()},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=new i(0),b=new i(1),h=0;l.isEven()&&d.isEven();)l.iushrn(1),d.iushrn(1),++h;for(var u=d.clone(),_=l.clone();!l.isZero();){for(var A=0,x=1;(l.words[0]&x)===0&&A<26;++A,x<<=1);if(A>0)for(l.iushrn(A);A-- >0;)(f.isOdd()||p.isOdd())&&(f.iadd(u),p.isub(_)),f.iushrn(1),p.iushrn(1);for(var I=0,j=1;(d.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(d.iushrn(I);I-- >0;)(g.isOdd()||b.isOdd())&&(g.iadd(u),b.isub(_)),g.iushrn(1),b.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(g),p.isub(b)):(d.isub(l),g.isub(f),b.isub(p))}return{a:g,b,gcd:d.iushln(h)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,d=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var f=new i(1),p=new i(0),g=d.clone();l.cmpn(1)>0&&d.cmpn(1)>0;){for(var b=0,h=1;(l.words[0]&h)===0&&b<26;++b,h<<=1);if(b>0)for(l.iushrn(b);b-- >0;)f.isOdd()&&f.iadd(g),f.iushrn(1);for(var u=0,_=1;(d.words[0]&_)===0&&u<26;++u,_<<=1);if(u>0)for(d.iushrn(u);u-- >0;)p.isOdd()&&p.iadd(g),p.iushrn(1);l.cmp(d)>=0?(l.isub(d),f.isub(p)):(d.isub(l),p.isub(f))}var A;return l.cmpn(1)===0?A=f:A=p,A.cmpn(0)<0&&A.iadd(s),A},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),d=s.clone();l.negative=0,d.negative=0;for(var f=0;l.isEven()&&d.isEven();f++)l.iushrn(1),d.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;d.isEven();)d.iushrn(1);var p=l.cmp(d);if(p<0){var g=l;l=d,d=g}else if(p===0||d.cmpn(1)===0)break;l.isub(d)}while(!0);return d.iushln(f)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,d=(s-l)/26,f=1<<l;if(this.length<=d)return this._expand(d+1),this.words[d]|=f,this;for(var p=f,g=d;p!==0&&g<this.length;g++){var b=this.words[g]|0;b+=p,p=b>>>26,b&=67108863,this.words[g]=b}return p!==0&&(this.words[g]=p,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var d;if(this.length>1)d=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var f=this.words[0]|0;d=f===s?0:f<s?-1:1}return this.negative!==0?-d|0:d},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var l=this.ucmp(s);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var l=0,d=this.length-1;d>=0;d--){var f=this.words[d]|0,p=s.words[d]|0;if(f!==p){f<p?l=-1:f>p&&(l=1);break}}return l},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new V(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var H={k256:null,p224:null,p192:null,p25519:null};function D(m,s){this.name=m,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},D.prototype.ireduce=function(s){var l=s,d;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),d=l.bitLength();while(d>this.n);var f=d<this.n?-1:l.ucmp(this.p);return f===0?(l.words[0]=0,l.length=1):f>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},D.prototype.split=function(s,l){s.iushrn(this.n,0,l)},D.prototype.imulK=function(s){return s.imul(this.k)};function ee(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(ee,D),ee.prototype.split=function(s,l){for(var d=4194303,f=Math.min(s.length,9),p=0;p<f;p++)l.words[p]=s.words[p];if(l.length=f,s.length<=9){s.words[0]=0,s.length=1;return}var g=s.words[9];for(l.words[l.length++]=g&d,p=10;p<s.length;p++){var b=s.words[p]|0;s.words[p-10]=(b&d)<<4|g>>>22,g=b}g>>>=22,s.words[p-10]=g,g===0&&s.length>10?s.length-=10:s.length-=9},ee.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,d=0;d<s.length;d++){var f=s.words[d]|0;l+=f*977,s.words[d]=l&67108863,l=f*64+(l/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function ge(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(ge,D);function Z(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(Z,D);function X(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,D),X.prototype.imulK=function(s){for(var l=0,d=0;d<s.length;d++){var f=(s.words[d]|0)*19+l,p=f&67108863;f>>>=26,s.words[d]=p,l=f}return l!==0&&(s.words[s.length++]=l),s},i._prime=function(s){if(H[s])return H[s];var l;if(s==="k256")l=new ee;else if(s==="p224")l=new ge;else if(s==="p192")l=new Z;else if(s==="p25519")l=new X;else throw new Error("Unknown prime "+s);return H[s]=l,l};function V(m){if(typeof m=="string"){var s=i._prime(m);this.m=s.p,this.prime=s}else r(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}V.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},V.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},V.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},V.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},V.prototype.add=function(s,l){this._verify2(s,l);var d=s.add(l);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},V.prototype.iadd=function(s,l){this._verify2(s,l);var d=s.iadd(l);return d.cmp(this.m)>=0&&d.isub(this.m),d},V.prototype.sub=function(s,l){this._verify2(s,l);var d=s.sub(l);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},V.prototype.isub=function(s,l){this._verify2(s,l);var d=s.isub(l);return d.cmpn(0)<0&&d.iadd(this.m),d},V.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},V.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},V.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},V.prototype.isqr=function(s){return this.imul(s,s.clone())},V.prototype.sqr=function(s){return this.mul(s,s)},V.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var d=this.m.add(new i(1)).iushrn(2);return this.pow(s,d)}for(var f=this.m.subn(1),p=0;!f.isZero()&&f.andln(1)===0;)p++,f.iushrn(1);r(!f.isZero());var g=new i(1).toRed(this),b=g.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);this.pow(u,h).cmp(b)!==0;)u.redIAdd(b);for(var _=this.pow(u,f),A=this.pow(s,f.addn(1).iushrn(1)),x=this.pow(s,f),I=p;x.cmp(g)!==0;){for(var j=x,O=0;j.cmp(g)!==0;O++)j=j.redSqr();r(O<I);var L=this.pow(_,new i(1).iushln(I-O-1));A=A.redMul(L),_=L.redSqr(),x=x.redMul(_),I=O}return A},V.prototype.invm=function(s){var l=s._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},V.prototype.pow=function(s,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return s.clone();var d=4,f=new Array(1<<d);f[0]=new i(1).toRed(this),f[1]=s;for(var p=2;p<f.length;p++)f[p]=this.mul(f[p-1],s);var g=f[0],b=0,h=0,u=l.bitLength()%26;for(u===0&&(u=26),p=l.length-1;p>=0;p--){for(var _=l.words[p],A=u-1;A>=0;A--){var x=_>>A&1;if(g!==f[0]&&(g=this.sqr(g)),x===0&&b===0){h=0;continue}b<<=1,b|=x,h++,!(h!==d&&(p!==0||A!==0))&&(g=this.mul(g,f[b]),h=0,b=0)}u=26}return g},V.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},V.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},i.mont=function(s){return new k(s)};function k(m){V.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(k,V),k.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},k.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},k.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var d=s.imul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},k.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new i(0)._forceRed(this);var d=s.mul(l),f=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=d.isub(f).iushrn(this.shift),g=p;return p.cmp(this.m)>=0?g=p.isub(this.m):p.cmpn(0)<0&&(g=p.iadd(this.m)),g._forceRed(this)},k.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof I3>"u"||I3,UB)});var WB=E(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var fu=Hs(),V0e=g1().ec,C3=new V0e("secp256k1"),tc=C3.curve;rc.privateKeyExport=function(e,t){t===void 0&&(t=!0);var r=new fu(e);if(r.ucmp(tc.n)>=0)throw new Error("couldn't export to DER format");var n=C3.g.mul(r);return HB(n.getX(),n.getY(),t)};rc.privateKeyModInverse=function(e){var t=new fu(e);if(t.ucmp(tc.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(tc.n).toArrayLike(Buffer,"be",32)};rc.signatureImport=function(e){var t=new fu(e.r);t.ucmp(tc.n)>=0&&(t=new fu(0));var r=new fu(e.s);return r.ucmp(tc.n)>=0&&(r=new fu(0)),Buffer.concat([t.toArrayLike(Buffer,"be",32),r.toArrayLike(Buffer,"be",32)])};rc.ecdhUnsafe=function(e,t,r){r===void 0&&(r=!0);var n=C3.keyFromPublic(e),i=new fu(t);if(i.ucmp(tc.n)>=0||i.isZero())throw new Error("scalar was invalid (zero or overflow)");var o=n.pub.mul(i);return HB(o.getX(),o.getY(),r)};var HB=function(e,t,r){var n;return r?(n=Buffer.alloc(33),n[0]=t.isOdd()?3:2,e.toArrayLike(Buffer,"be",32).copy(n,1)):(n=Buffer.alloc(65),n[0]=4,e.toArrayLike(Buffer,"be",32).copy(n,1),t.toArrayLike(Buffer,"be",32).copy(n,33)),n}});var zB=E(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var $0e=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),K0e=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);Bh.privateKeyExport=function(e,t,r){r===void 0&&(r=!0);var n=Buffer.from(r?$0e:K0e);return e.copy(n,r?8:9),t.copy(n,r?181:214),n};Bh.privateKeyImport=function(e){var t=e.length,r=0;if(t<r+1||e[r]!==48||(r+=1,t<r+1||!(e[r]&128)))return null;var n=e[r]&127;if(r+=1,n<1||n>2||t<r+n)return null;var i=e[r+n-1]|(n>1?e[r+n-2]<<8:0);return r+=n,t<r+i||t<r+3||e[r]!==2||e[r+1]!==1||e[r+2]!==1||(r+=3,t<r+2||e[r]!==4||e[r+1]>32||t<r+2+e[r+1])?null:e.slice(r+2,r+2+e[r+1])};Bh.signatureImportLax=function(e){var t=Buffer.alloc(32,0),r=Buffer.alloc(32,0),n=e.length,i=0;if(e[i++]!==48)return null;var o=e[i++];if(o&128&&(i+=o-128,i>n)||e[i++]!==2)return null;var a=e[i++];if(a&128){if(o=a-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(a=0;o>0;i+=1,o-=1)a=(a<<8)+e[i]}if(a>n-i)return null;var c=i;if(i+=a,e[i++]!==2)return null;var v=e[i++];if(v&128){if(o=v-128,i+o>n)return null;for(;o>0&&e[i]===0;i+=1,o-=1);for(v=0;o>0;i+=1,o-=1)v=(v<<8)+e[i]}if(v>n-i)return null;var y=i;for(i+=v;a>0&&e[c]===0;a-=1,c+=1);if(a>32)return null;var w=e.slice(c,c+a);for(w.copy(t,32-w.length);v>0&&e[y]===0;v-=1,y+=1);if(v>32)return null;var M=e.slice(y,y+v);return M.copy(r,32-M.length),{r:t,s:r}}});var Vm=E(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.ecdhUnsafe=Xe.ecdh=Xe.recover=Xe.verify=Xe.sign=Xe.signatureImportLax=Xe.signatureImport=Xe.signatureExport=Xe.signatureNormalize=Xe.publicKeyCombine=Xe.publicKeyTweakMul=Xe.publicKeyTweakAdd=Xe.publicKeyVerify=Xe.publicKeyConvert=Xe.publicKeyCreate=Xe.privateKeyTweakMul=Xe.privateKeyTweakAdd=Xe.privateKeyModInverse=Xe.privateKeyNegate=Xe.privateKeyImport=Xe.privateKeyExport=Xe.privateKeyVerify=void 0;var sn=V2(),zm=WB(),T3=zB();Xe.privateKeyVerify=function(e){return e.length!==32?!1:sn.privateKeyVerify(Uint8Array.from(e))};Xe.privateKeyExport=function(e,t){if(e.length!==32)throw new RangeError("private key length is invalid");var r=zm.privateKeyExport(e,t);return T3.privateKeyExport(e,r,t)};Xe.privateKeyImport=function(e){if(e=T3.privateKeyImport(e),e!==null&&e.length===32&&Xe.privateKeyVerify(e))return e;throw new Error("couldn't import from DER format")};Xe.privateKeyNegate=function(e){return Buffer.from(sn.privateKeyNegate(Uint8Array.from(e)))};Xe.privateKeyModInverse=function(e){if(e.length!==32)throw new Error("private key length is invalid");return Buffer.from(zm.privateKeyModInverse(Uint8Array.from(e)))};Xe.privateKeyTweakAdd=function(e,t){return Buffer.from(sn.privateKeyTweakAdd(Uint8Array.from(e),t))};Xe.privateKeyTweakMul=function(e,t){return Buffer.from(sn.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))};Xe.publicKeyCreate=function(e,t){return Buffer.from(sn.publicKeyCreate(Uint8Array.from(e),t))};Xe.publicKeyConvert=function(e,t){return Buffer.from(sn.publicKeyConvert(Uint8Array.from(e),t))};Xe.publicKeyVerify=function(e){return e.length!==33&&e.length!==65?!1:sn.publicKeyVerify(Uint8Array.from(e))};Xe.publicKeyTweakAdd=function(e,t,r){return Buffer.from(sn.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),r))};Xe.publicKeyTweakMul=function(e,t,r){return Buffer.from(sn.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),r))};Xe.publicKeyCombine=function(e,t){var r=[];return e.forEach(function(n){r.push(Uint8Array.from(n))}),Buffer.from(sn.publicKeyCombine(r,t))};Xe.signatureNormalize=function(e){return Buffer.from(sn.signatureNormalize(Uint8Array.from(e)))};Xe.signatureExport=function(e){return Buffer.from(sn.signatureExport(Uint8Array.from(e)))};Xe.signatureImport=function(e){return Buffer.from(sn.signatureImport(Uint8Array.from(e)))};Xe.signatureImportLax=function(e){if(e.length===0)throw new RangeError("signature length is invalid");var t=T3.signatureImportLax(e);if(t===null)throw new Error("couldn't parse DER signature");return zm.signatureImport(t)};Xe.sign=function(e,t,r){if(r===null)throw new TypeError("options should be an Object");var n=void 0;if(r){if(n={},r.data===null)throw new TypeError("options.data should be a Buffer");if(r.data){if(r.data.length!=32)throw new RangeError("options.data length is invalid");n.data=new Uint8Array(r.data)}if(r.noncefn===null)throw new TypeError("options.noncefn should be a Function");r.noncefn&&(n.noncefn=function(o,a,c,v,y){var w=c!=null?Buffer.from(c):null,M=v!=null?Buffer.from(v):null,S=Buffer.from("");return r.noncefn&&(S=r.noncefn(Buffer.from(o),Buffer.from(a),w,M,y)),new Uint8Array(S)})}var i=sn.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),n);return{signature:Buffer.from(i.signature),recovery:i.recid}};Xe.verify=function(e,t,r){return sn.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)};Xe.recover=function(e,t,r,n){return Buffer.from(sn.ecdsaRecover(Uint8Array.from(t),r,Uint8Array.from(e),n))};Xe.ecdh=function(e,t){return Buffer.from(sn.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))};Xe.ecdhUnsafe=function(e,t,r){if(e.length!==33&&e.length!==65)throw new RangeError("public key length is invalid");if(t.length!==32)throw new RangeError("private key length is invalid");return Buffer.from(zm.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),r))}});var $B=E(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.KECCAK256_RLP=kr.KECCAK256_RLP_S=kr.KECCAK256_RLP_ARRAY=kr.KECCAK256_RLP_ARRAY_S=kr.KECCAK256_NULL=kr.KECCAK256_NULL_S=kr.TWO_POW256=kr.MAX_INTEGER=void 0;var VB=Hs();kr.MAX_INTEGER=new VB("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16);kr.TWO_POW256=new VB("10000000000000000000000000000000000000000000000000000000000000000",16);kr.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";kr.KECCAK256_NULL=Buffer.from(kr.KECCAK256_NULL_S,"hex");kr.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";kr.KECCAK256_RLP_ARRAY=Buffer.from(kr.KECCAK256_RLP_ARRAY_S,"hex");kr.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";kr.KECCAK256_RLP=Buffer.from(kr.KECCAK256_RLP_S,"hex")});var ic=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.baToJSON=Et.addHexPrefix=Et.toUnsigned=Et.fromSigned=Et.bufferToHex=Et.bufferToInt=Et.toBuffer=Et.stripZeros=Et.unpad=Et.setLengthRight=Et.setLength=Et.setLengthLeft=Et.zeros=void 0;var nc=ou(),k3=Hs();Et.zeros=function(e){return Buffer.allocUnsafe(e).fill(0)};Et.setLengthLeft=function(e,t,r){r===void 0&&(r=!1);var n=Et.zeros(t);return e=Et.toBuffer(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)};Et.setLength=Et.setLengthLeft;Et.setLengthRight=function(e,t){return Et.setLength(e,t,!0)};Et.unpad=function(e){e=nc.stripHexPrefix(e);for(var t=e[0];e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e};Et.stripZeros=Et.unpad;Et.toBuffer=function(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")if(nc.isHexString(e))e=Buffer.from(nc.padToEven(nc.stripHexPrefix(e)),"hex");else throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);else if(typeof e=="number")e=nc.intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(k3.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e};Et.bufferToInt=function(e){return new k3(Et.toBuffer(e)).toNumber()};Et.bufferToHex=function(e){return e=Et.toBuffer(e),"0x"+e.toString("hex")};Et.fromSigned=function(e){return new k3(e).fromTwos(256)};Et.toUnsigned=function(e){return Buffer.from(e.toTwos(256).toArray())};Et.addHexPrefix=function(e){return typeof e!="string"||nc.isHexPrefixed(e)?e:"0x"+e};Et.baToJSON=function(e){if(Buffer.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var t=[],r=0;r<e.length;r++)t.push(Et.baToJSON(e[r]));return t}}});var Gm=E($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.rlphash=$n.ripemd160=$n.sha256=$n.keccak256=$n.keccak=void 0;var Km=m2(),G0e=Km.keccak224,Z0e=Km.keccak384,Y0e=Km.keccak256,J0e=Km.keccak512,KB=vx(),Q0e=ou(),X0e=hh(),$m=ic();$n.keccak=function(e,t){switch(t===void 0&&(t=256),typeof e=="string"&&!Q0e.isHexString(e)?e=Buffer.from(e,"utf8"):e=$m.toBuffer(e),t||(t=256),t){case 224:return G0e(e);case 256:return Y0e(e);case 384:return Z0e(e);case 512:return J0e(e);default:throw new Error("Invald algorithm: keccak"+t)}};$n.keccak256=function(e){return $n.keccak(e)};$n.sha256=function(e){return e=$m.toBuffer(e),KB("sha256").update(e).digest()};$n.ripemd160=function(e,t){e=$m.toBuffer(e);var r=KB("rmd160").update(e).digest();return t===!0?$m.setLength(r,32):r};$n.rlphash=function(e){return $n.keccak(X0e.encode(e))}});var GB=E(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.importPublic=Mt.privateToPublic=Mt.privateToAddress=Mt.publicToAddress=Mt.pubToAddress=Mt.isValidPublic=Mt.isValidPrivate=Mt.isPrecompiled=Mt.generateAddress2=Mt.generateAddress=Mt.isValidChecksumAddress=Mt.toChecksumAddress=Mt.isZeroAddress=Mt.isValidAddress=Mt.zeroAddress=void 0;var P3=E1(),ede=ou(),oc=Vm(),tde=Hs(),Hi=ic(),sc=Gm();Mt.zeroAddress=function(){var e=20,t=Hi.zeros(e);return Hi.bufferToHex(t)};Mt.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)};Mt.isZeroAddress=function(e){var t=Mt.zeroAddress();return t===Hi.addHexPrefix(e)};Mt.toChecksumAddress=function(e,t){e=ede.stripHexPrefix(e).toLowerCase();for(var r=t!==void 0?t.toString()+"0x":"",n=sc.keccak(r+e).toString("hex"),i="0x",o=0;o<e.length;o++)parseInt(n[o],16)>=8?i+=e[o].toUpperCase():i+=e[o];return i};Mt.isValidChecksumAddress=function(e,t){return Mt.isValidAddress(e)&&Mt.toChecksumAddress(e,t)===e};Mt.generateAddress=function(e,t){e=Hi.toBuffer(e);var r=new tde(t);return r.isZero()?sc.rlphash([e,null]).slice(-20):sc.rlphash([e,Buffer.from(r.toArray())]).slice(-20)};Mt.generateAddress2=function(e,t,r){var n=Hi.toBuffer(e),i=Hi.toBuffer(t),o=Hi.toBuffer(r);P3(n.length===20),P3(i.length===32);var a=sc.keccak256(Buffer.concat([Buffer.from("ff","hex"),n,i,sc.keccak256(o)]));return a.slice(-20)};Mt.isPrecompiled=function(e){var t=Hi.unpad(e);return t.length===1&&t[0]>=1&&t[0]<=8};Mt.isValidPrivate=function(e){return oc.privateKeyVerify(e)};Mt.isValidPublic=function(e,t){return t===void 0&&(t=!1),e.length===64?oc.publicKeyVerify(Buffer.concat([Buffer.from([4]),e])):t?oc.publicKeyVerify(e):!1};Mt.pubToAddress=function(e,t){return t===void 0&&(t=!1),e=Hi.toBuffer(e),t&&e.length!==64&&(e=oc.publicKeyConvert(e,!1).slice(1)),P3(e.length===64),sc.keccak(e).slice(-20)};Mt.publicToAddress=Mt.pubToAddress;Mt.privateToAddress=function(e){return Mt.publicToAddress(Mt.privateToPublic(e))};Mt.privateToPublic=function(e){return e=Hi.toBuffer(e),oc.publicKeyCreate(e,!1).slice(1)};Mt.importPublic=function(e){return e=Hi.toBuffer(e),e.length!==64&&(e=oc.publicKeyConvert(e,!1).slice(1)),e}});var ZB=E(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.hashPersonalMessage=Kn.isValidSignature=Kn.fromRpcSig=Kn.toRpcSig=Kn.ecrecover=Kn.ecsign=void 0;var N3=Vm(),Zm=Hs(),cu=ic(),rde=Gm();Kn.ecsign=function(e,t,r){var n=N3.sign(e,t),i=n.recovery,o={r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?i+(r*2+35):i+27};return o};Kn.ecrecover=function(e,t,r,n,i){var o=Buffer.concat([cu.setLength(r,32),cu.setLength(n,32)],64),a=q3(t,i);if(!L3(a))throw new Error("Invalid signature v value");var c=N3.recover(e,o,a);return N3.publicKeyConvert(c,!1).slice(1)};Kn.toRpcSig=function(e,t,r,n){var i=q3(e,n);if(!L3(i))throw new Error("Invalid signature v value");return cu.bufferToHex(Buffer.concat([cu.setLengthLeft(t,32),cu.setLengthLeft(r,32),cu.toBuffer(e)]))};Kn.fromRpcSig=function(e){var t=cu.toBuffer(e);if(t.length!==65)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}};Kn.isValidSignature=function(e,t,r,n,i){n===void 0&&(n=!0);var o=new Zm("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new Zm("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(t.length!==32||r.length!==32||!L3(q3(e,i)))return!1;var c=new Zm(t),v=new Zm(r);return!(c.isZero()||c.gt(a)||v.isZero()||v.gt(a)||n&&v.cmp(o)===1)};Kn.hashPersonalMessage=function(e){var t=Buffer.from(`Ethereum Signed Message:
|
|
552
|
+
`+e.length.toString(),"utf-8");return rde.keccak(Buffer.concat([t,e]))};function q3(e,t){return t?e-(2*t+35):e-27}function L3(e){return e===0||e===1}});var QB=E(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.defineProperties=void 0;var YB=E1(),nde=ou(),JB=hh(),Ym=ic();Jm.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(i){if(i===void 0&&(i=!1),i){var o={};return e._fields.forEach(function(a){o[a]="0x"+e[a].toString("hex")}),o}return Ym.baToJSON(e.raw)},e.serialize=function(){return JB.encode(e.raw)},t.forEach(function(i,o){e._fields.push(i.name);function a(){return e.raw[o]}function c(v){v=Ym.toBuffer(v),v.toString("hex")==="00"&&!i.allowZero&&(v=Buffer.allocUnsafe(0)),i.allowLess&&i.length?(v=Ym.stripZeros(v),YB(i.length>=v.length,"The field "+i.name+" must not have more "+i.length+" bytes")):!(i.allowZero&&v.length===0)&&i.length&&YB(i.length===v.length,"The field "+i.name+" must have byte length of "+i.length),e.raw[o]=v}Object.defineProperty(e,i.name,{enumerable:!0,configurable:!0,get:a,set:c}),i.default&&(e[i.name]=i.default),i.alias&&Object.defineProperty(e,i.alias,{enumerable:!1,configurable:!0,set:c,get:a})}),r)if(typeof r=="string"&&(r=Buffer.from(nde.stripHexPrefix(r),"hex")),Buffer.isBuffer(r)&&(r=JB.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach(function(i,o){e[e._fields[o]]=Ym.toBuffer(i)})}else if(typeof r=="object"){var n=Object.keys(r);t.forEach(function(i){n.indexOf(i.name)!==-1&&(e[i.name]=r[i.name]),n.indexOf(i.alias)!==-1&&(e[i.alias]=r[i.alias])})}else throw new Error("invalid data")}});var XB=E(jr=>{"use strict";var ide=jr&&jr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ac=jr&&jr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&ide(t,e,r)};Object.defineProperty(jr,"__esModule",{value:!0});jr.secp256k1=jr.rlp=jr.BN=void 0;var ode=Vm();jr.secp256k1=ode;var sde=ou(),ade=Hs();jr.BN=ade;var ude=hh();jr.rlp=ude;Object.assign(jr,sde);ac($B(),jr);ac(GB(),jr);ac(Gm(),jr);ac(ZB(),jr);ac(ic(),jr);ac(QB(),jr)});var nD=E((rLe,rD)=>{var _o=XB(),Gn=Hs(),br=function(){};function Qm(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}br.eventID=function(e,t){var r=e+"("+t.map(Qm).join(",")+")";return _o.keccak256(Buffer.from(r))};br.methodID=function(e,t){return br.eventID(e,t).slice(0,4)};function Ws(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function B3(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function jh(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function lu(e){var t=typeof e;if(t==="string")return _o.isHexPrefixed(e)?new Gn(_o.stripHexPrefix(e),16):new Gn(e,10);if(t==="number")return new Gn(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function tD(e){var t=/^(\w+)\((.*)\)$/.exec(e);if(t.length!==3)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(t[2]);if(r!==null&&r.length===3)return{method:t[1],args:r[1].split(","),retargs:r[2].split(",")};var n=t[2].split(",");return n.length===1&&n[0]===""&&(n=[]),{method:t[1],args:n}}function yo(e,t){var r,n,i,o;if(e==="address")return yo("uint160",lu(t));if(e==="bool")return yo("uint8",t?1:0);if(e==="string")return yo("bytes",Buffer.from(t,"utf8"));if(Dh(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=jh(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(o in t)i.push(yo(e,t[o]));if(r==="dynamic"){var a=yo("uint256",t.length);i.unshift(a)}return Buffer.concat(i)}else{if(e==="bytes")return t=Buffer.from(t),i=Buffer.concat([yo("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,_o.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Ws(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return _o.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Ws(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=lu(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Ws(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=lu(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=B3(e),n=lu(t),n<0)throw new Error("Supplied ufixed is negative");return yo("uint256",n.mul(new Gn(2).pow(new Gn(r[1]))))}else if(e.startsWith("fixed"))return r=B3(e),yo("int256",lu(t).mul(new Gn(2).pow(new Gn(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Wi(e,t,r){typeof e=="string"&&(e=D3(e));var n,i,o,a;if(e.name==="address")return Wi(e.rawType,t,r).toArrayLike(Buffer,"be",20).toString("hex");if(e.name==="bool")return Wi(e.rawType,t,r).toString()===new Gn(1).toString();if(e.name==="string"){var c=Wi(e.rawType,t,r);return Buffer.from(c,"utf8").toString()}else if(e.isArray){for(o=[],n=e.size,e.size==="dynamic"&&(r=Wi("uint256",t,r).toNumber(),n=Wi("uint256",t,r).toNumber(),r=r+32),a=0;a<n;a++){var v=Wi(e.subArray,t,r);o.push(v),r+=e.subArray.memoryUsage}return o}else{if(e.name==="bytes")return r=Wi("uint256",t,r).toNumber(),n=Wi("uint256",t,r).toNumber(),t.slice(r+32,r+32+n);if(e.name.startsWith("bytes"))return t.slice(r,r+e.size);if(e.name.startsWith("uint")){if(i=new Gn(t.slice(r,r+32),16,"be"),i.bitLength()>e.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+i.bitLength());return i}else if(e.name.startsWith("int")){if(i=new Gn(t.slice(r,r+32),16,"be").fromTwos(256),i.bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+i.bitLength());return i}else if(e.name.startsWith("ufixed")){if(n=new Gn(2).pow(new Gn(e.size[1])),i=Wi("uint256",t,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}else if(e.name.startsWith("fixed")){if(n=new Gn(2).pow(new Gn(e.size[1])),i=Wi("int256",t,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}}throw new Error("Unsupported or invalid type: "+e.name)}function D3(e){var t,r;if(Dh(e)){t=jh(e);var n=e.slice(0,e.lastIndexOf("["));return n=D3(n),r={isArray:!0,name:e,size:t,memoryUsage:t==="dynamic"?32:n.memoryUsage*t,subArray:n},r}else{var i;switch(e){case"address":i="uint160";break;case"bool":i="uint8";break;case"string":i="bytes";break}if(r={rawType:i,name:e,memoryUsage:32},e.startsWith("bytes")&&e!=="bytes"||e.startsWith("uint")||e.startsWith("int")?r.size=Ws(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=B3(e)),e.startsWith("bytes")&&e!=="bytes"&&(r.size<1||r.size>32))throw new Error("Invalid bytes<N> width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint<N> width: "+r.size);return r}}function fde(e){return e==="string"||e==="bytes"||jh(e)==="dynamic"}function Dh(e){return e.lastIndexOf("]")===e.length-1}br.rawEncode=function(e,t){var r=[],n=[],i=0;e.forEach(function(y){if(Dh(y)){var w=jh(y);w!=="dynamic"?i+=32*w:i+=32}else i+=32});for(var o=0;o<e.length;o++){var a=Qm(e[o]),c=t[o],v=yo(a,c);fde(a)?(r.push(yo("uint256",i)),n.push(v),i+=v.length):r.push(v)}return Buffer.concat(r.concat(n))};br.rawDecode=function(e,t){var r=[];t=Buffer.from(t);for(var n=0,i=0;i<e.length;i++){var o=Qm(e[i]),a=D3(o,t,n),c=Wi(a,t,n);n+=a.memoryUsage,r.push(c)}return r};br.simpleEncode=function(e){var t=Array.prototype.slice.call(arguments).slice(1),r=tD(e);if(t.length!==r.args.length)throw new Error("Argument count mismatch");return Buffer.concat([br.methodID(r.method,r.args),br.rawEncode(r.args,t)])};br.simpleDecode=function(e,t){var r=tD(e);if(!r.retargs)throw new Error("No return values in method");return br.rawDecode(r.retargs,t)};function eD(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}br.stringify=function(e,t){var r=[];for(var n in e){var i=e[n],o=t[n];/^[^\[]+\[.*\]$/.test(i)?o=o.map(function(a){return eD(i,a)}).join(", "):o=eD(i,o),r.push(o)}return r};br.solidityHexValue=function(e,t,r){var n,i;if(Dh(e)){var o=e.replace(/\[.*?\]/,"");if(!Dh(o)){var a=jh(e);if(a!=="dynamic"&&a!==0&&t.length>a)throw new Error("Elements exceed array size: "+a)}var c=t.map(function(w){return br.solidityHexValue(o,w,256)});return Buffer.concat(c)}else{if(e==="bytes")return t;if(e==="string")return Buffer.from(t,"utf8");if(e==="bool"){r=r||8;var v=Array(r/4).join("0");return Buffer.from(t?v+"1":v+"0","hex")}else if(e==="address"){var y=20;return r&&(y=r/8),_o.setLengthLeft(t,y)}else if(e.startsWith("bytes")){if(n=Ws(e),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return _o.setLengthRight(t,n)}else if(e.startsWith("uint")){if(n=Ws(e),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(i=lu(t),i.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toArrayLike(Buffer,"be",r/8)}else if(e.startsWith("int")){if(n=Ws(e),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(i=lu(t),i.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toTwos(n).toArrayLike(Buffer,"be",r/8)}else throw new Error("Unsupported or invalid type: "+e)}};br.solidityPack=function(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r=[],n=0;n<e.length;n++){var i=Qm(e[n]),o=t[n];r.push(br.solidityHexValue(i,o,null))}return Buffer.concat(r)};br.soliditySHA3=function(e,t){return _o.keccak256(br.solidityPack(e,t))};br.soliditySHA256=function(e,t){return _o.sha256(br.solidityPack(e,t))};br.solidityRIPEMD160=function(e,t){return _o.ripemd160(br.solidityPack(e,t),!0)};function cde(e){return e>="0"&&e<="9"}br.fromSerpent=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n==="s")t.push("bytes");else if(n==="b"){for(var i="bytes",o=r+1;o<e.length&&cde(e[o]);)i+=e[o]-"0",o++;r=o-1,t.push(i)}else if(n==="i")t.push("int256");else if(n==="a")t.push("int256[]");else throw new Error("Unsupported or invalid type: "+n)}return t};br.toSerpent=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n==="bytes")t.push("s");else if(n.startsWith("bytes"))t.push("b"+Ws(n));else if(n==="int256")t.push("i");else if(n==="int256[]")t.push("a");else throw new Error("Unsupported or invalid type: "+n)}return t.join("")};rD.exports=br});var oD=E((nLe,iD)=>{iD.exports=nD()});var cD=E((iLe,fD)=>{var er=jf(),j3=oD();fD.exports={concatSig:function(e,t,r){let n=er.fromSigned(t),i=er.fromSigned(r),o=er.bufferToInt(e),a=aD(er.toUnsigned(n).toString("hex"),64),c=aD(er.toUnsigned(i).toString("hex"),64),v=er.stripHexPrefix(er.intToHex(o));return er.addHexPrefix(a.concat(c,v)).toString("hex")},normalize:function(e){if(!!e){if(typeof e=="number"){let r=er.toBuffer(e);e=er.bufferToHex(r)}if(typeof e!="string"){var t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=" received "+typeof e+": "+e,new Error(t)}return er.addHexPrefix(e.toLowerCase())}},personalSign:function(e,t){var r=er.toBuffer(t.data),n=er.hashPersonalMessage(r),i=er.ecsign(n,e),o=er.bufferToHex(this.concatSig(i.v,i.r,i.s));return o},recoverPersonalSignature:function(e){let t=sD(e),r=er.publicToAddress(t);return er.bufferToHex(r)},extractPublicKey:function(e){let t=sD(e);return"0x"+t.toString("hex")},typedSignatureHash:function(e){let t=F3(e);return er.bufferToHex(t)},signTypedData:function(e,t){let r=F3(t.data),n=er.ecsign(r,e);return er.bufferToHex(this.concatSig(n.v,n.r,n.s))},recoverTypedSignature:function(e){let t=F3(e.data),r=uD(t,e.sig),n=er.publicToAddress(r);return er.bufferToHex(n)}};function F3(e){let t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;let r=e.map(function(o){return o.type==="bytes"?er.toBuffer(o.value):o.value}),n=e.map(function(o){return o.type}),i=e.map(function(o){if(!o.name)throw t;return o.type+" "+o.name});return j3.soliditySHA3(["bytes32","bytes32"],[j3.soliditySHA3(new Array(e.length).fill("string"),i),j3.soliditySHA3(n,r)])}function uD(e,t){let r=er.toBuffer(t),n=er.fromRpcSig(r);return er.ecrecover(e,n.v,n.r,n.s)}function sD(e){let t=er.toBuffer(e.data),r=er.hashPersonalMessage(t);return uD(r,e.sig)}function aD(e,t){for(var r=""+e;r.length<t;)r="0"+r;return r}});var hD=E((U3,lD)=>{(function(e){"use strict";var t=function(n){setTimeout(n,0)};typeof process<"u"&&process&&typeof process.nextTick=="function"&&(t=process.nextTick);function r(n){var i={capacity:n||1,current:0,queue:[],firstHere:!1,take:function(){if(i.firstHere===!1){i.current++,i.firstHere=!0;var o=1}else var o=0;var a={n:1};typeof arguments[0]=="function"?a.task=arguments[0]:a.n=arguments[0],arguments.length>=2&&(typeof arguments[1]=="function"?a.task=arguments[1]:a.n=arguments[1]);var c=a.task;if(a.task=function(){c(i.leave)},i.current+a.n-o>i.capacity)return o===1&&(i.current--,i.firstHere=!1),i.queue.push(a);i.current+=a.n-o,a.task(i.leave),o===1&&(i.firstHere=!1)},leave:function(o){if(o=o||1,i.current-=o,!i.queue.length){if(i.current<0)throw new Error("leave called too many times.");return}var a=i.queue[0];a.n+i.current>i.capacity||(i.queue.shift(),i.current+=a.n,t(a.task))},available:function(o){return o=o||1,i.current+o<=i.capacity}};return i}typeof U3=="object"?lD.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):e.semaphore=r})(U3)});var pD=E((oLe,dD)=>{var lde=mm();dD.exports=hde;function hde(e,t,r){e.sendAsync(lde({method:"eth_estimateGas",params:[t]}),function(n,i){if(n)return n.message==="no contract code at given address"?r(null,"0xcf08"):r(n);r(null,i.result)})}});var gD=E((sLe,mD)=>{var _n=qB(),dde=FB(),pde=$o().inherits,Xm=jf(),vde=cD(),fc=j1(),mde=hD(),gde=Ph(),bde=pD(),yde=/^[0-9A-Fa-f]+$/g;mD.exports=zt;pde(zt,gde);function zt(e){let t=this;t.nonceLock=mde(1),e.getAccounts&&(t.getAccounts=e.getAccounts),e.processTransaction&&(t.processTransaction=e.processTransaction),e.processMessage&&(t.processMessage=e.processMessage),e.processPersonalMessage&&(t.processPersonalMessage=e.processPersonalMessage),e.processTypedMessage&&(t.processTypedMessage=e.processTypedMessage),t.approveTransaction=e.approveTransaction||t.autoApprove,t.approveMessage=e.approveMessage||t.autoApprove,t.approvePersonalMessage=e.approvePersonalMessage||t.autoApprove,t.approveDecryptMessage=e.approveDecryptMessage||t.autoApprove,t.approveEncryptionPublicKey=e.approveEncryptionPublicKey||t.autoApprove,t.approveTypedMessage=e.approveTypedMessage||t.autoApprove,e.signTransaction&&(t.signTransaction=e.signTransaction||uc("signTransaction")),e.signMessage&&(t.signMessage=e.signMessage||uc("signMessage")),e.signPersonalMessage&&(t.signPersonalMessage=e.signPersonalMessage||uc("signPersonalMessage")),e.decryptMessage&&(t.decryptMessage=e.decryptMessage||uc("decryptMessage")),e.encryptionPublicKey&&(t.encryptionPublicKey=e.encryptionPublicKey||uc("encryptionPublicKey")),e.signTypedMessage&&(t.signTypedMessage=e.signTypedMessage||uc("signTypedMessage")),e.recoverPersonalSignature&&(t.recoverPersonalSignature=e.recoverPersonalSignature),e.publishTransaction&&(t.publishTransaction=e.publishTransaction),t.estimateGas=e.estimateGas||t.estimateGas,t.getGasPrice=e.getGasPrice||t.getGasPrice}zt.prototype.handleRequest=function(e,t,r){let n=this;n._parityRequests={},n._parityRequestCount=0;let i,o,a,c,v;switch(e.method){case"eth_coinbase":n.getAccounts(function(y,w){if(y)return r(y);let M=w[0]||null;r(null,M)});return;case"eth_accounts":n.getAccounts(function(y,w){if(y)return r(y);r(null,w)});return;case"eth_sendTransaction":i=e.params[0],_n([y=>n.validateTransaction(i,y),y=>n.processTransaction(i,y)],r);return;case"eth_signTransaction":i=e.params[0],_n([y=>n.validateTransaction(i,y),y=>n.processSignTransaction(i,y)],r);return;case"eth_sign":v=e.params[0],c=e.params[1],a=e.params[2]||{},o=fc(a,{from:v,data:c}),_n([y=>n.validateMessage(o,y),y=>n.processMessage(o,y)],r);return;case"personal_sign":return function(){let y=e.params[0],w=e.params[1];if(vD(w)&&H3(y)){let M="The eth_personalSign method requires params ordered ";M+="[message, address]. This was previously handled incorrectly, ",M+="and has been corrected automatically. ",M+="Please switch this param order for smooth behavior in the future.",console.warn(M),v=e.params[0],c=e.params[1]}else c=e.params[0],v=e.params[1];a=e.params[2]||{},o=fc(a,{from:v,data:c}),_n([M=>n.validatePersonalMessage(o,M),M=>n.processPersonalMessage(o,M)],r)}();case"eth_decryptMessage":return function(){let y=e.params[0],w=e.params[1];if(vD(w)&&H3(y)){let M="The eth_decryptMessage method requires params ordered ";M+="[message, address]. This was previously handled incorrectly, ",M+="and has been corrected automatically. ",M+="Please switch this param order for smooth behavior in the future.",console.warn(M),v=e.params[0],c=e.params[1]}else c=e.params[0],v=e.params[1];a=e.params[2]||{},o=fc(a,{from:v,data:c}),_n([M=>n.validateDecryptMessage(o,M),M=>n.processDecryptMessage(o,M)],r)}();case"encryption_public_key":return function(){let y=e.params[0];_n([w=>n.validateEncryptionPublicKey(y,w),w=>n.processEncryptionPublicKey(y,w)],r)}();case"personal_ecRecover":return function(){c=e.params[0];let y=e.params[1];a=e.params[2]||{},o=fc(a,{sig:y,data:c}),n.recoverPersonalSignature(o,r)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){let y=e.params[0],w=e.params[1];H3(y)?(v=y,c=w):(c=y,v=w),a=e.params[2]||{},o=fc(a,{from:v,data:c}),_n([M=>n.validateTypedMessage(o,M),M=>n.processTypedMessage(o,M)],r)}();case"parity_postTransaction":i=e.params[0],n.parityPostTransaction(i,r);return;case"parity_postSign":v=e.params[0],c=e.params[1],n.parityPostSign(v,c,r);return;case"parity_checkRequest":return function(){let y=e.params[0];n.parityCheckRequest(y,r)}();case"parity_defaultAccount":n.getAccounts(function(y,w){if(y)return r(y);let M=w[0]||null;r(null,M)});return;default:t();return}};zt.prototype.getAccounts=function(e){e(null,[])};zt.prototype.processTransaction=function(e,t){let r=this;_n([n=>r.approveTransaction(e,n),(n,i)=>r.checkApproval("transaction",n,i),n=>r.finalizeAndSubmitTx(e,n)],t)};zt.prototype.processSignTransaction=function(e,t){let r=this;_n([n=>r.approveTransaction(e,n),(n,i)=>r.checkApproval("transaction",n,i),n=>r.finalizeTx(e,n)],t)};zt.prototype.processMessage=function(e,t){let r=this;_n([n=>r.approveMessage(e,n),(n,i)=>r.checkApproval("message",n,i),n=>r.signMessage(e,n)],t)};zt.prototype.processPersonalMessage=function(e,t){let r=this;_n([n=>r.approvePersonalMessage(e,n),(n,i)=>r.checkApproval("message",n,i),n=>r.signPersonalMessage(e,n)],t)};zt.prototype.processDecryptMessage=function(e,t){let r=this;_n([n=>r.approveDecryptMessage(e,n),(n,i)=>r.checkApproval("decryptMessage",n,i),n=>r.decryptMessage(e,n)],t)};zt.prototype.processEncryptionPublicKey=function(e,t){let r=this;_n([n=>r.approveEncryptionPublicKey(e,n),(n,i)=>r.checkApproval("encryptionPublicKey",n,i),n=>r.encryptionPublicKey(e,n)],t)};zt.prototype.processTypedMessage=function(e,t){let r=this;_n([n=>r.approveTypedMessage(e,n),(n,i)=>r.checkApproval("message",n,i),n=>r.signTypedMessage(e,n)],t)};zt.prototype.autoApprove=function(e,t){t(null,!0)};zt.prototype.checkApproval=function(e,t,r){r(t?null:new Error("User denied "+e+" signature."))};zt.prototype.parityPostTransaction=function(e,t){let r=this,i=`0x${r._parityRequestCount.toString(16)}`;r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[e]},function(o,a){if(o){r._parityRequests[i]={error:o};return}let c=a.result;r._parityRequests[i]=c}),t(null,i)};zt.prototype.parityPostSign=function(e,t,r){let n=this,o=`0x${n._parityRequestCount.toString(16)}`;n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[e,t]},function(a,c){if(a){n._parityRequests[o]={error:a};return}let v=c.result;n._parityRequests[o]=v}),r(null,o)};zt.prototype.parityCheckRequest=function(e,t){let n=this._parityRequests[e]||null;if(!n)return t(null,null);if(n.error)return t(n.error);t(null,n)};zt.prototype.recoverPersonalSignature=function(e,t){let r;try{r=vde.recoverPersonalSignature(e)}catch(n){return t(n)}t(null,r)};zt.prototype.validateTransaction=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to sign transaction."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to sign transaction for this address: "${e.from}"`));t()})};zt.prototype.validateMessage=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to sign message."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`));t()})};zt.prototype.validatePersonalMessage=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to sign personal message."));if(e.data===void 0)return t(new Error("Undefined message - message required to sign personal message."));if(!W3(e.data))return t(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`));t()})};zt.prototype.validateDecryptMessage=function(e,t){let r=this;if(e.from===void 0)return t(new Error("Undefined address - from address required to decrypt message."));if(e.data===void 0)return t(new Error("Undefined message - message required to decrypt message."));if(!W3(e.data))return t(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."));r.validateSender(e.from,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to decrypt message for this address: "${e.from}"`));t()})};zt.prototype.validateEncryptionPublicKey=function(e,t){this.validateSender(e,function(n,i){if(n)return t(n);if(!i)return t(new Error(`Unknown address - unable to obtain encryption public key for this address: "${e}"`));t()})};zt.prototype.validateTypedMessage=function(e,t){if(e.from===void 0)return t(new Error("Undefined address - from address required to sign typed data."));if(e.data===void 0)return t(new Error("Undefined data - message required to sign typed data."));this.validateSender(e.from,function(r,n){if(r)return t(r);if(!n)return t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`));t()})};zt.prototype.validateSender=function(e,t){let r=this;if(!e)return t(null,!1);r.getAccounts(function(n,i){if(n)return t(n);let o=i.map(wde).indexOf(e.toLowerCase())!==-1;t(null,o)})};zt.prototype.finalizeAndSubmitTx=function(e,t){let r=this;r.nonceLock.take(function(){_n([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r),r.publishTransaction.bind(r)],function(n,i){if(r.nonceLock.leave(),n)return t(n);t(null,i)})})};zt.prototype.finalizeTx=function(e,t){let r=this;r.nonceLock.take(function(){_n([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r)],function(n,i){if(r.nonceLock.leave(),n)return t(n);t(null,{raw:i,tx:e})})})};zt.prototype.publishTransaction=function(e,t){this.emitPayload({method:"eth_sendRawTransaction",params:[e]},function(n,i){if(n)return t(n);t(null,i.result)})};zt.prototype.estimateGas=function(e,t){bde(this.engine,e,t)};zt.prototype.getGasPrice=function(e){this.emitPayload({method:"eth_gasPrice",params:[]},function(r,n){if(r)return e(r);e(null,n.result)})};zt.prototype.fillInTxExtras=function(e,t){let r=this,n=e.from,i={};e.gasPrice===void 0&&(i.gasPrice=r.getGasPrice.bind(r)),e.nonce===void 0&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),e.gas===void 0&&(i.gas=r.estimateGas.bind(r,_de(e))),dde(i,function(o,a){if(o)return t(o);let c={};a.gasPrice&&(c.gasPrice=a.gasPrice),a.nonce&&(c.nonce=a.nonce.result),a.gas&&(c.gas=a.gas),t(null,fc(e,c))})};function _de(e){return{from:e.from,to:e.to,value:e.value,data:e.data,gas:e.gas,gasPrice:e.gasPrice,nonce:e.nonce}}function wde(e){return e.toLowerCase()}function H3(e){let t=Xm.addHexPrefix(e);return Xm.isValidAddress(t)}function vD(e){let t=Xm.addHexPrefix(e);return!Xm.isValidAddress(t)&&W3(e)}function W3(e){return!(typeof e=="string")||!(e.slice(0,2)==="0x")?!1:e.slice(2).match(yde)}function uc(e){return function(t,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+e+'" fn in constructor options'))}}});var bD=E((aLe,xde)=>{xde.exports={genesisGasLimit:{v:5e3,d:"Gas limit of the Genesis block."},genesisDifficulty:{v:17179869184,d:"Difficulty of the Genesis block."},genesisNonce:{v:"0x0000000000000042",d:"the geneis nonce"},genesisExtraData:{v:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",d:"extra data "},genesisHash:{v:"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",d:"genesis hash"},genesisStateRoot:{v:"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",d:"the genesis state root"},minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be."},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations."},minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be."},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations."},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},maximumExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis."},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs."},stackLimit:{v:1024,d:"Maximum size of VM stack allowed."},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack."},tierStepGas:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them."},expGas:{v:10,d:"Once per EXP instuction."},expByteGas:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction."},sha3Gas:{v:30,d:"Once per SHA3 operation."},sha3WordGas:{v:6,d:"Once per word of the SHA3 operation's data."},sloadGas:{v:50,d:"Once per SLOAD operation."},sstoreSetGas:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero."},sstoreResetGas:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero."},sstoreRefundGas:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero."},jumpdestGas:{v:1,d:"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},logGas:{v:375,d:"Per LOG* operation."},logDataGas:{v:8,d:"Per byte in a LOG* operation's data."},logTopicGas:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},createGas:{v:32e3,d:"Once per CREATE operation & contract-creation transaction."},callGas:{v:40,d:"Once per CALL operation & message call transaction."},callStipend:{v:2300,d:"Free gas given at beginning of call."},callValueTransferGas:{v:9e3,d:"Paid for CALL when the value transfor is non-zero."},callNewAccountGas:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior."},suicideRefundGas:{v:24e3,d:"Refunded following a suicide operation."},memoryGas:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation."},createDataGas:{v:200,d:""},txGas:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions."},txCreation:{v:32e3,d:"the cost of creating a contract via tx"},txDataZeroGas:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},txDataNonZeroGas:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},copyGas:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},ecrecoverGas:{v:3e3,d:""},sha256Gas:{v:60,d:""},sha256WordGas:{v:12,d:""},ripemd160Gas:{v:600,d:""},ripemd160WordGas:{v:120,d:""},identityGas:{v:15,d:""},identityWordGas:{v:3,d:""},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},ommerReward:{v:"625000000000000000",d:"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},niblingReward:{v:"156250000000000000",d:"the amount a miner gets for inculding a uncle"},homeSteadForkNumber:{v:115e4,d:"the block that the Homestead fork started at"},homesteadRepriceForkNumber:{v:2463e3,d:"the block that the Homestead Reprice (EIP150) fork started at"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},freeBlockPeriod:{v:2}}});var _D=E((uLe,yD)=>{"use strict";function Mde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var zs=jf(),eg=bD(),hu=zs.BN,Sde=new hu("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),Ede=function(){function e(t){Mde(this,e),t=t||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new Buffer([])},{name:"gasPrice",length:32,allowLess:!0,default:new Buffer([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new Buffer([])},{name:"to",allowZero:!0,length:20,default:new Buffer([])},{name:"value",length:32,allowLess:!0,default:new Buffer([])},{name:"data",alias:"input",allowZero:!0,default:new Buffer([])},{name:"v",allowZero:!0,default:new Buffer([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new Buffer([])}];zs.defineProperties(this,r,t),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var n=zs.bufferToInt(this.v),i=Math.floor((n-35)/2);i<0&&(i=0),this._chainId=i||t.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return this.to.toString("hex")===""},e.prototype.hash=function(r){r===void 0&&(r=!0);var n=void 0;if(r)n=this.raw;else if(this._chainId>0){var i=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,n=this.raw,this.raw=i}else n=this.raw.slice(0,6);return zs.rlphash(n)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var r=this.getSenderPublicKey();return this._from=zs.publicToAddress(r),this._from},e.prototype.getSenderPublicKey=function(){if((!this._senderPubKey||!this._senderPubKey.length)&&!this.verifySignature())throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var r=this.hash(!1);if(this._homestead&&new hu(this.s).cmp(Sde)===1)return!1;try{var n=zs.bufferToInt(this.v);this._chainId>0&&(n-=this._chainId*2+8),this._senderPubKey=zs.ecrecover(r,n,this.r,this.s)}catch{return!1}return!!this._senderPubKey},e.prototype.sign=function(r){var n=this.hash(!1),i=zs.ecsign(n,r);this._chainId>0&&(i.v+=this._chainId*2+8),Object.assign(this,i)},e.prototype.getDataFee=function(){for(var r=this.raw[5],n=new hu(0),i=0;i<r.length;i++)r[i]===0?n.iaddn(eg.txDataZeroGas.v):n.iaddn(eg.txDataNonZeroGas.v);return n},e.prototype.getBaseFee=function(){var r=this.getDataFee().iaddn(eg.txGas.v);return this._homestead&&this.toCreationAddress()&&r.iaddn(eg.txCreation.v),r},e.prototype.getUpfrontCost=function(){return new hu(this.gasLimit).imul(new hu(this.gasPrice)).iadd(new hu(this.value))},e.prototype.validate=function(r){var n=[];return this.verifySignature()||n.push("Invalid Signature"),this.getBaseFee().cmp(new hu(this.gasLimit))>0&&n.push(["gas limit is too low. Need at least "+this.getBaseFee()]),r===void 0||r===!1?n.length===0:n.join(" ")},e}();yD.exports=Ede});var xD=E((fLe,wD)=>{var Ade=$o().inherits,Ode=_D(),tg=jf(),Rde=Ph(),Ide=Kx().blockTagForPayload;wD.exports=z3;Ade(z3,Rde);function z3(e){let t=this;t.nonceCache={}}z3.prototype.handleRequest=function(e,t,r){let n=this;switch(e.method){case"eth_getTransactionCount":var i=Ide(e),o=e.params[0].toLowerCase(),a=n.nonceCache[o];i==="pending"?a?r(null,a):t(function(c,v,y){if(c)return y();n.nonceCache[o]===void 0&&(n.nonceCache[o]=v),y()}):t();return;case"eth_sendRawTransaction":t(function(c,v,y){if(c)return y();var w=e.params[0],M=tg.stripHexPrefix(w),S=Buffer.from(tg.stripHexPrefix(w),"hex"),R=new Ode(Buffer.from(tg.stripHexPrefix(w),"hex")),C="0x"+R.getSenderAddress().toString("hex").toLowerCase(),B=tg.bufferToInt(R.nonce);B++;var N=B.toString(16);N.length%2&&(N="0"+N),N="0x"+N,n.nonceCache[C]=N,y()});return;case"evm_revert":n.nonceCache={},t();return;default:t();return}}});var V3=E((cLe,SD)=>{var Cde=Nh().default,Tde=b3(),{createAsyncMiddleware:MD}=g3(),kde=O3(),{unsafeRandomBytes:Pde,incrementHexInt:Nde}=Qf(),qde=Dm();SD.exports=Lde;function Lde({blockTracker:e,provider:t}){let r={},n=kde({blockTracker:e,provider:t}),i=!1,o=new Cde,a=Tde({eth_subscribe:MD(c),eth_unsubscribe:MD(v)});return a.destroy=w,{events:o,middleware:a};async function c(M,S){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let R=M.params[0],C=Pde(16),B;switch(R){case"newHeads":B=N({subId:C});break;case"logs":let H=M.params[1],D=await n.newLogFilter(H);B=q({subId:C,filter:D});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${R}"`)}r[C]=B,S.result=C;return;function N({subId:H}){let D={type:R,destroy:async()=>{e.removeListener("sync",D.update)},update:async({oldBlock:ee,newBlock:ge})=>{let Z=ge,X=Nde(ee);(await qde({provider:t,fromBlock:X,toBlock:Z})).map(Bde).forEach(m=>{y(H,m)})}};return e.on("sync",D.update),D}function q({subId:H,filter:D}){return D.on("update",ge=>y(H,ge)),{type:R,destroy:async()=>await n.uninstallFilter(D.idHex)}}}async function v(M,S){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let R=M.params[0],C=r[R];if(!C){S.result=!1;return}delete r[R],await C.destroy(),S.result=!0}function y(M,S){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:M,result:S}})}function w(){o.removeAllListeners();for(let M in r)r[M].destroy(),delete r[M];i=!0}}function Bde(e){return{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}});var AD=E((lLe,ED)=>{var Dde=gm(),jde=V3(),$3=class extends Dde{constructor(){super(({blockTracker:t,provider:r,engine:n})=>{let{events:i,middleware:o}=jde({blockTracker:t,provider:r});return i.on("notification",a=>n.emit("data",null,a)),o})}};ED.exports=$3});var ID=E(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.walletLogo=void 0;var Kde=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};rg.walletLogo=Kde});var CD=E(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.ScopedLocalStorage=void 0;var G3=class{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){let t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}};ng.ScopedLocalStorage=G3});var og=E(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.EthereumProviderError=cc.EthereumRpcError=void 0;var Gde=f3(),ig=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Gde.default(this.serialize(),Yde,2)}};cc.EthereumRpcError=ig;var Z3=class extends ig{constructor(t,r,n){if(!Zde(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};cc.EthereumProviderError=Z3;function Zde(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Yde(e,t){if(t!=="[Circular]")return t}});var sg=E(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.errorValues=lc.errorCodes=void 0;lc.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};lc.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}});var Q3=E(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.serializeError=zi.isValidCode=zi.getMessageFromCode=zi.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var ag=sg(),Jde=og(),TD=ag.errorCodes.rpc.internal,Qde="Unspecified error message. This is a bug, please report it.",Xde={code:TD,message:J3(TD)};zi.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function J3(e,t=Qde){if(Number.isInteger(e)){let r=e.toString();if(Y3(ag.errorValues,r))return ag.errorValues[r].message;if(ND(e))return zi.JSON_RPC_SERVER_ERROR_MESSAGE}return t}zi.getMessageFromCode=J3;function PD(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(ag.errorValues[t]||ND(e))}zi.isValidCode=PD;function epe(e,{fallbackError:t=Xde,shouldIncludeStack:r=!1}={}){var n,i;if(!t||!Number.isInteger(t.code)||typeof t.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof Jde.EthereumRpcError)return e.serialize();let o={};if(e&&typeof e=="object"&&!Array.isArray(e)&&Y3(e,"code")&&PD(e.code)){let c=e;o.code=c.code,c.message&&typeof c.message=="string"?(o.message=c.message,Y3(c,"data")&&(o.data=c.data)):(o.message=J3(o.code),o.data={originalError:kD(e)})}else{o.code=t.code;let c=(n=e)===null||n===void 0?void 0:n.message;o.message=c&&typeof c=="string"?c:t.message,o.data={originalError:kD(e)}}let a=(i=e)===null||i===void 0?void 0:i.stack;return r&&e&&a&&typeof a=="string"&&(o.stack=a),o}zi.serializeError=epe;function ND(e){return e>=-32099&&e<=-32e3}function kD(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.assign({},e):e}function Y3(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var BD=E(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.ethErrors=void 0;var X3=og(),qD=Q3(),wn=sg();ug.ethErrors={rpc:{parse:e=>Ei(wn.errorCodes.rpc.parse,e),invalidRequest:e=>Ei(wn.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ei(wn.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ei(wn.errorCodes.rpc.methodNotFound,e),internal:e=>Ei(wn.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ei(t,e)},invalidInput:e=>Ei(wn.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ei(wn.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ei(wn.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ei(wn.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ei(wn.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ei(wn.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Fh(wn.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Fh(wn.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Fh(wn.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Fh(wn.errorCodes.provider.disconnected,e),chainDisconnected:e=>Fh(wn.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new X3.EthereumProviderError(t,r,n)}}};function Ei(e,t){let[r,n]=LD(t);return new X3.EthereumRpcError(e,r||qD.getMessageFromCode(e),n)}function Fh(e,t){let[r,n]=LD(t);return new X3.EthereumProviderError(e,r||qD.getMessageFromCode(e),n)}function LD(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}});var fg=E(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.getMessageFromCode=Zn.serializeError=Zn.EthereumProviderError=Zn.EthereumRpcError=Zn.ethErrors=Zn.errorCodes=void 0;var DD=og();Object.defineProperty(Zn,"EthereumRpcError",{enumerable:!0,get:function(){return DD.EthereumRpcError}});Object.defineProperty(Zn,"EthereumProviderError",{enumerable:!0,get:function(){return DD.EthereumProviderError}});var jD=Q3();Object.defineProperty(Zn,"serializeError",{enumerable:!0,get:function(){return jD.serializeError}});Object.defineProperty(Zn,"getMessageFromCode",{enumerable:!0,get:function(){return jD.getMessageFromCode}});var tpe=BD();Object.defineProperty(Zn,"ethErrors",{enumerable:!0,get:function(){return tpe.ethErrors}});var rpe=sg();Object.defineProperty(Zn,"errorCodes",{enumerable:!0,get:function(){return rpe.errorCodes}})});var lg=E(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.EVENTS=void 0;cg.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"}});var hc=E(e4=>{"use strict";Object.defineProperty(e4,"__esModule",{value:!0});function npe(e){return typeof e=="function"}e4.isFunction=npe});var Uh=E(r4=>{"use strict";Object.defineProperty(r4,"__esModule",{value:!0});var t4=!1;r4.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){var t=new Error;console.warn(`DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at:
|
|
553
|
+
`+t.stack)}else t4&&console.log("RxJS: Back to a better error behavior. Thank you. <3");t4=e},get useDeprecatedSynchronousErrorHandling(){return t4}}});var hg=E(n4=>{"use strict";Object.defineProperty(n4,"__esModule",{value:!0});function ipe(e){setTimeout(function(){throw e},0)}n4.hostReportError=ipe});var o4=E(i4=>{"use strict";Object.defineProperty(i4,"__esModule",{value:!0});var ope=Uh(),spe=hg();i4.empty={closed:!0,next:function(e){},error:function(e){if(ope.config.useDeprecatedSynchronousErrorHandling)throw e;spe.hostReportError(e)},complete:function(){}}});var Nn=E(s4=>{"use strict";Object.defineProperty(s4,"__esModule",{value:!0});s4.isArray=function(){return Array.isArray||function(e){return e&&typeof e.length=="number"}}()});var dg=E(a4=>{"use strict";Object.defineProperty(a4,"__esModule",{value:!0});function ape(e){return e!==null&&typeof e=="object"}a4.isObject=ape});var f4=E(u4=>{"use strict";Object.defineProperty(u4,"__esModule",{value:!0});var upe=function(){function e(t){return Error.call(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
554
|
+
`+t.map(function(r,n){return n+1+") "+r.toString()}).join(`
|
|
555
|
+
`):"",this.name="UnsubscriptionError",this.errors=t,this}return e.prototype=Object.create(Error.prototype),e}();u4.UnsubscriptionError=upe});var Fr=E(c4=>{"use strict";Object.defineProperty(c4,"__esModule",{value:!0});var fpe=Nn(),cpe=dg(),lpe=hc(),pg=f4(),hpe=function(){function e(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,o=r._unsubscribe,a=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(n!==null)for(var c=0;c<n.length;++c){var v=n[c];v.remove(this)}if(lpe.isFunction(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(M){t=M instanceof pg.UnsubscriptionError?FD(M.errors):[M]}}if(fpe.isArray(a))for(var c=-1,y=a.length;++c<y;){var w=a[c];if(cpe.isObject(w))try{w.unsubscribe()}catch(S){t=t||[],S instanceof pg.UnsubscriptionError?t=t.concat(FD(S.errors)):t.push(S)}}if(t)throw new pg.UnsubscriptionError(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||typeof r.unsubscribe!="function")return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;r=new e,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(i===null)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return r;var o=this._subscriptions;return o===null?this._subscriptions=[r]:o.push(r),r},e.prototype.remove=function(t){var r=this._subscriptions;if(r){var n=r.indexOf(t);n!==-1&&r.splice(n,1)}},e.EMPTY=function(t){return t.closed=!0,t}(new e),e}();c4.Subscription=hpe;function FD(e){return e.reduce(function(t,r){return t.concat(r instanceof pg.UnsubscriptionError?r.errors:r)},[])}});var vg=E(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.rxSubscriber=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}();Hh.$$rxSubscriber=Hh.rxSubscriber});var Ze=E(pc=>{"use strict";var HD=pc&&pc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(pc,"__esModule",{value:!0});var UD=hc(),l4=o4(),dpe=Fr(),ppe=vg(),dc=Uh(),mg=hg(),WD=function(e){HD(t,e);function t(r,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=l4.empty;break;case 1:if(!r){o.destination=l4.empty;break}if(typeof r=="object"){r instanceof t?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new h4(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new h4(o,r,n,i);break}return o}return t.prototype[ppe.rxSubscriber]=function(){return this},t.create=function(r,n,i){var o=new t(r,n,i);return o.syncErrorThrowable=!1,o},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},t}(dpe.Subscription);pc.Subscriber=WD;var h4=function(e){HD(t,e);function t(r,n,i,o){var a=e.call(this)||this;a._parentSubscriber=r;var c,v=a;return UD.isFunction(n)?c=n:n&&(c=n.next,i=n.error,o=n.complete,n!==l4.empty&&(v=Object.create(n),UD.isFunction(v.unsubscribe)&&a.add(v.unsubscribe.bind(v)),v.unsubscribe=a.unsubscribe.bind(a))),a._context=v,a._next=c,a._error=i,a._complete=o,a}return t.prototype.next=function(r){if(!this.isStopped&&this._next){var n=this._parentSubscriber;!dc.config.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?this.__tryOrUnsub(this._next,r):this.__tryOrSetError(n,this._next,r)&&this.unsubscribe()}},t.prototype.error=function(r){if(!this.isStopped){var n=this._parentSubscriber,i=dc.config.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!n.syncErrorThrowable?(this.__tryOrUnsub(this._error,r),this.unsubscribe()):(this.__tryOrSetError(n,this._error,r),this.unsubscribe());else if(n.syncErrorThrowable)i?(n.syncErrorValue=r,n.syncErrorThrown=!0):mg.hostReportError(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;mg.hostReportError(r)}}},t.prototype.complete=function(){var r=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var i=function(){return r._complete.call(r._context)};!dc.config.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(n,i),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(r,n){try{r.call(this._context,n)}catch(i){if(this.unsubscribe(),dc.config.useDeprecatedSynchronousErrorHandling)throw i;mg.hostReportError(i)}},t.prototype.__tryOrSetError=function(r,n,i){if(!dc.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(o){return dc.config.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=o,r.syncErrorThrown=!0,!0):(mg.hostReportError(o),!0)}return!1},t.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},t}(WD);pc.SafeSubscriber=h4});var gg=E(d4=>{"use strict";Object.defineProperty(d4,"__esModule",{value:!0});var vpe=Ze();function mpe(e){for(;e;){var t=e,r=t.closed,n=t.destination,i=t.isStopped;if(r||i)return!1;n&&n instanceof vpe.Subscriber?e=n:e=null}return!0}d4.canReportError=mpe});var VD=E(v4=>{"use strict";Object.defineProperty(v4,"__esModule",{value:!0});var p4=Ze(),zD=vg(),gpe=o4();function bpe(e,t,r){if(e){if(e instanceof p4.Subscriber)return e;if(e[zD.rxSubscriber])return e[zD.rxSubscriber]()}return!e&&!t&&!r?new p4.Subscriber(gpe.empty):new p4.Subscriber(e,t,r)}v4.toSubscriber=bpe});var du=E(m4=>{"use strict";Object.defineProperty(m4,"__esModule",{value:!0});m4.observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}()});var Vs=E(g4=>{"use strict";Object.defineProperty(g4,"__esModule",{value:!0});function ype(e){return e}g4.identity=ype});var yg=E(bg=>{"use strict";Object.defineProperty(bg,"__esModule",{value:!0});var _pe=Vs();function wpe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $D(e)}bg.pipe=wpe;function $D(e){return e.length===0?_pe.identity:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}bg.pipeFromArray=$D});var Ct=E(b4=>{"use strict";Object.defineProperty(b4,"__esModule",{value:!0});var xpe=gg(),Mpe=VD(),Spe=du(),Epe=yg(),_g=Uh(),Ape=function(){function e(t){this._isScalar=!1,t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this.operator,o=Mpe.toSubscriber(t,r,n);if(i?o.add(i.call(o,this.source)):o.add(this.source||_g.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),_g.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){_g.config.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=r),xpe.canReportError(t)?t.error(r):console.warn(r)}},e.prototype.forEach=function(t,r){var n=this;return r=KD(r),new r(function(i,o){var a;a=n.subscribe(function(c){try{t(c)}catch(v){o(v),a&&a.unsubscribe()}},o,i)})},e.prototype._subscribe=function(t){var r=this.source;return r&&r.subscribe(t)},e.prototype[Spe.observable]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length===0?this:Epe.pipeFromArray(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=KD(t),new t(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},e.create=function(t){return new e(t)},e}();b4.Observable=Ape;function KD(e){if(e||(e=_g.config.Promise||Promise),!e)throw new Error("no Promise impl found");return e}});var Wh=E(y4=>{"use strict";Object.defineProperty(y4,"__esModule",{value:!0});var Ope=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}();y4.ObjectUnsubscribedError=Ope});var _4=E(zh=>{"use strict";var Rpe=zh&&zh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(zh,"__esModule",{value:!0});var Ipe=Fr(),Cpe=function(e){Rpe(t,e);function t(r,n){var i=e.call(this)||this;return i.subject=r,i.subscriber=n,i.closed=!1,i}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var r=this.subject,n=r.observers;if(this.subject=null,!(!n||n.length===0||r.isStopped||r.closed)){var i=n.indexOf(this.subscriber);i!==-1&&n.splice(i,1)}}},t}(Ipe.Subscription);zh.SubjectSubscription=Cpe});var xn=E(pu=>{"use strict";var M4=pu&&pu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(pu,"__esModule",{value:!0});var GD=Ct(),Tpe=Ze(),w4=Fr(),Vh=Wh(),kpe=_4(),Ppe=vg(),ZD=function(e){M4(t,e);function t(r){var n=e.call(this,r)||this;return n.destination=r,n}return t}(Tpe.Subscriber);pu.SubjectSubscriber=ZD;var YD=function(e){M4(t,e);function t(){var r=e.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype[Ppe.rxSubscriber]=function(){return new ZD(this)},t.prototype.lift=function(r){var n=new x4(this,this);return n.operator=r,n},t.prototype.next=function(r){if(this.closed)throw new Vh.ObjectUnsubscribedError;if(!this.isStopped)for(var n=this.observers,i=n.length,o=n.slice(),a=0;a<i;a++)o[a].next(r)},t.prototype.error=function(r){if(this.closed)throw new Vh.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var n=this.observers,i=n.length,o=n.slice(),a=0;a<i;a++)o[a].error(r);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new Vh.ObjectUnsubscribedError;this.isStopped=!0;for(var r=this.observers,n=r.length,i=r.slice(),o=0;o<n;o++)i[o].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(r){if(this.closed)throw new Vh.ObjectUnsubscribedError;return e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){if(this.closed)throw new Vh.ObjectUnsubscribedError;return this.hasError?(r.error(this.thrownError),w4.Subscription.EMPTY):this.isStopped?(r.complete(),w4.Subscription.EMPTY):(this.observers.push(r),new kpe.SubjectSubscription(this,r))},t.prototype.asObservable=function(){var r=new GD.Observable;return r.source=this,r},t.create=function(r,n){return new x4(r,n)},t}(GD.Observable);pu.Subject=YD;var x4=function(e){M4(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n=this.destination;n&&n.next&&n.next(r)},t.prototype.error=function(r){var n=this.destination;n&&n.error&&this.destination.error(r)},t.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},t.prototype._subscribe=function(r){var n=this.source;return n?this.source.subscribe(r):w4.Subscription.EMPTY},t}(YD);pu.AnonymousSubject=x4});var wg=E($h=>{"use strict";var Npe=$h&&$h.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($h,"__esModule",{value:!0});var qpe=Ze();function Lpe(){return function(t){return t.lift(new Bpe(t))}}$h.refCount=Lpe;var Bpe=function(){function e(t){this.connectable=t}return e.prototype.call=function(t,r){var n=this.connectable;n._refCount++;var i=new Dpe(t,n),o=r.subscribe(i);return i.closed||(i.connection=n.connect()),o},e}(),Dpe=function(e){Npe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.connectable=n,i}return t.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,o=r._connection;this.connection=null,o&&(!i||o===i)&&o.unsubscribe()},t}(qpe.Subscriber)});var E4=E(vc=>{"use strict";var S4=vc&&vc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(vc,"__esModule",{value:!0});var jpe=xn(),Fpe=Ct(),Upe=Ze(),JD=Fr(),Hpe=wg(),QD=function(e){S4(t,e);function t(r,n){var i=e.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return t.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},t.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new JD.Subscription,r.add(this.source.subscribe(new Wpe(this.getSubject(),this))),r.closed&&(this._connection=null,r=JD.Subscription.EMPTY)),r},t.prototype.refCount=function(){return Hpe.refCount()(this)},t}(Fpe.Observable);vc.ConnectableObservable=QD;vc.connectableObservableDescriptor=function(){var e=QD.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}();var Wpe=function(e){S4(t,e);function t(r,n){var i=e.call(this,r)||this;return i.connectable=n,i}return t.prototype._error=function(r){this._unsubscribe(),e.prototype._error.call(this,r)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},t}(jpe.SubjectSubscriber),zLe=function(){function e(t){this.connectable=t}return e.prototype.call=function(t,r){var n=this.connectable;n._refCount++;var i=new zpe(t,n),o=r.subscribe(i);return i.closed||(i.connection=n.connect()),o},e}(),zpe=function(e){S4(t,e);function t(r,n){var i=e.call(this,r)||this;return i.connectable=n,i}return t.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,o=r._connection;this.connection=null,o&&(!i||o===i)&&o.unsubscribe()},t}(Upe.Subscriber)});var O4=E(mc=>{"use strict";var xg=mc&&mc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(mc,"__esModule",{value:!0});var XD=Ze(),ej=Fr(),Vpe=Ct(),$pe=xn();function Kpe(e,t,r,n){return function(i){return i.lift(new Gpe(e,t,r,n))}}mc.groupBy=Kpe;var Gpe=function(){function e(t,r,n,i){this.keySelector=t,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return e.prototype.call=function(t,r){return r.subscribe(new Zpe(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),Zpe=function(e){xg(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.keySelector=n,c.elementSelector=i,c.durationSelector=o,c.subjectSelector=a,c.groups=null,c.attemptedToUnsubscribe=!1,c.count=0,c}return t.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},t.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var o=i.get(n),a;if(this.elementSelector)try{a=this.elementSelector(r)}catch(y){this.error(y)}else a=r;if(!o){o=this.subjectSelector?this.subjectSelector():new $pe.Subject,i.set(n,o);var c=new A4(n,o,this);if(this.destination.next(c),this.durationSelector){var v=void 0;try{v=this.durationSelector(new A4(n,o))}catch(y){this.error(y);return}this.add(v.subscribe(new Ype(n,o,this)))}}o.closed||o.next(a)},t.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,o){i.error(r)}),n.clear()),this.destination.error(r)},t.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},t.prototype.removeGroup=function(r){this.groups.delete(r)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&e.prototype.unsubscribe.call(this))},t}(XD.Subscriber),Ype=function(e){xg(t,e);function t(r,n,i){var o=e.call(this,n)||this;return o.key=r,o.group=n,o.parent=i,o}return t.prototype._next=function(r){this.complete()},t.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},t}(XD.Subscriber),A4=function(e){xg(t,e);function t(r,n,i){var o=e.call(this)||this;return o.key=r,o.groupSubject=n,o.refCountSubscription=i,o}return t.prototype._subscribe=function(r){var n=new ej.Subscription,i=this,o=i.refCountSubscription,a=i.groupSubject;return o&&!o.closed&&n.add(new Jpe(o)),n.add(a.subscribe(r)),n},t}(Vpe.Observable);mc.GroupedObservable=A4;var Jpe=function(e){xg(t,e);function t(r){var n=e.call(this)||this;return n.parent=r,r.count++,n}return t.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(e.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},t}(ej.Subscription)});var R4=E(Kh=>{"use strict";var Qpe=Kh&&Kh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Kh,"__esModule",{value:!0});var Xpe=xn(),eve=Wh(),tve=function(e){Qpe(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new eve.ObjectUnsubscribedError;return this._value},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(Xpe.Subject);Kh.BehaviorSubject=tve});var tj=E(Gh=>{"use strict";var rve=Gh&&Gh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Gh,"__esModule",{value:!0});var nve=Fr(),ive=function(e){rve(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(nve.Subscription);Gh.Action=ive});var gc=E(Zh=>{"use strict";var ove=Zh&&Zh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Zh,"__esModule",{value:!0});var sve=tj(),ave=function(e){ove(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,o=void 0;try{this.work(r)}catch(a){i=!0,o=!!a&&a||new Error(a)}if(i)return this.unsubscribe(),o},t.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,o=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,o!==-1&&i.splice(o,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},t}(sve.Action);Zh.AsyncAction=ave});var rj=E(Yh=>{"use strict";var uve=Yh&&Yh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Yh,"__esModule",{value:!0});var fve=gc(),cve=function(e){uve(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?e.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,n){return n>0||this.closed?e.prototype.execute.call(this,r,n):this._execute(r,n)},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},t}(fve.AsyncAction);Yh.QueueAction=cve});var C4=E(I4=>{"use strict";Object.defineProperty(I4,"__esModule",{value:!0});var lve=function(){function e(t,r){r===void 0&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,t).schedule(n,r)},e.now=function(){return Date.now()},e}();I4.Scheduler=lve});var bc=E(Jh=>{"use strict";var hve=Jh&&Jh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Jh,"__esModule",{value:!0});var nj=C4(),dve=function(e){hve(t,e);function t(r,n){n===void 0&&(n=nj.Scheduler.now);var i=e.call(this,r,function(){return t.delegate&&t.delegate!==i?t.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return t.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),t.delegate&&t.delegate!==this?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t}(nj.Scheduler);Jh.AsyncScheduler=dve});var ij=E(Qh=>{"use strict";var pve=Qh&&Qh.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Qh,"__esModule",{value:!0});var vve=bc(),mve=function(e){pve(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(vve.AsyncScheduler);Qh.QueueScheduler=mve});var T4=E(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});var gve=rj(),bve=ij();Xh.queueScheduler=new bve.QueueScheduler(gve.QueueAction);Xh.queue=Xh.queueScheduler});var Vi=E(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var oj=Ct();e0.EMPTY=new oj.Observable(function(e){return e.complete()});function yve(e){return e?_ve(e):e0.EMPTY}e0.empty=yve;function _ve(e){return new oj.Observable(function(t){return e.schedule(function(){return t.complete()})})}});var $i=E(k4=>{"use strict";Object.defineProperty(k4,"__esModule",{value:!0});function wve(e){return e&&typeof e.schedule=="function"}k4.isScheduler=wve});var N4=E(P4=>{"use strict";Object.defineProperty(P4,"__esModule",{value:!0});P4.subscribeToArray=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}});var Mg=E(q4=>{"use strict";Object.defineProperty(q4,"__esModule",{value:!0});var xve=Ct(),Mve=Fr();function Sve(e,t){return new xve.Observable(function(r){var n=new Mve.Subscription,i=0;return n.add(t.schedule(function(){if(i===e.length){r.complete();return}r.next(e[i++]),r.closed||n.add(this.schedule())})),n})}q4.scheduleArray=Sve});var yc=E(L4=>{"use strict";Object.defineProperty(L4,"__esModule",{value:!0});var Eve=Ct(),Ave=N4(),Ove=Mg();function Rve(e,t){return t?Ove.scheduleArray(e,t):new Eve.Observable(Ave.subscribeToArray(e))}L4.fromArray=Rve});var t0=E(B4=>{"use strict";Object.defineProperty(B4,"__esModule",{value:!0});var Ive=$i(),Cve=yc(),Tve=Mg();function kve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return Ive.isScheduler(r)?(e.pop(),Tve.scheduleArray(e,r)):Cve.fromArray(e)}B4.of=kve});var Sg=E(D4=>{"use strict";Object.defineProperty(D4,"__esModule",{value:!0});var sj=Ct();function Pve(e,t){return t?new sj.Observable(function(r){return t.schedule(Nve,0,{error:e,subscriber:r})}):new sj.Observable(function(r){return r.error(e)})}D4.throwError=Pve;function Nve(e){var t=e.error,r=e.subscriber;r.error(t)}});var n0=E(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var qve=Vi(),Lve=t0(),Bve=Sg(),Dve;(function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"})(Dve=r0.NotificationKind||(r0.NotificationKind={}));var jve=function(){function e(t,r,n){this.kind=t,this.value=r,this.error=n,this.hasValue=t==="N"}return e.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},e.prototype.do=function(t,r,n){var i=this.kind;switch(i){case"N":return t&&t(this.value);case"E":return r&&r(this.error);case"C":return n&&n()}},e.prototype.accept=function(t,r,n){return t&&typeof t.next=="function"?this.observe(t):this.do(t,r,n)},e.prototype.toObservable=function(){var t=this.kind;switch(t){case"N":return Lve.of(this.value);case"E":return Bve.throwError(this.error);case"C":return qve.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return typeof t<"u"?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();r0.Notification=jve});var F4=E($s=>{"use strict";var Fve=$s&&$s.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($s,"__esModule",{value:!0});var Uve=Ze(),j4=n0();function Hve(e,t){return t===void 0&&(t=0),function(n){return n.lift(new aj(e,t))}}$s.observeOn=Hve;var aj=function(){function e(t,r){r===void 0&&(r=0),this.scheduler=t,this.delay=r}return e.prototype.call=function(t,r){return r.subscribe(new uj(t,this.scheduler,this.delay))},e}();$s.ObserveOnOperator=aj;var uj=function(e){Fve(t,e);function t(r,n,i){i===void 0&&(i=0);var o=e.call(this,r)||this;return o.scheduler=n,o.delay=i,o}return t.dispatch=function(r){var n=r.notification,i=r.destination;n.observe(i),this.unsubscribe()},t.prototype.scheduleMessage=function(r){var n=this.destination;n.add(this.scheduler.schedule(t.dispatch,this.delay,new fj(r,this.destination)))},t.prototype._next=function(r){this.scheduleMessage(j4.Notification.createNext(r))},t.prototype._error=function(r){this.scheduleMessage(j4.Notification.createError(r)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(j4.Notification.createComplete()),this.unsubscribe()},t}(Uve.Subscriber);$s.ObserveOnSubscriber=uj;var fj=function(){function e(t,r){this.notification=t,this.destination=r}return e}();$s.ObserveOnMessage=fj});var Eg=E(i0=>{"use strict";var Wve=i0&&i0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(i0,"__esModule",{value:!0});var zve=xn(),Vve=T4(),$ve=Fr(),Kve=F4(),Gve=Wh(),Zve=_4(),Yve=function(e){Wve(t,e);function t(r,n,i){r===void 0&&(r=Number.POSITIVE_INFINITY),n===void 0&&(n=Number.POSITIVE_INFINITY);var o=e.call(this)||this;return o.scheduler=i,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=r<1?1:r,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return t.prototype.nextInfiniteTimeWindow=function(r){if(!this.isStopped){var n=this._events;n.push(r),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,r)},t.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new Jve(this._getNow(),r)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,a=i.length,c;if(this.closed)throw new Gve.ObjectUnsubscribedError;if(this.isStopped||this.hasError?c=$ve.Subscription.EMPTY:(this.observers.push(r),c=new Zve.SubjectSubscription(this,r)),o&&r.add(r=new Kve.ObserveOnSubscriber(r,o)),n)for(var v=0;v<a&&!r.closed;v++)r.next(i[v]);else for(var v=0;v<a&&!r.closed;v++)r.next(i[v].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),c},t.prototype._getNow=function(){return(this.scheduler||Vve.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var r=this._getNow(),n=this._bufferSize,i=this._windowTime,o=this._events,a=o.length,c=0;c<a&&!(r-o[c].time<i);)c++;return a>n&&(c=Math.max(c,a-n)),c>0&&o.splice(0,c),o},t}(zve.Subject);i0.ReplaySubject=Yve;var Jve=function(){function e(t,r){this.time=t,this.value=r}return e}()});var s0=E(o0=>{"use strict";var Qve=o0&&o0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(o0,"__esModule",{value:!0});var Xve=xn(),cj=Fr(),e1e=function(e){Qve(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return t.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),cj.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),cj.Subscription.EMPTY):e.prototype._subscribe.call(this,r)},t.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},t.prototype.error=function(r){this.hasCompleted||e.prototype.error.call(this,r)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(Xve.Subject);o0.AsyncSubject=e1e});var hj=E(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});var t1e=1,r1e=function(){return Promise.resolve()}(),Ag={};function lj(e){return e in Ag?(delete Ag[e],!0):!1}Og.Immediate={setImmediate:function(e){var t=t1e++;return Ag[t]=!0,r1e.then(function(){return lj(t)&&e()}),t},clearImmediate:function(e){lj(e)}};Og.TestTools={pending:function(){return Object.keys(Ag).length}}});var pj=E(a0=>{"use strict";var n1e=a0&&a0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(a0,"__esModule",{value:!0});var dj=hj(),i1e=gc(),o1e=function(e){n1e(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=dj.Immediate.setImmediate(r.flush.bind(r,null))))},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(dj.Immediate.clearImmediate(n),r.scheduled=void 0)},t}(i1e.AsyncAction);a0.AsapAction=o1e});var vj=E(u0=>{"use strict";var s1e=u0&&u0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(u0,"__esModule",{value:!0});var a1e=bc(),u1e=function(e){s1e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,o=-1,a=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++o<a&&(r=n.shift()));if(this.active=!1,i){for(;++o<a&&(r=n.shift());)r.unsubscribe();throw i}},t}(a1e.AsyncScheduler);u0.AsapScheduler=u1e});var U4=E(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});var f1e=pj(),c1e=vj();f0.asapScheduler=new c1e.AsapScheduler(f1e.AsapAction);f0.asap=f0.asapScheduler});var qn=E(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var l1e=gc(),h1e=bc();c0.asyncScheduler=new h1e.AsyncScheduler(l1e.AsyncAction);c0.async=c0.asyncScheduler});var mj=E(l0=>{"use strict";var d1e=l0&&l0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(l0,"__esModule",{value:!0});var p1e=gc(),v1e=function(e){d1e(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},t}(p1e.AsyncAction);l0.AnimationFrameAction=v1e});var gj=E(h0=>{"use strict";var m1e=h0&&h0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(h0,"__esModule",{value:!0});var g1e=bc(),b1e=function(e){m1e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,o=-1,a=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++o<a&&(r=n.shift()));if(this.active=!1,i){for(;++o<a&&(r=n.shift());)r.unsubscribe();throw i}},t}(g1e.AsyncScheduler);h0.AnimationFrameScheduler=b1e});var bj=E(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});var y1e=mj(),_1e=gj();d0.animationFrameScheduler=new _1e.AnimationFrameScheduler(y1e.AnimationFrameAction);d0.animationFrame=d0.animationFrameScheduler});var wj=E(_c=>{"use strict";var yj=_c&&_c.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_c,"__esModule",{value:!0});var w1e=gc(),x1e=bc(),M1e=function(e){yj(t,e);function t(r,n){r===void 0&&(r=_j),n===void 0&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return t.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,o,a;(a=n[0])&&a.delay<=i&&(n.shift(),this.frame=a.delay,!(o=a.execute(a.state,a.delay))););if(o){for(;a=n.shift();)a.unsubscribe();throw o}},t.frameTimeFactor=10,t}(x1e.AsyncScheduler);_c.VirtualTimeScheduler=M1e;var _j=function(e){yj(t,e);function t(r,n,i){i===void 0&&(i=r.index+=1);var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.index=i,o.active=!0,o.index=r.index=i,o}return t.prototype.schedule=function(r,n){if(n===void 0&&(n=0),!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},t.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var o=r.actions;return o.push(this),o.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(r,n,i){i===void 0&&(i=0)},t.prototype._execute=function(r,n){if(this.active===!0)return e.prototype._execute.call(this,r,n)},t.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},t}(w1e.AsyncAction);_c.VirtualAction=_j});var Rg=E(H4=>{"use strict";Object.defineProperty(H4,"__esModule",{value:!0});function S1e(){}H4.noop=S1e});var xj=E(W4=>{"use strict";Object.defineProperty(W4,"__esModule",{value:!0});var E1e=Ct();function A1e(e){return!!e&&(e instanceof E1e.Observable||typeof e.lift=="function"&&typeof e.subscribe=="function")}W4.isObservable=A1e});var wc=E(z4=>{"use strict";Object.defineProperty(z4,"__esModule",{value:!0});var O1e=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}();z4.ArgumentOutOfRangeError=O1e});var xc=E(V4=>{"use strict";Object.defineProperty(V4,"__esModule",{value:!0});var R1e=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}();V4.EmptyError=R1e});var K4=E($4=>{"use strict";Object.defineProperty($4,"__esModule",{value:!0});var I1e=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}();$4.TimeoutError=I1e});var ni=E(Mc=>{"use strict";var C1e=Mc&&Mc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mc,"__esModule",{value:!0});var T1e=Ze();function k1e(e,t){return function(n){if(typeof e!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Mj(e,t))}}Mc.map=k1e;var Mj=function(){function e(t,r){this.project=t,this.thisArg=r}return e.prototype.call=function(t,r){return r.subscribe(new P1e(t,this.project,this.thisArg))},e}();Mc.MapOperator=Mj;var P1e=function(e){C1e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.project=n,o.count=0,o.thisArg=i||o,o}return t.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(T1e.Subscriber)});var Aj=E(G4=>{"use strict";Object.defineProperty(G4,"__esModule",{value:!0});var N1e=Ct(),Sj=s0(),q1e=ni(),L1e=gg(),B1e=Nn(),D1e=$i();function Ej(e,t,r){if(t)if(D1e.isScheduler(t))r=t;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Ej(e,r).apply(void 0,n).pipe(q1e.map(function(o){return B1e.isArray(o)?t.apply(void 0,o):t(o)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=this,a,c={context:o,subject:a,callbackFunc:e,scheduler:r};return new N1e.Observable(function(v){if(r){var w={args:n,subscriber:v,params:c};return r.schedule(j1e,0,w)}else{if(!a){a=new Sj.AsyncSubject;var y=function(){for(var M=[],S=0;S<arguments.length;S++)M[S]=arguments[S];a.next(M.length<=1?M[0]:M),a.complete()};try{e.apply(o,n.concat([y]))}catch(M){L1e.canReportError(a)?a.error(M):console.warn(M)}}return a.subscribe(v)}})}}G4.bindCallback=Ej;function j1e(e){var t=this,r=this,n=e.args,i=e.subscriber,o=e.params,a=o.callbackFunc,c=o.context,v=o.scheduler,y=o.subject;if(!y){y=o.subject=new Sj.AsyncSubject;var w=function(){for(var M=[],S=0;S<arguments.length;S++)M[S]=arguments[S];var R=M.length<=1?M[0]:M;t.add(v.schedule(F1e,0,{value:R,subject:y}))};try{a.apply(c,n.concat([w]))}catch(M){y.error(M)}}this.add(y.subscribe(i))}function F1e(e){var t=e.value,r=e.subject;r.next(t),r.complete()}});var Cj=E(Z4=>{"use strict";Object.defineProperty(Z4,"__esModule",{value:!0});var U1e=Ct(),Rj=s0(),H1e=ni(),W1e=gg(),z1e=$i(),V1e=Nn();function Ij(e,t,r){if(t)if(z1e.isScheduler(t))r=t;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Ij(e,r).apply(void 0,n).pipe(H1e.map(function(o){return V1e.isArray(o)?t.apply(void 0,o):t(o)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o={subject:void 0,args:n,callbackFunc:e,scheduler:r,context:this};return new U1e.Observable(function(a){var c=o.context,v=o.subject;if(r)return r.schedule($1e,0,{params:o,subscriber:a,context:c});if(!v){v=o.subject=new Rj.AsyncSubject;var y=function(){for(var w=[],M=0;M<arguments.length;M++)w[M]=arguments[M];var S=w.shift();if(S){v.error(S);return}v.next(w.length<=1?w[0]:w),v.complete()};try{e.apply(c,n.concat([y]))}catch(w){W1e.canReportError(v)?v.error(w):console.warn(w)}}return v.subscribe(a)})}}Z4.bindNodeCallback=Ij;function $1e(e){var t=this,r=e.params,n=e.subscriber,i=e.context,o=r.callbackFunc,a=r.args,c=r.scheduler,v=r.subject;if(!v){v=r.subject=new Rj.AsyncSubject;var y=function(){for(var w=[],M=0;M<arguments.length;M++)w[M]=arguments[M];var S=w.shift();if(S)t.add(c.schedule(Oj,0,{err:S,subject:v}));else{var R=w.length<=1?w[0]:w;t.add(c.schedule(K1e,0,{value:R,subject:v}))}};try{o.apply(i,a.concat([y]))}catch(w){this.add(c.schedule(Oj,0,{err:w,subject:v}))}}this.add(v.subscribe(n))}function K1e(e){var t=e.value,r=e.subject;r.next(t),r.complete()}function Oj(e){var t=e.err,r=e.subject;r.error(t)}});var Ks=E(p0=>{"use strict";var G1e=p0&&p0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(p0,"__esModule",{value:!0});var Z1e=Ze(),Y1e=function(e){G1e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.notifyNext=function(r,n,i,o,a){this.destination.next(n)},t.prototype.notifyError=function(r,n){this.destination.error(r)},t.prototype.notifyComplete=function(r){this.destination.complete()},t}(Z1e.Subscriber);p0.OuterSubscriber=Y1e});var Tj=E(v0=>{"use strict";var J1e=v0&&v0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(v0,"__esModule",{value:!0});var Q1e=Ze(),X1e=function(e){J1e(t,e);function t(r,n,i){var o=e.call(this)||this;return o.parent=r,o.outerValue=n,o.outerIndex=i,o.index=0,o}return t.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this.index++,this)},t.prototype._error=function(r){this.parent.notifyError(r,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(Q1e.Subscriber);v0.InnerSubscriber=X1e});var kj=E(Y4=>{"use strict";Object.defineProperty(Y4,"__esModule",{value:!0});var eme=hg();Y4.subscribeToPromise=function(e){return function(t){return e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,eme.hostReportError),t}}});var Ec=E(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});function Pj(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}Sc.getSymbolIterator=Pj;Sc.iterator=Pj();Sc.$$iterator=Sc.iterator});var Nj=E(J4=>{"use strict";Object.defineProperty(J4,"__esModule",{value:!0});var tme=Ec();J4.subscribeToIterable=function(e){return function(t){var r=e[tme.iterator]();do{var n=void 0;try{n=r.next()}catch(i){return t.error(i),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}while(!0);return typeof r.return=="function"&&t.add(function(){r.return&&r.return()}),t}}});var qj=E(Q4=>{"use strict";Object.defineProperty(Q4,"__esModule",{value:!0});var rme=du();Q4.subscribeToObservable=function(e){return function(t){var r=e[rme.observable]();if(typeof r.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(t)}}});var e6=E(X4=>{"use strict";Object.defineProperty(X4,"__esModule",{value:!0});X4.isArrayLike=function(e){return e&&typeof e.length=="number"&&typeof e!="function"}});var r6=E(t6=>{"use strict";Object.defineProperty(t6,"__esModule",{value:!0});function nme(e){return!!e&&typeof e.subscribe!="function"&&typeof e.then=="function"}t6.isPromise=nme});var m0=E(n6=>{"use strict";Object.defineProperty(n6,"__esModule",{value:!0});var ime=N4(),ome=kj(),sme=Nj(),ame=qj(),ume=e6(),fme=r6(),cme=dg(),lme=Ec(),hme=du();n6.subscribeTo=function(e){if(!!e&&typeof e[hme.observable]=="function")return ame.subscribeToObservable(e);if(ume.isArrayLike(e))return ime.subscribeToArray(e);if(fme.isPromise(e))return ome.subscribeToPromise(e);if(!!e&&typeof e[lme.iterator]=="function")return sme.subscribeToIterable(e);var t=cme.isObject(e)?"an invalid object":"'"+e+"'",r="You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)}});var Gs=E(i6=>{"use strict";Object.defineProperty(i6,"__esModule",{value:!0});var dme=Tj(),pme=m0(),vme=Ct();function mme(e,t,r,n,i){if(i===void 0&&(i=new dme.InnerSubscriber(e,r,n)),!i.closed)return t instanceof vme.Observable?t.subscribe(i):pme.subscribeTo(t)(i)}i6.subscribeToResult=mme});var Ig=E(vu=>{"use strict";var gme=vu&&vu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(vu,"__esModule",{value:!0});var bme=$i(),yme=Nn(),_me=Ks(),wme=Gs(),xme=yc(),Lj={};function Mme(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return bme.isScheduler(e[e.length-1])&&(n=e.pop()),typeof e[e.length-1]=="function"&&(r=e.pop()),e.length===1&&yme.isArray(e[0])&&(e=e[0]),xme.fromArray(e,n).lift(new Bj(r))}vu.combineLatest=Mme;var Bj=function(){function e(t){this.resultSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new Dj(t,this.resultSelector))},e}();vu.CombineLatestOperator=Bj;var Dj=function(e){gme(t,e);function t(r,n){var i=e.call(this,r)||this;return i.resultSelector=n,i.active=0,i.values=[],i.observables=[],i}return t.prototype._next=function(r){this.values.push(Lj),this.observables.push(r)},t.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{this.active=n,this.toRespond=n;for(var i=0;i<n;i++){var o=r[i];this.add(wme.subscribeToResult(this,o,void 0,i))}}},t.prototype.notifyComplete=function(r){(this.active-=1)===0&&this.destination.complete()},t.prototype.notifyNext=function(r,n,i){var o=this.values,a=o[i],c=this.toRespond?a===Lj?--this.toRespond:this.toRespond:0;o[i]=n,c===0&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},t.prototype._tryResultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(_me.OuterSubscriber);vu.CombineLatestSubscriber=Dj});var jj=E(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0});var Sme=Ct(),Eme=Fr(),Ame=du();function Ome(e,t){return new Sme.Observable(function(r){var n=new Eme.Subscription;return n.add(t.schedule(function(){var i=e[Ame.observable]();n.add(i.subscribe({next:function(o){n.add(t.schedule(function(){return r.next(o)}))},error:function(o){n.add(t.schedule(function(){return r.error(o)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}o6.scheduleObservable=Ome});var Fj=E(s6=>{"use strict";Object.defineProperty(s6,"__esModule",{value:!0});var Rme=Ct(),Ime=Fr();function Cme(e,t){return new Rme.Observable(function(r){var n=new Ime.Subscription;return n.add(t.schedule(function(){return e.then(function(i){n.add(t.schedule(function(){r.next(i),n.add(t.schedule(function(){return r.complete()}))}))},function(i){n.add(t.schedule(function(){return r.error(i)}))})})),n})}s6.schedulePromise=Cme});var Uj=E(a6=>{"use strict";Object.defineProperty(a6,"__esModule",{value:!0});var Tme=Ct(),kme=Fr(),Pme=Ec();function Nme(e,t){if(!e)throw new Error("Iterable cannot be null");return new Tme.Observable(function(r){var n=new kme.Subscription,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(t.schedule(function(){i=e[Pme.iterator](),n.add(t.schedule(function(){if(!r.closed){var o,a;try{var c=i.next();o=c.value,a=c.done}catch(v){r.error(v);return}a?r.complete():(r.next(o),this.schedule())}}))})),n})}a6.scheduleIterable=Nme});var Hj=E(u6=>{"use strict";Object.defineProperty(u6,"__esModule",{value:!0});var qme=du();function Lme(e){return e&&typeof e[qme.observable]=="function"}u6.isInteropObservable=Lme});var Wj=E(f6=>{"use strict";Object.defineProperty(f6,"__esModule",{value:!0});var Bme=Ec();function Dme(e){return e&&typeof e[Bme.iterator]=="function"}f6.isIterable=Dme});var l6=E(c6=>{"use strict";Object.defineProperty(c6,"__esModule",{value:!0});var jme=jj(),Fme=Fj(),Ume=Mg(),Hme=Uj(),Wme=Hj(),zme=r6(),Vme=e6(),$me=Wj();function Kme(e,t){if(e!=null){if(Wme.isInteropObservable(e))return jme.scheduleObservable(e,t);if(zme.isPromise(e))return Fme.schedulePromise(e,t);if(Vme.isArrayLike(e))return Ume.scheduleArray(e,t);if($me.isIterable(e)||typeof e=="string")return Hme.scheduleIterable(e,t)}throw new TypeError((e!==null&&typeof e||e)+" is not observable")}c6.scheduled=Kme});var Ki=E(h6=>{"use strict";Object.defineProperty(h6,"__esModule",{value:!0});var zj=Ct(),Gme=m0(),Zme=l6();function Yme(e,t){return t?Zme.scheduled(e,t):e instanceof zj.Observable?e:new zj.Observable(Gme.subscribeTo(e))}h6.from=Yme});var xr=E(ts=>{"use strict";var Cg=ts&&ts.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ts,"__esModule",{value:!0});var Tg=Ze(),Jme=Ct(),Qme=m0(),Xme=function(e){Cg(t,e);function t(r){var n=e.call(this)||this;return n.parent=r,n}return t.prototype._next=function(r){this.parent.notifyNext(r)},t.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(Tg.Subscriber);ts.SimpleInnerSubscriber=Xme;var ege=function(e){Cg(t,e);function t(r,n,i){var o=e.call(this)||this;return o.parent=r,o.outerValue=n,o.outerIndex=i,o}return t.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this)},t.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(Tg.Subscriber);ts.ComplexInnerSubscriber=ege;var tge=function(e){Cg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.notifyNext=function(r){this.destination.next(r)},t.prototype.notifyError=function(r){this.destination.error(r)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(Tg.Subscriber);ts.SimpleOuterSubscriber=tge;var rge=function(e){Cg(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.notifyNext=function(r,n,i,o){this.destination.next(n)},t.prototype.notifyError=function(r){this.destination.error(r)},t.prototype.notifyComplete=function(r){this.destination.complete()},t}(Tg.Subscriber);ts.ComplexOuterSubscriber=rge;function nge(e,t){if(!t.closed){if(e instanceof Jme.Observable)return e.subscribe(t);var r;try{r=Qme.subscribeTo(e)(t)}catch(n){t.error(n)}return r}}ts.innerSubscribe=nge});var g0=E(Zs=>{"use strict";var ige=Zs&&Zs.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Zs,"__esModule",{value:!0});var oge=ni(),sge=Ki(),d6=xr();function p6(e,t,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof t=="function"?function(n){return n.pipe(p6(function(i,o){return sge.from(e(i,o)).pipe(oge.map(function(a,c){return t(i,a,o,c)}))},r))}:(typeof t=="number"&&(r=t),function(n){return n.lift(new Vj(e,r))})}Zs.mergeMap=p6;var Vj=function(){function e(t,r){r===void 0&&(r=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=r}return e.prototype.call=function(t,r){return r.subscribe(new $j(t,this.project,this.concurrent))},e}();Zs.MergeMapOperator=Vj;var $j=function(e){ige(t,e);function t(r,n,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var o=e.call(this,r)||this;return o.project=n,o.concurrent=i,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return t.prototype._next=function(r){this.active<this.concurrent?this._tryNext(r):this.buffer.push(r)},t.prototype._tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this.active++,this._innerSub(n)},t.prototype._innerSub=function(r){var n=new d6.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=d6.innerSubscribe(r,n);o!==n&&i.add(o)},t.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(r){this.destination.next(r)},t.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},t}(d6.SimpleOuterSubscriber);Zs.MergeMapSubscriber=$j;Zs.flatMap=p6});var kg=E(v6=>{"use strict";Object.defineProperty(v6,"__esModule",{value:!0});var age=g0(),uge=Vs();function fge(e){return e===void 0&&(e=Number.POSITIVE_INFINITY),age.mergeMap(uge.identity,e)}v6.mergeAll=fge});var g6=E(m6=>{"use strict";Object.defineProperty(m6,"__esModule",{value:!0});var cge=kg();function lge(){return cge.mergeAll(1)}m6.concatAll=lge});var b0=E(b6=>{"use strict";Object.defineProperty(b6,"__esModule",{value:!0});var hge=t0(),dge=g6();function pge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dge.concatAll()(hge.of.apply(void 0,e))}b6.concat=pge});var Pg=E(y6=>{"use strict";Object.defineProperty(y6,"__esModule",{value:!0});var vge=Ct(),mge=Ki(),gge=Vi();function bge(e){return new vge.Observable(function(t){var r;try{r=e()}catch(i){t.error(i);return}var n=r?mge.from(r):gge.empty();return n.subscribe(t)})}y6.defer=bge});var Gj=E(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0});var yge=Ct(),Kj=Nn(),_ge=ni(),wge=dg(),xge=Ki();function Mge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var r=e[0];if(Kj.isArray(r))return Ng(r,null);if(wge.isObject(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return Ng(n.map(function(o){return r[o]}),n)}}if(typeof e[e.length-1]=="function"){var i=e.pop();return e=e.length===1&&Kj.isArray(e[0])?e[0]:e,Ng(e,null).pipe(_ge.map(function(o){return i.apply(void 0,o)}))}return Ng(e,null)}_6.forkJoin=Mge;function Ng(e,t){return new yge.Observable(function(r){var n=e.length;if(n===0){r.complete();return}for(var i=new Array(n),o=0,a=0,c=function(y){var w=xge.from(e[y]),M=!1;r.add(w.subscribe({next:function(S){M||(M=!0,a++),i[y]=S},error:function(S){return r.error(S)},complete:function(){o++,(o===n||!M)&&(a===n&&r.next(t?t.reduce(function(S,R,C){return S[R]=i[C],S},{}):i),r.complete())}}))},v=0;v<n;v++)c(v)})}});var Jj=E(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});var Sge=Ct(),Ege=Nn(),Age=hc(),Oge=ni(),eDe=function(){return Object.prototype.toString}();function Zj(e,t,r,n){return Age.isFunction(r)&&(n=r,r=void 0),n?Zj(e,t,r).pipe(Oge.map(function(i){return Ege.isArray(i)?n.apply(void 0,i):n(i)})):new Sge.Observable(function(i){function o(a){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(a)}Yj(e,t,o,i,r)})}w6.fromEvent=Zj;function Yj(e,t,r,n,i){var o;if(Cge(e)){var a=e;e.addEventListener(t,r,i),o=function(){return a.removeEventListener(t,r,i)}}else if(Ige(e)){var c=e;e.on(t,r),o=function(){return c.off(t,r)}}else if(Rge(e)){var v=e;e.addListener(t,r),o=function(){return v.removeListener(t,r)}}else if(e&&e.length)for(var y=0,w=e.length;y<w;y++)Yj(e[y],t,r,n,i);else throw new TypeError("Invalid event target");n.add(o)}function Rge(e){return e&&typeof e.addListener=="function"&&typeof e.removeListener=="function"}function Ige(e){return e&&typeof e.on=="function"&&typeof e.off=="function"}function Cge(e){return e&&typeof e.addEventListener=="function"&&typeof e.removeEventListener=="function"}});var Xj=E(x6=>{"use strict";Object.defineProperty(x6,"__esModule",{value:!0});var Tge=Ct(),kge=Nn(),Pge=hc(),Nge=ni();function Qj(e,t,r){return r?Qj(e,t).pipe(Nge.map(function(n){return kge.isArray(n)?r.apply(void 0,n):r(n)})):new Tge.Observable(function(n){var i=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return n.next(a.length===1?a[0]:a)},o;try{o=e(i)}catch(a){n.error(a);return}if(!!Pge.isFunction(t))return function(){return t(i,o)}})}x6.fromEventPattern=Qj});var tF=E(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});var qge=Ct(),eF=Vs(),Lge=$i();function Bge(e,t,r,n,i){var o,a;if(arguments.length==1){var c=e;a=c.initialState,t=c.condition,r=c.iterate,o=c.resultSelector||eF.identity,i=c.scheduler}else n===void 0||Lge.isScheduler(n)?(a=e,o=eF.identity,i=n):(a=e,o=n);return new qge.Observable(function(v){var y=a;if(i)return i.schedule(Dge,0,{subscriber:v,iterate:r,condition:t,resultSelector:o,state:y});do{if(t){var w=void 0;try{w=t(y)}catch(S){v.error(S);return}if(!w){v.complete();break}}var M=void 0;try{M=o(y)}catch(S){v.error(S);return}if(v.next(M),v.closed)break;try{y=r(y)}catch(S){v.error(S);return}}while(!0)})}M6.generate=Bge;function Dge(e){var t=e.subscriber,r=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(o){t.error(o);return}else e.needIterate=!0;if(r){var n=void 0;try{n=r(e.state)}catch(o){t.error(o);return}if(!n){t.complete();return}if(t.closed)return}var i;try{i=e.resultSelector(e.state)}catch(o){t.error(o);return}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}});var nF=E(S6=>{"use strict";Object.defineProperty(S6,"__esModule",{value:!0});var jge=Pg(),rF=Vi();function Fge(e,t,r){return t===void 0&&(t=rF.EMPTY),r===void 0&&(r=rF.EMPTY),jge.defer(function(){return e()?t:r})}S6.iif=Fge});var y0=E(E6=>{"use strict";Object.defineProperty(E6,"__esModule",{value:!0});var Uge=Nn();function Hge(e){return!Uge.isArray(e)&&e-parseFloat(e)+1>=0}E6.isNumeric=Hge});var oF=E(A6=>{"use strict";Object.defineProperty(A6,"__esModule",{value:!0});var Wge=Ct(),iF=qn(),zge=y0();function Vge(e,t){return e===void 0&&(e=0),t===void 0&&(t=iF.async),(!zge.isNumeric(e)||e<0)&&(e=0),(!t||typeof t.schedule!="function")&&(t=iF.async),new Wge.Observable(function(r){return r.add(t.schedule($ge,e,{subscriber:r,counter:0,period:e})),r})}A6.interval=Vge;function $ge(e){var t=e.subscriber,r=e.counter,n=e.period;t.next(r),this.schedule({subscriber:t,counter:r+1,period:n},n)}});var R6=E(O6=>{"use strict";Object.defineProperty(O6,"__esModule",{value:!0});var Kge=Ct(),Gge=$i(),Zge=kg(),Yge=yc();function Jge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Number.POSITIVE_INFINITY,n=null,i=e[e.length-1];return Gge.isScheduler(i)?(n=e.pop(),e.length>1&&typeof e[e.length-1]=="number"&&(r=e.pop())):typeof i=="number"&&(r=e.pop()),n===null&&e.length===1&&e[0]instanceof Kge.Observable?e[0]:Zge.mergeAll(r)(Yge.fromArray(e,n))}O6.merge=Jge});var I6=E(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});var Qge=Ct(),Xge=Rg();_0.NEVER=new Qge.Observable(Xge.noop);function ebe(){return _0.NEVER}_0.never=ebe});var sF=E(T6=>{"use strict";Object.defineProperty(T6,"__esModule",{value:!0});var tbe=Ct(),rbe=Ki(),nbe=Nn(),ibe=Vi();function C6(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===0)return ibe.EMPTY;var r=e[0],n=e.slice(1);return e.length===1&&nbe.isArray(r)?C6.apply(void 0,r):new tbe.Observable(function(i){var o=function(){return i.add(C6.apply(void 0,n).subscribe(i))};return rbe.from(r).subscribe({next:function(a){i.next(a)},error:o,complete:o})})}T6.onErrorResumeNext=C6});var fF=E(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});var aF=Ct(),obe=Fr();function sbe(e,t){return t?new aF.Observable(function(r){var n=Object.keys(e),i=new obe.Subscription;return i.add(t.schedule(uF,0,{keys:n,index:0,subscriber:r,subscription:i,obj:e})),i}):new aF.Observable(function(r){for(var n=Object.keys(e),i=0;i<n.length&&!r.closed;i++){var o=n[i];e.hasOwnProperty(o)&&r.next([o,e[o]])}r.complete()})}qg.pairs=sbe;function uF(e){var t=e.keys,r=e.index,n=e.subscriber,i=e.subscription,o=e.obj;if(!n.closed)if(r<t.length){var a=t[r];n.next([a,o[a]]),i.add(this.schedule({keys:t,index:r+1,subscriber:n,subscription:i,obj:o}))}else n.complete()}qg.dispatch=uF});var P6=E(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});function abe(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}k6.not=abe});var mu=E(w0=>{"use strict";var ube=w0&&w0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(w0,"__esModule",{value:!0});var fbe=Ze();function cbe(e,t){return function(n){return n.lift(new lbe(e,t))}}w0.filter=cbe;var lbe=function(){function e(t,r){this.predicate=t,this.thisArg=r}return e.prototype.call=function(t,r){return r.subscribe(new hbe(t,this.predicate,this.thisArg))},e}(),hbe=function(e){ube(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.count=0,o}return t.prototype._next=function(r){var n;try{n=this.predicate.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}n&&this.destination.next(r)},t}(fbe.Subscriber)});var dF=E(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});var dbe=P6(),cF=m0(),lF=mu(),hF=Ct();function pbe(e,t,r){return[lF.filter(t,r)(new hF.Observable(cF.subscribeTo(e))),lF.filter(dbe.not(t,r))(new hF.Observable(cF.subscribeTo(e)))]}N6.partition=pbe});var q6=E(gu=>{"use strict";var vbe=gu&&gu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(gu,"__esModule",{value:!0});var mbe=Nn(),gbe=yc(),bbe=Ks(),ybe=Gs();function _be(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1)if(mbe.isArray(e[0]))e=e[0];else return e[0];return gbe.fromArray(e,void 0).lift(new pF)}gu.race=_be;var pF=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new vF(t))},e}();gu.RaceOperator=pF;var vF=function(e){vbe(t,e);function t(r){var n=e.call(this,r)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return t.prototype._next=function(r){this.observables.push(r)},t.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{for(var i=0;i<n&&!this.hasFirst;i++){var o=r[i],a=ybe.subscribeToResult(this,o,void 0,i);this.subscriptions&&this.subscriptions.push(a),this.add(a)}this.observables=null}},t.prototype.notifyNext=function(r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var o=0;o<this.subscriptions.length;o++)if(o!==i){var a=this.subscriptions[o];a.unsubscribe(),this.remove(a)}this.subscriptions=null}this.destination.next(n)},t}(bbe.OuterSubscriber);gu.RaceSubscriber=vF});var gF=E(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});var wbe=Ct();function xbe(e,t,r){return e===void 0&&(e=0),new wbe.Observable(function(n){t===void 0&&(t=e,e=0);var i=0,o=e;if(r)return r.schedule(mF,0,{index:i,count:t,start:e,subscriber:n});do{if(i++>=t){n.complete();break}if(n.next(o++),n.closed)break}while(!0)})}Lg.range=xbe;function mF(e){var t=e.start,r=e.index,n=e.count,i=e.subscriber;if(r>=n){i.complete();return}i.next(t),!i.closed&&(e.index=r+1,e.start=t+1,this.schedule(e))}Lg.dispatch=mF});var B6=E(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});var Mbe=Ct(),Sbe=qn(),bF=y0(),yF=$i();function Ebe(e,t,r){e===void 0&&(e=0);var n=-1;return bF.isNumeric(t)?n=Number(t)<1&&1||Number(t):yF.isScheduler(t)&&(r=t),yF.isScheduler(r)||(r=Sbe.async),new Mbe.Observable(function(i){var o=bF.isNumeric(e)?e:+e-r.now();return r.schedule(Abe,o,{index:0,period:n,subscriber:i})})}L6.timer=Ebe;function Abe(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(r===-1)return n.complete();e.index=t+1,this.schedule(e,r)}}});var _F=E(D6=>{"use strict";Object.defineProperty(D6,"__esModule",{value:!0});var Obe=Ct(),Rbe=Ki(),Ibe=Vi();function Cbe(e,t){return new Obe.Observable(function(r){var n;try{n=e()}catch(c){r.error(c);return}var i;try{i=t(n)}catch(c){r.error(c);return}var o=i?Rbe.from(i):Ibe.EMPTY,a=o.subscribe(r);return function(){a.unsubscribe(),n&&n.unsubscribe()}})}D6.using=Cbe});var Dg=E(bu=>{"use strict";var wF=bu&&bu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(bu,"__esModule",{value:!0});var Tbe=yc(),kbe=Nn(),Pbe=Ze(),Bg=Ec(),j6=xr();function Nbe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return typeof r=="function"&&e.pop(),Tbe.fromArray(e,void 0).lift(new xF(r))}bu.zip=Nbe;var xF=function(){function e(t){this.resultSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new MF(t,this.resultSelector))},e}();bu.ZipOperator=xF;var MF=function(e){wF(t,e);function t(r,n,i){i===void 0&&(i=Object.create(null));var o=e.call(this,r)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector=typeof n=="function"?n:void 0,o}return t.prototype._next=function(r){var n=this.iterators;kbe.isArray(r)?n.push(new Lbe(r)):typeof r[Bg.iterator]=="function"?n.push(new qbe(r[Bg.iterator]())):n.push(new Bbe(this.destination,this,r))},t.prototype._complete=function(){var r=this.iterators,n=r.length;if(this.unsubscribe(),n===0){this.destination.complete();return}this.active=n;for(var i=0;i<n;i++){var o=r[i];if(o.stillUnsubscribed){var a=this.destination;a.add(o.subscribe())}else this.active--}},t.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},t.prototype.checkIterators=function(){for(var r=this.iterators,n=r.length,i=this.destination,o=0;o<n;o++){var a=r[o];if(typeof a.hasValue=="function"&&!a.hasValue())return}for(var c=!1,v=[],o=0;o<n;o++){var a=r[o],y=a.next();if(a.hasCompleted()&&(c=!0),y.done){i.complete();return}v.push(y.value)}this.resultSelector?this._tryresultSelector(v):i.next(v),c&&i.complete()},t.prototype._tryresultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(Pbe.Subscriber);bu.ZipSubscriber=MF;var qbe=function(){function e(t){this.iterator=t,this.nextResult=t.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},e.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},e}(),Lbe=function(){function e(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return e.prototype[Bg.iterator]=function(){return this},e.prototype.next=function(t){var r=this.index++,n=this.array;return r<this.length?{value:n[r],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),Bbe=function(e){wF(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.parent=n,o.observable=i,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return t.prototype[Bg.iterator]=function(){return this},t.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},t.prototype.subscribe=function(){return j6.innerSubscribe(this.observable,new j6.SimpleInnerSubscriber(this))},t}(j6.SimpleOuterSubscriber)});var yu=E(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});var Dbe=Ct();We.Observable=Dbe.Observable;var jbe=E4();We.ConnectableObservable=jbe.ConnectableObservable;var Fbe=O4();We.GroupedObservable=Fbe.GroupedObservable;var Ube=du();We.observable=Ube.observable;var Hbe=xn();We.Subject=Hbe.Subject;var Wbe=R4();We.BehaviorSubject=Wbe.BehaviorSubject;var zbe=Eg();We.ReplaySubject=zbe.ReplaySubject;var Vbe=s0();We.AsyncSubject=Vbe.AsyncSubject;var SF=U4();We.asap=SF.asap;We.asapScheduler=SF.asapScheduler;var EF=qn();We.async=EF.async;We.asyncScheduler=EF.asyncScheduler;var AF=T4();We.queue=AF.queue;We.queueScheduler=AF.queueScheduler;var OF=bj();We.animationFrame=OF.animationFrame;We.animationFrameScheduler=OF.animationFrameScheduler;var RF=wj();We.VirtualTimeScheduler=RF.VirtualTimeScheduler;We.VirtualAction=RF.VirtualAction;var $be=C4();We.Scheduler=$be.Scheduler;var Kbe=Fr();We.Subscription=Kbe.Subscription;var Gbe=Ze();We.Subscriber=Gbe.Subscriber;var IF=n0();We.Notification=IF.Notification;We.NotificationKind=IF.NotificationKind;var Zbe=yg();We.pipe=Zbe.pipe;var Ybe=Rg();We.noop=Ybe.noop;var Jbe=Vs();We.identity=Jbe.identity;var Qbe=xj();We.isObservable=Qbe.isObservable;var Xbe=wc();We.ArgumentOutOfRangeError=Xbe.ArgumentOutOfRangeError;var eye=xc();We.EmptyError=eye.EmptyError;var tye=Wh();We.ObjectUnsubscribedError=tye.ObjectUnsubscribedError;var rye=f4();We.UnsubscriptionError=rye.UnsubscriptionError;var nye=K4();We.TimeoutError=nye.TimeoutError;var iye=Aj();We.bindCallback=iye.bindCallback;var oye=Cj();We.bindNodeCallback=oye.bindNodeCallback;var sye=Ig();We.combineLatest=sye.combineLatest;var aye=b0();We.concat=aye.concat;var uye=Pg();We.defer=uye.defer;var fye=Vi();We.empty=fye.empty;var cye=Gj();We.forkJoin=cye.forkJoin;var lye=Ki();We.from=lye.from;var hye=Jj();We.fromEvent=hye.fromEvent;var dye=Xj();We.fromEventPattern=dye.fromEventPattern;var pye=tF();We.generate=pye.generate;var vye=nF();We.iif=vye.iif;var mye=oF();We.interval=mye.interval;var gye=R6();We.merge=gye.merge;var bye=I6();We.never=bye.never;var yye=t0();We.of=yye.of;var _ye=sF();We.onErrorResumeNext=_ye.onErrorResumeNext;var wye=fF();We.pairs=wye.pairs;var xye=dF();We.partition=xye.partition;var Mye=q6();We.race=Mye.race;var Sye=gF();We.range=Sye.range;var Eye=Sg();We.throwError=Eye.throwError;var Aye=B6();We.timer=Aye.timer;var Oye=_F();We.using=Oye.using;var Rye=Dg();We.zip=Rye.zip;var Iye=l6();We.scheduled=Iye.scheduled;var Cye=Vi();We.EMPTY=Cye.EMPTY;var Tye=I6();We.NEVER=Tye.NEVER;var kye=Uh();We.config=kye.config});var U6=E(x0=>{"use strict";var Pye=x0&&x0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(x0,"__esModule",{value:!0});var F6=xr();function Nye(e){return function(r){return r.lift(new qye(e))}}x0.audit=Nye;var qye=function(){function e(t){this.durationSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new Lye(t,this.durationSelector))},e}(),Lye=function(e){Pye(t,e);function t(r,n){var i=e.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return t.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(a){return this.destination.error(a)}var o=F6.innerSubscribe(n,new F6.SimpleInnerSubscriber(this));!o||o.closed?this.clearThrottle():this.add(this.throttled=o)}},t.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,o=r.throttled;o&&(this.remove(o),this.throttled=void 0,o.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(F6.SimpleOuterSubscriber)});var CF=E(H6=>{"use strict";Object.defineProperty(H6,"__esModule",{value:!0});var Bye=qn(),Dye=U6(),jye=B6();function Fye(e,t){return t===void 0&&(t=Bye.async),Dye.audit(function(){return jye.timer(e,t)})}H6.auditTime=Fye});var TF=E(M0=>{"use strict";var Uye=M0&&M0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(M0,"__esModule",{value:!0});var W6=xr();function Hye(e){return function(r){return r.lift(new Wye(e))}}M0.buffer=Hye;var Wye=function(){function e(t){this.closingNotifier=t}return e.prototype.call=function(t,r){return r.subscribe(new zye(t,this.closingNotifier))},e}(),zye=function(e){Uye(t,e);function t(r,n){var i=e.call(this,r)||this;return i.buffer=[],i.add(W6.innerSubscribe(n,new W6.SimpleInnerSubscriber(i))),i}return t.prototype._next=function(r){this.buffer.push(r)},t.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},t}(W6.SimpleOuterSubscriber)});var NF=E(S0=>{"use strict";var kF=S0&&S0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(S0,"__esModule",{value:!0});var PF=Ze();function Vye(e,t){return t===void 0&&(t=null),function(n){return n.lift(new $ye(e,t))}}S0.bufferCount=Vye;var $ye=function(){function e(t,r){this.bufferSize=t,this.startBufferEvery=r,!r||t===r?this.subscriberClass=Kye:this.subscriberClass=Gye}return e.prototype.call=function(t,r){return r.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},e}(),Kye=function(e){kF(t,e);function t(r,n){var i=e.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return t.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},t.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),e.prototype._complete.call(this)},t}(PF.Subscriber),Gye=function(e){kF(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.bufferSize=n,o.startBufferEvery=i,o.buffers=[],o.count=0,o}return t.prototype._next=function(r){var n=this,i=n.bufferSize,o=n.startBufferEvery,a=n.buffers,c=n.count;this.count++,c%o===0&&a.push([]);for(var v=a.length;v--;){var y=a[v];y.push(r),y.length===i&&(a.splice(v,1),this.destination.next(y))}},t.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var o=n.shift();o.length>0&&i.next(o)}e.prototype._complete.call(this)},t}(PF.Subscriber)});var BF=E(E0=>{"use strict";var Zye=E0&&E0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(E0,"__esModule",{value:!0});var Yye=qn(),Jye=Ze(),Qye=$i();function Xye(e){var t=arguments.length,r=Yye.async;Qye.isScheduler(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return t>=3&&(i=arguments[2]),function(a){return a.lift(new e_e(e,n,i,r))}}E0.bufferTime=Xye;var e_e=function(){function e(t,r,n,i){this.bufferTimeSpan=t,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return e.prototype.call=function(t,r){return r.subscribe(new r_e(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),t_e=function(){function e(){this.buffer=[]}return e}(),r_e=function(e){Zye(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;c.bufferTimeSpan=n,c.bufferCreationInterval=i,c.maxBufferSize=o,c.scheduler=a,c.contexts=[];var v=c.openContext();if(c.timespanOnly=i==null||i<0,c.timespanOnly){var y={subscriber:c,context:v,bufferTimeSpan:n};c.add(v.closeAction=a.schedule(qF,n,y))}else{var w={subscriber:c,context:v},M={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:c,scheduler:a};c.add(v.closeAction=a.schedule(LF,n,w)),c.add(a.schedule(n_e,i,M))}return c}return t.prototype._next=function(r){for(var n=this.contexts,i=n.length,o,a=0;a<i;a++){var c=n[a],v=c.buffer;v.push(r),v.length==this.maxBufferSize&&(o=c)}o&&this.onBufferFull(o)},t.prototype._error=function(r){this.contexts.length=0,e.prototype._error.call(this,r)},t.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var o=n.shift();i.next(o.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,o={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(qF,i,o))}},t.prototype.openContext=function(){var r=new t_e;return this.contexts.push(r),r},t.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},t}(Jye.Subscriber);function qF(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function n_e(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext(),a=this;n.closed||(n.add(o.closeAction=i.schedule(LF,r,{subscriber:n,context:o})),a.schedule(e,t))}function LF(e){var t=e.subscriber,r=e.context;t.closeContext(r)}});var jF=E(A0=>{"use strict";var i_e=A0&&A0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(A0,"__esModule",{value:!0});var o_e=Fr(),DF=Gs(),s_e=Ks();function a_e(e,t){return function(n){return n.lift(new u_e(e,t))}}A0.bufferToggle=a_e;var u_e=function(){function e(t,r){this.openings=t,this.closingSelector=r}return e.prototype.call=function(t,r){return r.subscribe(new f_e(t,this.openings,this.closingSelector))},e}(),f_e=function(e){i_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.closingSelector=i,o.contexts=[],o.add(DF.subscribeToResult(o,n)),o}return t.prototype._next=function(r){for(var n=this.contexts,i=n.length,o=0;o<i;o++)n[o].buffer.push(r)},t.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,e.prototype._error.call(this,r)},t.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},t.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},t.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(o){this._error(o)}},t.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,o=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(o),o.unsubscribe()}},t.prototype.trySubscribe=function(r){var n=this.contexts,i=[],o=new o_e.Subscription,a={buffer:i,subscription:o};n.push(a);var c=DF.subscribeToResult(this,r,a);!c||c.closed?this.closeBuffer(a):(c.context=a,this.add(c),o.add(c))},t}(s_e.OuterSubscriber)});var FF=E(O0=>{"use strict";var c_e=O0&&O0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(O0,"__esModule",{value:!0});var l_e=Fr(),z6=xr();function h_e(e){return function(t){return t.lift(new d_e(e))}}O0.bufferWhen=h_e;var d_e=function(){function e(t){this.closingSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new p_e(t,this.closingSelector))},e}(),p_e=function(e){c_e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return t.prototype._next=function(r){this.buffer.push(r)},t.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var o=this.closingSelector;i=o()}catch(a){return this.error(a)}r=new l_e.Subscription,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(z6.innerSubscribe(i,new z6.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(z6.SimpleOuterSubscriber)});var UF=E(R0=>{"use strict";var v_e=R0&&R0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(R0,"__esModule",{value:!0});var V6=xr();function m_e(e){return function(r){var n=new g_e(e),i=r.lift(n);return n.caught=i}}R0.catchError=m_e;var g_e=function(){function e(t){this.selector=t}return e.prototype.call=function(t,r){return r.subscribe(new b_e(t,this.selector,this.caught))},e}(),b_e=function(e){v_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.selector=n,o.caught=i,o}return t.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(a){e.prototype.error.call(this,a);return}this._unsubscribeAndRecycle();var i=new V6.SimpleInnerSubscriber(this);this.add(i);var o=V6.innerSubscribe(n,i);o!==i&&this.add(o)}},t}(V6.SimpleOuterSubscriber)});var HF=E($6=>{"use strict";Object.defineProperty($6,"__esModule",{value:!0});var y_e=Ig();function __e(e){return function(t){return t.lift(new y_e.CombineLatestOperator(e))}}$6.combineAll=__e});var WF=E(K6=>{"use strict";Object.defineProperty(K6,"__esModule",{value:!0});var w_e=Nn(),x_e=Ig(),M_e=Ki();function S_e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return typeof e[e.length-1]=="function"&&(r=e.pop()),e.length===1&&w_e.isArray(e[0])&&(e=e[0].slice()),function(n){return n.lift.call(M_e.from([n].concat(e)),new x_e.CombineLatestOperator(r))}}K6.combineLatest=S_e});var zF=E(G6=>{"use strict";Object.defineProperty(G6,"__esModule",{value:!0});var E_e=b0();function A_e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){return r.lift.call(E_e.concat.apply(void 0,[r].concat(e)))}}G6.concat=A_e});var Y6=E(Z6=>{"use strict";Object.defineProperty(Z6,"__esModule",{value:!0});var O_e=g0();function R_e(e,t){return O_e.mergeMap(e,t,1)}Z6.concatMap=R_e});var VF=E(J6=>{"use strict";Object.defineProperty(J6,"__esModule",{value:!0});var I_e=Y6();function C_e(e,t){return I_e.concatMap(function(){return e},t)}J6.concatMapTo=C_e});var $F=E(I0=>{"use strict";var T_e=I0&&I0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(I0,"__esModule",{value:!0});var k_e=Ze();function P_e(e){return function(t){return t.lift(new N_e(e,t))}}I0.count=P_e;var N_e=function(){function e(t,r){this.predicate=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new q_e(t,this.predicate,this.source))},e}(),q_e=function(e){T_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.source=i,o.count=0,o.index=0,o}return t.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},t.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(k_e.Subscriber)});var KF=E(C0=>{"use strict";var L_e=C0&&C0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(C0,"__esModule",{value:!0});var Q6=xr();function B_e(e){return function(t){return t.lift(new D_e(e))}}C0.debounce=B_e;var D_e=function(){function e(t){this.durationSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new j_e(t,this.durationSelector))},e}(),j_e=function(e){L_e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return t.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=Q6.innerSubscribe(n,new Q6.SimpleInnerSubscriber(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,r)}},t}(Q6.SimpleOuterSubscriber)});var GF=E(T0=>{"use strict";var F_e=T0&&T0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(T0,"__esModule",{value:!0});var U_e=Ze(),H_e=qn();function W_e(e,t){return t===void 0&&(t=H_e.async),function(r){return r.lift(new z_e(e,t))}}T0.debounceTime=W_e;var z_e=function(){function e(t,r){this.dueTime=t,this.scheduler=r}return e.prototype.call=function(t,r){return r.subscribe(new V_e(t,this.dueTime,this.scheduler))},e}(),V_e=function(e){F_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.dueTime=n,o.scheduler=i,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return t.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule($_e,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},t.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},t}(U_e.Subscriber);function $_e(e){e.debouncedNext()}});var Ac=E(k0=>{"use strict";var K_e=k0&&k0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(k0,"__esModule",{value:!0});var G_e=Ze();function Z_e(e){return e===void 0&&(e=null),function(t){return t.lift(new Y_e(e))}}k0.defaultIfEmpty=Z_e;var Y_e=function(){function e(t){this.defaultValue=t}return e.prototype.call=function(t,r){return r.subscribe(new J_e(t,this.defaultValue))},e}(),J_e=function(e){K_e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return t.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(G_e.Subscriber)});var eM=E(X6=>{"use strict";Object.defineProperty(X6,"__esModule",{value:!0});function Q_e(e){return e instanceof Date&&!isNaN(+e)}X6.isDate=Q_e});var YF=E(P0=>{"use strict";var X_e=P0&&P0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(P0,"__esModule",{value:!0});var ewe=qn(),twe=eM(),rwe=Ze(),ZF=n0();function nwe(e,t){t===void 0&&(t=ewe.async);var r=twe.isDate(e),n=r?+e-t.now():Math.abs(e);return function(i){return i.lift(new iwe(n,t))}}P0.delay=nwe;var iwe=function(){function e(t,r){this.delay=t,this.scheduler=r}return e.prototype.call=function(t,r){return r.subscribe(new owe(t,this.delay,this.scheduler))},e}(),owe=function(e){X_e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.delay=n,o.scheduler=i,o.queue=[],o.active=!1,o.errored=!1,o}return t.dispatch=function(r){for(var n=r.source,i=n.queue,o=r.scheduler,a=r.destination;i.length>0&&i[0].time-o.now()<=0;)i.shift().notification.observe(a);if(i.length>0){var c=Math.max(0,i[0].time-o.now());this.schedule(r,c)}else this.unsubscribe(),n.active=!1},t.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},t.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new swe(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},t.prototype._next=function(r){this.scheduleNotification(ZF.Notification.createNext(r))},t.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(ZF.Notification.createComplete()),this.unsubscribe()},t}(rwe.Subscriber),swe=function(){function e(t,r){this.time=t,this.notification=r}return e}()});var QF=E(N0=>{"use strict";var tM=N0&&N0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(N0,"__esModule",{value:!0});var awe=Ze(),uwe=Ct(),fwe=Ks(),cwe=Gs();function lwe(e,t){return t?function(r){return new dwe(r,t).lift(new JF(e))}:function(r){return r.lift(new JF(e))}}N0.delayWhen=lwe;var JF=function(){function e(t){this.delayDurationSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new hwe(t,this.delayDurationSelector))},e}(),hwe=function(e){tM(t,e);function t(r,n){var i=e.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return t.prototype.notifyNext=function(r,n,i,o,a){this.destination.next(r),this.removeSubscription(a),this.tryComplete()},t.prototype.notifyError=function(r,n){this._error(r)},t.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},t.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(o){this.destination.error(o)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},t.prototype.tryDelay=function(r,n){var i=cwe.subscribeToResult(this,r,n);if(i&&!i.closed){var o=this.destination;o.add(i),this.delayNotifierSubscriptions.push(i)}},t.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},t}(fwe.OuterSubscriber),dwe=function(e){tM(t,e);function t(r,n){var i=e.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return t.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new pwe(r,this.source))},t}(uwe.Observable),pwe=function(e){tM(t,e);function t(r,n){var i=e.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return t.prototype._next=function(r){this.subscribeToSource()},t.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(awe.Subscriber)});var XF=E(q0=>{"use strict";var vwe=q0&&q0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(q0,"__esModule",{value:!0});var mwe=Ze();function gwe(){return function(t){return t.lift(new bwe)}}q0.dematerialize=gwe;var bwe=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new ywe(t))},e}(),ywe=function(e){vwe(t,e);function t(r){return e.call(this,r)||this}return t.prototype._next=function(r){r.observe(this.destination)},t}(mwe.Subscriber)});var tU=E(Oc=>{"use strict";var _we=Oc&&Oc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Oc,"__esModule",{value:!0});var rM=xr();function wwe(e,t){return function(r){return r.lift(new xwe(e,t))}}Oc.distinct=wwe;var xwe=function(){function e(t,r){this.keySelector=t,this.flushes=r}return e.prototype.call=function(t,r){return r.subscribe(new eU(t,this.keySelector,this.flushes))},e}(),eU=function(e){_we(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.keySelector=n,o.values=new Set,i&&o.add(rM.innerSubscribe(i,new rM.SimpleInnerSubscriber(o))),o}return t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(r){this._error(r)},t.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},t.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(o){i.error(o);return}this._finalizeNext(n,r)},t.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},t}(rM.SimpleOuterSubscriber);Oc.DistinctSubscriber=eU});var nM=E(L0=>{"use strict";var Mwe=L0&&L0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(L0,"__esModule",{value:!0});var Swe=Ze();function Ewe(e,t){return function(r){return r.lift(new Awe(e,t))}}L0.distinctUntilChanged=Ewe;var Awe=function(){function e(t,r){this.compare=t,this.keySelector=r}return e.prototype.call=function(t,r){return r.subscribe(new Owe(t,this.compare,this.keySelector))},e}(),Owe=function(e){Mwe(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.keySelector=i,o.hasKey=!1,typeof n=="function"&&(o.compare=n),o}return t.prototype.compare=function(r,n){return r===n},t.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(c){return this.destination.error(c)}var o=!1;if(this.hasKey)try{var a=this.compare;o=a(this.key,n)}catch(c){return this.destination.error(c)}else this.hasKey=!0;o||(this.key=n,this.destination.next(r))},t}(Swe.Subscriber)});var rU=E(iM=>{"use strict";Object.defineProperty(iM,"__esModule",{value:!0});var Rwe=nM();function Iwe(e,t){return Rwe.distinctUntilChanged(function(r,n){return t?t(r[e],n[e]):r[e]===n[e]})}iM.distinctUntilKeyChanged=Iwe});var D0=E(B0=>{"use strict";var Cwe=B0&&B0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(B0,"__esModule",{value:!0});var Twe=xc(),kwe=Ze();function Pwe(e){return e===void 0&&(e=Lwe),function(t){return t.lift(new Nwe(e))}}B0.throwIfEmpty=Pwe;var Nwe=function(){function e(t){this.errorFactory=t}return e.prototype.call=function(t,r){return r.subscribe(new qwe(t,this.errorFactory))},e}(),qwe=function(e){Cwe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return t.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},t}(kwe.Subscriber);function Lwe(){return new Twe.EmptyError}});var jg=E(j0=>{"use strict";var Bwe=j0&&j0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(j0,"__esModule",{value:!0});var Dwe=Ze(),jwe=wc(),Fwe=Vi();function Uwe(e){return function(t){return e===0?Fwe.empty():t.lift(new Hwe(e))}}j0.take=Uwe;var Hwe=function(){function e(t){if(this.total=t,this.total<0)throw new jwe.ArgumentOutOfRangeError}return e.prototype.call=function(t,r){return r.subscribe(new Wwe(t,this.total))},e}(),Wwe=function(e){Bwe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.total=n,i.count=0,i}return t.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},t}(Dwe.Subscriber)});var iU=E(oM=>{"use strict";Object.defineProperty(oM,"__esModule",{value:!0});var nU=wc(),zwe=mu(),Vwe=D0(),$we=Ac(),Kwe=jg();function Gwe(e,t){if(e<0)throw new nU.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(n){return n.pipe(zwe.filter(function(i,o){return o===e}),Kwe.take(1),r?$we.defaultIfEmpty(t):Vwe.throwIfEmpty(function(){return new nU.ArgumentOutOfRangeError}))}}oM.elementAt=Gwe});var oU=E(sM=>{"use strict";Object.defineProperty(sM,"__esModule",{value:!0});var Zwe=b0(),Ywe=t0();function Jwe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){return Zwe.concat(r,Ywe.of.apply(void 0,e))}}sM.endWith=Jwe});var sU=E(F0=>{"use strict";var Qwe=F0&&F0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(F0,"__esModule",{value:!0});var Xwe=Ze();function e2e(e,t){return function(r){return r.lift(new t2e(e,t,r))}}F0.every=e2e;var t2e=function(){function e(t,r,n){this.predicate=t,this.thisArg=r,this.source=n}return e.prototype.call=function(t,r){return r.subscribe(new r2e(t,this.predicate,this.thisArg,this.source))},e}(),r2e=function(e){Qwe(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.predicate=n,a.thisArg=i,a.source=o,a.index=0,a.thisArg=i||a,a}return t.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},t.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(Xwe.Subscriber)});var aU=E(U0=>{"use strict";var n2e=U0&&U0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(U0,"__esModule",{value:!0});var aM=xr();function i2e(){return function(e){return e.lift(new o2e)}}U0.exhaust=i2e;var o2e=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new s2e(t))},e}(),s2e=function(e){n2e(t,e);function t(r){var n=e.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return t.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(aM.innerSubscribe(r,new aM.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(aM.SimpleOuterSubscriber)});var fU=E(H0=>{"use strict";var a2e=H0&&H0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(H0,"__esModule",{value:!0});var u2e=ni(),f2e=Ki(),uM=xr();function uU(e,t){return t?function(r){return r.pipe(uU(function(n,i){return f2e.from(e(n,i)).pipe(u2e.map(function(o,a){return t(n,o,i,a)}))}))}:function(r){return r.lift(new c2e(e))}}H0.exhaustMap=uU;var c2e=function(){function e(t){this.project=t}return e.prototype.call=function(t,r){return r.subscribe(new l2e(t,this.project))},e}(),l2e=function(e){a2e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return t.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},t.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this.hasSubscription=!0,this._innerSub(n)},t.prototype._innerSub=function(r){var n=new uM.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=uM.innerSubscribe(r,n);o!==n&&i.add(o)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(r){this.destination.next(r)},t.prototype.notifyError=function(r){this.destination.error(r)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(uM.SimpleOuterSubscriber)});var hU=E(_u=>{"use strict";var h2e=_u&&_u.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_u,"__esModule",{value:!0});var fM=xr();function d2e(e,t,r){return t===void 0&&(t=Number.POSITIVE_INFINITY),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(n){return n.lift(new cU(e,t,r))}}_u.expand=d2e;var cU=function(){function e(t,r,n){this.project=t,this.concurrent=r,this.scheduler=n}return e.prototype.call=function(t,r){return r.subscribe(new lU(t,this.project,this.concurrent,this.scheduler))},e}();_u.ExpandOperator=cU;var lU=function(e){h2e(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.project=n,a.concurrent=i,a.scheduler=o,a.index=0,a.active=0,a.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(a.buffer=[]),a}return t.dispatch=function(r){var n=r.subscriber,i=r.result,o=r.value,a=r.index;n.subscribeToProjection(i,o,a)},t.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var o=this.project,a=o(r,i);if(!this.scheduler)this.subscribeToProjection(a,r,i);else{var c={subscriber:this,result:a,value:r,index:i},v=this.destination;v.add(this.scheduler.schedule(t.dispatch,0,c))}}catch(y){n.error(y)}}else this.buffer.push(r)},t.prototype.subscribeToProjection=function(r,n,i){this.active++;var o=this.destination;o.add(fM.innerSubscribe(r,new fM.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(r){this._next(r)},t.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},t}(fM.SimpleOuterSubscriber);_u.ExpandSubscriber=lU});var dU=E(W0=>{"use strict";var p2e=W0&&W0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(W0,"__esModule",{value:!0});var v2e=Ze(),m2e=Fr();function g2e(e){return function(t){return t.lift(new b2e(e))}}W0.finalize=g2e;var b2e=function(){function e(t){this.callback=t}return e.prototype.call=function(t,r){return r.subscribe(new y2e(t,this.callback))},e}(),y2e=function(e){p2e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.add(new m2e.Subscription(n)),i}return t}(v2e.Subscriber)});var cM=E(wu=>{"use strict";var _2e=wu&&wu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(wu,"__esModule",{value:!0});var w2e=Ze();function x2e(e,t){if(typeof e!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new pU(e,r,!1,t))}}wu.find=x2e;var pU=function(){function e(t,r,n,i){this.predicate=t,this.source=r,this.yieldIndex=n,this.thisArg=i}return e.prototype.call=function(t,r){return r.subscribe(new vU(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();wu.FindValueOperator=pU;var vU=function(e){_2e(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.predicate=n,c.source=i,c.yieldIndex=o,c.thisArg=a,c.index=0,c}return t.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},t.prototype._next=function(r){var n=this,i=n.predicate,o=n.thisArg,a=this.index++;try{var c=i.call(o||this,r,a,this.source);c&&this.notifyComplete(this.yieldIndex?a:r)}catch(v){this.destination.error(v)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(w2e.Subscriber);wu.FindValueSubscriber=vU});var mU=E(lM=>{"use strict";Object.defineProperty(lM,"__esModule",{value:!0});var M2e=cM();function S2e(e,t){return function(r){return r.lift(new M2e.FindValueOperator(e,r,!0,t))}}lM.findIndex=S2e});var gU=E(hM=>{"use strict";Object.defineProperty(hM,"__esModule",{value:!0});var E2e=xc(),A2e=mu(),O2e=jg(),R2e=Ac(),I2e=D0(),C2e=Vs();function T2e(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?A2e.filter(function(i,o){return e(i,o,n)}):C2e.identity,O2e.take(1),r?R2e.defaultIfEmpty(t):I2e.throwIfEmpty(function(){return new E2e.EmptyError}))}}hM.first=T2e});var bU=E(z0=>{"use strict";var k2e=z0&&z0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(z0,"__esModule",{value:!0});var P2e=Ze();function N2e(){return function(t){return t.lift(new q2e)}}z0.ignoreElements=N2e;var q2e=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new L2e(t))},e}(),L2e=function(e){k2e(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._next=function(r){},t}(P2e.Subscriber)});var yU=E(V0=>{"use strict";var B2e=V0&&V0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(V0,"__esModule",{value:!0});var D2e=Ze();function j2e(){return function(e){return e.lift(new F2e)}}V0.isEmpty=j2e;var F2e=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new U2e(t))},e}(),U2e=function(e){B2e(t,e);function t(r){return e.call(this,r)||this}return t.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},t.prototype._next=function(r){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(D2e.Subscriber)});var Fg=E($0=>{"use strict";var H2e=$0&&$0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty($0,"__esModule",{value:!0});var W2e=Ze(),z2e=wc(),V2e=Vi();function $2e(e){return function(r){return e===0?V2e.empty():r.lift(new K2e(e))}}$0.takeLast=$2e;var K2e=function(){function e(t){if(this.total=t,this.total<0)throw new z2e.ArgumentOutOfRangeError}return e.prototype.call=function(t,r){return r.subscribe(new G2e(t,this.total))},e}(),G2e=function(e){H2e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return t.prototype._next=function(r){var n=this.ring,i=this.total,o=this.count++;if(n.length<i)n.push(r);else{var a=o%i;n[a]=r}},t.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,o=this.ring,a=0;a<i;a++){var c=n++%i;r.next(o[c])}r.complete()},t}(W2e.Subscriber)});var _U=E(dM=>{"use strict";Object.defineProperty(dM,"__esModule",{value:!0});var Z2e=xc(),Y2e=mu(),J2e=Fg(),Q2e=D0(),X2e=Ac(),exe=Vs();function txe(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?Y2e.filter(function(i,o){return e(i,o,n)}):exe.identity,J2e.takeLast(1),r?X2e.defaultIfEmpty(t):Q2e.throwIfEmpty(function(){return new Z2e.EmptyError}))}}dM.last=txe});var wU=E(K0=>{"use strict";var rxe=K0&&K0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(K0,"__esModule",{value:!0});var nxe=Ze();function ixe(e){return function(t){return t.lift(new oxe(e))}}K0.mapTo=ixe;var oxe=function(){function e(t){this.value=t}return e.prototype.call=function(t,r){return r.subscribe(new sxe(t,this.value))},e}(),sxe=function(e){rxe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.value=n,i}return t.prototype._next=function(r){this.destination.next(this.value)},t}(nxe.Subscriber)});var xU=E(G0=>{"use strict";var axe=G0&&G0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(G0,"__esModule",{value:!0});var uxe=Ze(),pM=n0();function fxe(){return function(t){return t.lift(new cxe)}}G0.materialize=fxe;var cxe=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new lxe(t))},e}(),lxe=function(e){axe(t,e);function t(r){return e.call(this,r)||this}return t.prototype._next=function(r){this.destination.next(pM.Notification.createNext(r))},t.prototype._error=function(r){var n=this.destination;n.next(pM.Notification.createError(r)),n.complete()},t.prototype._complete=function(){var r=this.destination;r.next(pM.Notification.createComplete()),r.complete()},t}(uxe.Subscriber)});var Ug=E(Z0=>{"use strict";var hxe=Z0&&Z0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Z0,"__esModule",{value:!0});var dxe=Ze();function pxe(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new vxe(e,t,r))}}Z0.scan=pxe;var vxe=function(){function e(t,r,n){n===void 0&&(n=!1),this.accumulator=t,this.seed=r,this.hasSeed=n}return e.prototype.call=function(t,r){return r.subscribe(new mxe(t,this.accumulator,this.seed,this.hasSeed))},e}(),mxe=function(e){hxe(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.accumulator=n,a._seed=i,a.hasSeed=o,a.index=0,a}return Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),t.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},t.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(o){this.destination.error(o)}this.seed=i,this.destination.next(i)},t}(dxe.Subscriber)});var Y0=E(vM=>{"use strict";Object.defineProperty(vM,"__esModule",{value:!0});var MU=Ug(),SU=Fg(),gxe=Ac(),EU=yg();function bxe(e,t){return arguments.length>=2?function(n){return EU.pipe(MU.scan(e,t),SU.takeLast(1),gxe.defaultIfEmpty(t))(n)}:function(n){return EU.pipe(MU.scan(function(i,o,a){return e(i,o,a+1)}),SU.takeLast(1))(n)}}vM.reduce=bxe});var AU=E(mM=>{"use strict";Object.defineProperty(mM,"__esModule",{value:!0});var yxe=Y0();function _xe(e){var t=typeof e=="function"?function(r,n){return e(r,n)>0?r:n}:function(r,n){return r>n?r:n};return yxe.reduce(t)}mM.max=_xe});var OU=E(gM=>{"use strict";Object.defineProperty(gM,"__esModule",{value:!0});var wxe=R6();function xxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){return r.lift.call(wxe.merge.apply(void 0,[r].concat(e)))}}gM.merge=xxe});var IU=E(bM=>{"use strict";Object.defineProperty(bM,"__esModule",{value:!0});var RU=g0();function Mxe(e,t,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof t=="function"?RU.mergeMap(function(){return e},t,r):(typeof t=="number"&&(r=t),RU.mergeMap(function(){return e},r))}bM.mergeMapTo=Mxe});var kU=E(xu=>{"use strict";var Sxe=xu&&xu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(xu,"__esModule",{value:!0});var yM=xr();function Exe(e,t,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new CU(e,t,r))}}xu.mergeScan=Exe;var CU=function(){function e(t,r,n){this.accumulator=t,this.seed=r,this.concurrent=n}return e.prototype.call=function(t,r){return r.subscribe(new TU(t,this.accumulator,this.seed,this.concurrent))},e}();xu.MergeScanOperator=CU;var TU=function(e){Sxe(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.accumulator=n,a.acc=i,a.concurrent=o,a.hasValue=!1,a.hasCompleted=!1,a.buffer=[],a.active=0,a.index=0,a}return t.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,o=void 0;try{var a=this.accumulator;o=a(this.acc,r,n)}catch(c){return i.error(c)}this.active++,this._innerSub(o)}else this.buffer.push(r)},t.prototype._innerSub=function(r){var n=new yM.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=yM.innerSubscribe(r,n);o!==n&&i.add(o)},t.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},t.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},t}(yM.SimpleOuterSubscriber);xu.MergeScanSubscriber=TU});var PU=E(_M=>{"use strict";Object.defineProperty(_M,"__esModule",{value:!0});var Axe=Y0();function Oxe(e){var t=typeof e=="function"?function(r,n){return e(r,n)<0?r:n}:function(r,n){return r<n?r:n};return Axe.reduce(t)}_M.min=Oxe});var Mu=E(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});var Rxe=E4();function Ixe(e,t){return function(n){var i;if(typeof e=="function"?i=e:i=function(){return e},typeof t=="function")return n.lift(new NU(i,t));var o=Object.create(n,Rxe.connectableObservableDescriptor);return o.source=n,o.subjectFactory=i,o}}Hg.multicast=Ixe;var NU=function(){function e(t,r){this.subjectFactory=t,this.selector=r}return e.prototype.call=function(t,r){var n=this.selector,i=this.subjectFactory(),o=n(i).subscribe(t);return o.add(r.subscribe(i)),o},e}();Hg.MulticastOperator=NU});var BU=E(Rc=>{"use strict";var Cxe=Rc&&Rc.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Rc,"__esModule",{value:!0});var Txe=Ki(),qU=Nn(),wM=xr();function kxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1&&qU.isArray(e[0])&&(e=e[0]),function(r){return r.lift(new LU(e))}}Rc.onErrorResumeNext=kxe;function Pxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0;return e.length===1&&qU.isArray(e[0])&&(e=e[0]),r=e.shift(),Txe.from(r).lift(new LU(e))}Rc.onErrorResumeNextStatic=Pxe;var LU=function(){function e(t){this.nextSources=t}return e.prototype.call=function(t,r){return r.subscribe(new Nxe(t,this.nextSources))},e}(),Nxe=function(e){Cxe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new wM.SimpleInnerSubscriber(this),i=this.destination;i.add(n);var o=wM.innerSubscribe(r,n);o!==n&&i.add(o)}else this.destination.complete()},t}(wM.SimpleOuterSubscriber)});var DU=E(J0=>{"use strict";var qxe=J0&&J0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(J0,"__esModule",{value:!0});var Lxe=Ze();function Bxe(){return function(e){return e.lift(new Dxe)}}J0.pairwise=Bxe;var Dxe=function(){function e(){}return e.prototype.call=function(t,r){return r.subscribe(new jxe(t))},e}(),jxe=function(e){qxe(t,e);function t(r){var n=e.call(this,r)||this;return n.hasPrev=!1,n}return t.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},t}(Lxe.Subscriber)});var FU=E(xM=>{"use strict";Object.defineProperty(xM,"__esModule",{value:!0});var Fxe=P6(),jU=mu();function Uxe(e,t){return function(r){return[jU.filter(e,t)(r),jU.filter(Fxe.not(e,t))(r)]}}xM.partition=Uxe});var UU=E(MM=>{"use strict";Object.defineProperty(MM,"__esModule",{value:!0});var Hxe=ni();function Wxe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return Hxe.map(zxe(e,r))(n)}}MM.pluck=Wxe;function zxe(e,t){var r=function(n){for(var i=n,o=0;o<t;o++){var a=i?.[e[o]];if(a!==void 0)i=a;else return}return i};return r}});var zU=E(SM=>{"use strict";Object.defineProperty(SM,"__esModule",{value:!0});var HU=xn(),WU=Mu();function Vxe(e){return e?WU.multicast(function(){return new HU.Subject},e):WU.multicast(new HU.Subject)}SM.publish=Vxe});var VU=E(EM=>{"use strict";Object.defineProperty(EM,"__esModule",{value:!0});var $xe=R4(),Kxe=Mu();function Gxe(e){return function(t){return Kxe.multicast(new $xe.BehaviorSubject(e))(t)}}EM.publishBehavior=Gxe});var $U=E(AM=>{"use strict";Object.defineProperty(AM,"__esModule",{value:!0});var Zxe=s0(),Yxe=Mu();function Jxe(){return function(e){return Yxe.multicast(new Zxe.AsyncSubject)(e)}}AM.publishLast=Jxe});var KU=E(OM=>{"use strict";Object.defineProperty(OM,"__esModule",{value:!0});var Qxe=Eg(),Xxe=Mu();function e3e(e,t,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,o=new Qxe.ReplaySubject(e,t,n);return function(a){return Xxe.multicast(function(){return o},i)(a)}}OM.publishReplay=e3e});var GU=E(RM=>{"use strict";Object.defineProperty(RM,"__esModule",{value:!0});var t3e=Nn(),r3e=q6();function n3e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.length===1&&t3e.isArray(e[0])&&(e=e[0]),n.lift.call(r3e.race.apply(void 0,[n].concat(e)))}}RM.race=n3e});var YU=E(Q0=>{"use strict";var i3e=Q0&&Q0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Q0,"__esModule",{value:!0});var o3e=Ze(),s3e=Vi();function a3e(e){return e===void 0&&(e=-1),function(t){return e===0?s3e.empty():e<0?t.lift(new ZU(-1,t)):t.lift(new ZU(e-1,t))}}Q0.repeat=a3e;var ZU=function(){function e(t,r){this.count=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new u3e(t,this.count,this.source))},e}(),u3e=function(e){i3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.count=n,o.source=i,o}return t.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return e.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},t}(o3e.Subscriber)});var JU=E(X0=>{"use strict";var f3e=X0&&X0.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(X0,"__esModule",{value:!0});var c3e=xn(),IM=xr();function l3e(e){return function(t){return t.lift(new h3e(e))}}X0.repeatWhen=l3e;var h3e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){return r.subscribe(new d3e(t,this.notifier,r))},e}(),d3e=function(e){f3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.notifier=n,o.source=i,o.sourceIsBeingSubscribedTo=!0,o}return t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},t.prototype.subscribeToRetries=function(){this.notifications=new c3e.Subject;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return e.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=IM.innerSubscribe(r,new IM.SimpleInnerSubscriber(this))},t}(IM.SimpleOuterSubscriber)});var QU=E(ed=>{"use strict";var p3e=ed&&ed.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ed,"__esModule",{value:!0});var v3e=Ze();function m3e(e){return e===void 0&&(e=-1),function(t){return t.lift(new g3e(e,t))}}ed.retry=m3e;var g3e=function(){function e(t,r){this.count=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new b3e(t,this.count,this.source))},e}(),b3e=function(e){p3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.count=n,o.source=i,o}return t.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,o=n.count;if(o===0)return e.prototype.error.call(this,r);o>-1&&(this.count=o-1),i.subscribe(this._unsubscribeAndRecycle())}},t}(v3e.Subscriber)});var XU=E(td=>{"use strict";var y3e=td&&td.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(td,"__esModule",{value:!0});var _3e=xn(),CM=xr();function w3e(e){return function(t){return t.lift(new x3e(e,t))}}td.retryWhen=w3e;var x3e=function(){function e(t,r){this.notifier=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new M3e(t,this.notifier,this.source))},e}(),M3e=function(e){y3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.notifier=n,o.source=i,o}return t.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,o=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new _3e.Subject;try{var a=this.notifier;i=a(n)}catch(c){return e.prototype.error.call(this,c)}o=CM.innerSubscribe(i,new CM.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=o,n.next(r)}},t.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},t}(CM.SimpleOuterSubscriber)});var eH=E(rd=>{"use strict";var S3e=rd&&rd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(rd,"__esModule",{value:!0});var TM=xr();function E3e(e){return function(t){return t.lift(new A3e(e))}}rd.sample=E3e;var A3e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){var n=new O3e(t),i=r.subscribe(n);return i.add(TM.innerSubscribe(this.notifier,new TM.SimpleInnerSubscriber(n))),i},e}(),O3e=function(e){S3e(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.hasValue=!1,r}return t.prototype._next=function(r){this.value=r,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(TM.SimpleOuterSubscriber)});var tH=E(nd=>{"use strict";var R3e=nd&&nd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(nd,"__esModule",{value:!0});var I3e=Ze(),C3e=qn();function T3e(e,t){return t===void 0&&(t=C3e.async),function(r){return r.lift(new k3e(e,t))}}nd.sampleTime=T3e;var k3e=function(){function e(t,r){this.period=t,this.scheduler=r}return e.prototype.call=function(t,r){return r.subscribe(new P3e(t,this.period,this.scheduler))},e}(),P3e=function(e){R3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.period=n,o.scheduler=i,o.hasValue=!1,o.add(i.schedule(N3e,n,{subscriber:o,period:n})),o}return t.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(I3e.Subscriber);function N3e(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}});var sH=E(Su=>{"use strict";var rH=Su&&Su.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Su,"__esModule",{value:!0});var nH=Ze();function q3e(e,t){return function(r){return r.lift(new iH(e,t))}}Su.sequenceEqual=q3e;var iH=function(){function e(t,r){this.compareTo=t,this.comparator=r}return e.prototype.call=function(t,r){return r.subscribe(new oH(t,this.compareTo,this.comparator))},e}();Su.SequenceEqualOperator=iH;var oH=function(e){rH(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.compareTo=n,o.comparator=i,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new L3e(r,o))),o}return t.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,o=r.comparator;n.length>0&&i.length>0;){var a=n.shift(),c=i.shift(),v=!1;try{v=o?o(a,c):a===c}catch(y){this.destination.error(y)}v||this.emit(!1)}},t.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},t.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},t}(nH.Subscriber);Su.SequenceEqualSubscriber=oH;var L3e=function(e){rH(t,e);function t(r,n){var i=e.call(this,r)||this;return i.parent=n,i}return t.prototype._next=function(r){this.parent.nextB(r)},t.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(nH.Subscriber)});var aH=E(kM=>{"use strict";Object.defineProperty(kM,"__esModule",{value:!0});var B3e=Mu(),D3e=wg(),j3e=xn();function F3e(){return new j3e.Subject}function U3e(){return function(e){return D3e.refCount()(B3e.multicast(F3e)(e))}}kM.share=U3e});var uH=E(PM=>{"use strict";Object.defineProperty(PM,"__esModule",{value:!0});var H3e=Eg();function W3e(e,t,r){var n;return e&&typeof e=="object"?n=e:n={bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(i){return i.lift(z3e(n))}}PM.shareReplay=W3e;function z3e(e){var t=e.bufferSize,r=t===void 0?Number.POSITIVE_INFINITY:t,n=e.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,o=e.refCount,a=e.scheduler,c,v=0,y,w=!1,M=!1;return function(R){v++;var C;!c||w?(w=!1,c=new H3e.ReplaySubject(r,i,a),C=c.subscribe(this),y=R.subscribe({next:function(B){c.next(B)},error:function(B){w=!0,c.error(B)},complete:function(){M=!0,y=void 0,c.complete()}}),M&&(y=void 0)):C=c.subscribe(this),this.add(function(){v--,C.unsubscribe(),C=void 0,y&&!M&&o&&v===0&&(y.unsubscribe(),y=void 0,c=void 0)})}}});var fH=E(id=>{"use strict";var V3e=id&&id.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(id,"__esModule",{value:!0});var $3e=Ze(),K3e=xc();function G3e(e){return function(t){return t.lift(new Z3e(e,t))}}id.single=G3e;var Z3e=function(){function e(t,r){this.predicate=t,this.source=r}return e.prototype.call=function(t,r){return r.subscribe(new Y3e(t,this.predicate,this.source))},e}(),Y3e=function(e){V3e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.source=i,o.seenValue=!1,o.index=0,o}return t.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},t.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},t.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},t.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new K3e.EmptyError)},t}($3e.Subscriber)});var cH=E(od=>{"use strict";var J3e=od&&od.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(od,"__esModule",{value:!0});var Q3e=Ze();function X3e(e){return function(t){return t.lift(new e4e(e))}}od.skip=X3e;var e4e=function(){function e(t){this.total=t}return e.prototype.call=function(t,r){return r.subscribe(new t4e(t,this.total))},e}(),t4e=function(e){J3e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.total=n,i.count=0,i}return t.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},t}(Q3e.Subscriber)});var hH=E(sd=>{"use strict";var r4e=sd&&sd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(sd,"__esModule",{value:!0});var lH=Ze(),n4e=wc();function i4e(e){return function(t){return t.lift(new o4e(e))}}sd.skipLast=i4e;var o4e=function(){function e(t){if(this._skipCount=t,this._skipCount<0)throw new n4e.ArgumentOutOfRangeError}return e.prototype.call=function(t,r){return this._skipCount===0?r.subscribe(new lH.Subscriber(t)):r.subscribe(new s4e(t,this._skipCount))},e}(),s4e=function(e){r4e(t,e);function t(r,n){var i=e.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return t.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i<n)this._ring[i]=r;else{var o=i%n,a=this._ring,c=a[o];a[o]=r,this.destination.next(c)}},t}(lH.Subscriber)});var dH=E(ad=>{"use strict";var a4e=ad&&ad.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ad,"__esModule",{value:!0});var NM=xr();function u4e(e){return function(t){return t.lift(new f4e(e))}}ad.skipUntil=u4e;var f4e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){return r.subscribe(new c4e(t,this.notifier))},e}(),c4e=function(e){a4e(t,e);function t(r,n){var i=e.call(this,r)||this;i.hasValue=!1;var o=new NM.SimpleInnerSubscriber(i);i.add(o),i.innerSubscription=o;var a=NM.innerSubscribe(n,o);return a!==o&&(i.add(a),i.innerSubscription=a),i}return t.prototype._next=function(r){this.hasValue&&e.prototype._next.call(this,r)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(NM.SimpleOuterSubscriber)});var pH=E(ud=>{"use strict";var l4e=ud&&ud.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ud,"__esModule",{value:!0});var h4e=Ze();function d4e(e){return function(t){return t.lift(new p4e(e))}}ud.skipWhile=d4e;var p4e=function(){function e(t){this.predicate=t}return e.prototype.call=function(t,r){return r.subscribe(new v4e(t,this.predicate))},e}(),v4e=function(e){l4e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return t.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},t.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=Boolean(n)}catch(i){this.destination.error(i)}},t}(h4e.Subscriber)});var mH=E(qM=>{"use strict";Object.defineProperty(qM,"__esModule",{value:!0});var vH=b0(),m4e=$i();function g4e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return m4e.isScheduler(r)?(e.pop(),function(n){return vH.concat(e,n,r)}):function(n){return vH.concat(e,n)}}qM.startWith=g4e});var gH=E(fd=>{"use strict";var b4e=fd&&fd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(fd,"__esModule",{value:!0});var y4e=Ct(),LM=U4(),_4e=y0(),w4e=function(e){b4e(t,e);function t(r,n,i){n===void 0&&(n=0),i===void 0&&(i=LM.asap);var o=e.call(this)||this;return o.source=r,o.delayTime=n,o.scheduler=i,(!_4e.isNumeric(n)||n<0)&&(o.delayTime=0),(!i||typeof i.schedule!="function")&&(o.scheduler=LM.asap),o}return t.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=LM.asap),new t(r,n,i)},t.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},t.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,o=this.scheduler;return o.schedule(t.dispatch,n,{source:i,subscriber:r})},t}(y4e.Observable);fd.SubscribeOnObservable=w4e});var bH=E(BM=>{"use strict";Object.defineProperty(BM,"__esModule",{value:!0});var x4e=gH();function M4e(e,t){return t===void 0&&(t=0),function(n){return n.lift(new S4e(e,t))}}BM.subscribeOn=M4e;var S4e=function(){function e(t,r){this.scheduler=t,this.delay=r}return e.prototype.call=function(t,r){return new x4e.SubscribeOnObservable(r,this.delay,this.scheduler).subscribe(t)},e}()});var Wg=E(cd=>{"use strict";var E4e=cd&&cd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(cd,"__esModule",{value:!0});var A4e=ni(),O4e=Ki(),DM=xr();function yH(e,t){return typeof t=="function"?function(r){return r.pipe(yH(function(n,i){return O4e.from(e(n,i)).pipe(A4e.map(function(o,a){return t(n,o,i,a)}))}))}:function(r){return r.lift(new R4e(e))}}cd.switchMap=yH;var R4e=function(){function e(t){this.project=t}return e.prototype.call=function(t,r){return r.subscribe(new I4e(t,this.project))},e}(),I4e=function(e){E4e(t,e);function t(r,n){var i=e.call(this,r)||this;return i.project=n,i.index=0,i}return t.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(o){this.destination.error(o);return}this._innerSub(n)},t.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new DM.SimpleInnerSubscriber(this),o=this.destination;o.add(i),this.innerSubscription=DM.innerSubscribe(r,i),this.innerSubscription!==i&&o.add(this.innerSubscription)},t.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(r){this.destination.next(r)},t}(DM.SimpleOuterSubscriber)});var _H=E(jM=>{"use strict";Object.defineProperty(jM,"__esModule",{value:!0});var C4e=Wg(),T4e=Vs();function k4e(){return C4e.switchMap(T4e.identity)}jM.switchAll=k4e});var xH=E(FM=>{"use strict";Object.defineProperty(FM,"__esModule",{value:!0});var wH=Wg();function P4e(e,t){return t?wH.switchMap(function(){return e},t):wH.switchMap(function(){return e})}FM.switchMapTo=P4e});var MH=E(ld=>{"use strict";var N4e=ld&&ld.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(ld,"__esModule",{value:!0});var UM=xr();function q4e(e){return function(t){return t.lift(new L4e(e))}}ld.takeUntil=q4e;var L4e=function(){function e(t){this.notifier=t}return e.prototype.call=function(t,r){var n=new B4e(t),i=UM.innerSubscribe(this.notifier,new UM.SimpleInnerSubscriber(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},e}(),B4e=function(e){N4e(t,e);function t(r){var n=e.call(this,r)||this;return n.seenValue=!1,n}return t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(UM.SimpleOuterSubscriber)});var SH=E(hd=>{"use strict";var D4e=hd&&hd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(hd,"__esModule",{value:!0});var j4e=Ze();function F4e(e,t){return t===void 0&&(t=!1),function(r){return r.lift(new U4e(e,t))}}hd.takeWhile=F4e;var U4e=function(){function e(t,r){this.predicate=t,this.inclusive=r}return e.prototype.call=function(t,r){return r.subscribe(new H4e(t,this.predicate,this.inclusive))},e}(),H4e=function(e){D4e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.predicate=n,o.inclusive=i,o.index=0,o}return t.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(o){n.error(o);return}this.nextOrComplete(r,i)},t.prototype.nextOrComplete=function(r,n){var i=this.destination;Boolean(n)?i.next(r):(this.inclusive&&i.next(r),i.complete())},t}(j4e.Subscriber)});var EH=E(dd=>{"use strict";var W4e=dd&&dd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(dd,"__esModule",{value:!0});var z4e=Ze(),Ys=Rg(),V4e=hc();function $4e(e,t,r){return function(i){return i.lift(new K4e(e,t,r))}}dd.tap=$4e;var K4e=function(){function e(t,r,n){this.nextOrObserver=t,this.error=r,this.complete=n}return e.prototype.call=function(t,r){return r.subscribe(new G4e(t,this.nextOrObserver,this.error,this.complete))},e}(),G4e=function(e){W4e(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a._tapNext=Ys.noop,a._tapError=Ys.noop,a._tapComplete=Ys.noop,a._tapError=i||Ys.noop,a._tapComplete=o||Ys.noop,V4e.isFunction(n)?(a._context=a,a._tapNext=n):n&&(a._context=n,a._tapNext=n.next||Ys.noop,a._tapError=n.error||Ys.noop,a._tapComplete=n.complete||Ys.noop),a}return t.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},t.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},t}(z4e.Subscriber)});var WM=E(Eu=>{"use strict";var Z4e=Eu&&Eu.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Eu,"__esModule",{value:!0});var HM=xr();Eu.defaultThrottleConfig={leading:!0,trailing:!1};function Y4e(e,t){return t===void 0&&(t=Eu.defaultThrottleConfig),function(r){return r.lift(new J4e(e,!!t.leading,!!t.trailing))}}Eu.throttle=Y4e;var J4e=function(){function e(t,r,n){this.durationSelector=t,this.leading=r,this.trailing=n}return e.prototype.call=function(t,r){return r.subscribe(new Q4e(t,this.durationSelector,this.leading,this.trailing))},e}(),Q4e=function(e){Z4e(t,e);function t(r,n,i,o){var a=e.call(this,r)||this;return a.destination=r,a.durationSelector=n,a._leading=i,a._trailing=o,a._hasValue=!1,a}return t.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},t.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=HM.innerSubscribe(n,new HM.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},t.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(HM.SimpleOuterSubscriber)});var AH=E(pd=>{"use strict";var X4e=pd&&pd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(pd,"__esModule",{value:!0});var e6e=Ze(),t6e=qn(),r6e=WM();function n6e(e,t,r){return t===void 0&&(t=t6e.async),r===void 0&&(r=r6e.defaultThrottleConfig),function(n){return n.lift(new i6e(e,t,r.leading,r.trailing))}}pd.throttleTime=n6e;var i6e=function(){function e(t,r,n,i){this.duration=t,this.scheduler=r,this.leading=n,this.trailing=i}return e.prototype.call=function(t,r){return r.subscribe(new o6e(t,this.duration,this.scheduler,this.leading,this.trailing))},e}(),o6e=function(e){X4e(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.duration=n,c.scheduler=i,c.leading=o,c.trailing=a,c._hasTrailingValue=!1,c._trailingValue=null,c}return t.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(s6e,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},t}(e6e.Subscriber);function s6e(e){var t=e.subscriber;t.clearThrottle()}});var RH=E(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});var a6e=qn(),u6e=Ug(),f6e=Pg(),c6e=ni();function l6e(e){return e===void 0&&(e=a6e.async),function(t){return f6e.defer(function(){return t.pipe(u6e.scan(function(r,n){var i=r.current;return{value:n,current:e.now(),last:i}},{current:e.now(),value:void 0,last:void 0}),c6e.map(function(r){var n=r.current,i=r.last,o=r.value;return new OH(o,n-i)}))})}}zg.timeInterval=l6e;var OH=function(){function e(t,r){this.value=t,this.interval=r}return e}();zg.TimeInterval=OH});var VM=E(vd=>{"use strict";var h6e=vd&&vd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(vd,"__esModule",{value:!0});var d6e=qn(),p6e=eM(),zM=xr();function v6e(e,t,r){return r===void 0&&(r=d6e.async),function(n){var i=p6e.isDate(e),o=i?+e-r.now():Math.abs(e);return n.lift(new m6e(o,i,t,r))}}vd.timeoutWith=v6e;var m6e=function(){function e(t,r,n,i){this.waitFor=t,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return e.prototype.call=function(t,r){return r.subscribe(new g6e(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),g6e=function(e){h6e(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;return c.absoluteTimeout=n,c.waitFor=i,c.withObservable=o,c.scheduler=a,c.scheduleTimeout(),c}return t.dispatchTimeout=function(r){var n=r.withObservable;r._unsubscribeAndRecycle(),r.add(zM.innerSubscribe(n,new zM.SimpleInnerSubscriber(r)))},t.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,r)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(zM.SimpleOuterSubscriber)});var IH=E($M=>{"use strict";Object.defineProperty($M,"__esModule",{value:!0});var b6e=qn(),y6e=K4(),_6e=VM(),w6e=Sg();function x6e(e,t){return t===void 0&&(t=b6e.async),_6e.timeoutWith(e,w6e.throwError(new y6e.TimeoutError),t)}$M.timeout=x6e});var TH=E(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});var M6e=qn(),S6e=ni();function E6e(e){return e===void 0&&(e=M6e.async),S6e.map(function(t){return new CH(t,e.now())})}Vg.timestamp=E6e;var CH=function(){function e(t,r){this.value=t,this.timestamp=r}return e}();Vg.Timestamp=CH});var kH=E(KM=>{"use strict";Object.defineProperty(KM,"__esModule",{value:!0});var A6e=Y0();function O6e(e,t,r){return r===0?[t]:(e.push(t),e)}function R6e(){return A6e.reduce(O6e,[])}KM.toArray=R6e});var NH=E(md=>{"use strict";var I6e=md&&md.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(md,"__esModule",{value:!0});var PH=xn(),GM=xr();function C6e(e){return function(r){return r.lift(new T6e(e))}}md.window=C6e;var T6e=function(){function e(t){this.windowBoundaries=t}return e.prototype.call=function(t,r){var n=new k6e(t),i=r.subscribe(n);return i.closed||n.add(GM.innerSubscribe(this.windowBoundaries,new GM.SimpleInnerSubscriber(n))),i},e}(),k6e=function(e){I6e(t,e);function t(r){var n=e.call(this,r)||this;return n.window=new PH.Subject,r.next(n.window),n}return t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(r){this._error(r)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(r){this.window.next(r)},t.prototype._error=function(r){this.window.error(r),this.destination.error(r)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new PH.Subject;n.next(i)},t}(GM.SimpleOuterSubscriber)});var LH=E(gd=>{"use strict";var P6e=gd&&gd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(gd,"__esModule",{value:!0});var N6e=Ze(),qH=xn();function q6e(e,t){return t===void 0&&(t=0),function(n){return n.lift(new L6e(e,t))}}gd.windowCount=q6e;var L6e=function(){function e(t,r){this.windowSize=t,this.startWindowEvery=r}return e.prototype.call=function(t,r){return r.subscribe(new B6e(t,this.windowSize,this.startWindowEvery))},e}(),B6e=function(e){P6e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.destination=r,o.windowSize=n,o.startWindowEvery=i,o.windows=[new qH.Subject],o.count=0,r.next(o.windows[0]),o}return t.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,o=this.windowSize,a=this.windows,c=a.length,v=0;v<c&&!this.closed;v++)a[v].next(r);var y=this.count-o+1;if(y>=0&&y%n===0&&!this.closed&&a.shift().complete(),++this.count%n===0&&!this.closed){var w=new qH.Subject;a.push(w),i.next(w)}},t.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},t.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(N6e.Subscriber)});var FH=E(bd=>{"use strict";var DH=bd&&bd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(bd,"__esModule",{value:!0});var D6e=xn(),j6e=qn(),F6e=Ze(),BH=y0(),ZM=$i();function U6e(e){var t=j6e.async,r=null,n=Number.POSITIVE_INFINITY;return ZM.isScheduler(arguments[3])&&(t=arguments[3]),ZM.isScheduler(arguments[2])?t=arguments[2]:BH.isNumeric(arguments[2])&&(n=Number(arguments[2])),ZM.isScheduler(arguments[1])?t=arguments[1]:BH.isNumeric(arguments[1])&&(r=Number(arguments[1])),function(o){return o.lift(new H6e(e,r,n,t))}}bd.windowTime=U6e;var H6e=function(){function e(t,r,n,i){this.windowTimeSpan=t,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return e.prototype.call=function(t,r){return r.subscribe(new z6e(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),W6e=function(e){DH(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return t.prototype.next=function(r){this._numberOfNextedValues++,e.prototype.next.call(this,r)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(D6e.Subject),z6e=function(e){DH(t,e);function t(r,n,i,o,a){var c=e.call(this,r)||this;c.destination=r,c.windowTimeSpan=n,c.windowCreationInterval=i,c.maxWindowSize=o,c.scheduler=a,c.windows=[];var v=c.openWindow();if(i!==null&&i>=0){var y={subscriber:c,window:v,context:null},w={windowTimeSpan:n,windowCreationInterval:i,subscriber:c,scheduler:a};c.add(a.schedule(jH,n,y)),c.add(a.schedule($6e,i,w))}else{var M={subscriber:c,window:v,windowTimeSpan:n};c.add(a.schedule(V6e,n,M))}return c}return t.prototype._next=function(r){for(var n=this.windows,i=n.length,o=0;o<i;o++){var a=n[o];a.closed||(a.next(r),a.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(a))}},t.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},t.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},t.prototype.openWindow=function(){var r=new W6e;this.windows.push(r);var n=this.destination;return n.next(r),r},t.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},t}(F6e.Subscriber);function V6e(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function $6e(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),a=this,c={action:a,subscription:null},v={subscriber:r,window:o,context:c};c.subscription=n.schedule(jH,t,v),a.add(c.subscription),a.schedule(e,i)}function jH(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}});var HH=E(yd=>{"use strict";var K6e=yd&&yd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(yd,"__esModule",{value:!0});var G6e=xn(),Z6e=Fr(),Y6e=Ks(),UH=Gs();function J6e(e,t){return function(r){return r.lift(new Q6e(e,t))}}yd.windowToggle=J6e;var Q6e=function(){function e(t,r){this.openings=t,this.closingSelector=r}return e.prototype.call=function(t,r){return r.subscribe(new X6e(t,this.openings,this.closingSelector))},e}(),X6e=function(e){K6e(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.openings=n,o.closingSelector=i,o.contexts=[],o.add(o.openSubscription=UH.subscribeToResult(o,n,n)),o}return t.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,o=0;o<i;o++)n[o].window.next(r)},t.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,o=-1;++o<i;){var a=n[o];a.window.error(r),a.subscription.unsubscribe()}e.prototype._error.call(this,r)},t.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.complete(),o.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.unsubscribe(),o.subscription.unsubscribe()}},t.prototype.notifyNext=function(r,n,i,o,a){if(r===this.openings){var c=void 0;try{var v=this.closingSelector;c=v(n)}catch(R){return this.error(R)}var y=new G6e.Subject,w=new Z6e.Subscription,M={window:y,subscription:w};this.contexts.push(M);var S=UH.subscribeToResult(this,c,M);S.closed?this.closeWindow(this.contexts.length-1):(S.context=M,w.add(S)),this.destination.next(y)}else this.closeWindow(this.contexts.indexOf(r))},t.prototype.notifyError=function(r){this.error(r)},t.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},t.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],o=i.window,a=i.subscription;n.splice(r,1),o.complete(),a.unsubscribe()}},t}(Y6e.OuterSubscriber)});var WH=E(_d=>{"use strict";var eMe=_d&&_d.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(_d,"__esModule",{value:!0});var tMe=xn(),rMe=Ks(),nMe=Gs();function iMe(e){return function(r){return r.lift(new oMe(e))}}_d.windowWhen=iMe;var oMe=function(){function e(t){this.closingSelector=t}return e.prototype.call=function(t,r){return r.subscribe(new sMe(t,this.closingSelector))},e}(),sMe=function(e){eMe(t,e);function t(r,n){var i=e.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return t.prototype.notifyNext=function(r,n,i,o,a){this.openWindow(a)},t.prototype.notifyError=function(r){this._error(r)},t.prototype.notifyComplete=function(r){this.openWindow(r)},t.prototype._next=function(r){this.window.next(r)},t.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new tMe.Subject;this.destination.next(i);var o;try{var a=this.closingSelector;o=a()}catch(c){this.destination.error(c),this.window.error(c);return}this.add(this.closingNotification=nMe.subscribeToResult(this,o))},t}(rMe.OuterSubscriber)});var zH=E(wd=>{"use strict";var aMe=wd&&wd.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(wd,"__esModule",{value:!0});var uMe=Ks(),fMe=Gs();function cMe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var n;typeof e[e.length-1]=="function"&&(n=e.pop());var i=e;return r.lift(new lMe(i,n))}}wd.withLatestFrom=cMe;var lMe=function(){function e(t,r){this.observables=t,this.project=r}return e.prototype.call=function(t,r){return r.subscribe(new hMe(t,this.observables,this.project))},e}(),hMe=function(e){aMe(t,e);function t(r,n,i){var o=e.call(this,r)||this;o.observables=n,o.project=i,o.toRespond=[];var a=n.length;o.values=new Array(a);for(var c=0;c<a;c++)o.toRespond.push(c);for(var c=0;c<a;c++){var v=n[c];o.add(fMe.subscribeToResult(o,v,void 0,c))}return o}return t.prototype.notifyNext=function(r,n,i){this.values[i]=n;var o=this.toRespond;if(o.length>0){var a=o.indexOf(i);a!==-1&&o.splice(a,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},t.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},t}(uMe.OuterSubscriber)});var VH=E(YM=>{"use strict";Object.defineProperty(YM,"__esModule",{value:!0});var dMe=Dg();function pMe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return n.lift.call(dMe.zip.apply(void 0,[n].concat(e)))}}YM.zip=pMe});var $H=E(JM=>{"use strict";Object.defineProperty(JM,"__esModule",{value:!0});var vMe=Dg();function mMe(e){return function(t){return t.lift(new vMe.ZipOperator(e))}}JM.zipAll=mMe});var xd=E(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});var gMe=U6();we.audit=gMe.audit;var bMe=CF();we.auditTime=bMe.auditTime;var yMe=TF();we.buffer=yMe.buffer;var _Me=NF();we.bufferCount=_Me.bufferCount;var wMe=BF();we.bufferTime=wMe.bufferTime;var xMe=jF();we.bufferToggle=xMe.bufferToggle;var MMe=FF();we.bufferWhen=MMe.bufferWhen;var SMe=UF();we.catchError=SMe.catchError;var EMe=HF();we.combineAll=EMe.combineAll;var AMe=WF();we.combineLatest=AMe.combineLatest;var OMe=zF();we.concat=OMe.concat;var RMe=g6();we.concatAll=RMe.concatAll;var IMe=Y6();we.concatMap=IMe.concatMap;var CMe=VF();we.concatMapTo=CMe.concatMapTo;var TMe=$F();we.count=TMe.count;var kMe=KF();we.debounce=kMe.debounce;var PMe=GF();we.debounceTime=PMe.debounceTime;var NMe=Ac();we.defaultIfEmpty=NMe.defaultIfEmpty;var qMe=YF();we.delay=qMe.delay;var LMe=QF();we.delayWhen=LMe.delayWhen;var BMe=XF();we.dematerialize=BMe.dematerialize;var DMe=tU();we.distinct=DMe.distinct;var jMe=nM();we.distinctUntilChanged=jMe.distinctUntilChanged;var FMe=rU();we.distinctUntilKeyChanged=FMe.distinctUntilKeyChanged;var UMe=iU();we.elementAt=UMe.elementAt;var HMe=oU();we.endWith=HMe.endWith;var WMe=sU();we.every=WMe.every;var zMe=aU();we.exhaust=zMe.exhaust;var VMe=fU();we.exhaustMap=VMe.exhaustMap;var $Me=hU();we.expand=$Me.expand;var KMe=mu();we.filter=KMe.filter;var GMe=dU();we.finalize=GMe.finalize;var ZMe=cM();we.find=ZMe.find;var YMe=mU();we.findIndex=YMe.findIndex;var JMe=gU();we.first=JMe.first;var QMe=O4();we.groupBy=QMe.groupBy;var XMe=bU();we.ignoreElements=XMe.ignoreElements;var e5e=yU();we.isEmpty=e5e.isEmpty;var t5e=_U();we.last=t5e.last;var r5e=ni();we.map=r5e.map;var n5e=wU();we.mapTo=n5e.mapTo;var i5e=xU();we.materialize=i5e.materialize;var o5e=AU();we.max=o5e.max;var s5e=OU();we.merge=s5e.merge;var a5e=kg();we.mergeAll=a5e.mergeAll;var KH=g0();we.mergeMap=KH.mergeMap;we.flatMap=KH.flatMap;var u5e=IU();we.mergeMapTo=u5e.mergeMapTo;var f5e=kU();we.mergeScan=f5e.mergeScan;var c5e=PU();we.min=c5e.min;var l5e=Mu();we.multicast=l5e.multicast;var h5e=F4();we.observeOn=h5e.observeOn;var d5e=BU();we.onErrorResumeNext=d5e.onErrorResumeNext;var p5e=DU();we.pairwise=p5e.pairwise;var v5e=FU();we.partition=v5e.partition;var m5e=UU();we.pluck=m5e.pluck;var g5e=zU();we.publish=g5e.publish;var b5e=VU();we.publishBehavior=b5e.publishBehavior;var y5e=$U();we.publishLast=y5e.publishLast;var _5e=KU();we.publishReplay=_5e.publishReplay;var w5e=GU();we.race=w5e.race;var x5e=Y0();we.reduce=x5e.reduce;var M5e=YU();we.repeat=M5e.repeat;var S5e=JU();we.repeatWhen=S5e.repeatWhen;var E5e=QU();we.retry=E5e.retry;var A5e=XU();we.retryWhen=A5e.retryWhen;var O5e=wg();we.refCount=O5e.refCount;var R5e=eH();we.sample=R5e.sample;var I5e=tH();we.sampleTime=I5e.sampleTime;var C5e=Ug();we.scan=C5e.scan;var T5e=sH();we.sequenceEqual=T5e.sequenceEqual;var k5e=aH();we.share=k5e.share;var P5e=uH();we.shareReplay=P5e.shareReplay;var N5e=fH();we.single=N5e.single;var q5e=cH();we.skip=q5e.skip;var L5e=hH();we.skipLast=L5e.skipLast;var B5e=dH();we.skipUntil=B5e.skipUntil;var D5e=pH();we.skipWhile=D5e.skipWhile;var j5e=mH();we.startWith=j5e.startWith;var F5e=bH();we.subscribeOn=F5e.subscribeOn;var U5e=_H();we.switchAll=U5e.switchAll;var H5e=Wg();we.switchMap=H5e.switchMap;var W5e=xH();we.switchMapTo=W5e.switchMapTo;var z5e=jg();we.take=z5e.take;var V5e=Fg();we.takeLast=V5e.takeLast;var $5e=MH();we.takeUntil=$5e.takeUntil;var K5e=SH();we.takeWhile=K5e.takeWhile;var G5e=EH();we.tap=G5e.tap;var Z5e=WM();we.throttle=Z5e.throttle;var Y5e=AH();we.throttleTime=Y5e.throttleTime;var J5e=D0();we.throwIfEmpty=J5e.throwIfEmpty;var Q5e=RH();we.timeInterval=Q5e.timeInterval;var X5e=IH();we.timeout=X5e.timeout;var eSe=VM();we.timeoutWith=eSe.timeoutWith;var tSe=TH();we.timestamp=tSe.timestamp;var rSe=kH();we.toArray=rSe.toArray;var nSe=NH();we.window=nSe.window;var iSe=LH();we.windowCount=iSe.windowCount;var oSe=FH();we.windowTime=oSe.windowTime;var sSe=HH();we.windowToggle=sSe.windowToggle;var aSe=WH();we.windowWhen=aSe.windowWhen;var uSe=zH();we.withLatestFrom=uSe.withLatestFrom;var fSe=VH();we.zip=fSe.zip;var cSe=$H();we.zipAll=cSe.zipAll});var ZH=E((cFe,GH)=>{"use strict";GH.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0}});var QH=E((lFe,JH)=>{"use strict";var YH=typeof Symbol<"u"&&Symbol,lSe=ZH();JH.exports=function(){return typeof YH!="function"||typeof Symbol!="function"||typeof YH("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:lSe()}});var eW=E((hFe,XH)=>{"use strict";var hSe="Function.prototype.bind called on incompatible ",QM=Array.prototype.slice,dSe=Object.prototype.toString,pSe="[object Function]";XH.exports=function(t){var r=this;if(typeof r!="function"||dSe.call(r)!==pSe)throw new TypeError(hSe+r);for(var n=QM.call(arguments,1),i,o=function(){if(this instanceof i){var w=r.apply(this,n.concat(QM.call(arguments)));return Object(w)===w?w:this}else return r.apply(t,n.concat(QM.call(arguments)))},a=Math.max(0,r.length-n.length),c=[],v=0;v<a;v++)c.push("$"+v);if(i=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var y=function(){};y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i}});var $g=E((dFe,tW)=>{"use strict";var vSe=eW();tW.exports=Function.prototype.bind||vSe});var nW=E((pFe,rW)=>{"use strict";var mSe=$g();rW.exports=mSe.call(Function.call,Object.prototype.hasOwnProperty)});var Zg=E((vFe,uW)=>{"use strict";var At,kc=SyntaxError,aW=Function,Tc=TypeError,XM=function(e){try{return aW('"use strict"; return ('+e+").constructor;")()}catch{}},Au=Object.getOwnPropertyDescriptor;if(Au)try{Au({},"")}catch{Au=null}var e5=function(){throw new Tc},gSe=Au?function(){try{return arguments.callee,e5}catch{try{return Au(arguments,"callee").get}catch{return e5}}}():e5,Ic=QH()(),wo=Object.getPrototypeOf||function(e){return e.__proto__},Cc={},bSe=typeof Uint8Array>"u"?At:wo(Uint8Array),Ou={"%AggregateError%":typeof AggregateError>"u"?At:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?At:ArrayBuffer,"%ArrayIteratorPrototype%":Ic?wo([][Symbol.iterator]()):At,"%AsyncFromSyncIteratorPrototype%":At,"%AsyncFunction%":Cc,"%AsyncGenerator%":Cc,"%AsyncGeneratorFunction%":Cc,"%AsyncIteratorPrototype%":Cc,"%Atomics%":typeof Atomics>"u"?At:Atomics,"%BigInt%":typeof BigInt>"u"?At:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?At:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?At:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?At:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?At:Float32Array,"%Float64Array%":typeof Float64Array>"u"?At:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?At:FinalizationRegistry,"%Function%":aW,"%GeneratorFunction%":Cc,"%Int8Array%":typeof Int8Array>"u"?At:Int8Array,"%Int16Array%":typeof Int16Array>"u"?At:Int16Array,"%Int32Array%":typeof Int32Array>"u"?At:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ic?wo(wo([][Symbol.iterator]())):At,"%JSON%":typeof JSON=="object"?JSON:At,"%Map%":typeof Map>"u"?At:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ic?At:wo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?At:Promise,"%Proxy%":typeof Proxy>"u"?At:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?At:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?At:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ic?At:wo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?At:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ic?wo(""[Symbol.iterator]()):At,"%Symbol%":Ic?Symbol:At,"%SyntaxError%":kc,"%ThrowTypeError%":gSe,"%TypedArray%":bSe,"%TypeError%":Tc,"%Uint8Array%":typeof Uint8Array>"u"?At:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?At:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?At:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?At:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?At:WeakMap,"%WeakRef%":typeof WeakRef>"u"?At:WeakRef,"%WeakSet%":typeof WeakSet>"u"?At:WeakSet};try{null.error}catch(e){iW=wo(wo(e)),Ou["%Error.prototype%"]=iW}var iW,ySe=function e(t){var r;if(t==="%AsyncFunction%")r=XM("async function () {}");else if(t==="%GeneratorFunction%")r=XM("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=XM("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&(r=wo(i.prototype))}return Ou[t]=r,r},oW={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Md=$g(),Kg=nW(),_Se=Md.call(Function.call,Array.prototype.concat),wSe=Md.call(Function.apply,Array.prototype.splice),sW=Md.call(Function.call,String.prototype.replace),Gg=Md.call(Function.call,String.prototype.slice),xSe=Md.call(Function.call,RegExp.prototype.exec),MSe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,SSe=/\\(\\)?/g,ESe=function(t){var r=Gg(t,0,1),n=Gg(t,-1);if(r==="%"&&n!=="%")throw new kc("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new kc("invalid intrinsic syntax, expected opening `%`");var i=[];return sW(t,MSe,function(o,a,c,v){i[i.length]=c?sW(v,SSe,"$1"):a||o}),i},ASe=function(t,r){var n=t,i;if(Kg(oW,n)&&(i=oW[n],n="%"+i[0]+"%"),Kg(Ou,n)){var o=Ou[n];if(o===Cc&&(o=ySe(n)),typeof o>"u"&&!r)throw new Tc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new kc("intrinsic "+t+" does not exist!")};uW.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Tc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Tc('"allowMissing" argument must be a boolean');if(xSe(/^%?[^%]*%?$/,t)===null)throw new kc("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ESe(t),i=n.length>0?n[0]:"",o=ASe("%"+i+"%",r),a=o.name,c=o.value,v=!1,y=o.alias;y&&(i=y[0],wSe(n,_Se([0,1],y)));for(var w=1,M=!0;w<n.length;w+=1){var S=n[w],R=Gg(S,0,1),C=Gg(S,-1);if((R==='"'||R==="'"||R==="`"||C==='"'||C==="'"||C==="`")&&R!==C)throw new kc("property names with quotes must have matching quotes");if((S==="constructor"||!M)&&(v=!0),i+="."+S,a="%"+i+"%",Kg(Ou,a))c=Ou[a];else if(c!=null){if(!(S in c)){if(!r)throw new Tc("base intrinsic for "+t+" exists, but the property is not available.");return}if(Au&&w+1>=n.length){var B=Au(c,S);M=!!B,M&&"get"in B&&!("originalValue"in B.get)?c=B.get:c=c[S]}else M=Kg(c,S),c=c[S];M&&!v&&(Ou[a]=c)}}return c}});var pW=E((mFe,Yg)=>{"use strict";var t5=$g(),Pc=Zg(),lW=Pc("%Function.prototype.apply%"),hW=Pc("%Function.prototype.call%"),dW=Pc("%Reflect.apply%",!0)||t5.call(hW,lW),fW=Pc("%Object.getOwnPropertyDescriptor%",!0),Ru=Pc("%Object.defineProperty%",!0),OSe=Pc("%Math.max%");if(Ru)try{Ru({},"a",{value:1})}catch{Ru=null}Yg.exports=function(t){var r=dW(t5,hW,arguments);if(fW&&Ru){var n=fW(r,"length");n.configurable&&Ru(r,"length",{value:1+OSe(0,t.length-(arguments.length-1))})}return r};var cW=function(){return dW(t5,lW,arguments)};Ru?Ru(Yg.exports,"apply",{value:cW}):Yg.exports.apply=cW});var bW=E((gFe,gW)=>{"use strict";var vW=Zg(),mW=pW(),RSe=mW(vW("String.prototype.indexOf"));gW.exports=function(t,r){var n=vW(t,!!r);return typeof n=="function"&&RSe(t,".prototype.")>-1?mW(n):n}});var yW=E(()=>{});var jW=E((_Fe,DW)=>{var l5=typeof Map=="function"&&Map.prototype,r5=Object.getOwnPropertyDescriptor&&l5?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qg=l5&&r5&&typeof r5.get=="function"?r5.get:null,_W=l5&&Map.prototype.forEach,h5=typeof Set=="function"&&Set.prototype,n5=Object.getOwnPropertyDescriptor&&h5?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Xg=h5&&n5&&typeof n5.get=="function"?n5.get:null,wW=h5&&Set.prototype.forEach,ISe=typeof WeakMap=="function"&&WeakMap.prototype,Ed=ISe?WeakMap.prototype.has:null,CSe=typeof WeakSet=="function"&&WeakSet.prototype,Ad=CSe?WeakSet.prototype.has:null,TSe=typeof WeakRef=="function"&&WeakRef.prototype,xW=TSe?WeakRef.prototype.deref:null,kSe=Boolean.prototype.valueOf,PSe=Object.prototype.toString,NSe=Function.prototype.toString,qSe=String.prototype.match,d5=String.prototype.slice,Qs=String.prototype.replace,LSe=String.prototype.toUpperCase,MW=String.prototype.toLowerCase,kW=RegExp.prototype.test,SW=Array.prototype.concat,xo=Array.prototype.join,BSe=Array.prototype.slice,EW=Math.floor,s5=typeof BigInt=="function"?BigInt.prototype.valueOf:null,i5=Object.getOwnPropertySymbols,a5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Mn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Nc?"object":"symbol")?Symbol.toStringTag:null,PW=Object.prototype.propertyIsEnumerable,AW=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function OW(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||kW.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-EW(-e):EW(e);if(n!==e){var i=String(n),o=d5.call(t,i.length+1);return Qs.call(i,r,"$&_")+"."+Qs.call(Qs.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Qs.call(t,r,"$&_")}var u5=yW(),RW=u5.custom,IW=qW(RW)?RW:null;DW.exports=function e(t,r,n,i){var o=r||{};if(Js(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Js(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Js(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Js(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Js(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return BW(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var v=String(t);return c?OW(t,v):v}if(typeof t=="bigint"){var y=String(t)+"n";return c?OW(t,y):y}var w=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=w&&w>0&&typeof t=="object")return f5(t)?"[Array]":"[Object]";var M=tEe(o,n);if(typeof i>"u")i=[];else if(LW(i,t)>=0)return"[Circular]";function S(d,f,p){if(f&&(i=BSe.call(i),i.push(f)),p){var g={depth:o.depth};return Js(o,"quoteStyle")&&(g.quoteStyle=o.quoteStyle),e(d,g,n+1,i)}return e(d,o,n+1,i)}if(typeof t=="function"&&!CW(t)){var R=$Se(t),C=Jg(t,S);return"[Function"+(R?": "+R:" (anonymous)")+"]"+(C.length>0?" { "+xo.call(C,", ")+" }":"")}if(qW(t)){var B=Nc?Qs.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):a5.call(t);return typeof t=="object"&&!Nc?Sd(B):B}if(QSe(t)){for(var N="<"+MW.call(String(t.nodeName)),q=t.attributes||[],H=0;H<q.length;H++)N+=" "+q[H].name+"="+NW(DSe(q[H].value),"double",o);return N+=">",t.childNodes&&t.childNodes.length&&(N+="..."),N+="</"+MW.call(String(t.nodeName))+">",N}if(f5(t)){if(t.length===0)return"[]";var D=Jg(t,S);return M&&!eEe(D)?"["+c5(D,M)+"]":"[ "+xo.call(D,", ")+" ]"}if(FSe(t)){var ee=Jg(t,S);return!("cause"in Error.prototype)&&"cause"in t&&!PW.call(t,"cause")?"{ ["+String(t)+"] "+xo.call(SW.call("[cause]: "+S(t.cause),ee),", ")+" }":ee.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+xo.call(ee,", ")+" }"}if(typeof t=="object"&&a){if(IW&&typeof t[IW]=="function"&&u5)return u5(t,{depth:w-n});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(KSe(t)){var ge=[];return _W&&_W.call(t,function(d,f){ge.push(S(f,t,!0)+" => "+S(d,t))}),TW("Map",Qg.call(t),ge,M)}if(YSe(t)){var Z=[];return wW&&wW.call(t,function(d){Z.push(S(d,t))}),TW("Set",Xg.call(t),Z,M)}if(GSe(t))return o5("WeakMap");if(JSe(t))return o5("WeakSet");if(ZSe(t))return o5("WeakRef");if(HSe(t))return Sd(S(Number(t)));if(zSe(t))return Sd(S(s5.call(t)));if(WSe(t))return Sd(kSe.call(t));if(USe(t))return Sd(S(String(t)));if(!jSe(t)&&!CW(t)){var X=Jg(t,S),V=AW?AW(t)===Object.prototype:t instanceof Object||t.constructor===Object,k=t instanceof Object?"":"null prototype",m=!V&&Mn&&Object(t)===t&&Mn in t?d5.call(Xs(t),8,-1):k?"Object":"",s=V||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",l=s+(m||k?"["+xo.call(SW.call([],m||[],k||[]),": ")+"] ":"");return X.length===0?l+"{}":M?l+"{"+c5(X,M)+"}":l+"{ "+xo.call(X,", ")+" }"}return String(t)};function NW(e,t,r){var n=(r.quoteStyle||t)==="double"?'"':"'";return n+e+n}function DSe(e){return Qs.call(String(e),/"/g,""")}function f5(e){return Xs(e)==="[object Array]"&&(!Mn||!(typeof e=="object"&&Mn in e))}function jSe(e){return Xs(e)==="[object Date]"&&(!Mn||!(typeof e=="object"&&Mn in e))}function CW(e){return Xs(e)==="[object RegExp]"&&(!Mn||!(typeof e=="object"&&Mn in e))}function FSe(e){return Xs(e)==="[object Error]"&&(!Mn||!(typeof e=="object"&&Mn in e))}function USe(e){return Xs(e)==="[object String]"&&(!Mn||!(typeof e=="object"&&Mn in e))}function HSe(e){return Xs(e)==="[object Number]"&&(!Mn||!(typeof e=="object"&&Mn in e))}function WSe(e){return Xs(e)==="[object Boolean]"&&(!Mn||!(typeof e=="object"&&Mn in e))}function qW(e){if(Nc)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!a5)return!1;try{return a5.call(e),!0}catch{}return!1}function zSe(e){if(!e||typeof e!="object"||!s5)return!1;try{return s5.call(e),!0}catch{}return!1}var VSe=Object.prototype.hasOwnProperty||function(e){return e in this};function Js(e,t){return VSe.call(e,t)}function Xs(e){return PSe.call(e)}function $Se(e){if(e.name)return e.name;var t=qSe.call(NSe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function LW(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function KSe(e){if(!Qg||!e||typeof e!="object")return!1;try{Qg.call(e);try{Xg.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function GSe(e){if(!Ed||!e||typeof e!="object")return!1;try{Ed.call(e,Ed);try{Ad.call(e,Ad)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function ZSe(e){if(!xW||!e||typeof e!="object")return!1;try{return xW.call(e),!0}catch{}return!1}function YSe(e){if(!Xg||!e||typeof e!="object")return!1;try{Xg.call(e);try{Qg.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function JSe(e){if(!Ad||!e||typeof e!="object")return!1;try{Ad.call(e,Ad);try{Ed.call(e,Ed)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function QSe(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function BW(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return BW(d5.call(e,0,t.maxStringLength),t)+n}var i=Qs.call(Qs.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,XSe);return NW(i,"single",t)}function XSe(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+LSe.call(t.toString(16))}function Sd(e){return"Object("+e+")"}function o5(e){return e+" { ? }"}function TW(e,t,r,n){var i=n?c5(r,n):xo.call(r,", ");return e+" ("+t+") {"+i+"}"}function eEe(e){for(var t=0;t<e.length;t++)if(LW(e[t],`
|
|
556
|
+
`)>=0)return!1;return!0}function tEe(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=xo.call(Array(e.indent+1)," ");else return null;return{base:r,prev:xo.call(Array(t+1),r)}}function c5(e,t){if(e.length===0)return"";var r=`
|
|
557
|
+
`+t.prev+t.base;return r+xo.call(e,","+r)+`
|
|
558
|
+
`+t.prev}function Jg(e,t){var r=f5(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Js(e,i)?t(e[i],e):""}var o=typeof i5=="function"?i5(e):[],a;if(Nc){a={};for(var c=0;c<o.length;c++)a["$"+o[c]]=o[c]}for(var v in e)!Js(e,v)||r&&String(Number(v))===v&&v<e.length||Nc&&a["$"+v]instanceof Symbol||(kW.call(/[^\w$]/,v)?n.push(t(v,e)+": "+t(e[v],e)):n.push(v+": "+t(e[v],e)));if(typeof i5=="function")for(var y=0;y<o.length;y++)PW.call(e,o[y])&&n.push("["+t(o[y])+"]: "+t(e[o[y]],e));return n}});var UW=E((wFe,FW)=>{"use strict";var p5=Zg(),qc=bW(),rEe=jW(),nEe=p5("%TypeError%"),eb=p5("%WeakMap%",!0),tb=p5("%Map%",!0),iEe=qc("WeakMap.prototype.get",!0),oEe=qc("WeakMap.prototype.set",!0),sEe=qc("WeakMap.prototype.has",!0),aEe=qc("Map.prototype.get",!0),uEe=qc("Map.prototype.set",!0),fEe=qc("Map.prototype.has",!0),v5=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},cEe=function(e,t){var r=v5(e,t);return r&&r.value},lEe=function(e,t,r){var n=v5(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},hEe=function(e,t){return!!v5(e,t)};FW.exports=function(){var t,r,n,i={assert:function(o){if(!i.has(o))throw new nEe("Side channel does not contain "+rEe(o))},get:function(o){if(eb&&o&&(typeof o=="object"||typeof o=="function")){if(t)return iEe(t,o)}else if(tb){if(r)return aEe(r,o)}else if(n)return cEe(n,o)},has:function(o){if(eb&&o&&(typeof o=="object"||typeof o=="function")){if(t)return sEe(t,o)}else if(tb){if(r)return fEe(r,o)}else if(n)return hEe(n,o);return!1},set:function(o,a){eb&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new eb),oEe(t,o,a)):tb?(r||(r=new tb),uEe(r,o,a)):(n||(n={key:{},next:null}),lEe(n,o,a))}};return i}});var rb=E((xFe,HW)=>{"use strict";var dEe=String.prototype.replace,pEe=/%20/g,m5={RFC1738:"RFC1738",RFC3986:"RFC3986"};HW.exports={default:m5.RFC3986,formatters:{RFC1738:function(e){return dEe.call(e,pEe,"+")},RFC3986:function(e){return String(e)}},RFC1738:m5.RFC1738,RFC3986:m5.RFC3986}});var b5=E((MFe,zW)=>{"use strict";var vEe=rb(),g5=Object.prototype.hasOwnProperty,Iu=Array.isArray,Mo=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),mEe=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Iu(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);r.obj[r.prop]=i}}},WW=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},gEe=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(Iu(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!g5.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return Iu(t)&&!Iu(r)&&(i=WW(t,n)),Iu(t)&&Iu(r)?(r.forEach(function(o,a){if(g5.call(t,a)){var c=t[a];c&&typeof c=="object"&&o&&typeof o=="object"?t[a]=e(c,o,n):t.push(o)}else t[a]=o}),t):Object.keys(r).reduce(function(o,a){var c=r[a];return g5.call(o,a)?o[a]=e(o[a],c,n):o[a]=c,o},i)},bEe=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},yEe=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},_Ee=function(t,r,n,i,o){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(w){return"%26%23"+parseInt(w.slice(2),16)+"%3B"});for(var c="",v=0;v<a.length;++v){var y=a.charCodeAt(v);if(y===45||y===46||y===95||y===126||y>=48&&y<=57||y>=65&&y<=90||y>=97&&y<=122||o===vEe.RFC1738&&(y===40||y===41)){c+=a.charAt(v);continue}if(y<128){c=c+Mo[y];continue}if(y<2048){c=c+(Mo[192|y>>6]+Mo[128|y&63]);continue}if(y<55296||y>=57344){c=c+(Mo[224|y>>12]+Mo[128|y>>6&63]+Mo[128|y&63]);continue}v+=1,y=65536+((y&1023)<<10|a.charCodeAt(v)&1023),c+=Mo[240|y>>18]+Mo[128|y>>12&63]+Mo[128|y>>6&63]+Mo[128|y&63]}return c},wEe=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var o=r[i],a=o.obj[o.prop],c=Object.keys(a),v=0;v<c.length;++v){var y=c[v],w=a[y];typeof w=="object"&&w!==null&&n.indexOf(w)===-1&&(r.push({obj:a,prop:y}),n.push(w))}return mEe(r),t},xEe=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},MEe=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},SEe=function(t,r){return[].concat(t,r)},EEe=function(t,r){if(Iu(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)};zW.exports={arrayToObject:WW,assign:bEe,combine:SEe,compact:wEe,decode:yEe,encode:_Ee,isBuffer:MEe,isRegExp:xEe,maybeMap:EEe,merge:gEe}});var YW=E((SFe,ZW)=>{"use strict";var KW=UW(),nb=b5(),Od=rb(),AEe=Object.prototype.hasOwnProperty,VW={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},rs=Array.isArray,OEe=Array.prototype.push,GW=function(e,t){OEe.apply(e,rs(t)?t:[t])},REe=Date.prototype.toISOString,$W=Od.default,Sn={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:nb.encode,encodeValuesOnly:!1,format:$W,formatter:Od.formatters[$W],indices:!1,serializeDate:function(t){return REe.call(t)},skipNulls:!1,strictNullHandling:!1},IEe=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},y5={},CEe=function e(t,r,n,i,o,a,c,v,y,w,M,S,R,C,B,N){for(var q=t,H=N,D=0,ee=!1;(H=H.get(y5))!==void 0&&!ee;){var ge=H.get(t);if(D+=1,typeof ge<"u"){if(ge===D)throw new RangeError("Cyclic object value");ee=!0}typeof H.get(y5)>"u"&&(D=0)}if(typeof v=="function"?q=v(r,q):q instanceof Date?q=M(q):n==="comma"&&rs(q)&&(q=nb.maybeMap(q,function(g){return g instanceof Date?M(g):g})),q===null){if(o)return c&&!C?c(r,Sn.encoder,B,"key",S):r;q=""}if(IEe(q)||nb.isBuffer(q)){if(c){var Z=C?r:c(r,Sn.encoder,B,"key",S);return[R(Z)+"="+R(c(q,Sn.encoder,B,"value",S))]}return[R(r)+"="+R(String(q))]}var X=[];if(typeof q>"u")return X;var V;if(n==="comma"&&rs(q))C&&c&&(q=nb.maybeMap(q,c)),V=[{value:q.length>0?q.join(",")||null:void 0}];else if(rs(v))V=v;else{var k=Object.keys(q);V=y?k.sort(y):k}for(var m=i&&rs(q)&&q.length===1?r+"[]":r,s=0;s<V.length;++s){var l=V[s],d=typeof l=="object"&&typeof l.value<"u"?l.value:q[l];if(!(a&&d===null)){var f=rs(q)?typeof n=="function"?n(m,l):m:m+(w?"."+l:"["+l+"]");N.set(t,D);var p=KW();p.set(y5,N),GW(X,e(d,f,n,i,o,a,n==="comma"&&C&&rs(q)?null:c,v,y,w,M,S,R,C,B,p))}}return X},TEe=function(t){if(!t)return Sn;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||Sn.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Od.default;if(typeof t.format<"u"){if(!AEe.call(Od.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=Od.formatters[n],o=Sn.filter;return(typeof t.filter=="function"||rs(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Sn.addQueryPrefix,allowDots:typeof t.allowDots>"u"?Sn.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Sn.charsetSentinel,delimiter:typeof t.delimiter>"u"?Sn.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Sn.encode,encoder:typeof t.encoder=="function"?t.encoder:Sn.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Sn.encodeValuesOnly,filter:o,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Sn.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Sn.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Sn.strictNullHandling}};ZW.exports=function(e,t){var r=e,n=TEe(t),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):rs(n.filter)&&(o=n.filter,i=o);var a=[];if(typeof r!="object"||r===null)return"";var c;t&&t.arrayFormat in VW?c=t.arrayFormat:t&&"indices"in t?c=t.indices?"indices":"repeat":c="indices";var v=VW[c];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y=v==="comma"&&t&&t.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var w=KW(),M=0;M<i.length;++M){var S=i[M];n.skipNulls&&r[S]===null||GW(a,CEe(r[S],S,v,y,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,w))}var R=a.join(n.delimiter),C=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),R.length>0?C+R:""}});var XW=E((EFe,QW)=>{"use strict";var Lc=b5(),_5=Object.prototype.hasOwnProperty,kEe=Array.isArray,Zr={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Lc.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},PEe=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},JW=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},NEe="utf8=%26%2310003%3B",qEe="utf8=%E2%9C%93",LEe=function(t,r){var n={},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=r.parameterLimit===1/0?void 0:r.parameterLimit,a=i.split(r.delimiter,o),c=-1,v,y=r.charset;if(r.charsetSentinel)for(v=0;v<a.length;++v)a[v].indexOf("utf8=")===0&&(a[v]===qEe?y="utf-8":a[v]===NEe&&(y="iso-8859-1"),c=v,v=a.length);for(v=0;v<a.length;++v)if(v!==c){var w=a[v],M=w.indexOf("]="),S=M===-1?w.indexOf("="):M+1,R,C;S===-1?(R=r.decoder(w,Zr.decoder,y,"key"),C=r.strictNullHandling?null:""):(R=r.decoder(w.slice(0,S),Zr.decoder,y,"key"),C=Lc.maybeMap(JW(w.slice(S+1),r),function(B){return r.decoder(B,Zr.decoder,y,"value")})),C&&r.interpretNumericEntities&&y==="iso-8859-1"&&(C=PEe(C)),w.indexOf("[]=")>-1&&(C=kEe(C)?[C]:C),_5.call(n,R)?n[R]=Lc.combine(n[R],C):n[R]=C}return n},BEe=function(e,t,r,n){for(var i=n?t:JW(t,r),o=e.length-1;o>=0;--o){var a,c=e[o];if(c==="[]"&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var v=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,y=parseInt(v,10);!r.parseArrays&&v===""?a={0:i}:!isNaN(y)&&c!==v&&String(y)===v&&y>=0&&r.parseArrays&&y<=r.arrayLimit?(a=[],a[y]=i):v!=="__proto__"&&(a[v]=i)}i=a}return i},DEe=function(t,r,n,i){if(!!t){var o=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,c=/(\[[^[\]]*])/g,v=n.depth>0&&a.exec(o),y=v?o.slice(0,v.index):o,w=[];if(y){if(!n.plainObjects&&_5.call(Object.prototype,y)&&!n.allowPrototypes)return;w.push(y)}for(var M=0;n.depth>0&&(v=c.exec(o))!==null&&M<n.depth;){if(M+=1,!n.plainObjects&&_5.call(Object.prototype,v[1].slice(1,-1))&&!n.allowPrototypes)return;w.push(v[1])}return v&&w.push("["+o.slice(v.index)+"]"),BEe(w,r,n,i)}},jEe=function(t){if(!t)return Zr;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?Zr.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Zr.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Zr.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Zr.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Zr.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Zr.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Zr.comma,decoder:typeof t.decoder=="function"?t.decoder:Zr.decoder,delimiter:typeof t.delimiter=="string"||Lc.isRegExp(t.delimiter)?t.delimiter:Zr.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Zr.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Zr.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Zr.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Zr.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Zr.strictNullHandling}};QW.exports=function(e,t){var r=jEe(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?LEe(e,r):e,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),a=0;a<o.length;++a){var c=o[a],v=DEe(c,n[c],r,typeof e=="string");i=Lc.merge(i,v,r)}return r.allowSparse===!0?i:Lc.compact(i)}});var tz=E((AFe,ez)=>{"use strict";var FEe=YW(),UEe=XW(),HEe=rb();ez.exports={formats:HEe,parse:UEe,stringify:FEe}});var Id=E(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.ProviderType=an.RegExpString=an.IntNumber=an.BigIntString=an.AddressString=an.HexString=an.OpaqueType=void 0;function Rd(){return e=>e}an.OpaqueType=Rd;an.HexString=Rd();an.AddressString=Rd();an.BigIntString=Rd();function WEe(e){return Math.floor(e)}an.IntNumber=WEe;an.RegExpString=Rd();var zEe;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(zEe=an.ProviderType||(an.ProviderType={}))});var ns=E($e=>{"use strict";var VEe=$e&&$e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($e,"__esModule",{value:!0});$e.isInIFrame=$e.createQrUrl=$e.getFavicon=$e.range=$e.isBigNumber=$e.ensureParsedJSONObject=$e.ensureBN=$e.ensureRegExpString=$e.ensureIntNumber=$e.ensureBuffer=$e.ensureAddressString=$e.ensureEvenLengthHexString=$e.ensureHexString=$e.isHexString=$e.prepend0x=$e.strip0x=$e.has0xPrefix=$e.hexStringFromIntNumber=$e.intNumberFromHexString=$e.bigIntStringFromBN=$e.hexStringFromBuffer=$e.hexStringToUint8Array=$e.uint8ArrayToHex=$e.randomBytesHex=void 0;var ea=VEe(Df()),$Ee=tz(),Ai=Id(),rz=/^[0-9]*$/,nz=/^[a-f0-9]*$/;function KEe(e){return iz(crypto.getRandomValues(new Uint8Array(e)))}$e.randomBytesHex=KEe;function iz(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}$e.uint8ArrayToHex=iz;function GEe(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}$e.hexStringToUint8Array=GEe;function ZEe(e,t=!1){let r=e.toString("hex");return(0,Ai.HexString)(t?"0x"+r:r)}$e.hexStringFromBuffer=ZEe;function YEe(e){return(0,Ai.BigIntString)(e.toString(10))}$e.bigIntStringFromBN=YEe;function JEe(e){return(0,Ai.IntNumber)(new ea.default(Td(e,!1),16).toNumber())}$e.intNumberFromHexString=JEe;function QEe(e){return(0,Ai.HexString)("0x"+new ea.default(e).toString(16))}$e.hexStringFromIntNumber=QEe;function w5(e){return e.startsWith("0x")||e.startsWith("0X")}$e.has0xPrefix=w5;function ib(e){return w5(e)?e.slice(2):e}$e.strip0x=ib;function oz(e){return w5(e)?"0x"+e.slice(2):"0x"+e}$e.prepend0x=oz;function Cd(e){if(typeof e!="string")return!1;let t=ib(e).toLowerCase();return nz.test(t)}$e.isHexString=Cd;function sz(e,t=!1){if(typeof e=="string"){let r=ib(e).toLowerCase();if(nz.test(r))return(0,Ai.HexString)(t?"0x"+r:r)}throw new Error(`"${String(e)}" is not a hexadecimal string`)}$e.ensureHexString=sz;function Td(e,t=!1){let r=sz(e,!1);return r.length%2===1&&(r=(0,Ai.HexString)("0"+r)),t?(0,Ai.HexString)("0x"+r):r}$e.ensureEvenLengthHexString=Td;function XEe(e){if(typeof e=="string"){let t=ib(e).toLowerCase();if(Cd(t)&&t.length===40)return(0,Ai.AddressString)(oz(t))}throw new Error(`Invalid Ethereum address: ${String(e)}`)}$e.ensureAddressString=XEe;function e8e(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string")if(Cd(e)){let t=Td(e,!1);return Buffer.from(t,"hex")}else return Buffer.from(e,"utf8");throw new Error(`Not binary data: ${String(e)}`)}$e.ensureBuffer=e8e;function az(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Ai.IntNumber)(e);if(typeof e=="string"){if(rz.test(e))return(0,Ai.IntNumber)(Number(e));if(Cd(e))return(0,Ai.IntNumber)(new ea.default(Td(e,!1),16).toNumber())}throw new Error(`Not an integer: ${String(e)}`)}$e.ensureIntNumber=az;function t8e(e){if(e instanceof RegExp)return(0,Ai.RegExpString)(e.toString());throw new Error(`Not a RegExp: ${String(e)}`)}$e.ensureRegExpString=t8e;function r8e(e){if(e!==null&&(ea.default.isBN(e)||uz(e)))return new ea.default(e.toString(10),10);if(typeof e=="number")return new ea.default(az(e));if(typeof e=="string"){if(rz.test(e))return new ea.default(e,10);if(Cd(e))return new ea.default(Td(e,!1),16)}throw new Error(`Not an integer: ${String(e)}`)}$e.ensureBN=r8e;function n8e(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw new Error(`Not a JSON string or an object: ${String(e)}`)}$e.ensureParsedJSONObject=n8e;function uz(e){if(e==null||typeof e.constructor!="function")return!1;let{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}$e.isBigNumber=uz;function i8e(e,t){return Array.from({length:t-e},(r,n)=>e+n)}$e.range=i8e;function o8e(){let e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}$e.getFavicon=o8e;function s8e(e,t,r,n,i,o){let a=n?"parent-id":"id",c=(0,$Ee.stringify)({[a]:e,secret:t,server:r,v:i,chainId:o});return`${r}/#/link?${c}`}$e.createQrUrl=s8e;function a8e(){try{return window.frameElement!==null}catch{return!1}}$e.isInIFrame=a8e});var sb=E(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});ob.Session=void 0;var u8e=yu(),fz=xd(),cz=px(),lz=ns(),x5="session:id",hz="session:secret",dz="session:linked",kd=class{constructor(t,r,n,i){this._storage=t,this._id=r||(0,lz.randomBytesHex)(16),this._secret=n||(0,lz.randomBytesHex)(32),this._key=new cz.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){let r=t.getItem(x5),n=t.getItem(dz),i=t.getItem(hz);return r&&i?new kd(t,r,i,n==="1"):null}static get persistedSessionIdChange$(){return(0,u8e.fromEvent)(window,"storage").pipe((0,fz.filter)(t=>t.key===x5),(0,fz.map)(t=>({oldValue:t.oldValue||null,newValue:t.newValue||null})))}static hash(t){return new cz.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(x5,this._id),this._storage.setItem(hz,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(dz,this._linked?"1":"0")}};ob.Session=kd});var S5=E(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.WalletSDKRelayAbstract=So.APP_VERSION_KEY=So.LOCAL_STORAGE_ADDRESSES_KEY=So.WALLET_USER_NAME_KEY=void 0;var pz=fg();So.WALLET_USER_NAME_KEY="walletUsername";So.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";So.APP_VERSION_KEY="AppVersion";var M5=class{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw pz.ethErrors.rpc.parse({});let i=n,{error:o}=i;if(o)throw(0,pz.serializeError)(o);return i})}};So.WalletSDKRelayAbstract=M5});var E5=E((TFe,yz)=>{var f8e=v2(),c8e=Df();function vz(e){return Buffer.allocUnsafe(e).fill(0)}function mz(e,t,r){let n=vz(t);return e=ab(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function l8e(e,t){return mz(e,t,!0)}function ab(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")gz(e)?e=Buffer.from(p8e(bz(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(c8e.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function h8e(e){return e=ab(e),"0x"+e.toString("hex")}function d8e(e,t){return e=ab(e),t||(t=256),f8e("keccak"+t).update(e).digest()}function p8e(e){return e.length%2?"0"+e:e}function gz(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function bz(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}yz.exports={zeros:vz,setLength:mz,setLengthRight:l8e,isHexString:gz,stripHexPrefix:bz,toBuffer:ab,bufferToHex:h8e,keccak:d8e}});var Ez=E((kFe,Sz)=>{var ku=E5(),Tu=Df();function wz(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Bc(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function _z(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function xz(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function Cu(e){var t=typeof e;if(t==="string")return ku.isHexString(e)?new Tu(ku.stripHexPrefix(e),16):new Tu(e,10);if(t==="number")return new Tu(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Eo(e,t){var r,n,i,o;if(e==="address")return Eo("uint160",Cu(t));if(e==="bool")return Eo("uint8",t?1:0);if(e==="string")return Eo("bytes",new Buffer(t,"utf8"));if(m8e(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=xz(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(o in t)i.push(Eo(e,t[o]));if(r==="dynamic"){var a=Eo("uint256",t.length);i.unshift(a)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([Eo("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,ku.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Bc(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return ku.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Bc(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Cu(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Bc(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Cu(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=_z(e),n=Cu(t),n<0)throw new Error("Supplied ufixed is negative");return Eo("uint256",n.mul(new Tu(2).pow(new Tu(r[1]))))}else if(e.startsWith("fixed"))return r=_z(e),Eo("int256",Cu(t).mul(new Tu(2).pow(new Tu(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function v8e(e){return e==="string"||e==="bytes"||xz(e)==="dynamic"}function m8e(e){return e.lastIndexOf("]")===e.length-1}function g8e(e,t){var r=[],n=[],i=32*e.length;for(var o in e){var a=wz(e[o]),c=t[o],v=Eo(a,c);v8e(a)?(r.push(Eo("uint256",i)),n.push(v),i+=v.length):r.push(v)}return Buffer.concat(r.concat(n))}function Mz(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<e.length;o++){var a=wz(e[o]),c=t[o];if(a==="bytes")i.push(c);else if(a==="string")i.push(new Buffer(c,"utf8"));else if(a==="bool")i.push(new Buffer(c?"01":"00","hex"));else if(a==="address")i.push(ku.setLength(c,20));else if(a.startsWith("bytes")){if(r=Bc(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(ku.setLengthRight(c,r))}else if(a.startsWith("uint")){if(r=Bc(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Cu(c),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=Bc(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Cu(c),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function b8e(e,t){return ku.keccak(Mz(e,t))}Sz.exports={rawEncode:g8e,solidityPack:Mz,soliditySHA3:b8e}});var Rz=E((PFe,Oz)=>{var Gi=E5(),Pd=Ez(),Az={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},A5={encodeData(e,t,r,n=!0){let i=["bytes32"],o=[this.hashType(e,r)];if(n){let a=(c,v,y)=>{if(r[v]!==void 0)return["bytes32",y==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Gi.keccak(this.encodeData(v,y,r,n))];if(y===void 0)throw new Error(`missing value for field ${c} of type ${v}`);if(v==="bytes")return["bytes32",Gi.keccak(y)];if(v==="string")return typeof y=="string"&&(y=Buffer.from(y,"utf8")),["bytes32",Gi.keccak(y)];if(v.lastIndexOf("]")===v.length-1){let w=v.slice(0,v.lastIndexOf("[")),M=y.map(S=>a(c,w,S));return["bytes32",Gi.keccak(Pd.rawEncode(M.map(([S])=>S),M.map(([,S])=>S)))]}return[v,y]};for(let c of r[e]){let[v,y]=a(c.name,c.type,t[c.name]);i.push(v),o.push(y)}}else for(let a of r[e]){let c=t[a.name];if(c!==void 0)if(a.type==="bytes")i.push("bytes32"),c=Gi.keccak(c),o.push(c);else if(a.type==="string")i.push("bytes32"),typeof c=="string"&&(c=Buffer.from(c,"utf8")),c=Gi.keccak(c),o.push(c);else if(r[a.type]!==void 0)i.push("bytes32"),c=Gi.keccak(this.encodeData(a.type,c,r,n)),o.push(c);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),o.push(c)}}return Pd.rawEncode(i,o)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(let i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:a,type:c})=>c+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(let n of t[e])for(let i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return Gi.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Gi.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let r in Az.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Gi.keccak(Buffer.concat(n))}};Oz.exports={TYPED_MESSAGE_SCHEMA:Az,TypedDataUtils:A5,hashForSignTypedDataLegacy:function(e){return y8e(e.data)},hashForSignTypedData_v3:function(e){return A5.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return A5.hash(e.data)}};function y8e(e){let t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;let r=e.map(function(o){return o.type==="bytes"?Gi.toBuffer(o.value):o.value}),n=e.map(function(o){return o.type}),i=e.map(function(o){if(!o.name)throw t;return o.type+" "+o.name});return Pd.soliditySHA3(["bytes32","bytes32"],[Pd.soliditySHA3(new Array(e.length).fill("string"),i),Pd.soliditySHA3(n,r)])}});var Pz=E(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.filterFromParam=jc.FilterPolyfill=void 0;var Dc=Id(),Ln=ns(),_8e=5*60*1e3,Pu={jsonrpc:"2.0",id:0},O5=class{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Dc.IntNumber)(1),this.provider=t}async newFilter(t){let r=kz(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ln.hexStringFromIntNumber)(n)}async newBlockFilter(){let t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Ln.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){let t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Ln.hexStringFromIntNumber)(t)}uninstallFilter(t){let r=(0,Ln.intNumberFromHexString)(t);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){let r=(0,Ln.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(ub())}async getFilterLogs(t){let r=(0,Ln.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Pu),{method:"eth_getLogs",params:[Iz(n)]})):ub()}makeFilterId(){return(0,Dc.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,o)=>{if(i)return n(i);if(Array.isArray(o)||o==null)return n(new Error(`unexpected response received: ${JSON.stringify(o)}`));r(o)})})}deleteFilter(t){console.log(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){let r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return ub();let i=await this.getCurrentBlockHeight(),o=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return fb();console.log(`Fetching logs from ${n} to ${o} for filter ${t}`);let a=await this.sendAsyncPromise(Object.assign(Object.assign({},Pu),{method:"eth_getLogs",params:[Iz(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:o}))]}));if(Array.isArray(a.result)){let c=a.result.map(y=>(0,Ln.intNumberFromHexString)(y.blockNumber||"0x0")),v=Math.max(...c);if(v&&v>n){let y=(0,Dc.IntNumber)(v+1);console.log(`Moving cursor position for filter (${t}) from ${n} to ${y}`),this.cursors.set(t,y)}}return a}async getBlockFilterChanges(t){let r=this.cursors.get(t);if(!r)return ub();let n=await this.getCurrentBlockHeight();if(r>n)return fb();console.log(`Fetching blocks from ${r} to ${n} for filter (${t})`);let i=(await Promise.all((0,Ln.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Dc.IntNumber)(a))))).filter(a=>!!a),o=(0,Dc.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${t}) from ${r} to ${o}`),this.cursors.set(t,o),Object.assign(Object.assign({},Pu),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(fb())}async setInitialCursorPosition(t,r){let n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){let r=this.timeouts.get(t);r&&window.clearTimeout(r);let n=window.setTimeout(()=>{console.log(`Filter (${t}) timed out`),this.deleteFilter(t)},_8e);this.timeouts.set(t,n)}async getCurrentBlockHeight(){let{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Pu),{method:"eth_blockNumber",params:[]}));return(0,Ln.intNumberFromHexString)((0,Ln.ensureHexString)(t))}async getBlockHashByNumber(t){let r=await this.sendAsyncPromise(Object.assign(Object.assign({},Pu),{method:"eth_getBlockByNumber",params:[(0,Ln.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ln.ensureHexString)(r.result.hash):null}};jc.FilterPolyfill=O5;function kz(e){return{fromBlock:Cz(e.fromBlock),toBlock:Cz(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}jc.filterFromParam=kz;function Iz(e){let t={fromBlock:Tz(e.fromBlock),toBlock:Tz(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Cz(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Dc.IntNumber)(0);if((0,Ln.isHexString)(e))return(0,Ln.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Tz(e){return e==="latest"?e:(0,Ln.hexStringFromIntNumber)(e)}function ub(){return Object.assign(Object.assign({},Pu),{error:{code:-32e3,message:"filter not found"}})}function fb(){return Object.assign(Object.assign({},Pu),{result:[]})}});var Nz=E(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.JSONRPCMethod=void 0;var w8e;(function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"})(w8e=Nd.JSONRPCMethod||(Nd.JSONRPCMethod={}))});var Lz=E(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});cb.SubscriptionManager=void 0;var x8e=Ex(),M8e=V3(),qz=()=>{},R5=class{constructor(t){let r=new x8e({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=M8e({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){let r={};return await this.subscriptionMiddleware(t,r,qz,qz),r}destroy(){this.subscriptionMiddleware.destroy()}};cb.SubscriptionManager=R5});var lb=E(Fc=>{"use strict";var k5=Fc&&Fc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fc,"__esModule",{value:!0});Fc.CoinbaseWalletProvider=void 0;var S8e=k5(Nh()),E8e=k5(Df()),En=fg(),I5=lg(),Bz=sb(),Dz=S5(),bt=ns(),C5=k5(Rz()),A8e=Pz(),Vt=Nz(),O8e=Lz(),jz="DefaultChainId",Fz="DefaultJsonRpcUrl",T5=class extends S8e.default{constructor(t){var r,n;super(),this._filterPolyfill=new A8e.FilterPolyfill(this),this._subscriptionManager=new O8e.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl,this.supportsAddressSwitching=t.supportsAddressSwitching,this.isLedger=t.isLedger;let i=this.getChainId(),o=(0,bt.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:o});let a=this._storage.getItem(Dz.LOCAL_STORAGE_ADDRESSES_KEY);if(a){let c=a.split(" ");c[0]!==""&&(this._addresses=c.map(v=>(0,bt.ensureAddressString)(v)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",c=>{var v;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"){if(c.data.data.action==="defaultChainChanged"||c.data.data.action==="dappChainSwitched"){let y=c.data.data.chainId,w=(v=c.data.data.jsonRpcUrl)!==null&&v!==void 0?v:this.jsonRpcUrl;this.updateProviderInfo(w,Number(y))}c.data.data.action==="addressChanged"&&this._setAddresses([c.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,bt.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(Fz))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Fz,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;let n=this.getChainId();this._storage.setItem(jz,r.toString(10)),((0,bt.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,o,a){return!!(await(await this.initializeRelay()).watchAsset(t,r,n,i,o,a?.toString()).promise).result}async addEthereumChain(t,r,n,i,o,a){var c,v;if((0,bt.ensureIntNumber)(t)===this.getChainId())return!1;let y=await this.initializeRelay(),w=y.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!w&&await y.requestEthereumAccounts().promise;let M=await y.addEthereumChain(t.toString(),r,o,n,i,a).promise;return((c=M.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],t),((v=M.result)===null||v===void 0?void 0:v.isApproved)===!0}async switchEthereumChain(t){let n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if(n.errorCode)throw En.ethErrors.provider.custom({code:n.errorCode});let i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(I5.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Bz.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(Vt.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){if(typeof t=="string"){let i=t,o=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:o};return this._sendRequestAsync(a).then(c=>c.result)}if(typeof r=="function"){let i=t,o=r;return this._sendAsync(i,o)}if(Array.isArray(t))return t.map(o=>this._sendRequest(o));let n=t;return this._sendRequest(n)}async sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){let i=r;this._sendMultipleRequestsAsync(t).then(o=>i(null,o)).catch(o=>i(o,null));return}let n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){if(!t||typeof t!="object"||Array.isArray(t))throw En.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});let{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw En.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw En.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});let i=n===void 0?[]:n,o=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:o})).result}async scanQRCode(t){let n=await(await this.initializeRelay()).scanQRCode((0,bt.ensureRegExpString)(t)).promise;if(typeof n.result!="string")throw new Error("result was not a string");return n.result}async genericRequest(t,r){let i=await(await this.initializeRelay()).genericRequest(t,r).promise;if(typeof i.result!="string")throw new Error("result was not a string");return i.result}async selectProvider(t){let n=await(await this.initializeRelay()).selectProvider(t).promise;if(typeof n.result!="string")throw new Error("result was not a string");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){let r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");let n=t.map(i=>(0,bt.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!r||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Dz.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(t){return new Promise((r,n)=>{try{let i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});let o=this._handleAsynchronousFilterMethods(t);if(o!==void 0){o.then(c=>r(Object.assign(Object.assign({},c),{id:t.id}))).catch(c=>n(c));return}let a=this._handleSubscriptionMethods(t);if(a!==void 0){a.then(c=>r({jsonrpc:"2.0",id:t.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){let{method:r}=t,n=t.params||[];switch(r){case Vt.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Vt.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Vt.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case Vt.JSONRPCMethod.net_version:return this._net_version();case Vt.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){let{method:r}=t,n=t.params||[];switch(r){case Vt.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Vt.JSONRPCMethod.eth_sign:return this._eth_sign(n);case Vt.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case Vt.JSONRPCMethod.personal_sign:return this._personal_sign(n);case Vt.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case Vt.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case Vt.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case Vt.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case Vt.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case Vt.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Vt.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case Vt.JSONRPCMethod.eth_signTypedData_v4:case Vt.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case Vt.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case Vt.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case Vt.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case Vt.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(t){let{method:r}=t,n=t.params||[];switch(r){case Vt.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case Vt.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Vt.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Vt.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case Vt.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case Vt.JSONRPCMethod.eth_subscribe:case Vt.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{let r=(0,bt.ensureAddressString)(t);return this._addresses.map(i=>(0,bt.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(I5.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){let r=t.from?(0,bt.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);let n=t.to?(0,bt.ensureAddressString)(t.to):null,i=t.value!=null?(0,bt.ensureBN)(t.value):new E8e.default(0),o=t.data?(0,bt.ensureBuffer)(t.data):Buffer.alloc(0),a=t.nonce!=null?(0,bt.ensureIntNumber)(t.nonce):null,c=t.gasPrice!=null?(0,bt.ensureBN)(t.gasPrice):null,v=t.maxFeePerGas!=null?(0,bt.ensureBN)(t.maxFeePerGas):null,y=t.maxPriorityFeePerGas!=null?(0,bt.ensureBN)(t.maxPriorityFeePerGas):null,w=t.gas!=null?(0,bt.ensureBN)(t.gas):null,M=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:o,nonce:a,gasPriceInWei:c,maxFeePerGas:v,maxPriorityFeePerGas:y,gasLimit:w,chainId:M}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw En.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw En.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{let a=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;return{jsonrpc:"2.0",id:0,result:a.result}}catch(o){throw typeof o.message=="string"&&o.message.match(/(denied|rejected)/i)?En.ethErrors.provider.userRejectedRequest("User denied message signature"):o}}async _ethereumAddressFromSignedMessage(t,r,n){let o=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;return{jsonrpc:"2.0",id:0,result:o.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,bt.hexStringFromIntNumber)(this.getChainId())}getChainId(){let t=this._storage.getItem(jz);if(!t)return(0,bt.ensureIntNumber)(this._chainIdFromOpts);let r=parseInt(t,10);return(0,bt.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(I5.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Bz.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?En.ethErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();let r=(0,bt.ensureAddressString)(t[0]),n=(0,bt.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){let r=(0,bt.ensureBuffer)(t[0]),n=(0,bt.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();let r=(0,bt.ensureBuffer)(t[0]),n=(0,bt.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){let r=(0,bt.ensureBuffer)(t[0]),n=(0,bt.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();let r=this._prepareTransactionParams(t[0]||{});try{let i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?En.ethErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){let r=(0,bt.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();let r=this._prepareTransactionParams(t[0]||{});try{let i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?En.ethErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();let r=(0,bt.ensureParsedJSONObject)(t[0]),n=(0,bt.ensureAddressString)(t[1]);this._ensureKnownAddress(n);let i=C5.default.hashForSignTypedDataLegacy({data:r}),o=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,o)}async _eth_signTypedData_v3(t){this._requireAuthorization();let r=(0,bt.ensureAddressString)(t[0]),n=(0,bt.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);let i=C5.default.hashForSignTypedData_v3({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _eth_signTypedData_v4(t){this._requireAuthorization();let r=(0,bt.ensureAddressString)(t[0]),n=(0,bt.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);let i=C5.default.hashForSignTypedData_v4({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _cbwallet_arbitrary(t){let r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");let i=await this.genericRequest(r,n);return{jsonrpc:"2.0",id:0,result:i}}async _wallet_addEthereumChain(t){var r,n,i,o;let a=t[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw En.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!a.nativeCurrency)throw En.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});let c=parseInt(a.chainId,16);return await this.addEthereumChain(c,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(o=a.iconUrls)!==null&&o!==void 0?o:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){let r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){let r=Array.isArray(t)?t[0]:t;if(!r.type)throw En.ethErrors.rpc.invalidParams({message:"Type is required"});if(r?.type!=="ERC20")throw En.ethErrors.rpc.invalidParams({message:`Asset of type '${r.type}' is not supported`});if(!r?.options)throw En.ethErrors.rpc.invalidParams({message:"Options are required"});if(!r?.options.address)throw En.ethErrors.rpc.invalidParams({message:"Address is required"});let n=this.getChainId(),{address:i,symbol:o,image:a,decimals:c}=r.options,v=await this.watchAsset(r.type,i,o,c,a,n);return{jsonrpc:"2.0",id:0,result:v}}_eth_uninstallFilter(t){let r=(0,bt.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){let r=t[0],n=await this._filterPolyfill.newFilter(r);return{jsonrpc:"2.0",id:0,result:n}}async _eth_newBlockFilter(){let t=await this._filterPolyfill.newBlockFilter();return{jsonrpc:"2.0",id:0,result:t}}async _eth_newPendingTransactionFilter(){let t=await this._filterPolyfill.newPendingTransactionFilter();return{jsonrpc:"2.0",id:0,result:t}}_eth_getFilterChanges(t){let r=(0,bt.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){let r=(0,bt.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}};Fc.CoinbaseWalletProvider=T5});var Yn={};Sr(Yn,{Component:()=>Ld,Fragment:()=>jd,cloneElement:()=>P8e,createContext:()=>N8e,createElement:()=>Jz,createRef:()=>I8e,h:()=>Jz,hydrate:()=>uV,isValidElement:()=>$z,options:()=>nt,render:()=>aV,toChildArray:()=>tV});function is(e,t){for(var r in t)e[r]=t[r];return e}function Yz(e){var t=e.parentNode;t&&t.removeChild(e)}function Jz(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Dd.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return qd(e,a,n,i,null)}function qd(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Vz};return i==null&&nt.vnode!=null&&nt.vnode(o),o}function I8e(){return{current:null}}function jd(e){return e.children}function Ld(e,t){this.props=e,this.context=t}function Bd(e,t){if(t==null)return e.__?Bd(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Bd(e):null}function Qz(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Qz(e)}}function N5(e){(!e.__d&&(e.__d=!0)&&Nu.push(e)&&!db.__r++||Uz!==nt.debounceRendering)&&((Uz=nt.debounceRendering)||Kz)(db)}function db(){var e,t,r,n,i,o,a,c;for(Nu.sort(P5);e=Nu.shift();)e.__d&&(t=Nu.length,n=void 0,i=void 0,a=(o=(r=e).__v).__e,(c=r.__P)&&(n=[],(i=is({},o)).__v=o.__v+1,q5(c,o,i,r.__n,c.ownerSVGElement!==void 0,o.__h!=null?[a]:null,n,a??Bd(o),o.__h),iV(n,o),o.__e!=a&&Qz(o)),Nu.length>t&&Nu.sort(P5));db.__r=0}function Xz(e,t,r,n,i,o,a,c,v,y){var w,M,S,R,C,B,N,q=n&&n.__k||Zz,H=q.length;for(r.__k=[],w=0;w<t.length;w++)if((R=r.__k[w]=(R=t[w])==null||typeof R=="boolean"||typeof R=="function"?null:typeof R=="string"||typeof R=="number"||typeof R=="bigint"?qd(null,R,null,null,R):Array.isArray(R)?qd(jd,{children:R},null,null,null):R.__b>0?qd(R.type,R.props,R.key,R.ref?R.ref:null,R.__v):R)!=null){if(R.__=r,R.__b=r.__b+1,(S=q[w])===null||S&&R.key==S.key&&R.type===S.type)q[w]=void 0;else for(M=0;M<H;M++){if((S=q[M])&&R.key==S.key&&R.type===S.type){q[M]=void 0;break}S=null}q5(e,R,S=S||hb,i,o,a,c,v,y),C=R.__e,(M=R.ref)&&S.ref!=M&&(N||(N=[]),S.ref&&N.push(S.ref,null,R),N.push(M,R.__c||C,R)),C!=null?(B==null&&(B=C),typeof R.type=="function"&&R.__k===S.__k?R.__d=v=eV(R,v,e):v=rV(e,R,S,q,C,v),typeof r.type=="function"&&(r.__d=v)):v&&S.__e==v&&v.parentNode!=e&&(v=Bd(S))}for(r.__e=B,w=H;w--;)q[w]!=null&&(typeof r.type=="function"&&q[w].__e!=null&&q[w].__e==r.__d&&(r.__d=nV(n).nextSibling),sV(q[w],q[w]));if(N)for(w=0;w<N.length;w++)oV(N[w],N[++w],N[++w])}function eV(e,t,r){for(var n,i=e.__k,o=0;i&&o<i.length;o++)(n=i[o])&&(n.__=e,t=typeof n.type=="function"?eV(n,t,r):rV(r,n,n,i,n.__e,t));return t}function tV(e,t){return t=t||[],e==null||typeof e=="boolean"||(Array.isArray(e)?e.some(function(r){tV(r,t)}):t.push(e)),t}function rV(e,t,r,n,i,o){var a,c,v;if(t.__d!==void 0)a=t.__d,t.__d=void 0;else if(r==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),a=null;else{for(c=o,v=0;(c=c.nextSibling)&&v<n.length;v+=1)if(c==i)break e;e.insertBefore(i,o),a=o}return a!==void 0?a:i.nextSibling}function nV(e){var t,r,n;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((r=e.__k[t])&&(n=nV(r)))return n}return null}function C8e(e,t,r,n,i){var o;for(o in r)o==="children"||o==="key"||o in t||pb(e,o,null,r[o],n);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||r[o]===t[o]||pb(e,o,t[o],r[o],n)}function Hz(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||R8e.test(t)?r:r+"px"}function pb(e,t,r,n,i){var o;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Hz(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Hz(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n||e.addEventListener(t,o?zz:Wz,o):e.removeEventListener(t,o?zz:Wz,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t.indexOf("-")==-1?e.removeAttribute(t):e.setAttribute(t,r))}}function Wz(e){return this.l[e.type+!1](nt.event?nt.event(e):e)}function zz(e){return this.l[e.type+!0](nt.event?nt.event(e):e)}function q5(e,t,r,n,i,o,a,c,v){var y,w,M,S,R,C,B,N,q,H,D,ee,ge,Z,X,V=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(v=r.__h,c=t.__e=r.__e,t.__h=null,o=[c]),(y=nt.__b)&&y(t);try{e:if(typeof V=="function"){if(N=t.props,q=(y=V.contextType)&&n[y.__c],H=y?q?q.props.value:y.__:n,r.__c?B=(w=t.__c=r.__c).__=w.__E:("prototype"in V&&V.prototype.render?t.__c=w=new V(N,H):(t.__c=w=new Ld(N,H),w.constructor=V,w.render=k8e),q&&q.sub(w),w.props=N,w.state||(w.state={}),w.context=H,w.__n=n,M=w.__d=!0,w.__h=[],w._sb=[]),w.__s==null&&(w.__s=w.state),V.getDerivedStateFromProps!=null&&(w.__s==w.state&&(w.__s=is({},w.__s)),is(w.__s,V.getDerivedStateFromProps(N,w.__s))),S=w.props,R=w.state,w.__v=t,M)V.getDerivedStateFromProps==null&&w.componentWillMount!=null&&w.componentWillMount(),w.componentDidMount!=null&&w.__h.push(w.componentDidMount);else{if(V.getDerivedStateFromProps==null&&N!==S&&w.componentWillReceiveProps!=null&&w.componentWillReceiveProps(N,H),!w.__e&&w.shouldComponentUpdate!=null&&w.shouldComponentUpdate(N,w.__s,H)===!1||t.__v===r.__v){for(t.__v!==r.__v&&(w.props=N,w.state=w.__s,w.__d=!1),w.__e=!1,t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(k){k&&(k.__=t)}),D=0;D<w._sb.length;D++)w.__h.push(w._sb[D]);w._sb=[],w.__h.length&&a.push(w);break e}w.componentWillUpdate!=null&&w.componentWillUpdate(N,w.__s,H),w.componentDidUpdate!=null&&w.__h.push(function(){w.componentDidUpdate(S,R,C)})}if(w.context=H,w.props=N,w.__P=e,ee=nt.__r,ge=0,"prototype"in V&&V.prototype.render){for(w.state=w.__s,w.__d=!1,ee&&ee(t),y=w.render(w.props,w.state,w.context),Z=0;Z<w._sb.length;Z++)w.__h.push(w._sb[Z]);w._sb=[]}else do w.__d=!1,ee&&ee(t),y=w.render(w.props,w.state,w.context),w.state=w.__s;while(w.__d&&++ge<25);w.state=w.__s,w.getChildContext!=null&&(n=is(is({},n),w.getChildContext())),M||w.getSnapshotBeforeUpdate==null||(C=w.getSnapshotBeforeUpdate(S,R)),X=y!=null&&y.type===jd&&y.key==null?y.props.children:y,Xz(e,Array.isArray(X)?X:[X],t,r,n,i,o,a,c,v),w.base=t.__e,t.__h=null,w.__h.length&&a.push(w),B&&(w.__E=w.__=null),w.__e=!1}else o==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=T8e(r.__e,t,r,n,i,o,a,v);(y=nt.diffed)&&y(t)}catch(k){t.__v=null,(v||o!=null)&&(t.__e=c,t.__h=!!v,o[o.indexOf(c)]=null),nt.__e(k,t,r)}}function iV(e,t){nt.__c&&nt.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(n){n.call(r)})}catch(n){nt.__e(n,r.__v)}})}function T8e(e,t,r,n,i,o,a,c){var v,y,w,M=r.props,S=t.props,R=t.type,C=0;if(R==="svg"&&(i=!0),o!=null){for(;C<o.length;C++)if((v=o[C])&&"setAttribute"in v==!!R&&(R?v.localName===R:v.nodeType===3)){e=v,o[C]=null;break}}if(e==null){if(R===null)return document.createTextNode(S);e=i?document.createElementNS("http://www.w3.org/2000/svg",R):document.createElement(R,S.is&&S),o=null,c=!1}if(R===null)M===S||c&&e.data===S||(e.data=S);else{if(o=o&&Dd.call(e.childNodes),y=(M=r.props||hb).dangerouslySetInnerHTML,w=S.dangerouslySetInnerHTML,!c){if(o!=null)for(M={},C=0;C<e.attributes.length;C++)M[e.attributes[C].name]=e.attributes[C].value;(w||y)&&(w&&(y&&w.__html==y.__html||w.__html===e.innerHTML)||(e.innerHTML=w&&w.__html||""))}if(C8e(e,S,M,i,c),w)t.__k=[];else if(C=t.props.children,Xz(e,Array.isArray(C)?C:[C],t,r,n,i&&R!=="foreignObject",o,a,o?o[0]:r.__k&&Bd(r,0),c),o!=null)for(C=o.length;C--;)o[C]!=null&&Yz(o[C]);c||("value"in S&&(C=S.value)!==void 0&&(C!==e.value||R==="progress"&&!C||R==="option"&&C!==M.value)&&pb(e,"value",C,M.value,!1),"checked"in S&&(C=S.checked)!==void 0&&C!==e.checked&&pb(e,"checked",C,M.checked,!1))}return e}function oV(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(n){nt.__e(n,r)}}function sV(e,t,r){var n,i;if(nt.unmount&&nt.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||oV(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){nt.__e(o,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&sV(n[i],t,r||typeof e.type!="function");r||e.__e==null||Yz(e.__e),e.__=e.__e=e.__d=void 0}function k8e(e,t,r){return this.constructor(e,r)}function aV(e,t,r){var n,i,o;nt.__&&nt.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],q5(t,e=(!n&&r||t).__k=Jz(jd,null,[e]),i||hb,hb,t.ownerSVGElement!==void 0,!n&&r?[r]:i?null:t.firstChild?Dd.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n),iV(o,e)}function uV(e,t){aV(e,t,uV)}function P8e(e,t,r){var n,i,o,a=is({},e.props);for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];return arguments.length>2&&(a.children=arguments.length>3?Dd.call(arguments,2):r),qd(e.type,a,n||e.key,i||e.ref,null)}function N8e(e,t){var r={__c:t="__cC"+Gz++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(c){c.__e=!0,N5(c)})},this.sub=function(a){i.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}var Dd,nt,Vz,$z,Nu,Uz,Kz,P5,Gz,hb,Zz,R8e,Bn=_t(()=>{hb={},Zz=[],R8e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;Dd=Zz.slice,nt={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(c){e=c}throw e}},Vz=0,$z=function(e){return e!=null&&e.constructor===void 0},Ld.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=is({},this.state),typeof e=="function"&&(e=e(is({},r),this.props)),e&&is(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),N5(this))},Ld.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N5(this))},Ld.prototype.render=jd,Nu=[],Kz=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,P5=function(e,t){return e.__v.__b-t.__v.__b},db.__r=0,Gz=0});var Fd=E((DFe,L5)=>{function cV(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=cV(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function fV(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=cV(e))&&(n&&(n+=" "),n+=t);return n}L5.exports=fV,L5.exports.clsx=fV});var Hc={};Sr(Hc,{useCallback:()=>D8e,useContext:()=>j8e,useDebugValue:()=>F8e,useEffect:()=>q8e,useErrorBoundary:()=>U8e,useId:()=>H8e,useImperativeHandle:()=>B8e,useLayoutEffect:()=>wV,useMemo:()=>j5,useReducer:()=>_V,useRef:()=>L8e,useState:()=>yV});function qu(e,t){nt.__h&&nt.__h(or,e,Uc||t),Uc=0;var r=or.__H||(or.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:vb}),r.__[e]}function yV(e){return Uc=1,_V(xV,e)}function _V(e,t,r){var n=qu(ta++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):xV(void 0,t),function(c){var v=n.__N?n.__N[0]:n.__[0],y=n.t(v,c);v!==y&&(n.__N=[y,n.__[1]],n.__c.setState({}))}],n.__c=or,!or.u)){var i=function(c,v,y){if(!n.__c.__H)return!0;var w=n.__c.__H.__.filter(function(S){return S.__c});if(w.every(function(S){return!S.__N}))return!o||o.call(this,c,v,y);var M=!1;return w.forEach(function(S){if(S.__N){var R=S.__[0];S.__=S.__N,S.__N=void 0,R!==S.__[0]&&(M=!0)}}),!(!M&&n.__c.props===c)&&(!o||o.call(this,c,v,y))};or.u=!0;var o=or.shouldComponentUpdate,a=or.componentWillUpdate;or.componentWillUpdate=function(c,v,y){if(this.__e){var w=o;o=void 0,i(c,v,y),o=w}a&&a.call(this,c,v,y)},or.shouldComponentUpdate=i}return n.__N||n.__}function q8e(e,t){var r=qu(ta++,3);!nt.__s&&F5(r.__H,t)&&(r.__=e,r.i=t,or.__H.__h.push(r))}function wV(e,t){var r=qu(ta++,4);!nt.__s&&F5(r.__H,t)&&(r.__=e,r.i=t,or.__h.push(r))}function L8e(e){return Uc=5,j5(function(){return{current:e}},[])}function B8e(e,t,r){Uc=6,wV(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function j5(e,t){var r=qu(ta++,7);return F5(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function D8e(e,t){return Uc=8,j5(function(){return e},t)}function j8e(e){var t=or.context[e.__c],r=qu(ta++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(or)),t.props.value):e.__}function F8e(e,t){nt.useDebugValue&&nt.useDebugValue(t?t(e):e)}function U8e(e){var t=qu(ta++,10),r=yV();return t.__=e,or.componentDidCatch||(or.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function H8e(){var e=qu(ta++,11);if(!e.__){for(var t=or.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function W8e(){for(var e;e=bV.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(mb),e.__H.__h.forEach(D5),e.__H.__h=[]}catch(t){e.__H.__h=[],nt.__e(t,e.__v)}}function z8e(e){var t,r=function(){clearTimeout(n),gV&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);gV&&(t=requestAnimationFrame(r))}function mb(e){var t=or,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),or=t}function D5(e){var t=or;e.__c=e.__(),or=t}function F5(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function xV(e,t){return typeof t=="function"?t(e):t}var ta,or,B5,lV,Uc,bV,vb,hV,dV,pV,vV,mV,gV,Wc=_t(()=>{Bn();Uc=0,bV=[],vb=[],hV=nt.__b,dV=nt.__r,pV=nt.diffed,vV=nt.__c,mV=nt.unmount;nt.__b=function(e){or=null,hV&&hV(e)},nt.__r=function(e){dV&&dV(e),ta=0;var t=(or=e.__c).__H;t&&(B5===or?(t.__h=[],or.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=vb,r.__N=r.i=void 0})):(t.__h.forEach(mb),t.__h.forEach(D5),t.__h=[])),B5=or},nt.diffed=function(e){pV&&pV(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(bV.push(t)!==1&&lV===nt.requestAnimationFrame||((lV=nt.requestAnimationFrame)||z8e)(W8e)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==vb&&(r.__=r.__V),r.i=void 0,r.__V=vb})),B5=or=null},nt.__c=function(e,t){t.some(function(r){try{r.__h.forEach(mb),r.__h=r.__h.filter(function(n){return!n.__||D5(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],nt.__e(n,r.__v)}}),vV&&vV(e,t)},nt.unmount=function(e){mV&&mV(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{mb(n)}catch(i){t=i}}),r.__H=void 0,t&&nt.__e(t,r.__v))};gV=typeof requestAnimationFrame=="function"});var MV=E(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.LIB_VERSION=void 0;gb.LIB_VERSION="3.6.3"});var EV=E(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});bb.CloseIcon=void 0;var SV=(Bn(),Pt(Yn));function V8e(e){return(0,SV.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,SV.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}bb.CloseIcon=V8e});var AV=E(U5=>{"use strict";Object.defineProperty(U5,"__esModule",{value:!0});U5.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4="});var OV=E(H5=>{"use strict";Object.defineProperty(H5,"__esModule",{value:!0});H5.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg=="});var RV=E(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});yb.QRCodeIcon=void 0;var Ao=(Bn(),Pt(Yn));function $8e(e){return(0,Ao.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ao.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Ao.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,Ao.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Ao.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,Ao.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Ao.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,Ao.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Ao.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Ao.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}yb.QRCodeIcon=$8e});var IV=E(W5=>{"use strict";Object.defineProperty(W5,"__esModule",{value:!0});var K8e=`
|
|
559
|
+
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
560
|
+
<path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>
|
|
561
|
+
<path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>
|
|
562
|
+
<path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>
|
|
563
|
+
</svg>
|
|
564
|
+
`;W5.default=K8e});var CV=E(z5=>{"use strict";Object.defineProperty(z5,"__esModule",{value:!0});z5.default=`
|
|
565
|
+
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
566
|
+
<circle cx="50" cy="50" r="50" fill="white"/>
|
|
567
|
+
<circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
|
|
568
|
+
<circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
|
|
569
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>
|
|
570
|
+
</svg>
|
|
571
|
+
`});var kV=E(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});_b.StatusDotIcon=void 0;var TV=(Bn(),Pt(Yn));function G8e(e){return(0,TV.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,TV.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}_b.StatusDotIcon=G8e});var BV=E((GFe,LV)=>{function PV(e){this.mode=ii.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}PV.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Ro(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Ro.prototype={addData:function(e){var t=new PV(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Ro.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=Mr.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var o=0;o<this.modules.length;o++)for(var a=o*i,c=0;c<this.modules[o].length;c++){var v=c*i,y=this.modules[o][c];y&&(n.beginFill(0,100),n.moveTo(v,a),n.lineTo(v+i,a),n.lineTo(v+i,a+i),n.lineTo(v,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=Mr.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var o=-2;o<=2;o++)for(var a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[n+o][i+a]=!0:this.modules[n+o][i+a]=!1}},setupTypeNumber:function(e){for(var t=Mr.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=Mr.getBCHTypeInfo(r),i=0;i<15;i++){var o=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[n][a-c]==null){var v=!1;o<e.length&&(v=(e[o]>>>i&1)==1);var y=Mr.getMask(t,n,a-c);y&&(v=!v),this.modules[n][a-c]=v,i--,i==-1&&(o++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Ro.PAD0=236;Ro.PAD1=17;Ro.createData=function(e,t,r){for(var n=Oo.getRSBlocks(e,t),i=new NV,o=0;o<r.length;o++){var a=r[o];i.put(a.mode,4),i.put(a.getLength(),Mr.getLengthInBits(a.mode,e)),a.write(i)}for(var c=0,o=0;o<n.length;o++)c+=n[o].dataCount;if(i.getLengthInBits()>c*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Ro.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Ro.PAD1,8);return Ro.createBytes(i,n)};Ro.createBytes=function(e,t){for(var r=0,n=0,i=0,o=new Array(t.length),a=new Array(t.length),c=0;c<t.length;c++){var v=t[c].dataCount,y=t[c].totalCount-v;n=Math.max(n,v),i=Math.max(i,y),o[c]=new Array(v);for(var w=0;w<o[c].length;w++)o[c][w]=255&e.buffer[w+r];r+=v;var M=Mr.getErrorCorrectPolynomial(y),S=new zc(o[c],M.getLength()-1),R=S.mod(M);a[c]=new Array(M.getLength()-1);for(var w=0;w<a[c].length;w++){var C=w+R.getLength()-a[c].length;a[c][w]=C>=0?R.get(C):0}}for(var B=0,w=0;w<t.length;w++)B+=t[w].totalCount;for(var N=new Array(B),q=0,w=0;w<n;w++)for(var c=0;c<t.length;c++)w<o[c].length&&(N[q++]=o[c][w]);for(var w=0;w<i;w++)for(var c=0;c<t.length;c++)w<a[c].length&&(N[q++]=a[c][w]);return N};var ii={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3},na={L:1,M:0,Q:3,H:2},ra={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Mr={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(e){for(var t=e<<10;Mr.getBCHDigit(t)-Mr.getBCHDigit(Mr.G15)>=0;)t^=Mr.G15<<Mr.getBCHDigit(t)-Mr.getBCHDigit(Mr.G15);return(e<<10|t)^Mr.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Mr.getBCHDigit(t)-Mr.getBCHDigit(Mr.G18)>=0;)t^=Mr.G18<<Mr.getBCHDigit(t)-Mr.getBCHDigit(Mr.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Mr.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case ra.PATTERN000:return(t+r)%2==0;case ra.PATTERN001:return t%2==0;case ra.PATTERN010:return r%3==0;case ra.PATTERN011:return(t+r)%3==0;case ra.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case ra.PATTERN101:return t*r%2+t*r%3==0;case ra.PATTERN110:return(t*r%2+t*r%3)%2==0;case ra.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new zc([1],0),r=0;r<e;r++)t=t.multiply(new zc([1,Yr.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ii.MODE_NUMBER:return 10;case ii.MODE_ALPHA_NUM:return 9;case ii.MODE_8BIT_BYTE:return 8;case ii.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ii.MODE_NUMBER:return 12;case ii.MODE_ALPHA_NUM:return 11;case ii.MODE_8BIT_BYTE:return 16;case ii.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ii.MODE_NUMBER:return 14;case ii.MODE_ALPHA_NUM:return 13;case ii.MODE_8BIT_BYTE:return 16;case ii.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var o=0,a=e.isDark(n,i),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var v=-1;v<=1;v++)i+v<0||t<=i+v||c==0&&v==0||a==e.isDark(n+c,i+v)&&o++;o>5&&(r+=3+o-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var y=0;e.isDark(n,i)&&y++,e.isDark(n+1,i)&&y++,e.isDark(n,i+1)&&y++,e.isDark(n+1,i+1)&&y++,(y==0||y==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var w=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&w++;var M=Math.abs(100*w/t/t-50)/5;return r+=M*10,r}},Yr={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Yr.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Yr.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(qr=0;qr<8;qr++)Yr.EXP_TABLE[qr]=1<<qr;var qr;for(qr=8;qr<256;qr++)Yr.EXP_TABLE[qr]=Yr.EXP_TABLE[qr-4]^Yr.EXP_TABLE[qr-5]^Yr.EXP_TABLE[qr-6]^Yr.EXP_TABLE[qr-8];var qr;for(qr=0;qr<255;qr++)Yr.LOG_TABLE[Yr.EXP_TABLE[qr]]=qr;var qr;function zc(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}zc.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Yr.gexp(Yr.glog(this.get(r))+Yr.glog(e.get(n)));return new zc(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Yr.glog(this.get(0))-Yr.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Yr.gexp(Yr.glog(e.get(n))+t);return new zc(r,0).mod(e)}};function Oo(e,t){this.totalCount=e,this.dataCount=t}Oo.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Oo.getRSBlocks=function(e,t){var r=Oo.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],o=0;o<n;o++)for(var a=r[o*3+0],c=r[o*3+1],v=r[o*3+2],y=0;y<a;y++)i.push(new Oo(c,v));return i};Oo.getRsBlockTable=function(e,t){switch(t){case na.L:return Oo.RS_BLOCK_TABLE[(e-1)*4+0];case na.M:return Oo.RS_BLOCK_TABLE[(e-1)*4+1];case na.Q:return Oo.RS_BLOCK_TABLE[(e-1)*4+2];case na.H:return Oo.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function NV(){this.buffer=[],this.length=0}NV.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var V5=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function qV(e){var t=this;if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var r in e)this.options[r]=e[r];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function n(y){switch(y){case"L":return na.L;case"M":return na.M;case"Q":return na.Q;case"H":return na.H;default:throw new Error("Unknwon error correction level: "+y)}}function i(y,w){for(var M=o(y),S=1,R=0,C=0,B=V5.length;C<=B;C++){var N=V5[C];if(!N)throw new Error("Content too long: expected "+R+" but got "+M);switch(w){case"L":R=N[0];break;case"M":R=N[1];break;case"Q":R=N[2];break;case"H":R=N[3];break;default:throw new Error("Unknwon error correction level: "+w)}if(M<=R)break;S++}if(S>V5.length)throw new Error("Content too long");return S}function o(y){var w=encodeURI(y).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return w.length+(w.length!=y?3:0)}var a=this.options.content,c=i(a,this.options.ecl),v=n(this.options.ecl);this.qrcode=new Ro(c,v),this.qrcode.addData(a),this.qrcode.make()}qV.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",o=n?`\r
|
|
572
|
+
`:"",a=t.width,c=t.height,v=r.length,y=a/(v+2*t.padding),w=c/(v+2*t.padding),M=typeof t.join<"u"?!!t.join:!1,S=typeof t.swap<"u"?!!t.swap:!1,R=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,C=typeof t.predefined<"u"?!!t.predefined:!1,B=C?i+'<defs><path id="qrmodule" d="M0 0 h'+w+" v"+y+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+o:"",N=i+'<rect x="0" y="0" width="'+a+'" height="'+c+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+o,q="",H="",D=0;D<v;D++)for(var ee=0;ee<v;ee++){var ge=r[ee][D];if(ge){var Z=ee*y+t.padding*y,X=D*w+t.padding*w;if(S){var V=Z;Z=X,X=V}if(M){var k=y+Z,m=w+X;Z=Number.isInteger(Z)?Number(Z):Z.toFixed(2),X=Number.isInteger(X)?Number(X):X.toFixed(2),k=Number.isInteger(k)?Number(k):k.toFixed(2),m=Number.isInteger(m)?Number(m):m.toFixed(2),H+="M"+Z+","+X+" V"+m+" H"+k+" V"+X+" H"+Z+" Z "}else C?q+=i+'<use x="'+Z.toString()+'" y="'+X.toString()+'" href="#qrmodule" />'+o:q+=i+'<rect x="'+Z.toString()+'" y="'+X.toString()+'" width="'+y+'" height="'+w+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+o}}M&&(q=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+H+'" />');let s="";if(this.options.image!==void 0&&this.options.image.svg){let d=a*this.options.image.width/100,f=c*this.options.image.height/100,p=a/2-d/2,g=c/2-f/2;s+=`<svg x="${p}" y="${g}" width="${d}" height="${f}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,s+=this.options.image.svg+o,s+="</svg>"}var l="";switch(e.container){case"svg":R&&(l+='<?xml version="1.0" standalone="yes"?>'+o),l+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+c+'">'+o,l+=B+N+q,l+=s,l+="</svg>";break;case"svg-viewbox":R&&(l+='<?xml version="1.0" standalone="yes"?>'+o),l+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+c+'">'+o,l+=B+N+q,l+=s,l+="</svg>";break;case"g":l+='<g width="'+a+'" height="'+c+'">'+o,l+=B+N+q,l+=s,l+="</g>";break;default:l+=(B+N+q+s).replace(/^\s+/,"");break}return l};LV.exports=qV});var jV=E(Vc=>{"use strict";var Z8e=Vc&&Vc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.QRCode=void 0;var Y8e=(Bn(),Pt(Yn)),DV=(Wc(),Pt(Hc)),J8e=Z8e(BV()),Q8e=e=>{let[t,r]=(0,DV.useState)("");return(0,DV.useEffect)(()=>{var n,i;let o=new J8e.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),a=Buffer.from(o.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)}),t?(0,Y8e.h)("img",{src:t,alt:"QR Code"}):null};Vc.QRCode=Q8e});var FV=E($5=>{"use strict";Object.defineProperty($5,"__esModule",{value:!0});$5.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"});var UV=E($c=>{"use strict";var X8e=$c&&$c.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($c,"__esModule",{value:!0});$c.Spinner=void 0;var wb=(Bn(),Pt(Yn)),e9e=X8e(FV()),t9e=e=>{var t;let r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,wb.h)("div",{class:"-cbwsdk-spinner"},(0,wb.h)("style",null,e9e.default),(0,wb.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,wb.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};$c.Spinner=t9e});var HV=E(K5=>{"use strict";Object.defineProperty(K5,"__esModule",{value:!0});K5.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"});var ZV=E(Ri=>{"use strict";var Kc=Ri&&Ri.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.CoinbaseAppSteps=Ri.CoinbaseWalletSteps=Ri.ConnectItem=Ri.ConnectContent=void 0;var Oi=Kc(Fd()),Ye=(Bn(),Pt(Yn)),WV=(Wc(),Pt(Hc)),r9e=ns(),n9e=MV(),i9e=EV(),o9e=Kc(AV()),s9e=Kc(OV()),VV=RV(),a9e=Kc(IV()),u9e=Kc(CV()),f9e=kV(),c9e=jV(),l9e=UV(),h9e=Kc(HV()),zV={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:s9e.default,steps:KV},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:o9e.default,steps:GV}},d9e=e=>{switch(e){case"coinbase-app":return a9e.default;case"coinbase-wallet-app":default:return u9e.default}},G5=e=>e==="light"?"#FFFFFF":"#0A0B0D";function p9e(e){let{theme:t}=e,[r,n]=(0,WV.useState)("coinbase-wallet-app"),i=(0,WV.useCallback)(y=>{n(y)},[]),o=(0,r9e.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),a=zV[r];if(!r)return null;let c=a.steps,v=r==="coinbase-app";return(0,Ye.h)("div",{"data-testid":"connect-content",class:(0,Oi.default)("-cbwsdk-connect-content",t)},(0,Ye.h)("style",null,h9e.default),(0,Ye.h)("div",{class:"-cbwsdk-connect-content-header"},(0,Ye.h)("h2",{class:(0,Oi.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with one of our mobile apps"),e.onCancel&&(0,Ye.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,Ye.h)(i9e.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ye.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,Ye.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,Ye.h)("div",null,Object.entries(zV).map(([y,w])=>(0,Ye.h)($V,{key:y,title:w.title,description:w.description,icon:w.icon,selected:r===y,onClick:()=>i(y),theme:t}))),v&&(0,Ye.h)("div",{class:(0,Oi.default)("-cbwsdk-connect-content-update-app",t)},"Don\u2019t see a ",(0,Ye.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,Ye.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,Ye.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,Ye.h)(c9e.QRCode,{content:o,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:d9e(r),width:25,height:25}}),(0,Ye.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:n9e.LIB_VERSION}),(0,Ye.h)("input",{type:"hidden",value:o})),(0,Ye.h)(c,{theme:t}),!e.isConnected&&(0,Ye.h)("div",{"data-testid":"connecting-spinner",class:(0,Oi.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,Ye.h)(l9e.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,Ye.h)("p",null,"Connecting...")))))}Ri.ConnectContent=p9e;function $V({title:e,description:t,icon:r,selected:n,theme:i,onClick:o}){return(0,Ye.h)("div",{onClick:o,class:(0,Oi.default)("-cbwsdk-connect-item",i,{selected:n})},(0,Ye.h)("div",null,(0,Ye.h)("img",{src:r,alt:e})),(0,Ye.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,Ye.h)("h3",{class:"-cbwsdk-connect-item-title"},e),(0,Ye.h)("p",{class:"-cbwsdk-connect-item-description"},t)))}Ri.ConnectItem=$V;function KV({theme:e}){return(0,Ye.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,Ye.h)("span",null,"Tap ",(0,Ye.h)("strong",null,"Scan")," "),(0,Ye.h)("span",{class:(0,Oi.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Ye.h)(VV.QRCodeIcon,{fill:G5(e)})))))}Ri.CoinbaseWalletSteps=KV;function GV({theme:e}){return(0,Ye.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,Ye.h)("li",{class:(0,Oi.default)("-cbwsdk-wallet-steps-item",e)},(0,Ye.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,Ye.h)("span",null,"Tap ",(0,Ye.h)("strong",null,"More")),(0,Ye.h)("span",{class:(0,Oi.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Ye.h)(f9e.StatusDotIcon,{fill:G5(e)})),(0,Ye.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,Ye.h)("strong",null,"Scan")),(0,Ye.h)("span",{class:(0,Oi.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Ye.h)(VV.QRCodeIcon,{fill:G5(e)})))))}Ri.CoinbaseAppSteps=GV});var JV=E(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.ArrowLeftIcon=void 0;var YV=(Bn(),Pt(Yn));function v9e(e){return(0,YV.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,YV.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}xb.ArrowLeftIcon=v9e});var QV=E(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});Mb.LaptopIcon=void 0;var Z5=(Bn(),Pt(Yn));function m9e(e){return(0,Z5.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Z5.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Z5.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Mb.LaptopIcon=m9e});var e$=E(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});Sb.SafeIcon=void 0;var XV=(Bn(),Pt(Yn));function g9e(e){return(0,XV.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,XV.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Sb.SafeIcon=g9e});var t$=E(Y5=>{"use strict";Object.defineProperty(Y5,"__esModule",{value:!0});Y5.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}"});var n$=E(Gc=>{"use strict";var r$=Gc&&Gc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.TryExtensionContent=void 0;var Lu=r$(Fd()),Lr=(Bn(),Pt(Yn)),J5=(Wc(),Pt(Hc)),b9e=JV(),y9e=QV(),_9e=e$(),w9e=r$(t$());function x9e({theme:e}){let[t,r]=(0,J5.useState)(!1),n=(0,J5.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,J5.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Lr.h)("div",{class:(0,Lu.default)("-cbwsdk-try-extension",e)},(0,Lr.h)("style",null,w9e.default),(0,Lr.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Lr.h)("h3",{class:(0,Lu.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Lr.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Lr.h)("button",{class:(0,Lu.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Lr.h)("div",null,!t&&(0,Lr.h)(b9e.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Lr.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Lr.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Lr.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Lr.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Lr.h)("span",{class:(0,Lu.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Lr.h)(y9e.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Lr.h)("div",{class:(0,Lu.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Lr.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Lr.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Lr.h)("span",{class:(0,Lu.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Lr.h)(_9e.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Lr.h)("div",{class:(0,Lu.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Gc.TryExtensionContent=x9e});var i$=E(Q5=>{"use strict";Object.defineProperty(Q5,"__esModule",{value:!0});Q5.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"});var s$=E(Zc=>{"use strict";var o$=Zc&&Zc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.ConnectDialog=void 0;var X5=o$(Fd()),Bu=(Bn(),Pt(Yn)),eS=(Wc(),Pt(Hc)),M9e=ZV(),S9e=n$(),E9e=o$(i$()),A9e=e=>{let{isOpen:t,darkMode:r}=e,[n,i]=(0,eS.useState)(!t),[o,a]=(0,eS.useState)(!t);(0,eS.useEffect)(()=>{let v=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):v.push(window.setTimeout(()=>{i(!0)},360)),()=>{v.forEach(window.clearTimeout)}},[e.isOpen]);let c=r?"dark":"light";return(0,Bu.h)("div",{class:(0,X5.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Bu.h)("style",null,E9e.default),(0,Bu.h)("div",{class:(0,X5.default)("-cbwsdk-connect-dialog-backdrop",c,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Bu.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Bu.h)("div",{class:(0,X5.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,Bu.h)(M9e.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,Bu.h)(S9e.TryExtensionContent,{theme:c}))))};Zc.ConnectDialog=A9e});var u$=E(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});Eb.LinkFlow=void 0;var tS=(Bn(),Pt(Yn)),a$=yu(),O9e=s$(),rS=class{constructor(t){this.extensionUI$=new a$.BehaviorSubject({}),this.subscriptions=new a$.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var t;!this.root||(this.subscriptions.unsubscribe(),(0,tS.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;let t=this.extensionUI$.subscribe(()=>{!this.root||(0,tS.render)((0,tS.h)(O9e.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(t)}};Eb.LinkFlow=rS});var f$=E(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});nS.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"});var l$=E(Ii=>{"use strict";var c$=Ii&&Ii.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.SnackbarInstance=Ii.SnackbarContainer=Ii.Snackbar=void 0;var Ab=c$(Fd()),Br=(Bn(),Pt(Yn)),iS=(Wc(),Pt(Hc)),R9e=c$(f$()),I9e="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function C9e(e){switch(e){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}var oS=class{constructor(t){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",t.appendChild(this.root),this.render()}presentItem(t){let r=this.nextItemKey++;return this.items.set(r,t),this.render(),()=>{this.items.delete(r),this.render()}}clear(){this.items.clear(),this.render()}render(){!this.root||(0,Br.render)((0,Br.h)("div",null,(0,Br.h)(Ii.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([t,r])=>(0,Br.h)(Ii.SnackbarInstance,Object.assign({},r,{key:t}))))),this.root)}};Ii.Snackbar=oS;var T9e=e=>(0,Br.h)("div",{class:(0,Ab.default)("-cbwsdk-snackbar-container")},(0,Br.h)("style",null,R9e.default),(0,Br.h)("div",{class:"-cbwsdk-snackbar"},e.children));Ii.SnackbarContainer=T9e;var k9e=({autoExpand:e,message:t,menuItems:r,appSrc:n})=>{let[i,o]=(0,iS.useState)(!0),[a,c]=(0,iS.useState)(e??!1);(0,iS.useEffect)(()=>{let y=[window.setTimeout(()=>{o(!1)},1),window.setTimeout(()=>{c(!0)},1e4)];return()=>{y.forEach(window.clearTimeout)}});let v=()=>{c(!a)};return(0,Br.h)("div",{class:(0,Ab.default)("-cbwsdk-snackbar-instance",i&&"-cbwsdk-snackbar-instance-hidden",a&&"-cbwsdk-snackbar-instance-expanded")},(0,Br.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:v},(0,Br.h)("img",{src:C9e(n),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,Br.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,Br.h)("div",{class:"-gear-container"},!a&&(0,Br.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Br.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,Br.h)("img",{src:I9e,class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,Br.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((y,w)=>(0,Br.h)("div",{class:(0,Ab.default)("-cbwsdk-snackbar-instance-menu-item",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:y.onClick,key:w},(0,Br.h)("svg",{width:y.svgWidth,height:y.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Br.h)("path",{"fill-rule":y.defaultFillRule,"clip-rule":y.defaultClipRule,d:y.path,fill:"#AAAAAA"})),(0,Br.h)("span",{class:(0,Ab.default)("-cbwsdk-snackbar-instance-menu-item-info",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},y.info)))))};Ii.SnackbarInstance=k9e});var h$=E(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});sS.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'});var d$=E(Yc=>{"use strict";var P9e=Yc&&Yc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.injectCssReset=void 0;var N9e=P9e(h$());function q9e(){let e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(N9e.default)),document.documentElement.appendChild(e)}Yc.injectCssReset=q9e});var p$=E(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});Ob.WalletSDKUI=void 0;var L9e=u$(),B9e=l$(),D9e=d$(),aS=class{constructor(t){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new B9e.Snackbar({darkMode:t.darkMode}),this.linkFlow=new L9e.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");let t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,D9e.injectCssReset)()}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(t){}watchAsset(t){}switchEthereumChain(t){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(t){}signEthereumTransaction(t){}submitEthereumTransaction(t){}ethereumAddressFromSignedMessage(t){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(t){this.appSrc=t}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(t){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}};Ob.WalletSDKUI=aS});var m$=E(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var Jc;(function(e){e.typeOfFunction="function",e.boolTrue=!0})(Jc||(Jc={}));function v$(e,t,r){if(!r||typeof r.value!==Jc.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+t+"> is not a method!");return{configurable:Jc.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,t,{value:n,configurable:Jc.boolTrue,writable:Jc.boolTrue}),n}}}Rb.bind=v$;Rb.default=v$});var g$=E(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.ClientMessagePublishEvent=Ci.ClientMessageSetSessionConfig=Ci.ClientMessageGetSessionConfig=Ci.ClientMessageIsLinked=Ci.ClientMessageHostSession=void 0;function j9e(e){return Object.assign({type:"HostSession"},e)}Ci.ClientMessageHostSession=j9e;function F9e(e){return Object.assign({type:"IsLinked"},e)}Ci.ClientMessageIsLinked=F9e;function U9e(e){return Object.assign({type:"GetSessionConfig"},e)}Ci.ClientMessageGetSessionConfig=U9e;function H9e(e){return Object.assign({type:"SetSessionConfig"},e)}Ci.ClientMessageSetSessionConfig=H9e;function W9e(e){return Object.assign({type:"PublishEvent"},e)}Ci.ClientMessagePublishEvent=W9e});var y$=E(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.RxWebSocket=Du.ConnectionState=void 0;var Qc=yu(),b$=xd(),Xc;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Xc=Du.ConnectionState||(Du.ConnectionState={}));var uS=class{constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new Qc.BehaviorSubject(Xc.DISCONNECTED),this.incomingDataSubject=new Qc.Subject,this.url=t.replace(/^http/,"ws")}connect(){return this.webSocket?(0,Qc.throwError)(new Error("webSocket object is not null")):new Qc.Observable(t=>{let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(n){t.error(n);return}this.connectionStateSubject.next(Xc.CONNECTING),r.onclose=n=>{this.clearWebSocket(),t.error(new Error(`websocket error ${n.code}: ${n.reason}`)),this.connectionStateSubject.next(Xc.DISCONNECTED)},r.onopen=n=>{t.next(),t.complete(),this.connectionStateSubject.next(Xc.CONNECTED)},r.onmessage=n=>{this.incomingDataSubject.next(n.data)}}).pipe((0,b$.take)(1))}disconnect(){let{webSocket:t}=this;if(!!t){this.clearWebSocket(),this.connectionStateSubject.next(Xc.DISCONNECTED);try{t.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,b$.flatMap)(t=>{let r;try{r=JSON.parse(t)}catch{return(0,Qc.empty)()}return(0,Qc.of)(r)}))}sendData(t){let{webSocket:r}=this;if(!r)throw new Error("websocket is not connected");r.send(t)}clearWebSocket(){let{webSocket:t}=this;!t||(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};Du.RxWebSocket=uS});var _$=E(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});Ib.isServerMessageFail=void 0;function z9e(e){return e&&e.type==="Fail"&&typeof e.id=="number"&&typeof e.sessionId=="string"&&typeof e.error=="string"}Ib.isServerMessageFail=z9e});var x$=E(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});Tb.WalletSDKConnection=void 0;var Zi=yu(),Rt=xd(),Ud=sb(),el=Id(),Hd=g$(),Wd=lg(),Cb=y$(),fS=_$(),w$=1e4,V9e=6e4,cS=class{constructor(t,r,n,i,o=WebSocket){this.sessionId=t,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new Zi.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,el.IntNumber)(1),this.connectedSubject=new Zi.BehaviorSubject(!1),this.linkedSubject=new Zi.BehaviorSubject(!1),this.sessionConfigSubject=new Zi.ReplaySubject(1);let a=new Cb.RxWebSocket(n+"/rpc",o);this.ws=a,this.subscriptions.add(a.connectionState$.pipe((0,Rt.tap)(c=>{var v;return(v=this.diagnostic)===null||v===void 0?void 0:v.log(Wd.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:Ud.Session.hash(t)})}),(0,Rt.skip)(1),(0,Rt.filter)(c=>c===Cb.ConnectionState.DISCONNECTED&&!this.destroyed),(0,Rt.delay)(5e3),(0,Rt.filter)(c=>!this.destroyed),(0,Rt.flatMap)(c=>a.connect()),(0,Rt.retry)()).subscribe()),this.subscriptions.add(a.connectionState$.pipe((0,Rt.skip)(2),(0,Rt.switchMap)(c=>(0,Zi.iif)(()=>c===Cb.ConnectionState.CONNECTED,this.authenticate().pipe((0,Rt.tap)(v=>this.sendIsLinked()),(0,Rt.tap)(v=>this.sendGetSessionConfig()),(0,Rt.map)(v=>!0)),(0,Zi.of)(!1))),(0,Rt.distinctUntilChanged)(),(0,Rt.catchError)(c=>(0,Zi.of)(!1))).subscribe(c=>this.connectedSubject.next(c))),this.subscriptions.add(a.connectionState$.pipe((0,Rt.skip)(1),(0,Rt.switchMap)(c=>(0,Zi.iif)(()=>c===Cb.ConnectionState.CONNECTED,(0,Zi.timer)(0,w$)))).subscribe(c=>c===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(a.incomingData$.pipe((0,Rt.filter)(c=>c==="h")).subscribe(c=>this.updateLastHeartbeat())),this.subscriptions.add(a.incomingJSONData$.pipe((0,Rt.filter)(c=>["IsLinkedOK","Linked"].includes(c.type))).subscribe(c=>{var v;let y=c;(v=this.diagnostic)===null||v===void 0||v.log(Wd.EVENTS.LINKED,{sessionIdHash:Ud.Session.hash(t),linked:y.linked,type:c.type,onlineGuests:y.onlineGuests}),this.linkedSubject.next(y.linked||y.onlineGuests>0)})),this.subscriptions.add(a.incomingJSONData$.pipe((0,Rt.filter)(c=>["GetSessionConfigOK","SessionConfigUpdated"].includes(c.type))).subscribe(c=>{var v;let y=c;(v=this.diagnostic)===null||v===void 0||v.log(Wd.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Ud.Session.hash(t),metadata_keys:y&&y.metadata?Object.keys(y.metadata):void 0}),this.sessionConfigSubject.next({webhookId:y.webhookId,webhookUrl:y.webhookUrl,metadata:y.metadata})}))}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Wd.EVENTS.STARTED_CONNECTING,{sessionIdHash:Ud.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var t;this.subscriptions.unsubscribe(),this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Wd.EVENTS.DISCONNECTED,{sessionIdHash:Ud.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,Rt.filter)(t=>t),(0,Rt.take)(1),(0,Rt.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Rt.filter)(t=>t),(0,Rt.take)(1),(0,Rt.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Rt.filter)(t=>{if(t.type!=="Event")return!1;let r=t;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,Rt.map)(t=>t))}setSessionMetadata(t,r){let n=(0,Hd.ClientMessageSetSessionConfig)({id:(0,el.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[t]:r}});return this.onceConnected$.pipe((0,Rt.flatMap)(i=>this.makeRequest(n)),(0,Rt.map)(i=>{if((0,fS.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(t,r,n=!1){let i=(0,Hd.ClientMessagePublishEvent)({id:(0,el.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:t,data:r,callWebhook:n});return this.onceLinked$.pipe((0,Rt.flatMap)(o=>this.makeRequest(i)),(0,Rt.map)(o=>{if((0,fS.isServerMessageFail)(o))throw new Error(o.error||"failed to publish event");return o.eventId}))}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>w$*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(t,r=V9e){let n=t.id;try{this.sendData(t)}catch(i){return(0,Zi.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,Rt.timeoutWith)(r,(0,Zi.throwError)(new Error(`request ${n} timed out`))),(0,Rt.filter)(i=>i.id===n),(0,Rt.take)(1))}authenticate(){let t=(0,Hd.ClientMessageHostSession)({id:(0,el.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe((0,Rt.map)(r=>{if((0,fS.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){let t=(0,Hd.ClientMessageIsLinked)({id:(0,el.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}sendGetSessionConfig(){let t=(0,Hd.ClientMessageGetSessionConfig)({id:(0,el.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}};Tb.WalletSDKConnection=cS});var M$=E(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});kb.WalletUIError=void 0;var ju=class extends Error{constructor(t,r){super(t),this.message=t,this.errorCode=r}};kb.WalletUIError=ju;ju.UserRejectedRequest=new ju("User rejected request");ju.SwitchEthereumChainUnsupportedChainId=new ju("Unsupported chainId",4902)});var S$=E(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.decrypt=tl.encrypt=void 0;var $9e=yu(),Pb=ns();async function K9e(e,t){if(t.length!==64)throw Error("secret must be 256 bits");let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,Pb.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(e)),a=16,c=o.slice(o.byteLength-a),v=o.slice(0,o.byteLength-a),y=new Uint8Array(c),w=new Uint8Array(v),M=new Uint8Array([...r,...y,...w]);return(0,Pb.uint8ArrayToHex)(M)}tl.encrypt=K9e;function G9e(e,t){if(t.length!==64)throw Error("secret must be 256 bits");return new $9e.Observable(r=>{(async function(){let n=await crypto.subtle.importKey("raw",(0,Pb.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=(0,Pb.hexStringToUint8Array)(e),o=i.slice(0,12),a=i.slice(12,28),c=i.slice(28),v=new Uint8Array([...c,...a]),y={name:"AES-GCM",iv:new Uint8Array(o)};try{let w=await window.crypto.subtle.decrypt(y,n,v),M=new TextDecoder;r.next(M.decode(w)),r.complete()}catch(w){r.error(w)}})()})}tl.decrypt=G9e});var lS=E(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.Web3Method=void 0;var Z9e;(function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"})(Z9e=zd.Web3Method||(zd.Web3Method={}))});var Nb=E(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.RelayMessageType=void 0;var Y9e;(function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"})(Y9e=Vd.RelayMessageType||(Vd.RelayMessageType={}))});var E$=E(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});qb.Web3RequestCanceledMessage=void 0;var J9e=Nb();function Q9e(e){return{type:J9e.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}}qb.Web3RequestCanceledMessage=Q9e});var A$=E(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});Lb.Web3RequestMessage=void 0;var X9e=Nb();function e7e(e){return Object.assign({type:X9e.RelayMessageType.WEB3_REQUEST},e)}Lb.Web3RequestMessage=e7e});var O$=E(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.EthereumAddressFromSignedMessageResponse=yr.SubmitEthereumTransactionResponse=yr.SignEthereumTransactionResponse=yr.SignEthereumMessageResponse=yr.isRequestEthereumAccountsResponse=yr.SelectProviderResponse=yr.WatchAssetReponse=yr.RequestEthereumAccountsResponse=yr.SwitchEthereumChainResponse=yr.AddEthereumChainResponse=yr.ErrorResponse=void 0;var Io=lS();function t7e(e,t,r){return{method:e,errorMessage:t,errorCode:r}}yr.ErrorResponse=t7e;function r7e(e){return{method:Io.Web3Method.addEthereumChain,result:e}}yr.AddEthereumChainResponse=r7e;function n7e(e){return{method:Io.Web3Method.switchEthereumChain,result:e}}yr.SwitchEthereumChainResponse=n7e;function i7e(e){return{method:Io.Web3Method.requestEthereumAccounts,result:e}}yr.RequestEthereumAccountsResponse=i7e;function o7e(e){return{method:Io.Web3Method.watchAsset,result:e}}yr.WatchAssetReponse=o7e;function s7e(e){return{method:Io.Web3Method.selectProvider,result:e}}yr.SelectProviderResponse=s7e;function a7e(e){return e&&e.method===Io.Web3Method.requestEthereumAccounts}yr.isRequestEthereumAccountsResponse=a7e;function u7e(e){return{method:Io.Web3Method.signEthereumMessage,result:e}}yr.SignEthereumMessageResponse=u7e;function f7e(e){return{method:Io.Web3Method.signEthereumTransaction,result:e}}yr.SignEthereumTransactionResponse=f7e;function c7e(e){return{method:Io.Web3Method.submitEthereumTransaction,result:e}}yr.SubmitEthereumTransactionResponse=c7e;function l7e(e){return{method:Io.Web3Method.ethereumAddressFromSignedMessage,result:e}}yr.EthereumAddressFromSignedMessageResponse=l7e});var I$=E(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.isWeb3ResponseMessage=rl.Web3ResponseMessage=void 0;var R$=Nb();function h7e(e){return Object.assign({type:R$.RelayMessageType.WEB3_RESPONSE},e)}rl.Web3ResponseMessage=h7e;function d7e(e){return e&&e.type===R$.RelayMessageType.WEB3_RESPONSE}rl.isWeb3ResponseMessage=d7e});var P$=E(Jn=>{"use strict";var p7e=Jn&&Jn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),v7e=Jn&&Jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),T$=Jn&&Jn.__decorate||function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},m7e=Jn&&Jn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&p7e(t,e,r);return v7e(t,e),t},g7e=Jn&&Jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WalletSDKRelay=void 0;var k$=g7e(m$()),C$=fg(),$d=yu(),Ur=xd(),An=lg(),b7e=x$(),hS=M$(),y7e=Id(),_r=ns(),ia=m7e(S$()),oa=sb(),Bb=S5(),Jr=lS(),_7e=E$(),w7e=A$(),oi=O$(),Dn=I$(),si=class extends Bb.WalletSDKRelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new $d.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new $d.Subscription,this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;let{session:n,ui:i,connection:o}=this.subscribe();if(this._session=n,this.connection=o,this.relayEventManager=t.relayEventManager,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this.diagnostic={log:t.eventListener.onEvent}:this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));let t=oa.Session.load(this.storage)||new oa.Session(this.storage).save(),r=new b7e.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,Ur.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,Ur.skip)(1),(0,Ur.tap)(i=>{var o;this.isLinked=i;let a=this.storage.getItem(Bb.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,a){let c=a.split(" "),v=this.storage.getItem("IsStandaloneSigning")==="true";if(c[0]!==""&&!i&&this.session.linked&&!v){this.isUnlinkedErrorState=!0;let y=this.getSessionIdHash();(o=this.diagnostic)===null||o===void 0||o.log(An.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:y})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;let o=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:o,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.WalletUsername,t.secret))).subscribe({next:i=>{this.storage.setItem(Bb.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.AppVersion,t.secret))).subscribe({next:i=>{this.storage.setItem(Bb.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,Ur.mergeMap)(i=>(0,$d.zip)(ia.decrypt(i.metadata.ChainId,t.secret),ia.decrypt(i.metadata.JsonRpcUrl,t.secret)))).pipe((0,Ur.distinctUntilChanged)()).subscribe({next:([i,o])=>{this.chainCallback&&this.chainCallback(i,o)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.EthereumAddress,t.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),si.accountRequestCallbackIds.size>0&&(Array.from(si.accountRequestCallbackIds.values()).forEach(o=>{let a=(0,Dn.Web3ResponseMessage)({id:o,response:(0,oi.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},a),{id:o}))}),si.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ur.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,Ur.mergeMap)(i=>ia.decrypt(i.metadata.AppSrc,t.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));let n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:t,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Ur.timeout)(1e3),(0,Ur.catchError)(t=>(0,$d.of)(null))).subscribe(t=>{var r,n,i;let o=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(An.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(An.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();let a=oa.Session.load(this.storage);if(a?.id===this._session.id?this.storage.clear():a&&((i=this.diagnostic)===null||i===void 0||i.log(An.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:oa.Session.hash(a.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);let{session:c,ui:v,connection:y}=this.subscribe();this._session=c,this.connection=y,this.ui=v,o&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(An.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:Jr.Web3Method.signEthereumMessage,params:{message:(0,_r.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:Jr.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,_r.hexStringFromBuffer)(t,!0),signature:(0,_r.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:Jr.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,_r.bigIntStringFromBN)(t.weiValue),data:(0,_r.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,_r.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,_r.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,_r.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,_r.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:Jr.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,_r.bigIntStringFromBN)(t.weiValue),data:(0,_r.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,_r.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,_r.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,_r.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,_r.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:Jr.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,_r.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:Jr.Web3Method.scanQRCode,params:{regExp:t}})}getQRCodeUrl(){return(0,_r.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:Jr.Web3Method.generic,params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null,n=(0,_r.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r?.()};return{promise:new Promise((a,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,v=>{if(r?.(),v.errorMessage)return c(new Error(v.errorMessage));a(v)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChainSubject.next(t)}publishWeb3RequestEvent(t,r){var n;let i=(0,w7e.Web3RequestMessage)({id:t,request:r}),o=oa.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(An.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?oa.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(An.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?oa.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()})},error:a=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:a.message}}))}}))}publishWeb3RequestCanceledEvent(t){let r=(0,_7e.Web3RequestCanceledMessage)(t);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(t,r,n){let i=this.session.secret;return new $d.Observable(o=>{ia.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(a=>{o.next(a),o.complete()})}).pipe((0,Ur.mergeMap)(o=>this.connection.publishEvent(t,o,n)))}handleIncomingEvent(t){try{this.subscriptions.add(ia.decrypt(t.data,this.session.secret).pipe((0,Ur.map)(r=>JSON.parse(r))).subscribe({next:r=>{let n=(0,Dn.isWeb3ResponseMessage)(r)?r:null;!n||this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(An.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(t){var r;let{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(An.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,oi.isRequestEthereumAccountsResponse)(n)){si.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),si.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:t,response:(0,oi.ErrorResponse)(r,(n??hS.WalletUIError.UserRejectedRequest).message,i)}))}invokeCallback(t){let r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){let t={method:Jr.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=null,n=(0,_r.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r?.()};return{promise:new Promise((a,c)=>{var v;this.relayEventManager.callbacks.set(n,w=>{if(this.ui.hideRequestEthereumAccounts(),r?.(),w.errorMessage)return c(new Error(w.errorMessage));a(w)});let y=((v=window?.navigator)===null||v===void 0?void 0:v.userAgent)||null;if(y&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(y)){let w;try{(0,_r.isInIFrame)()&&window.top?w=window.top.location:w=window.location}catch{w=window.location}w.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(w.href)}`;return}if(this.ui.inlineAccountsResponse()){let w=M=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:n,response:(0,oi.RequestEthereumAccountsResponse)(M)}))};this.ui.requestEthereumAccounts({onCancel:i,onAccounts:w})}else{let w=C$.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>i(w)})}si.accountRequestCallbackIds.add(n),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(n,t)}),cancel:i}}selectProvider(t){let r={method:Jr.Web3Method.selectProvider,params:{providerOptions:t}},n=(0,_r.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},o=new Promise((a,c)=>{this.relayEventManager.callbacks.set(n,w=>{if(w.errorMessage)return c(new Error(w.errorMessage));a(w)});let v=w=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:n,response:(0,oi.SelectProviderResponse)(y7e.ProviderType.Unselected)}))},y=w=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:n,response:(0,oi.SelectProviderResponse)(w)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:y,onCancel:v,providerOptions:t})});return{cancel:i,promise:o}}watchAsset(t,r,n,i,o,a){let c={method:Jr.Web3Method.watchAsset,params:{type:t,options:{address:r,symbol:n,decimals:i,image:o},chainId:a}},v=null,y=(0,_r.randomBytesHex)(8),w=S=>{this.publishWeb3RequestCanceledEvent(y),this.handleErrorResponse(y,c.method,S),v?.()};this.ui.inlineWatchAsset()||(v=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:w,onResetConnection:this.resetAndReload}));let M=new Promise((S,R)=>{this.relayEventManager.callbacks.set(y,N=>{if(v?.(),N.errorMessage)return R(new Error(N.errorMessage));S(N)});let C=N=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:y,response:(0,oi.WatchAssetReponse)(!1)}))},B=()=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:y,response:(0,oi.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:B,onCancel:C,type:t,address:r,symbol:n,decimals:i,image:o,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(y,c)});return{cancel:w,promise:M}}addEthereumChain(t,r,n,i,o,a){let c={method:Jr.Web3Method.addEthereumChain,params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:o,iconUrls:n,nativeCurrency:a}},v=null,y=(0,_r.randomBytesHex)(8),w=S=>{this.publishWeb3RequestCanceledEvent(y),this.handleErrorResponse(y,c.method,S),v?.()};return this.ui.inlineAddEthereumChain(t)||(v=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:w,onResetConnection:this.resetAndReload})),{promise:new Promise((S,R)=>{this.relayEventManager.callbacks.set(y,N=>{if(v?.(),N.errorMessage)return R(new Error(N.errorMessage));S(N)});let C=N=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:y,response:(0,oi.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},B=N=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:y,response:(0,oi.AddEthereumChainResponse)({isApproved:!0,rpcUrl:N})}))};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:C,onApprove:B,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(y,c)}),cancel:w}}switchEthereumChain(t,r){let n={method:Jr.Web3Method.switchEthereumChain,params:Object.assign({chainId:t},{address:r})},i=(0,_r.randomBytesHex)(8),o=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,v)=>{this.relayEventManager.callbacks.set(i,M=>{if(M.errorMessage&&M.errorCode)return v(C$.ethErrors.provider.custom({code:M.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(M.errorMessage)return v(new Error(M.errorMessage));c(M)});let y=M=>{if(typeof M=="number"){let S=M;this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:i,response:(0,oi.ErrorResponse)(Jr.Web3Method.switchEthereumChain,hS.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,S)}))}else M instanceof hS.WalletUIError?this.handleErrorResponse(i,Jr.Web3Method.switchEthereumChain,M,M.errorCode):this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:i,response:(0,oi.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},w=M=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:i,response:(0,oi.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:M})}))};this.ui.switchEthereumChain({onCancel:y,onApprove:w,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:o}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return oa.Session.hash(this._session.id)}sendRequestStandalone(t,r){let n=o=>{this.handleErrorResponse(t,r.method,o)},i=o=>{this.handleWeb3ResponseMessage((0,Dn.Web3ResponseMessage)({id:t,response:o}))};switch(r.method){case Jr.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case Jr.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Jr.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Jr.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(t){}};si.accountRequestCallbackIds=new Set;T$([k$.default],si.prototype,"resetAndReload",null);T$([k$.default],si.prototype,"handleIncomingEvent",null);Jn.WalletSDKRelay=si});var N$=E(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});Db.WalletSDKRelayEventManager=void 0;var x7e=ns(),dS=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let t=this._nextRequestId,r=(0,x7e.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}};Db.WalletSDKRelayEventManager=dS});var q$=E((RUe,M7e)=>{M7e.exports={name:"@coinbase/wallet-sdk",version:"3.6.3",description:"Coinbase Wallet JavaScript SDK",keywords:["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],main:"dist/index.js",types:"dist/index.d.ts",repository:"https://github.com/coinbase/coinbase-wallet-sdk.git",author:"Coinbase, Inc.",license:"Apache-2.0",scripts:{"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},dependencies:{"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"4.4.3","eth-json-rpc-filters":"4.2.2","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},devDependencies:{"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.3.15","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.72.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},engines:{node:">= 10.0.0"}}});var pS=E(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});jb.CoinbaseWalletSDK=void 0;var S7e=ID(),E7e=CD(),A7e=lb(),O7e=p$(),R7e=P$(),I7e=N$(),C7e=ns(),T7e=process.env.LINK_API_URL||"https://www.walletlink.org",L$=process.env.SDK_VERSION||q$().version||"unknown",nl=class{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;let o=t.linkAPIUrl||T7e,a;if(t.uiConstructor?a=t.uiConstructor:a=y=>new O7e.WalletSDKUI(y),typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;let c=new URL(o),v=`${c.protocol}//${c.host}`;this._storage=new E7e.ScopedLocalStorage(`-walletlink:${v}`),this._storage.setItem("version",nl.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new I7e.WalletSDKRelayEventManager,this._relay=new R7e.WalletSDKRelay({linkAPIUrl:o,version:L$,darkMode:!!t.darkMode,uiConstructor:a,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger}),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI())}makeWeb3Provider(t="",r=1){let n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;let i=this.coinbaseBrowser;if(i)return i;let o=this._relay;if(!o||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||o.setConnectDisabled(!0),new A7e.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(o),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,C7e.getFavicon)();let i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;let r=this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,S7e.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{let n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}};jb.CoinbaseWalletSDK=nl;nl.VERSION=L$});var D$=E(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.CoinbaseWalletProvider=Fu.CoinbaseWalletSDK=void 0;var vS=pS(),B$=lb(),k7e=pS();Object.defineProperty(Fu,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return k7e.CoinbaseWalletSDK}});var P7e=lb();Object.defineProperty(Fu,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return P7e.CoinbaseWalletProvider}});Fu.default=vS.CoinbaseWalletSDK;typeof window<"u"&&(window.CoinbaseWalletSDK=vS.CoinbaseWalletSDK,window.CoinbaseWalletProvider=B$.CoinbaseWalletProvider,window.WalletLink=vS.CoinbaseWalletSDK,window.WalletLinkProvider=B$.CoinbaseWalletProvider)});var wK=E((_K,ES)=>{(function(e){if(typeof _K=="object"&&typeof ES<"u")ES.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof globalThis<"u"?t=globalThis:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(i,o,a){function c(w,M){if(!o[w]){if(!i[w]){var S=typeof dl=="function"&&dl;if(!M&&S)return S(w,!0);if(v)return v(w,!0);var R=new Error("Cannot find module '"+w+"'");throw R.code="MODULE_NOT_FOUND",R}var C=o[w]={exports:{}};i[w][0].call(C.exports,function(B){var N=i[w][1][B];return c(N||B)},C,C.exports,n,i,o,a)}return o[w].exports}for(var v=typeof dl=="function"&&dl,y=0;y<a.length;y++)c(a[y]);return c}({1:[function(n,i,o){(function(a){"use strict";var c=a.MutationObserver||a.WebKitMutationObserver,v;if(c){var y=0,w=new c(B),M=a.document.createTextNode("");w.observe(M,{characterData:!0}),v=function(){M.data=y=++y%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var S=new a.MessageChannel;S.port1.onmessage=B,v=function(){S.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?v=function(){var q=a.document.createElement("script");q.onreadystatechange=function(){B(),q.onreadystatechange=null,q.parentNode.removeChild(q),q=null},a.document.documentElement.appendChild(q)}:v=function(){setTimeout(B,0)};var R,C=[];function B(){R=!0;for(var q,H,D=C.length;D;){for(H=C,C=[],q=-1;++q<D;)H[q]();D=C.length}R=!1}i.exports=N;function N(q){C.push(q)===1&&!R&&v()}}).call(this,typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function c(){}var v={},y=["REJECTED"],w=["FULFILLED"],M=["PENDING"];i.exports=S;function S(Z){if(typeof Z!="function")throw new TypeError("resolver must be a function");this.state=M,this.queue=[],this.outcome=void 0,Z!==c&&N(this,Z)}S.prototype.catch=function(Z){return this.then(null,Z)},S.prototype.then=function(Z,X){if(typeof Z!="function"&&this.state===w||typeof X!="function"&&this.state===y)return this;var V=new this.constructor(c);if(this.state!==M){var k=this.state===w?Z:X;C(V,k,this.outcome)}else this.queue.push(new R(V,Z,X));return V};function R(Z,X,V){this.promise=Z,typeof X=="function"&&(this.onFulfilled=X,this.callFulfilled=this.otherCallFulfilled),typeof V=="function"&&(this.onRejected=V,this.callRejected=this.otherCallRejected)}R.prototype.callFulfilled=function(Z){v.resolve(this.promise,Z)},R.prototype.otherCallFulfilled=function(Z){C(this.promise,this.onFulfilled,Z)},R.prototype.callRejected=function(Z){v.reject(this.promise,Z)},R.prototype.otherCallRejected=function(Z){C(this.promise,this.onRejected,Z)};function C(Z,X,V){a(function(){var k;try{k=X(V)}catch(m){return v.reject(Z,m)}k===Z?v.reject(Z,new TypeError("Cannot resolve promise with itself")):v.resolve(Z,k)})}v.resolve=function(Z,X){var V=q(B,X);if(V.status==="error")return v.reject(Z,V.value);var k=V.value;if(k)N(Z,k);else{Z.state=w,Z.outcome=X;for(var m=-1,s=Z.queue.length;++m<s;)Z.queue[m].callFulfilled(X)}return Z},v.reject=function(Z,X){Z.state=y,Z.outcome=X;for(var V=-1,k=Z.queue.length;++V<k;)Z.queue[V].callRejected(X);return Z};function B(Z){var X=Z&&Z.then;if(Z&&(typeof Z=="object"||typeof Z=="function")&&typeof X=="function")return function(){X.apply(Z,arguments)}}function N(Z,X){var V=!1;function k(d){V||(V=!0,v.reject(Z,d))}function m(d){V||(V=!0,v.resolve(Z,d))}function s(){X(m,k)}var l=q(s);l.status==="error"&&k(l.value)}function q(Z,X){var V={};try{V.value=Z(X),V.status="success"}catch(k){V.status="error",V.value=k}return V}S.resolve=H;function H(Z){return Z instanceof this?Z:v.resolve(new this(c),Z)}S.reject=D;function D(Z){var X=new this(c);return v.reject(X,Z)}S.all=ee;function ee(Z){var X=this;if(Object.prototype.toString.call(Z)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=Z.length,k=!1;if(!V)return this.resolve([]);for(var m=new Array(V),s=0,l=-1,d=new this(c);++l<V;)f(Z[l],l);return d;function f(p,g){X.resolve(p).then(b,function(h){k||(k=!0,v.reject(d,h))});function b(h){m[g]=h,++s===V&&!k&&(k=!0,v.resolve(d,m))}}}S.race=ge;function ge(Z){var X=this;if(Object.prototype.toString.call(Z)!=="[object Array]")return this.reject(new TypeError("must be an array"));var V=Z.length,k=!1;if(!V)return this.resolve([]);for(var m=-1,s=new this(c);++m<V;)l(Z[m]);return s;function l(d){X.resolve(d).then(function(f){k||(k=!0,v.resolve(s,f))},function(f){k||(k=!0,v.reject(s,f))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T};function c(T,U){if(!(T instanceof U))throw new TypeError("Cannot call a class as a function")}function v(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var y=v();function w(){try{if(!y||!y.open)return!1;var T=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),U=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!T||U)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function M(T,U){T=T||[],U=U||{};try{return new Blob(T,U)}catch(z){if(z.name!=="TypeError")throw z;for(var P=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,$=new P,G=0;G<T.length;G+=1)$.append(T[G]);return $.getBlob(U.type)}}typeof Promise>"u"&&n(3);var S=Promise;function R(T,U){U&&T.then(function(P){U(null,P)},function(P){U(P)})}function C(T,U,P){typeof U=="function"&&T.then(U),typeof P=="function"&&T.catch(P)}function B(T){return typeof T!="string"&&(console.warn(T+" used as a key, but it is not a string."),T=String(T)),T}function N(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var q="local-forage-detect-blob-support",H=void 0,D={},ee=Object.prototype.toString,ge="readonly",Z="readwrite";function X(T){for(var U=T.length,P=new ArrayBuffer(U),$=new Uint8Array(P),G=0;G<U;G++)$[G]=T.charCodeAt(G);return P}function V(T){return new S(function(U){var P=T.transaction(q,Z),$=M([""]);P.objectStore(q).put($,"key"),P.onabort=function(G){G.preventDefault(),G.stopPropagation(),U(!1)},P.oncomplete=function(){var G=navigator.userAgent.match(/Chrome\/(\d+)/),z=navigator.userAgent.match(/Edge\//);U(z||!G||parseInt(G[1],10)>=43)}}).catch(function(){return!1})}function k(T){return typeof H=="boolean"?S.resolve(H):V(T).then(function(U){return H=U,H})}function m(T){var U=D[T.name],P={};P.promise=new S(function($,G){P.resolve=$,P.reject=G}),U.deferredOperations.push(P),U.dbReady?U.dbReady=U.dbReady.then(function(){return P.promise}):U.dbReady=P.promise}function s(T){var U=D[T.name],P=U.deferredOperations.pop();if(P)return P.resolve(),P.promise}function l(T,U){var P=D[T.name],$=P.deferredOperations.pop();if($)return $.reject(U),$.promise}function d(T,U){return new S(function(P,$){if(D[T.name]=D[T.name]||I(),T.db)if(U)m(T),T.db.close();else return P(T.db);var G=[T.name];U&&G.push(T.version);var z=y.open.apply(y,G);U&&(z.onupgradeneeded=function(fe){var Oe=z.result;try{Oe.createObjectStore(T.storeName),fe.oldVersion<=1&&Oe.createObjectStore(q)}catch(je){if(je.name==="ConstraintError")console.warn('The database "'+T.name+'" has been upgraded from version '+fe.oldVersion+" to version "+fe.newVersion+', but the storage "'+T.storeName+'" already exists.');else throw je}}),z.onerror=function(fe){fe.preventDefault(),$(z.error)},z.onsuccess=function(){var fe=z.result;fe.onversionchange=function(Oe){Oe.target.close()},P(fe),s(T)}})}function f(T){return d(T,!1)}function p(T){return d(T,!0)}function g(T,U){if(!T.db)return!0;var P=!T.db.objectStoreNames.contains(T.storeName),$=T.version<T.db.version,G=T.version>T.db.version;if($&&(T.version!==U&&console.warn('The database "'+T.name+`" can't be downgraded from version `+T.db.version+" to version "+T.version+"."),T.version=T.db.version),G||P){if(P){var z=T.db.version+1;z>T.version&&(T.version=z)}return!0}return!1}function b(T){return new S(function(U,P){var $=new FileReader;$.onerror=P,$.onloadend=function(G){var z=btoa(G.target.result||"");U({__local_forage_encoded_blob:!0,data:z,type:T.type})},$.readAsBinaryString(T)})}function h(T){var U=X(atob(T.data));return M([U],{type:T.type})}function u(T){return T&&T.__local_forage_encoded_blob}function _(T){var U=this,P=U._initReady().then(function(){var $=D[U._dbInfo.name];if($&&$.dbReady)return $.dbReady});return C(P,T,T),P}function A(T){m(T);for(var U=D[T.name],P=U.forages,$=0;$<P.length;$++){var G=P[$];G._dbInfo.db&&(G._dbInfo.db.close(),G._dbInfo.db=null)}return T.db=null,f(T).then(function(z){return T.db=z,g(T)?p(T):z}).then(function(z){T.db=U.db=z;for(var fe=0;fe<P.length;fe++)P[fe]._dbInfo.db=z}).catch(function(z){throw l(T,z),z})}function x(T,U,P,$){$===void 0&&($=1);try{var G=T.db.transaction(T.storeName,U);P(null,G)}catch(z){if($>0&&(!T.db||z.name==="InvalidStateError"||z.name==="NotFoundError"))return S.resolve().then(function(){if(!T.db||z.name==="NotFoundError"&&!T.db.objectStoreNames.contains(T.storeName)&&T.version<=T.db.version)return T.db&&(T.version=T.db.version+1),p(T)}).then(function(){return A(T).then(function(){x(T,U,P,$-1)})}).catch(P);P(z)}}function I(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function j(T){var U=this,P={db:null};if(T)for(var $ in T)P[$]=T[$];var G=D[P.name];G||(G=I(),D[P.name]=G),G.forages.push(U),U._initReady||(U._initReady=U.ready,U.ready=_);var z=[];function fe(){return S.resolve()}for(var Oe=0;Oe<G.forages.length;Oe++){var je=G.forages[Oe];je!==U&&z.push(je._initReady().catch(fe))}var Fe=G.forages.slice(0);return S.all(z).then(function(){return P.db=G.db,f(P)}).then(function(Ue){return P.db=Ue,g(P,U._defaultConfig.version)?p(P):Ue}).then(function(Ue){P.db=G.db=Ue,U._dbInfo=P;for(var ze=0;ze<Fe.length;ze++){var yt=Fe[ze];yt!==U&&(yt._dbInfo.db=P.db,yt._dbInfo.version=P.version)}})}function O(T,U){var P=this;T=B(T);var $=new S(function(G,z){P.ready().then(function(){x(P._dbInfo,ge,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=je.get(T);Fe.onsuccess=function(){var Ue=Fe.result;Ue===void 0&&(Ue=null),u(Ue)&&(Ue=h(Ue)),G(Ue)},Fe.onerror=function(){z(Fe.error)}}catch(Ue){z(Ue)}})}).catch(z)});return R($,U),$}function L(T,U){var P=this,$=new S(function(G,z){P.ready().then(function(){x(P._dbInfo,ge,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=je.openCursor(),Ue=1;Fe.onsuccess=function(){var ze=Fe.result;if(ze){var yt=ze.value;u(yt)&&(yt=h(yt));var Ht=T(yt,ze.key,Ue++);Ht!==void 0?G(Ht):ze.continue()}else G()},Fe.onerror=function(){z(Fe.error)}}catch(ze){z(ze)}})}).catch(z)});return R($,U),$}function W(T,U,P){var $=this;T=B(T);var G=new S(function(z,fe){var Oe;$.ready().then(function(){return Oe=$._dbInfo,ee.call(U)==="[object Blob]"?k(Oe.db).then(function(je){return je?U:b(U)}):U}).then(function(je){x($._dbInfo,Z,function(Fe,Ue){if(Fe)return fe(Fe);try{var ze=Ue.objectStore($._dbInfo.storeName);je===null&&(je=void 0);var yt=ze.put(je,T);Ue.oncomplete=function(){je===void 0&&(je=null),z(je)},Ue.onabort=Ue.onerror=function(){var Ht=yt.error?yt.error:yt.transaction.error;fe(Ht)}}catch(Ht){fe(Ht)}})}).catch(fe)});return R(G,P),G}function F(T,U){var P=this;T=B(T);var $=new S(function(G,z){P.ready().then(function(){x(P._dbInfo,Z,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=je.delete(T);Oe.oncomplete=function(){G()},Oe.onerror=function(){z(Fe.error)},Oe.onabort=function(){var Ue=Fe.error?Fe.error:Fe.transaction.error;z(Ue)}}catch(Ue){z(Ue)}})}).catch(z)});return R($,U),$}function K(T){var U=this,P=new S(function($,G){U.ready().then(function(){x(U._dbInfo,Z,function(z,fe){if(z)return G(z);try{var Oe=fe.objectStore(U._dbInfo.storeName),je=Oe.clear();fe.oncomplete=function(){$()},fe.onabort=fe.onerror=function(){var Fe=je.error?je.error:je.transaction.error;G(Fe)}}catch(Fe){G(Fe)}})}).catch(G)});return R(P,T),P}function De(T){var U=this,P=new S(function($,G){U.ready().then(function(){x(U._dbInfo,ge,function(z,fe){if(z)return G(z);try{var Oe=fe.objectStore(U._dbInfo.storeName),je=Oe.count();je.onsuccess=function(){$(je.result)},je.onerror=function(){G(je.error)}}catch(Fe){G(Fe)}})}).catch(G)});return R(P,T),P}function Y(T,U){var P=this,$=new S(function(G,z){if(T<0){G(null);return}P.ready().then(function(){x(P._dbInfo,ge,function(fe,Oe){if(fe)return z(fe);try{var je=Oe.objectStore(P._dbInfo.storeName),Fe=!1,Ue=je.openKeyCursor();Ue.onsuccess=function(){var ze=Ue.result;if(!ze){G(null);return}T===0||Fe?G(ze.key):(Fe=!0,ze.advance(T))},Ue.onerror=function(){z(Ue.error)}}catch(ze){z(ze)}})}).catch(z)});return R($,U),$}function Q(T){var U=this,P=new S(function($,G){U.ready().then(function(){x(U._dbInfo,ge,function(z,fe){if(z)return G(z);try{var Oe=fe.objectStore(U._dbInfo.storeName),je=Oe.openKeyCursor(),Fe=[];je.onsuccess=function(){var Ue=je.result;if(!Ue){$(Fe);return}Fe.push(Ue.key),Ue.continue()},je.onerror=function(){G(je.error)}}catch(Ue){G(Ue)}})}).catch(G)});return R(P,T),P}function Ve(T,U){U=N.apply(this,arguments);var P=this.config();T=typeof T!="function"&&T||{},T.name||(T.name=T.name||P.name,T.storeName=T.storeName||P.storeName);var $=this,G;if(!T.name)G=S.reject("Invalid arguments");else{var z=T.name===P.name&&$._dbInfo.db,fe=z?S.resolve($._dbInfo.db):f(T).then(function(Oe){var je=D[T.name],Fe=je.forages;je.db=Oe;for(var Ue=0;Ue<Fe.length;Ue++)Fe[Ue]._dbInfo.db=Oe;return Oe});T.storeName?G=fe.then(function(Oe){if(!!Oe.objectStoreNames.contains(T.storeName)){var je=Oe.version+1;m(T);var Fe=D[T.name],Ue=Fe.forages;Oe.close();for(var ze=0;ze<Ue.length;ze++){var yt=Ue[ze];yt._dbInfo.db=null,yt._dbInfo.version=je}var Ht=new S(function(Gt,Pr){var Ir=y.open(T.name,je);Ir.onerror=function(ai){var ll=Ir.result;ll.close(),Pr(ai)},Ir.onupgradeneeded=function(){var ai=Ir.result;ai.deleteObjectStore(T.storeName)},Ir.onsuccess=function(){var ai=Ir.result;ai.close(),Gt(ai)}});return Ht.then(function(Gt){Fe.db=Gt;for(var Pr=0;Pr<Ue.length;Pr++){var Ir=Ue[Pr];Ir._dbInfo.db=Gt,s(Ir._dbInfo)}}).catch(function(Gt){throw(l(T,Gt)||S.resolve()).catch(function(){}),Gt})}}):G=fe.then(function(Oe){m(T);var je=D[T.name],Fe=je.forages;Oe.close();for(var Ue=0;Ue<Fe.length;Ue++){var ze=Fe[Ue];ze._dbInfo.db=null}var yt=new S(function(Ht,Gt){var Pr=y.deleteDatabase(T.name);Pr.onerror=function(){var Ir=Pr.result;Ir&&Ir.close(),Gt(Pr.error)},Pr.onblocked=function(){console.warn('dropInstance blocked for database "'+T.name+'" until all open connections are closed')},Pr.onsuccess=function(){var Ir=Pr.result;Ir&&Ir.close(),Ht(Ir)}});return yt.then(function(Ht){je.db=Ht;for(var Gt=0;Gt<Fe.length;Gt++){var Pr=Fe[Gt];s(Pr._dbInfo)}}).catch(function(Ht){throw(l(T,Ht)||S.resolve()).catch(function(){}),Ht})})}return R(G,U),G}var J={_driver:"asyncStorage",_initStorage:j,_support:w(),iterate:L,getItem:O,setItem:W,removeItem:F,clear:K,length:De,key:Y,keys:Q,dropInstance:Ve};function be(){return typeof openDatabase=="function"}var Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ye="~~local_forage_type~",Re=/^~~local_forage_type~([^~]+)~/,et="__lfsc__:",oe=et.length,xe="arbf",it="blob",ce="si08",Ie="ui08",ft="uic8",le="si16",Ce="si32",ot="ur16",se="ui32",Me="fl32",st="fl64",ae=oe+xe.length,Se=Object.prototype.toString;function at(T){var U=T.length*.75,P=T.length,$,G=0,z,fe,Oe,je;T[T.length-1]==="="&&(U--,T[T.length-2]==="="&&U--);var Fe=new ArrayBuffer(U),Ue=new Uint8Array(Fe);for($=0;$<P;$+=4)z=Ke.indexOf(T[$]),fe=Ke.indexOf(T[$+1]),Oe=Ke.indexOf(T[$+2]),je=Ke.indexOf(T[$+3]),Ue[G++]=z<<2|fe>>4,Ue[G++]=(fe&15)<<4|Oe>>2,Ue[G++]=(Oe&3)<<6|je&63;return Fe}function re(T){var U=new Uint8Array(T),P="",$;for($=0;$<U.length;$+=3)P+=Ke[U[$]>>2],P+=Ke[(U[$]&3)<<4|U[$+1]>>4],P+=Ke[(U[$+1]&15)<<2|U[$+2]>>6],P+=Ke[U[$+2]&63];return U.length%3===2?P=P.substring(0,P.length-1)+"=":U.length%3===1&&(P=P.substring(0,P.length-2)+"=="),P}function Te(T,U){var P="";if(T&&(P=Se.call(T)),T&&(P==="[object ArrayBuffer]"||T.buffer&&Se.call(T.buffer)==="[object ArrayBuffer]")){var $,G=et;T instanceof ArrayBuffer?($=T,G+=xe):($=T.buffer,P==="[object Int8Array]"?G+=ce:P==="[object Uint8Array]"?G+=Ie:P==="[object Uint8ClampedArray]"?G+=ft:P==="[object Int16Array]"?G+=le:P==="[object Uint16Array]"?G+=ot:P==="[object Int32Array]"?G+=Ce:P==="[object Uint32Array]"?G+=se:P==="[object Float32Array]"?G+=Me:P==="[object Float64Array]"?G+=st:U(new Error("Failed to get type for BinaryArray"))),U(G+re($))}else if(P==="[object Blob]"){var z=new FileReader;z.onload=function(){var fe=ye+T.type+"~"+re(this.result);U(et+it+fe)},z.readAsArrayBuffer(T)}else try{U(JSON.stringify(T))}catch(fe){console.error("Couldn't convert value into a JSON string: ",T),U(null,fe)}}function ct(T){if(T.substring(0,oe)!==et)return JSON.parse(T);var U=T.substring(ae),P=T.substring(oe,ae),$;if(P===it&&Re.test(U)){var G=U.match(Re);$=G[1],U=U.substring(G[0].length)}var z=at(U);switch(P){case xe:return z;case it:return M([z],{type:$});case ce:return new Int8Array(z);case Ie:return new Uint8Array(z);case ft:return new Uint8ClampedArray(z);case le:return new Int16Array(z);case ot:return new Uint16Array(z);case Ce:return new Int32Array(z);case se:return new Uint32Array(z);case Me:return new Float32Array(z);case st:return new Float64Array(z);default:throw new Error("Unkown type: "+P)}}var ne={serialize:Te,deserialize:ct,stringToBuffer:at,bufferToString:re};function Ee(T,U,P,$){T.executeSql("CREATE TABLE IF NOT EXISTS "+U.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],P,$)}function lt(T){var U=this,P={db:null};if(T)for(var $ in T)P[$]=typeof T[$]!="string"?T[$].toString():T[$];var G=new S(function(z,fe){try{P.db=openDatabase(P.name,String(P.version),P.description,P.size)}catch(Oe){return fe(Oe)}P.db.transaction(function(Oe){Ee(Oe,P,function(){U._dbInfo=P,z()},function(je,Fe){fe(Fe)})},fe)});return P.serializer=ne,G}function te(T,U,P,$,G,z){T.executeSql(P,$,G,function(fe,Oe){Oe.code===Oe.SYNTAX_ERR?fe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[U.storeName],function(je,Fe){Fe.rows.length?z(je,Oe):Ee(je,U,function(){je.executeSql(P,$,G,z)},z)},z):z(fe,Oe)},z)}function ke(T,U){var P=this;T=B(T);var $=new S(function(G,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"SELECT * FROM "+fe.storeName+" WHERE key = ? LIMIT 1",[T],function(je,Fe){var Ue=Fe.rows.length?Fe.rows.item(0).value:null;Ue&&(Ue=fe.serializer.deserialize(Ue)),G(Ue)},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function ht(T,U){var P=this,$=new S(function(G,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"SELECT * FROM "+fe.storeName,[],function(je,Fe){for(var Ue=Fe.rows,ze=Ue.length,yt=0;yt<ze;yt++){var Ht=Ue.item(yt),Gt=Ht.value;if(Gt&&(Gt=fe.serializer.deserialize(Gt)),Gt=T(Gt,Ht.key,yt+1),Gt!==void 0){G(Gt);return}}G()},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function ue(T,U,P,$){var G=this;T=B(T);var z=new S(function(fe,Oe){G.ready().then(function(){U===void 0&&(U=null);var je=U,Fe=G._dbInfo;Fe.serializer.serialize(U,function(Ue,ze){ze?Oe(ze):Fe.db.transaction(function(yt){te(yt,Fe,"INSERT OR REPLACE INTO "+Fe.storeName+" (key, value) VALUES (?, ?)",[T,Ue],function(){fe(je)},function(Ht,Gt){Oe(Gt)})},function(yt){if(yt.code===yt.QUOTA_ERR){if($>0){fe(ue.apply(G,[T,je,P,$-1]));return}Oe(yt)}})})}).catch(Oe)});return R(z,P),z}function Pe(T,U,P){return ue.apply(this,[T,U,P,1])}function dt(T,U){var P=this;T=B(T);var $=new S(function(G,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"DELETE FROM "+fe.storeName+" WHERE key = ?",[T],function(){G()},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function he(T){var U=this,P=new S(function($,G){U.ready().then(function(){var z=U._dbInfo;z.db.transaction(function(fe){te(fe,z,"DELETE FROM "+z.storeName,[],function(){$()},function(Oe,je){G(je)})})}).catch(G)});return R(P,T),P}function Ne(T){var U=this,P=new S(function($,G){U.ready().then(function(){var z=U._dbInfo;z.db.transaction(function(fe){te(fe,z,"SELECT COUNT(key) as c FROM "+z.storeName,[],function(Oe,je){var Fe=je.rows.item(0).c;$(Fe)},function(Oe,je){G(je)})})}).catch(G)});return R(P,T),P}function pt(T,U){var P=this,$=new S(function(G,z){P.ready().then(function(){var fe=P._dbInfo;fe.db.transaction(function(Oe){te(Oe,fe,"SELECT key FROM "+fe.storeName+" WHERE id = ? LIMIT 1",[T+1],function(je,Fe){var Ue=Fe.rows.length?Fe.rows.item(0).key:null;G(Ue)},function(je,Fe){z(Fe)})})}).catch(z)});return R($,U),$}function de(T){var U=this,P=new S(function($,G){U.ready().then(function(){var z=U._dbInfo;z.db.transaction(function(fe){te(fe,z,"SELECT key FROM "+z.storeName,[],function(Oe,je){for(var Fe=[],Ue=0;Ue<je.rows.length;Ue++)Fe.push(je.rows.item(Ue).key);$(Fe)},function(Oe,je){G(je)})})}).catch(G)});return R(P,T),P}function qe(T){return new S(function(U,P){T.transaction(function($){$.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(G,z){for(var fe=[],Oe=0;Oe<z.rows.length;Oe++)fe.push(z.rows.item(Oe).name);U({db:T,storeNames:fe})},function(G,z){P(z)})},function($){P($)})})}function vt(T,U){U=N.apply(this,arguments);var P=this.config();T=typeof T!="function"&&T||{},T.name||(T.name=T.name||P.name,T.storeName=T.storeName||P.storeName);var $=this,G;return T.name?G=new S(function(z){var fe;T.name===P.name?fe=$._dbInfo.db:fe=openDatabase(T.name,"","",0),T.storeName?z({db:fe,storeNames:[T.storeName]}):z(qe(fe))}).then(function(z){return new S(function(fe,Oe){z.db.transaction(function(je){function Fe(Ht){return new S(function(Gt,Pr){je.executeSql("DROP TABLE IF EXISTS "+Ht,[],function(){Gt()},function(Ir,ai){Pr(ai)})})}for(var Ue=[],ze=0,yt=z.storeNames.length;ze<yt;ze++)Ue.push(Fe(z.storeNames[ze]));S.all(Ue).then(function(){fe()}).catch(function(Ht){Oe(Ht)})},function(je){Oe(je)})})}):G=S.reject("Invalid arguments"),R(G,U),G}var pe={_driver:"webSQLStorage",_initStorage:lt,_support:be(),iterate:ht,getItem:ke,setItem:Pe,removeItem:dt,clear:he,length:Ne,key:pt,keys:de,dropInstance:vt};function Le(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ut(T,U){var P=T.name+"/";return T.storeName!==U.storeName&&(P+=T.storeName+"/"),P}function ve(){var T="_localforage_support_test";try{return localStorage.setItem(T,!0),localStorage.removeItem(T),!1}catch{return!0}}function Be(){return!ve()||localStorage.length>0}function mt(T){var U=this,P={};if(T)for(var $ in T)P[$]=T[$];return P.keyPrefix=ut(T,U._defaultConfig),Be()?(U._dbInfo=P,P.serializer=ne,S.resolve()):S.reject()}function me(T){var U=this,P=U.ready().then(function(){for(var $=U._dbInfo.keyPrefix,G=localStorage.length-1;G>=0;G--){var z=localStorage.key(G);z.indexOf($)===0&&localStorage.removeItem(z)}});return R(P,T),P}function Ae(T,U){var P=this;T=B(T);var $=P.ready().then(function(){var G=P._dbInfo,z=localStorage.getItem(G.keyPrefix+T);return z&&(z=G.serializer.deserialize(z)),z});return R($,U),$}function $t(T,U){var P=this,$=P.ready().then(function(){for(var G=P._dbInfo,z=G.keyPrefix,fe=z.length,Oe=localStorage.length,je=1,Fe=0;Fe<Oe;Fe++){var Ue=localStorage.key(Fe);if(Ue.indexOf(z)===0){var ze=localStorage.getItem(Ue);if(ze&&(ze=G.serializer.deserialize(ze)),ze=T(ze,Ue.substring(fe),je++),ze!==void 0)return ze}}});return R($,U),$}function Je(T,U){var P=this,$=P.ready().then(function(){var G=P._dbInfo,z;try{z=localStorage.key(T)}catch{z=null}return z&&(z=z.substring(G.keyPrefix.length)),z});return R($,U),$}function Qe(T){var U=this,P=U.ready().then(function(){for(var $=U._dbInfo,G=localStorage.length,z=[],fe=0;fe<G;fe++){var Oe=localStorage.key(fe);Oe.indexOf($.keyPrefix)===0&&z.push(Oe.substring($.keyPrefix.length))}return z});return R(P,T),P}function Lt(T){var U=this,P=U.keys().then(function($){return $.length});return R(P,T),P}function Bt(T,U){var P=this;T=B(T);var $=P.ready().then(function(){var G=P._dbInfo;localStorage.removeItem(G.keyPrefix+T)});return R($,U),$}function Dt(T,U,P){var $=this;T=B(T);var G=$.ready().then(function(){U===void 0&&(U=null);var z=U;return new S(function(fe,Oe){var je=$._dbInfo;je.serializer.serialize(U,function(Fe,Ue){if(Ue)Oe(Ue);else try{localStorage.setItem(je.keyPrefix+T,Fe),fe(z)}catch(ze){(ze.name==="QuotaExceededError"||ze.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Oe(ze),Oe(ze)}})})});return R(G,P),G}function jt(T,U){if(U=N.apply(this,arguments),T=typeof T!="function"&&T||{},!T.name){var P=this.config();T.name=T.name||P.name,T.storeName=T.storeName||P.storeName}var $=this,G;return T.name?G=new S(function(z){T.storeName?z(ut(T,$._defaultConfig)):z(T.name+"/")}).then(function(z){for(var fe=localStorage.length-1;fe>=0;fe--){var Oe=localStorage.key(fe);Oe.indexOf(z)===0&&localStorage.removeItem(Oe)}}):G=S.reject("Invalid arguments"),R(G,U),G}var Ft={_driver:"localStorageWrapper",_initStorage:mt,_support:Le(),iterate:$t,getItem:Ae,setItem:Dt,removeItem:Bt,clear:me,length:Lt,key:Je,keys:Qe,dropInstance:jt},hr=function(U,P){return U===P||typeof U=="number"&&typeof P=="number"&&isNaN(U)&&isNaN(P)},dr=function(U,P){for(var $=U.length,G=0;G<$;){if(hr(U[G],P))return!0;G++}return!1},sr=Array.isArray||function(T){return Object.prototype.toString.call(T)==="[object Array]"},Kt={},ar={},Ut={INDEXEDDB:J,WEBSQL:pe,LOCALSTORAGE:Ft},pr=[Ut.INDEXEDDB._driver,Ut.WEBSQL._driver,Ut.LOCALSTORAGE._driver],Jt=["dropInstance"],tr=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Jt),Rr={description:"",driver:pr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Qr(T,U){T[U]=function(){var P=arguments;return T.ready().then(function(){return T[U].apply(T,P)})}}function aa(){for(var T=1;T<arguments.length;T++){var U=arguments[T];if(U)for(var P in U)U.hasOwnProperty(P)&&(sr(U[P])?arguments[0][P]=U[P].slice():arguments[0][P]=U[P])}return arguments[0]}var fl=function(){function T(U){c(this,T);for(var P in Ut)if(Ut.hasOwnProperty(P)){var $=Ut[P],G=$._driver;this[P]=G,Kt[G]||this.defineDriver($)}this._defaultConfig=aa({},Rr),this._config=aa({},this._defaultConfig,U),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return T.prototype.config=function(P){if((typeof P>"u"?"undefined":a(P))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var $ in P){if($==="storeName"&&(P[$]=P[$].replace(/\W/g,"_")),$==="version"&&typeof P[$]!="number")return new Error("Database version must be a number.");this._config[$]=P[$]}return"driver"in P&&P.driver?this.setDriver(this._config.driver):!0}else return typeof P=="string"?this._config[P]:this._config},T.prototype.defineDriver=function(P,$,G){var z=new S(function(fe,Oe){try{var je=P._driver,Fe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!P._driver){Oe(Fe);return}for(var Ue=tr.concat("_initStorage"),ze=0,yt=Ue.length;ze<yt;ze++){var Ht=Ue[ze],Gt=!dr(Jt,Ht);if((Gt||P[Ht])&&typeof P[Ht]!="function"){Oe(Fe);return}}var Pr=function(){for(var ll=function(EK){return function(){var AK=new Error("Method "+EK+" is not implemented by the current driver"),OS=S.reject(AK);return R(OS,arguments[arguments.length-1]),OS}},ry=0,SK=Jt.length;ry<SK;ry++){var ny=Jt[ry];P[ny]||(P[ny]=ll(ny))}};Pr();var Ir=function(ll){Kt[je]&&console.info("Redefining LocalForage driver: "+je),Kt[je]=P,ar[je]=ll,fe()};"_support"in P?P._support&&typeof P._support=="function"?P._support().then(Ir,Oe):Ir(!!P._support):Ir(!0)}catch(ai){Oe(ai)}});return C(z,$,G),z},T.prototype.driver=function(){return this._driver||null},T.prototype.getDriver=function(P,$,G){var z=Kt[P]?S.resolve(Kt[P]):S.reject(new Error("Driver not found."));return C(z,$,G),z},T.prototype.getSerializer=function(P){var $=S.resolve(ne);return C($,P),$},T.prototype.ready=function(P){var $=this,G=$._driverSet.then(function(){return $._ready===null&&($._ready=$._initDriver()),$._ready});return C(G,P,P),G},T.prototype.setDriver=function(P,$,G){var z=this;sr(P)||(P=[P]);var fe=this._getSupportedDrivers(P);function Oe(){z._config.driver=z.driver()}function je(ze){return z._extend(ze),Oe(),z._ready=z._initStorage(z._config),z._ready}function Fe(ze){return function(){var yt=0;function Ht(){for(;yt<ze.length;){var Gt=ze[yt];return yt++,z._dbInfo=null,z._ready=null,z.getDriver(Gt).then(je).catch(Ht)}Oe();var Pr=new Error("No available storage method found.");return z._driverSet=S.reject(Pr),z._driverSet}return Ht()}}var Ue=this._driverSet!==null?this._driverSet.catch(function(){return S.resolve()}):S.resolve();return this._driverSet=Ue.then(function(){var ze=fe[0];return z._dbInfo=null,z._ready=null,z.getDriver(ze).then(function(yt){z._driver=yt._driver,Oe(),z._wrapLibraryMethodsWithReady(),z._initDriver=Fe(fe)})}).catch(function(){Oe();var ze=new Error("No available storage method found.");return z._driverSet=S.reject(ze),z._driverSet}),C(this._driverSet,$,G),this._driverSet},T.prototype.supports=function(P){return!!ar[P]},T.prototype._extend=function(P){aa(this,P)},T.prototype._getSupportedDrivers=function(P){for(var $=[],G=0,z=P.length;G<z;G++){var fe=P[G];this.supports(fe)&&$.push(fe)}return $},T.prototype._wrapLibraryMethodsWithReady=function(){for(var P=0,$=tr.length;P<$;P++)Qr(this,tr[P])},T.prototype.createInstance=function(P){return new T(P)},T}(),cl=new fl;i.exports=cl},{3:3}]},{},[4])(4)})});var MK=E((Xb,xK)=>{(function(e,t){typeof Xb=="object"&&typeof xK<"u"?t(Xb):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],t):t(e.LocalforageDriverMemory={})})(typeof self<"u"?self:Xb,function(e){"use strict";var t="localforage-driver-memory";function r(g){var b=typeof Symbol=="function"&&g[Symbol.iterator],h=0;return b?b.call(g):{next:function(){return g&&h>=g.length&&(g=void 0),{value:g&&g[h++],done:!g}}}}function n(g,b){g=g||[],b=b||{};try{return new Blob(g,b)}catch(A){if(A.name!=="TypeError")throw A;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,u=new h,_=0;_<g.length;_+=1)u.append(g[_]);return u.getBlob(b.type)}}var i=/^~~local_forage_type~([^~]+)~/,o=9,a=o+4,c=Object.prototype.toString;function v(g){var b=g.length*.75,h=g.length;g[g.length-1]==="="&&(b--,g[g.length-2]==="="&&b--);for(var u=new ArrayBuffer(b),_=new Uint8Array(u),A=0,x=0;A<h;A+=4){var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A]),j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A+1]),O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A+2]),L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(g[A+3]);_[x++]=I<<2|j>>4,_[x++]=(j&15)<<4|O>>2,_[x++]=(O&3)<<6|L&63}return u}function y(g){for(var b=new Uint8Array(g),h="",u=0;u<b.length;u+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b[u]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(b[u]&3)<<4|b[u+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(b[u+1]&15)<<2|b[u+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b[u+2]&63];return b.length%3===2?h=h.substring(0,h.length-1)+"=":b.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(g,b){var h="";if(g&&(h=c.call(g)),g&&(h==="[object ArrayBuffer]"||g.buffer&&c.call(g.buffer)==="[object ArrayBuffer]")){var u=void 0,_="__lfsc__:";g instanceof ArrayBuffer?(u=g,_+="arbf"):(u=g.buffer,h==="[object Int8Array]"?_+="si08":h==="[object Uint8Array]"?_+="ui08":h==="[object Uint8ClampedArray]"?_+="uic8":h==="[object Int16Array]"?_+="si16":h==="[object Uint16Array]"?_+="ur16":h==="[object Int32Array]"?_+="si32":h==="[object Uint32Array]"?_+="ui32":h==="[object Float32Array]"?_+="fl32":h==="[object Float64Array]"?_+="fl64":b(new Error("Failed to get type for BinaryArray"))),b(_+y(u))}else if(h==="[object Blob]"){var A=new FileReader;A.onload=function(){var x="~~local_forage_type~"+g.type+"~"+y(this.result);b("__lfsc__:blob"+x)},A.readAsArrayBuffer(g)}else try{b(JSON.stringify(g))}catch(x){console.error("Couldn't convert value into a JSON string: ",g),b(null,x)}}function M(g){if(g.substring(0,o)!=="__lfsc__:")return JSON.parse(g);var b=g.substring(a),h=g.substring(o,a),u;if(h==="blob"&&i.test(b)){var _=b.match(i);u=_[1],b=b.substring(_[0].length)}var A=v(b);switch(h){case"arbf":return A;case"blob":return n([A],{type:u});case"si08":return new Int8Array(A);case"ui08":return new Uint8Array(A);case"uic8":return new Uint8ClampedArray(A);case"si16":return new Int16Array(A);case"ur16":return new Uint16Array(A);case"si32":return new Int32Array(A);case"ui32":return new Uint32Array(A);case"fl32":return new Float32Array(A);case"fl64":return new Float64Array(A);default:throw new Error("Unkown type: "+h)}}function S(g){var b,h;if(g===null||typeof g!="object"||"isActiveClone"in g)return g;var u=g instanceof Date?new Date(g):g.constructor();try{for(var _=r(Object.keys(g)),A=_.next();!A.done;A=_.next()){var x=A.value;Object.prototype.hasOwnProperty.call(g,x)&&(g.isActiveClone=null,u[x]=S(g[x]),delete g.isActiveClone)}}catch(I){b={error:I}}finally{try{A&&!A.done&&(h=_.return)&&h.call(_)}finally{if(b)throw b.error}}return u}function R(g,b){return(g.name||b.name)+"/"+(g.storeName||b.storeName)+"/"}function C(g,b){b&&g.then(function(h){b(null,h)},function(h){b(h)})}function B(){for(var g=[],b=0;b<arguments.length;b++)g[b]=arguments[b];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function N(g,b){var h=this;if(b=B.apply(this,arguments),g=typeof g!="function"&&g||{},!g.name){var u=this.config();g.name=g.name||u.name,g.storeName=g.storeName||u.storeName}var _;return g.name?_=new Promise(function(A){g.storeName?A(R(g,h._defaultConfig)):A(g.name+"/")}):_=Promise.reject("Invalid arguments"),{promise:_,callback:b}}function q(g){return typeof g!="string"&&(console.warn(g+" used as a key, but it is not a string."),g=String(g)),g}var H={bufferToString:y,deserialize:M,serialize:w,stringToBuffer:v},D={},ee=function(){function g(b){this.kp=b,this.data={}}return g.resolve=function(b){return D[b]||(D[b]=new g(b)),D[b]},g.prototype.clear=function(){this.data={}},g.prototype.drop=function(){this.clear(),delete D[this.kp]},g.prototype.get=function(b){return this.data[b]},g.prototype.key=function(b){return this.keys()[b]},g.prototype.keys=function(){return Object.keys(this.data)},g.prototype.rm=function(b){delete this.data[b]},g.prototype.set=function(b,h){this.data[b]=h},g}();function ge(g){var b=g?S(g):{},h=R(b,this._defaultConfig),u=ee.resolve(h);return this._dbInfo=b,this._dbInfo.serializer=H,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=u,Promise.resolve()}function Z(g){var b=this,h=this.ready().then(function(){b._dbInfo.mStore.clear()});return C(h,g),h}function X(g,b){var h=N.apply(this,arguments),u=h.promise,_=h.callback,A=u.then(function(x){ee.resolve(x).drop()});return C(A,_),u}function V(g,b){var h=this;g=q(g);var u=this.ready().then(function(){var _=h._dbInfo.mStore.get(g);return _==null?null:h._dbInfo.serializer.deserialize(_)});return C(u,b),u}function k(g,b){var h=this,u=this.ready().then(function(){for(var _=h._dbInfo.mStore,A=_.keys(),x=0;x<A.length;x++){var I=_.get(A[x]);if(I&&(I=h._dbInfo.serializer.deserialize(I)),I=g(I,A[x],x+1),I!==void 0)return I}});return C(u,b),u}function m(g,b){var h=this,u=this.ready().then(function(){var _;try{_=h._dbInfo.mStore.key(g),_===void 0&&(_=null)}catch{_=null}return _});return C(u,b),u}function s(g){var b=this,h=this.ready().then(function(){return b._dbInfo.mStore.keys()});return C(h,g),h}function l(g){var b=this.keys().then(function(h){return h.length});return C(b,g),b}function d(g,b){var h=this;g=q(g);var u=this.ready().then(function(){h._dbInfo.mStore.rm(g)});return C(u,b),u}function f(g,b,h){var u=this;g=q(g);var _=this.ready().then(function(){b===void 0&&(b=null);var A=b;return new Promise(function(x,I){u._dbInfo.serializer.serialize(b,function(j,O){if(O)I(O);else try{u._dbInfo.mStore.set(g,j),x(A)}catch(L){I(L)}})})});return C(_,h),_}var p=!0;e._support=p,e._driver=t,e._initStorage=ge,e.clear=Z,e.dropInstance=X,e.getItem=V,e.iterate=k,e.key=m,e.keys=s,e.length=l,e.removeItem=d,e.setItem=f,Object.defineProperty(e,"__esModule",{value:!0})})});var IOe={};Sr(IOe,{default:()=>ROe});var Co=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(Co||{}),zu=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(zu||{}),Vu=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(Vu||{}),Xr=(e=>(e.MetaMask="metamask",e.WalletConnect="wallet_connect",e.CoinbaseWallet="coinbase_wallet",e))(Xr||{}),To=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e.DisplayUri="display_uri",e.Uri="uri",e))(To||{}),ko=(e=>(e.WalletConnectError="Missing Wallet Connect Config",e.CoinbaseWalletError="Missing Coinbase Wallet Config",e))(ko||{}),gt=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e))(gt||{}),Po=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(Po||{}),ua=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ua||{}),kS=(e=>(e.Harmony="HARMONY",e))(kS||{});dy();var rE=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],Gu=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];var nE={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var DE=Hr(SE());var aZ=Hr(_y()),CE=Hr(IE()),TE="hex",kE="utf8";var hp="0";function as(e){return new Uint8Array(e)}function wy(e,t=!1){let r=e.toString(TE);return t?qo(r):r}function PE(e){return e.toString(kE)}function Zu(e){return(0,CE.default)(e)}function us(e,t=!1){return wy(Zu(e),t)}function xy(e){return PE(Zu(e))}function NE(e){return Buffer.from(ci(e),TE)}function fs(e){return as(NE(e))}function dp(e){return Buffer.from(e,kE)}function My(e){return as(dp(e))}function qE(e,t=!1){return wy(dp(e),t)}function LE(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function Sy(...e){let t=[];return e.forEach(r=>t=t.concat(Array.from(r))),new Uint8Array([...t])}function uZ(e,t=8){let r=e%t;return r?(e-r)/t*t+t:e}function fZ(e,t=8,r=hp){return cZ(e,uZ(e.length,t),r)}function cZ(e,t,r=hp){return lZ(e,t,!0,r)}function ci(e){return e.replace(/^0x/,"")}function qo(e){return e.startsWith("0x")?e:`0x${e}`}function pp(e){return e=ci(e),e=fZ(e,2),e&&(e=qo(e)),e}function BE(e){let t=e.startsWith("0x");return e=ci(e),e=e.startsWith(hp)?e.substring(1):e,t?qo(e):e}function lZ(e,t,r,n=hp){let i=t-e.length,o=e;if(i>0){let a=n.repeat(i);o=r?a+e:e+a}return o}function mp(e){return Zu(new Uint8Array(e))}function jE(e,t){return us(new Uint8Array(e),!t)}function FE(e){return as(e).buffer}function UE(e){return dp(e)}function HE(e,t){return qE(e,!t)}function WE(e){return fs(e).buffer}function gp(e,t){let r=ci(pp(new DE.default(e).toString(16)));return t?r:qo(r)}var L8=Hr(zE());var li={};Sr(li,{DEFAULT_ERROR:()=>wl,IBaseJsonRpcProvider:()=>Cp,IEvents:()=>Qu,IJsonRpcConnection:()=>Ry,IJsonRpcProvider:()=>Iy,INTERNAL_ERROR:()=>yp,INVALID_PARAMS:()=>GE,INVALID_REQUEST:()=>$E,METHOD_NOT_FOUND:()=>KE,PARSE_ERROR:()=>VE,RESERVED_ERROR_CODES:()=>Ey,SERVER_ERROR:()=>_l,SERVER_ERROR_CODE_RANGE:()=>_p,STANDARD_ERROR_MAP:()=>cs,formatErrorMessage:()=>E8,formatJsonRpcError:()=>yZ,formatJsonRpcRequest:()=>gZ,formatJsonRpcResult:()=>bZ,getError:()=>xp,getErrorByCode:()=>Mp,isHttpUrl:()=>AZ,isJsonRpcError:()=>R8,isJsonRpcPayload:()=>Cy,isJsonRpcRequest:()=>IZ,isJsonRpcResponse:()=>CZ,isJsonRpcResult:()=>O8,isJsonRpcValidationInvalid:()=>TZ,isLocalhostUrl:()=>RZ,isNodeJs:()=>S8,isReservedErrorCode:()=>wp,isServerErrorCode:()=>hZ,isValidDefaultRoute:()=>Rp,isValidErrorCode:()=>ZE,isValidLeadingWildcardRoute:()=>wZ,isValidRoute:()=>_Z,isValidTrailingWildcardRoute:()=>xZ,isValidWildcardRoute:()=>Ip,isWsUrl:()=>OZ,parseConnectionError:()=>pZ,payloadId:()=>Op,validateJsonRpcError:()=>dZ});var VE="PARSE_ERROR",$E="INVALID_REQUEST",KE="METHOD_NOT_FOUND",GE="INVALID_PARAMS",yp="INTERNAL_ERROR",_l="SERVER_ERROR",Ey=[-32700,-32600,-32601,-32602,-32603],_p=[-32e3,-32099],cs={[VE]:{code:-32700,message:"Parse error"},[$E]:{code:-32600,message:"Invalid Request"},[KE]:{code:-32601,message:"Method not found"},[GE]:{code:-32602,message:"Invalid params"},[yp]:{code:-32603,message:"Internal error"},[_l]:{code:-32e3,message:"Server error"}},wl=_l;function hZ(e){return e<=_p[0]&&e>=_p[1]}function wp(e){return Ey.includes(e)}function ZE(e){return typeof e=="number"}function xp(e){return Object.keys(cs).includes(e)?cs[e]:cs[wl]}function Mp(e){let t=Object.values(cs).find(r=>r.code===e);return t||cs[wl]}function dZ(e){if(typeof e.error.code>"u")return{valid:!1,error:"Missing code for JSON-RPC error"};if(typeof e.error.message>"u")return{valid:!1,error:"Missing message for JSON-RPC error"};if(!ZE(e.error.code))return{valid:!1,error:`Invalid error code type for JSON-RPC: ${e.error.code}`};if(wp(e.error.code)){let t=Mp(e.error.code);if(t.message!==cs[wl].message&&e.error.message===t.message)return{valid:!1,error:`Invalid error code message for JSON-RPC: ${e.error.code}`}}return{valid:!0}}function pZ(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var Rn={};Sr(Rn,{isNodeJs:()=>S8});var M8=Hr(Ju());rr(Rn,Hr(Ju()));var S8=M8.isNode;rr(li,Rn);function Op(){let e=Date.now()*Math.pow(10,3),t=Math.floor(Math.random()*Math.pow(10,3));return e+t}function gZ(e,t,r){return{id:r||Op(),jsonrpc:"2.0",method:e,params:t}}function bZ(e,t){return{id:e,jsonrpc:"2.0",result:t}}function yZ(e,t,r){return{id:e,jsonrpc:"2.0",error:E8(t,r)}}function E8(e,t){return typeof e>"u"?xp(yp):(typeof e=="string"&&(e=Object.assign(Object.assign({},xp(_l)),{message:e})),typeof t<"u"&&(e.data=t),wp(e.code)&&(e=Mp(e.code)),e)}function _Z(e){return e.includes("*")?Ip(e):!/\W/g.test(e)}function Rp(e){return e==="*"}function Ip(e){return Rp(e)?!0:!(!e.includes("*")||e.split("*").length!==2||e.split("*").filter(t=>t.trim()==="").length!==1)}function wZ(e){return!Rp(e)&&Ip(e)&&!e.split("*")[0].trim()}function xZ(e){return!Rp(e)&&Ip(e)&&!e.split("*")[1].trim()}var Qu=class{};var Ry=class extends Qu{constructor(t){super()}},Cp=class extends Qu{constructor(){super()}},Iy=class extends Cp{constructor(t){super()}};var MZ="^https?:",SZ="^wss?:";function EZ(e){let t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function A8(e,t){let r=EZ(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function AZ(e){return A8(e,MZ)}function OZ(e){return A8(e,SZ)}function RZ(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function Cy(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function IZ(e){return Cy(e)&&"method"in e}function CZ(e){return Cy(e)&&(O8(e)||R8(e))}function O8(e){return"result"in e}function R8(e){return"error"in e}function TZ(e){return"error"in e&&e.valid===!1}function xl(e){return pp(e)}function I8(e){return BE(qo(e))}var Ml=Op;function Tp(){return((t,r)=>{for(r=t="";t++<36;r+=t*51&52?(t^15?8^Math.random()*(t^20?16:4):4).toString(16):"-");return r})()}function kZ(e,t){let r,n=nE[e];return n&&(r=`https://${n}.infura.io/v3/${t}`),r}function C8(e,t){let r,n=kZ(e,t.infuraId);return t.custom&&t.custom[e]?r=t.custom[e]:n&&(r=n),r}function T8(e){return e===""||typeof e=="string"&&e.trim()===""}function k8(e){return!(e&&e.length)}function Ty(e,t){return LE(e,t)}function P8(e){return typeof e.method<"u"}function pa(e){return typeof e.result<"u"}function Xu(e){return typeof e.error<"u"}function ky(e){return typeof e.event<"u"}function N8(e){return rE.includes(e)||e.startsWith("wc_")}function q8(e){return e.method.startsWith("wc_")?!0:!Gu.includes(e.method)}function PZ(e){e=ci(e.toLowerCase());let t=ci((0,L8.keccak_256)(UE(e))),r="";for(let n=0;n<e.length;n++)parseInt(t[n],16)>7?r+=e[n].toUpperCase():r+=e[n];return qo(r)}var NZ=e=>e?e.toLowerCase().substring(0,2)!=="0x"?!1:/^(0x)?[0-9a-f]{40}$/i.test(e)?/^(0x)?[0-9a-f]{40}$/.test(e)||/^(0x)?[0-9A-F]{40}$/.test(e)?!0:e===PZ(e):!1:!1;function ef(e){return!k8(e)&&!Ty(e[0])&&(e[0]=HE(e[0])),e}function kp(e){if(typeof e.type<"u"&&e.type!=="0")return e;if(typeof e.from>"u"||!NZ(e.from))throw new Error("Transaction object must include a valid 'from' value.");function t(i){let o=i;return(typeof i=="number"||typeof i=="string"&&!T8(i))&&(Ty(i)?typeof i=="string"&&(o=xl(i)):o=gp(i)),typeof o=="string"&&(o=I8(o)),o}let r={from:xl(e.from),to:typeof e.to>"u"?void 0:xl(e.to),gasPrice:typeof e.gasPrice>"u"?"":t(e.gasPrice),gas:typeof e.gas>"u"?typeof e.gasLimit>"u"?"":t(e.gasLimit):t(e.gas),value:typeof e.value>"u"?"":t(e.value),nonce:typeof e.nonce>"u"?"":t(e.nonce),data:typeof e.data>"u"?"":xl(e.data)||"0x"},n=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach(i=>{(typeof r[i]>"u"||typeof r[i]=="string"&&!r[i].trim().length)&&n.includes(i)&&delete r[i]}),r}function B8(e){let t=e.message||"Failed or Rejected Request",r=-32e3;if(e&&!e.code)switch(t){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3;break}let n={code:r,message:t};return e.data&&(n.data=e.data),n}var Pp=Hr(e9());function t9(e){let t=e.indexOf("?")!==-1?e.indexOf("?"):void 0;return typeof t<"u"?e.substr(t):""}function r9(e,t){let r=Ny(e);return r=Object.assign(Object.assign({},r),t),e=WZ(r),e}function Ny(e){return Pp.parse(e)}function WZ(e){return Pp.stringify(e)}function n9(e){return typeof e.bridge<"u"}function i9(e){let t=e.indexOf(":"),r=e.indexOf("?")!==-1?e.indexOf("?"):void 0,n=e.substring(0,t),i=e.substring(t+1,r);function o(M){let S="@",R=M.split(S);return{handshakeTopic:R[0],version:parseInt(R[1],10)}}let a=o(i),c=typeof r<"u"?e.substr(r):"";function v(M){let S=Ny(M);return{key:S.key||"",bridge:S.bridge||""}}let y=v(c);return Object.assign(Object.assign({protocol:n},a),y)}var qy=class{constructor(){this._eventEmitters=[],typeof window<"u"&&typeof window.addEventListener<"u"&&(window.addEventListener("online",()=>this.trigger("online")),window.addEventListener("offline",()=>this.trigger("offline")))}on(t,r){this._eventEmitters.push({event:t,callback:r})}trigger(t){let r=[];t&&(r=this._eventEmitters.filter(n=>n.event===t)),r.forEach(n=>{n.callback()})}},o9=qy;var zZ=typeof globalThis.WebSocket<"u"?globalThis.WebSocket:a9(),Ly=class{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new o9,!t.url||typeof t.url!="string")throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",()=>this._socketCreate())}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return this.readyState===0}set connected(t){}get connected(){return this.readyState===1}set closing(t){}get closing(){return this.readyState===2}set closed(t){}get closed(){return this.readyState===3}open(){this._socketCreate()}close(){this._socketClose()}send(t,r,n){if(!r||typeof r!="string")throw new Error("Missing or invalid topic field");this._socketSend({topic:r,type:"pub",payload:t,silent:!!n})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,r){this._events.push({event:t,callback:r})}_socketCreate(){if(this._nextSocket)return;let t=VZ(this._url,this._protocol,this._version);if(this._nextSocket=new zZ(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=r=>this._socketReceive(r),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=r=>this._socketError(r),this._nextSocket.onclose=()=>{setTimeout(()=>{this._nextSocket=null,this._socketCreate()},1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){let r=JSON.stringify(t);this._socket&&this._socket.readyState===1?this._socket.send(r):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let r;try{r=JSON.parse(t.data)}catch{return}if(this._socketSend({topic:r.topic,type:"ack",payload:"",silent:!0}),this._socket&&this._socket.readyState===1){let n=this._events.filter(i=>i.event==="message");n&&n.length&&n.forEach(i=>i.callback(r))}}_socketError(t){let r=this._events.filter(n=>n.event==="error");r&&r.length&&r.forEach(n=>n.callback(t))}_queueSubscriptions(){this._subscriptions.forEach(r=>this._queue.push({topic:r,type:"sub",payload:"",silent:!0})),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){this._queue.forEach(r=>this._socketSend(r)),this._queue=[]}};function VZ(e,t,r){var n,i;let a=(e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e).split("?"),c=oy()?{protocol:t,version:r,env:"browser",host:((n=ay())===null||n===void 0?void 0:n.host)||""}:{protocol:t,version:r,env:((i=pl())===null||i===void 0?void 0:i.name)||""},v=r9(t9(a[1]||""),c);return a[0]+"?"+v}var u9=Ly;var Np="Session currently connected",ds="Session currently disconnected",f9="Session Rejected",c9="Missing JSON RPC response",l9='JSON-RPC success response must include "result" field',h9='JSON-RPC error response must include "error" field',d9='JSON RPC request must have valid "method" value',p9='JSON RPC request must have valid "id" value',v9="Missing one of the required parameters: bridge / uri / session",By="JSON RPC response format is invalid",m9="URI format is invalid",g9="QRCode Modal not provided",Dy="User close QRCode Modal";var jy=class{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter(r=>r.event!==t)}trigger(t){let r=[],n;P8(t)?n=t.method:pa(t)||Xu(t)?n=`response:${t.id}`:ky(t)?n=t.event:n="",n&&(r=this._eventEmitters.filter(i=>i.event===n)),(!r||!r.length)&&!N8(n)&&!ky(n)&&(r=this._eventEmitters.filter(i=>i.event==="call_request")),r.forEach(i=>{if(Xu(t)){let o=new Error(t.error.message);i.callback(o,null)}else i.callback(null,t)})}},b9=jy;var Fy=class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null,r=gl(this.storageId);return r&&n9(r)&&(t=r),t}setSession(t){return ml(this.storageId,t),t}removeSession(){bl(this.storageId)}},y9=Fy;var $Z="walletconnect.org",KZ="abcdefghijklmnopqrstuvwxyz0123456789",_9=KZ.split("").map(e=>`https://${e}.bridge.walletconnect.org`);function GZ(e){let t=e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0];return t=t.split(":")[0],t=t.split("?")[0],t}function ZZ(e){return GZ(e).split(".").slice(-2).join(".")}function YZ(){return Math.floor(Math.random()*_9.length)}function JZ(){return _9[YZ()]}function QZ(e){return ZZ(e)===$Z}function w9(e){return QZ(e)?JZ():e}var Uy=class{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new b9,this._clientMeta=ip()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new y9(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...Gu,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error(v9);t.connectorOpts.bridge&&(this.bridge=w9(t.connectorOpts.bridge)),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);let r=t.connectorOpts.session||this._getStorageSession();r&&(this.session=r),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new u9({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){!t||(this._bridge=t)}get bridge(){return this._bridge}set key(t){if(!t)return;let r=WE(t);this._key=r}get key(){return this._key?jE(this._key,!0):""}set clientId(t){!t||(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=Tp()),this._clientId}set peerId(t){!t||(this._peerId=t)}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return t||(t=this._clientMeta=ip()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){return this._peerMeta}set handshakeTopic(t){!t||(this._handshakeTopic=t)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){!t||(this._handshakeId=t)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(t){if(!t)return;let{handshakeTopic:r,bridge:n,key:i}=this._parseUri(t);this.handshakeTopic=r,this.bridge=n,this.key=i}set chainId(t){this._chainId=t}get chainId(){return this._chainId}set networkId(t){this._networkId=t}get networkId(){return this._networkId}set accounts(t){this._accounts=t}get accounts(){return this._accounts}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){return this._rpcUrl}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){!t||(this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic)}on(t,r){let n={event:t,callback:r};this._eventManager.subscribe(n)}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();let r=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=r.id,this.handshakeTopic=Tp(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",()=>{throw new Error(Dy)});let n=()=>{this.killSession()};try{let i=await this._sendCallRequest(r);return i&&n(),i}catch(i){throw n(),i}}async connect(t){if(!this._qrcodeModal)throw new Error(g9);return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise(async(r,n)=>{this.on("modal_closed",()=>n(new Error(Dy))),this.on("connect",(i,o)=>{if(i)return n(i);r(o.params[0])})}))}async createSession(t){if(this._connected)throw new Error(Np);if(this.pending)return;this._key=await this._generateKey();let r=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=r.id,this.handshakeTopic=Tp(),this._sendSessionRequest(r,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw new Error(Np);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let r={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},n={id:this.handshakeId,jsonrpc:"2.0",result:r};this._sendResponse(n),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw new Error(Np);let r=t&&t.message?t.message:f9,n=this._formatResponse({id:this.handshakeId,error:{message:r}});this._sendResponse(n),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:r}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw new Error(ds);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";let r={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},n=this._formatRequest({method:"wc_sessionUpdate",params:[r]});this._sendSessionRequest(n,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){let r=t?t.message:"Session Disconnected",n={approved:!1,chainId:null,networkId:null,accounts:null},i=this._formatRequest({method:"wc_sessionUpdate",params:[n]});await this._sendRequest(i),this._handleSessionDisconnect(r)}async sendTransaction(t){if(!this._connected)throw new Error(ds);let r=kp(t),n=this._formatRequest({method:"eth_sendTransaction",params:[r]});return await this._sendCallRequest(n)}async signTransaction(t){if(!this._connected)throw new Error(ds);let r=kp(t),n=this._formatRequest({method:"eth_signTransaction",params:[r]});return await this._sendCallRequest(n)}async signMessage(t){if(!this._connected)throw new Error(ds);let r=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(r)}async signPersonalMessage(t){if(!this._connected)throw new Error(ds);t=ef(t);let r=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(r)}async signTypedData(t){if(!this._connected)throw new Error(ds);let r=this._formatRequest({method:"eth_signTypedData",params:t});return await this._sendCallRequest(r)}async updateChain(t){if(!this._connected)throw new Error("Session currently disconnected");let r=this._formatRequest({method:"wallet_updateChain",params:[t]});return await this._sendCallRequest(r)}unsafeSend(t,r){return this._sendRequest(t,r),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:r}]}),new Promise((n,i)=>{this._subscribeToResponse(t.id,(o,a)=>{if(o){i(o);return}if(!a)throw new Error(c9);n(a)})})}async sendCustomRequest(t,r){if(!this._connected)throw new Error(ds);switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return gp(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=kp(t.params[0]));break;case"personal_sign":t.params&&(t.params=ef(t.params));break;default:break}let n=this._formatRequest(t);return await this._sendCallRequest(n,r)}approveRequest(t){if(pa(t)){let r=this._formatResponse(t);this._sendResponse(r)}else throw new Error(l9)}rejectRequest(t){if(Xu(t)){let r=this._formatResponse(t);this._sendResponse(r)}else throw new Error(h9)}transportClose(){this._transport.close()}async _sendRequest(t,r){let n=this._formatRequest(t),i=await this._encrypt(n),o=typeof r?.topic<"u"?r.topic:this.peerId,a=JSON.stringify(i),c=typeof r?.forcePushNotification<"u"?!r.forcePushNotification:q8(n);this._transport.send(a,o,c)}async _sendResponse(t){let r=await this._encrypt(t),n=this.peerId,i=JSON.stringify(r),o=!0;this._transport.send(i,n,o)}async _sendSessionRequest(t,r,n){this._sendRequest(t,n),this._subscribeToSessionResponse(t.id,r)}_sendCallRequest(t,r){return this._sendRequest(t,r),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:r}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(typeof t.method>"u")throw new Error(d9);return{id:typeof t.id>"u"?Ml():t.id,jsonrpc:"2.0",method:t.method,params:typeof t.params>"u"?[]:t.params}}_formatResponse(t){if(typeof t.id>"u")throw new Error(p9);let r={id:t.id,jsonrpc:"2.0"};if(Xu(t)){let n=B8(t.error);return Object.assign(Object.assign(Object.assign({},r),t),{error:n})}else if(pa(t))return Object.assign(Object.assign({},r),t);throw new Error(By)}_handleSessionDisconnect(t){let r=t||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),bl(yl)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:r}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,r){r?r.approved?(this._connected?(r.chainId&&(this.chainId=r.chainId),r.accounts&&(this.accounts=r.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,r.chainId&&(this.chainId=r.chainId),r.accounts&&(this.accounts=r.accounts),r.peerId&&!this.peerId&&(this.peerId=r.peerId),r.peerMeta&&!this.peerMeta&&(this.peerMeta=r.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){if(![this.clientId,this.handshakeTopic].includes(t.topic))return;let n;try{n=JSON.parse(t.payload)}catch{return}let i=await this._decrypt(n);i&&this._eventManager.trigger(i)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,r){this.on(`response:${t}`,r)}_subscribeToSessionResponse(t,r){this._subscribeToResponse(t,(n,i)=>{if(n){this._handleSessionResponse(n.message);return}pa(i)?this._handleSessionResponse(r,i.result):i.error&&i.error.message?this._handleSessionResponse(i.error.message):this._handleSessionResponse(r)})}_subscribeToCallResponse(t){return new Promise((r,n)=>{this._subscribeToResponse(t,(i,o)=>{if(i){n(i);return}pa(o)?r(o.result):o.error&&o.error.message?n(o.error):n(new Error(By))})})}_subscribeToInternalEvents(){this.on("display_uri",()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,()=>{this._eventManager.trigger({event:"modal_closed",params:[]})},this._qrcodeModalOptions)}),this.on("connect",()=>{this._qrcodeModal&&this._qrcodeModal.close()}),this.on("call_request_sent",(t,r)=>{let{request:n}=r.params[0];if(iy()&&this._signingMethods.includes(n.method)){let i=gl(yl);i&&(window.location.href=i.href)}}),this.on("wc_sessionRequest",(t,r)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=r.id,this.peerId=r.params[0].peerId,this.peerMeta=r.params[0].peerMeta;let n=Object.assign(Object.assign({},r),{method:"session_request"});this._eventManager.trigger(n)}),this.on("wc_sessionUpdate",(t,r)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",r.params[0])})}_initTransport(){this._transport.on("message",t=>this._handleIncomingMessages(t)),this._transport.on("open",()=>this._eventManager.trigger({event:"transport_open",params:[]})),this._transport.on("close",()=>this._eventManager.trigger({event:"transport_close",params:[]})),this._transport.on("error",()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]})),this._transport.open()}_formatUri(){let t=this.protocol,r=this.handshakeTopic,n=this.version,i=encodeURIComponent(this.bridge),o=this.key;return`${t}:${r}@${n}?bridge=${i}&key=${o}`}_parseUri(t){let r=i9(t);if(r.protocol===this.protocol){if(!r.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");let n=r.handshakeTopic;if(!r.bridge)throw Error("Invalid or missing bridge url parameter value");let i=decodeURIComponent(r.bridge);if(!r.key)throw Error("Invalid or missing key parameter value");let o=r.key;return{handshakeTopic:n,bridge:i,key:o}}else throw new Error(m9)}async _generateKey(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(t){let r=this._key;return this._cryptoLib&&r?await this._cryptoLib.encrypt(t,r):null}async _decrypt(t){let r=this._key;return this._cryptoLib&&r?await this._cryptoLib.decrypt(t,r):null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||typeof t.url!="string")throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||typeof t.type!="string")throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||typeof t.token!="string")throw Error("Invalid or missing pushServerOpts.token parameter value");let r={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",async(n,i)=>{if(n)throw n;if(t.peerMeta){let o=i.params[0].peerMeta.name;r.peerName=o}try{if(!(await(await fetch(`${t.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r)})).json()).success)throw Error("Failed to register in Push Server")}catch{throw Error("Failed to register in Push Server")}})}},x9=Uy;var n_={};Sr(n_,{decrypt:()=>EY,encrypt:()=>SY,generateKey:()=>C9,verifyHmac:()=>T9});var eo={};Sr(eo,{AES_BROWSER_ALGO:()=>Xi,AES_LENGTH:()=>El,AES_NODE_ALGO:()=>nY,DECRYPT_OP:()=>Yy,ENCRYPT_OP:()=>Zy,ERROR_BAD_MAC:()=>pY,HEX_ENC:()=>hY,HMAC_BROWSER:()=>va,HMAC_BROWSER_ALGO:()=>$y,HMAC_LENGTH:()=>Bp,HMAC_NODE_ALGO:()=>iY,IV_LENGTH:()=>cY,KEY_LENGTH:()=>fY,LENGTH_0:()=>XZ,LENGTH_1:()=>Wy,LENGTH_1024:()=>rY,LENGTH_128:()=>tY,LENGTH_16:()=>zy,LENGTH_256:()=>Lp,LENGTH_32:()=>qp,LENGTH_512:()=>Vy,LENGTH_64:()=>eY,MAC_LENGTH:()=>lY,PREFIX_LENGTH:()=>uY,RIPEMD160_NODE_ALGO:()=>aY,SHA256_BROWSER_ALGO:()=>Ky,SHA256_NODE_ALGO:()=>oY,SHA512_BROWSER_ALGO:()=>Gy,SHA512_NODE_ALGO:()=>sY,SIGN_OP:()=>Jy,UTF8_ENC:()=>dY,VERIFY_OP:()=>Qy,aesCbcDecrypt:()=>r_,aesCbcEncrypt:()=>t_,assert:()=>I9,hmacSha256Sign:()=>jp,hmacSha256Verify:()=>bY,hmacSha512Sign:()=>yY,hmacSha512Verify:()=>_Y,isConstantTime:()=>Al,pkcs7:()=>R9,randomBytes:()=>Hy,ripemd160:()=>MY,sha256:()=>wY,sha512:()=>xY});var M9=Hr(Ju());function Hy(e){return M9.getBrowerCrypto().getRandomValues(new Uint8Array(e))}var ps=Hr(Ju());var XZ=0,Wy=1,zy=16,qp=32,eY=64,tY=128,Lp=256,Vy=512,rY=1024;var El=256,Bp=256,Xi="AES-CBC",$y=`SHA-${El}`,va="HMAC",Ky="SHA-256",Gy="SHA-512",nY=`aes-${El}-cbc`,iY=`sha${Bp}`,oY="sha256",sY="sha512",aY="ripemd160",uY=1,fY=32,cY=16,lY=32;var hY="hex",dY="utf8";var pY="Bad MAC";var Zy="encrypt",Yy="decrypt",Jy="sign",Qy="verify";function vY(e){return e===Xi?{length:El,name:Xi}:{hash:{name:$y},name:va}}function mY(e){return e===Xi?[Zy,Yy]:[Jy,Qy]}async function Dp(e,t=Xi){return ps.getSubtleCrypto().importKey("raw",e,vY(t),!0,mY(t))}async function S9(e,t,r){let n=ps.getSubtleCrypto(),i=await Dp(t,Xi),o=await n.encrypt({iv:e,name:Xi},i,r);return new Uint8Array(o)}async function E9(e,t,r){let n=ps.getSubtleCrypto(),i=await Dp(t,Xi),o=await n.decrypt({iv:e,name:Xi},i,r);return new Uint8Array(o)}async function Xy(e,t){let r=ps.getSubtleCrypto(),n=await Dp(e,va),i=await r.sign({length:Bp,name:va},n,t);return new Uint8Array(i)}async function e_(e,t){let r=ps.getSubtleCrypto(),n=await Dp(e,va),i=await r.sign({length:512,name:va},n,t);return new Uint8Array(i)}async function A9(e){let r=await ps.getSubtleCrypto().digest({name:Ky},e);return new Uint8Array(r)}async function O9(e){let r=await ps.getSubtleCrypto().digest({name:Gy},e);return new Uint8Array(r)}function t_(e,t,r){return S9(e,t,r)}function r_(e,t,r){return E9(e,t,r)}var In={};Sr(In,{assert:()=>I9,isConstantTime:()=>Al,pkcs7:()=>R9});var Bo={};rr(Bo,Hr(Ju()));rr(In,Bo);var gY=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]],R9={pad(e){let t=gY[e.byteLength%16||0],r=new Uint8Array(e.byteLength+t.length);return r.set(e),r.set(t,e.byteLength),r},unpad(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}};function I9(e,t){if(!e)throw new Error(t||"Assertion failed")}function Al(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}async function jp(e,t){return await Xy(e,t)}async function bY(e,t,r){let n=await Xy(e,t);return Al(n,r)}async function yY(e,t){return await e_(e,t)}async function _Y(e,t,r){let n=await e_(e,t);return Al(n,r)}async function wY(e){return await A9(e)}async function xY(e){return await O9(e)}async function MY(e){throw new Error("Not supported for Browser async methods, use sync instead!")}rr(eo,In);async function C9(e){let t=(e||256)/8,r=Hy(t);return FE(Zu(r))}async function T9(e,t){let r=fs(e.data),n=fs(e.iv),i=fs(e.hmac),o=us(i,!1),a=Sy(r,n),c=await jp(t,a),v=us(c,!1);return ci(o)===ci(v)}async function SY(e,t,r){let n=as(mp(t)),i=r||await C9(128),o=as(mp(i)),a=us(o,!1),c=JSON.stringify(e),v=My(c),y=await t_(o,n,v),w=us(y,!1),M=Sy(y,o),S=await jp(n,M),R=us(S,!1);return{data:w,hmac:R,iv:a}}async function EY(e,t){let r=as(mp(t));if(!r)throw new Error("Missing key: required for decryption");if(!await T9(e,r))return null;let i=fs(e.data),o=fs(e.iv),a=await r_(o,r,i),c=xy(a),v;try{v=JSON.parse(c)}catch{return null}return v}var i_=class extends x9{constructor(t,r){super({cryptoLib:n_,connectorOpts:t,pushServerOpts:r})}},k9=i_;var OD=Hr(WA());var FR=Hr(VA()),UR=Hr(jR());var ste=sy("XMLHttpRequest")||UR.XMLHttpRequest,jw=class extends FR.default{constructor(t){super(),this.url=t}formatError(t,r,n=-1){return{error:{message:r,code:n},id:t.id,jsonrpc:t.jsonrpc}}send(t,r){return new Promise(n=>{if(t.method==="eth_subscribe"){let c=this.formatError(t,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",c),n(c)}let i=new ste,o=!1,a=(c,v)=>{if(!o)if(i.abort(),o=!0,r)r(c,v);else{let{id:y,jsonrpc:w}=t,M=c?{id:y,jsonrpc:w,error:{message:c.message,code:c.code}}:{id:y,jsonrpc:w,result:v};this.emit("payload",M),n(M)}};i.open("POST",this.url,!0),i.setRequestHeader("Content-Type","application/json"),i.timeout=60*1e3,i.onerror=a,i.ontimeout=a,i.onreadystatechange=()=>{if(i.readyState===4)try{let c=JSON.parse(i.responseText);a(c.error,c.result)}catch(c){a(c)}},i.send(JSON.stringify(t))})}},HR=jw;var Fde=Yq(),Ude=fL(),Hde=lL(),Wde=PB(),zde=gD(),Vde=xD(),$de=AD(),K3=class extends Fde{constructor(t){if(super({pollingInterval:t.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=OD.default,this.qrcodeModalOptions=void 0,this.rpc=null,this.infuraId="",this.http=null,this.isConnecting=!1,this.connected=!1,this.connectCallbacks=[],this.accounts=[],this.chainId=1,this.rpcUrl="",this.enable=async()=>{let r=await this.getWalletConnector();if(r)return this.start(),this.subscribeWalletConnector(),r.accounts;throw new Error("Failed to connect to WalleConnect")},this.request=async r=>this.send(r),this.send=async(r,n)=>{var i;if(typeof r=="string"){let o=r,a=n;return o==="personal_sign"&&(a=ef(a)),this.sendAsyncPromise(o,a)}if(r=Object.assign({id:Ml(),jsonrpc:"2.0"},r),r.method==="personal_sign"&&(r.params=ef(r.params)),n){this.sendAsync(r,n);return}if(r.method==="eth_signTypedData_v4"&&((i=this.walletMeta)===null||i===void 0?void 0:i.name)==="MetaMask"){let{result:o}=await this.handleOtherRequests(r);return o}else return this.sendAsyncPromise(r.method,r.params)},this.onConnect=r=>{this.connectCallbacks.push(r)},this.triggerConnect=r=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach(n=>n(r))},this.bridge=t.connector?t.connector.bridge:t.bridge||"https://bridge.walletconnect.org",this.qrcode=typeof t.qrcode>"u"||t.qrcode!==!1,this.qrcodeModal=t.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=t.qrcodeModalOptions,this.wc=t.connector||new k9({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:t?.storageId,signingMethods:t?.signingMethods,clientMeta:t?.clientMeta}),this.rpc=t.rpc||null,!this.rpc&&(!t.infuraId||typeof t.infuraId!="string"||!t.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=t.infuraId||"",this.chainId=t?.chainId||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}async disconnect(){this.close()}async close(){await(await this.getWalletConnector({disableSessionCreation:!0})).killSession(),await this.onDisconnect()}async handleRequest(t){try{let r,n=null,i=await this.getWalletConnector();switch(t.method){case"wc_killSession":await this.close(),n=null;break;case"eth_accounts":n=i.accounts;break;case"eth_coinbase":n=i.accounts[0];break;case"eth_chainId":n=i.chainId;break;case"net_version":n=i.chainId;break;case"eth_uninstallFilter":this.sendAsync(t,o=>o),n=!0;break;default:r=await this.handleOtherRequests(t)}return r||this.formatResponse(t,n)}catch(r){throw this.emit("error",r),r}}async handleOtherRequests(t){if(!Gu.includes(t.method)&&t.method.startsWith("eth_"))return this.handleReadRequests(t);let n=await(await this.getWalletConnector()).sendCustomRequest(t);return this.formatResponse(t,n)}async handleReadRequests(t){if(!this.http){let r=new Error("HTTP Connection not available");throw this.emit("error",r),r}return this.http.send(t)}formatResponse(t,r){return{id:t.id,jsonrpc:t.jsonrpc,result:r}}getWalletConnector(t={}){let{disableSessionCreation:r=!1}=t;return new Promise((n,i)=>{let o=this.wc;this.isConnecting?this.onConnect(a=>n(a)):!o.connected&&!r?(this.isConnecting=!0,o.on("modal_closed",()=>{i(new Error("User closed modal"))}),o.createSession({chainId:this.chainId}).then(()=>{o.on("connect",(a,c)=>{if(a)return this.isConnecting=!1,i(a);this.isConnecting=!1,this.connected=!0,c&&this.updateState(c.params[0]),this.emit("connect"),this.triggerConnect(o),n(o)})}).catch(a=>{this.isConnecting=!1,i(a)})):(this.connected||(this.connected=!0,this.updateState(o.session)),n(o))})}async subscribeWalletConnector(){let t=await this.getWalletConnector();t.on("disconnect",r=>{if(r){this.emit("error",r);return}this.onDisconnect()}),t.on("session_update",(r,n)=>{if(r){this.emit("error",r);return}this.updateState(n.params[0])})}async onDisconnect(){await this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1}async updateState(t){let{accounts:r,chainId:n,networkId:i,rpcUrl:o}=t;(!this.accounts||r&&this.accounts!==r)&&(this.accounts=r,this.emit("accountsChanged",r)),(!this.chainId||n&&this.chainId!==n)&&(this.chainId=n,this.emit("chainChanged",n)),(!this.networkId||i&&this.networkId!==i)&&(this.networkId=i,this.emit("networkChanged",i)),this.updateRpcUrl(this.chainId,o||"")}updateRpcUrl(t,r=""){let n={infuraId:this.infuraId,custom:this.rpc||void 0};r=r||C8(t,n),r?(this.rpcUrl=r,this.updateHttpConnection()):this.emit("error",new Error(`No RPC Url available for chainId: ${t}`))}updateHttpConnection(){this.rpcUrl&&(this.http=new HR(this.rpcUrl),this.http.on("payload",t=>this.emit("payload",t)),this.http.on("error",t=>this.emit("error",t)))}sendAsyncPromise(t,r){return new Promise((n,i)=>{this.sendAsync({id:Ml(),jsonrpc:"2.0",method:t,params:r||[]},(o,a)=>{if(o){i(o);return}n(a.result)})})}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new Hde({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new Ude),this.addProvider(new $de),this.addProvider(new Wde),this.addProvider(new Vde),this.addProvider(new zde(this.configWallet())),this.addProvider({handleRequest:async(t,r,n)=>{try{let{error:i,result:o}=await this.handleRequest(t);n(i,o)}catch(i){n(i)}},setEngine:t=>t})}configWallet(){return{getAccounts:async t=>{try{let n=(await this.getWalletConnector()).accounts;n&&n.length?t(null,n):t(new Error("Failed to get accounts"))}catch(r){t(r)}},processMessage:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signMessage([t.from,t.data]);r(null,i)}catch(n){r(n)}},processPersonalMessage:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signPersonalMessage([t.data,t.from]);r(null,i)}catch(n){r(n)}},processSignTransaction:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signTransaction(t);r(null,i)}catch(n){r(n)}},processTransaction:async(t,r)=>{try{let i=await(await this.getWalletConnector()).sendTransaction(t);r(null,i)}catch(n){r(n)}},processTypedMessage:async(t,r)=>{try{let i=await(await this.getWalletConnector()).signTypedData([t.from,t.data]);r(null,i)}catch(n){r(n)}}}}},RD=K3;var gK=Hr(D$());var N7e=Object.create,Jb=Object.defineProperty,q7e=Object.defineProperties,L7e=Object.getOwnPropertyDescriptor,B7e=Object.getOwnPropertyDescriptors,D7e=Object.getOwnPropertyNames,j$=Object.getOwnPropertySymbols,j7e=Object.getPrototypeOf,X$=Object.prototype.hasOwnProperty,F7e=Object.prototype.propertyIsEnumerable,F$=(e,t,r)=>t in e?Jb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yd=(e,t)=>{for(var r in t||(t={}))X$.call(t,r)&&F$(e,r,t[r]);if(j$)for(var r of j$(t))F7e.call(t,r)&&F$(e,r,t[r]);return e},Vb=(e,t)=>q7e(e,B7e(t)),U7e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),H7e=(e,t)=>{for(var r in t)Jb(e,r,{get:t[r],enumerable:!0})},W7e=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of D7e(t))!X$.call(e,i)&&i!==r&&Jb(e,i,{get:()=>t[i],enumerable:!(n=L7e(t,i))||n.enumerable});return e},z7e=(e,t,r)=>(r=e!=null?N7e(j7e(e)):{},W7e(t||!e||!e.__esModule?Jb(r,"default",{value:e,enumerable:!0}):r,e)),fn=(e,t,r)=>new Promise((n,i)=>{var o=v=>{try{c(r.next(v))}catch(y){i(y)}},a=v=>{try{c(r.throw(v))}catch(y){i(y)}},c=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,a);c((r=r.apply(e,t)).next())}),V7e=U7e((e,t)=>{"use strict";var r=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function o(y,w,M){this.fn=y,this.context=w,this.once=M||!1}function a(y,w,M,S,R){if(typeof M!="function")throw new TypeError("The listener must be a function");var C=new o(M,S||y,R),B=n?n+w:w;return y._events[B]?y._events[B].fn?y._events[B]=[y._events[B],C]:y._events[B].push(C):(y._events[B]=C,y._eventsCount++),y}function c(y,w){--y._eventsCount===0?y._events=new i:delete y._events[w]}function v(){this._events=new i,this._eventsCount=0}v.prototype.eventNames=function(){var y=[],w,M;if(this._eventsCount===0)return y;for(M in w=this._events)r.call(w,M)&&y.push(n?M.slice(1):M);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(w)):y},v.prototype.listeners=function(y){var w=n?n+y:y,M=this._events[w];if(!M)return[];if(M.fn)return[M.fn];for(var S=0,R=M.length,C=new Array(R);S<R;S++)C[S]=M[S].fn;return C},v.prototype.listenerCount=function(y){var w=n?n+y:y,M=this._events[w];return M?M.fn?1:M.length:0},v.prototype.emit=function(y,w,M,S,R,C){var B=n?n+y:y;if(!this._events[B])return!1;var N=this._events[B],q=arguments.length,H,D;if(N.fn){switch(N.once&&this.removeListener(y,N.fn,void 0,!0),q){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,w),!0;case 3:return N.fn.call(N.context,w,M),!0;case 4:return N.fn.call(N.context,w,M,S),!0;case 5:return N.fn.call(N.context,w,M,S,R),!0;case 6:return N.fn.call(N.context,w,M,S,R,C),!0}for(D=1,H=new Array(q-1);D<q;D++)H[D-1]=arguments[D];N.fn.apply(N.context,H)}else{var ee=N.length,ge;for(D=0;D<ee;D++)switch(N[D].once&&this.removeListener(y,N[D].fn,void 0,!0),q){case 1:N[D].fn.call(N[D].context);break;case 2:N[D].fn.call(N[D].context,w);break;case 3:N[D].fn.call(N[D].context,w,M);break;case 4:N[D].fn.call(N[D].context,w,M,S);break;default:if(!H)for(ge=1,H=new Array(q-1);ge<q;ge++)H[ge-1]=arguments[ge];N[D].fn.apply(N[D].context,H)}}return!0},v.prototype.on=function(y,w,M){return a(this,y,w,M,!1)},v.prototype.once=function(y,w,M){return a(this,y,w,M,!0)},v.prototype.removeListener=function(y,w,M,S){var R=n?n+y:y;if(!this._events[R])return this;if(!w)return c(this,R),this;var C=this._events[R];if(C.fn)C.fn===w&&(!S||C.once)&&(!M||C.context===M)&&c(this,R);else{for(var B=0,N=[],q=C.length;B<q;B++)(C[B].fn!==w||S&&!C[B].once||M&&C[B].context!==M)&&N.push(C[B]);N.length?this._events[R]=N.length===1?N[0]:N:c(this,R)}return this},v.prototype.removeAllListeners=function(y){var w;return y?(w=n?n+y:y,this._events[w]&&c(this,w)):(this._events=new i,this._eventsCount=0),this},v.prototype.off=v.prototype.removeListener,v.prototype.addListener=v.prototype.on,v.prefixed=n,v.EventEmitter=v,typeof t<"u"&&(t.exports=v)});function $7e(e){let t={exports:{}};return e(t,t.exports),t.exports}var K7e=Number.MAX_SAFE_INTEGER||9007199254740991,bS={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:K7e,MAX_SAFE_COMPONENT_LENGTH:16},G7e=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},Yt=G7e,Xd=$7e(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=bS,n=(t=e.exports={}).re=[],i=t.src=[],o=t.t={},a=0,c=(v,y,w)=>{let M=a++;Yt(M,y),o[v]=M,i[M]=y,n[M]=new RegExp(y,w?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})\\.(${i[o.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})\\.(${i[o.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${i[o.NUMERICIDENTIFIER]}|${i[o.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${i[o.NUMERICIDENTIFIERLOOSE]}|${i[o.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${i[o.PRERELEASEIDENTIFIER]}(?:\\.${i[o.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${i[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[o.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${i[o.BUILDIDENTIFIER]}(?:\\.${i[o.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${i[o.MAINVERSION]}${i[o.PRERELEASE]}?${i[o.BUILD]}?`),c("FULL",`^${i[o.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${i[o.MAINVERSIONLOOSE]}${i[o.PRERELEASELOOSE]}?${i[o.BUILD]}?`),c("LOOSE",`^${i[o.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${i[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${i[o.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:\\.(${i[o.XRANGEIDENTIFIER]})(?:${i[o.PRERELEASE]})?${i[o.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:${i[o.PRERELEASELOOSE]})?${i[o.BUILD]}?)?)?`),c("XRANGE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${i[o.GTLT]}\\s*${i[o.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),c("COERCERTL",i[o.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${i[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${i[o.LONETILDE]}${i[o.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${i[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${i[o.LONECARET]}${i[o.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${i[o.LONECARET]}${i[o.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${i[o.GTLT]}\\s*(${i[o.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${i[o.GTLT]}\\s*(${i[o.LOOSEPLAIN]}|${i[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${i[o.XRANGEPLAIN]})\\s+-\\s+(${i[o.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${i[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[o.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),U$=/^[0-9]+$/,eK=(e,t)=>{let r=U$.test(e),n=U$.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Z7e=(e,t)=>eK(t,e),Y7e={compareIdentifiers:eK,rcompareIdentifiers:Z7e},{MAX_LENGTH:H$,MAX_SAFE_INTEGER:Fb}=bS,{re:W$,t:z$}=Xd,{compareIdentifiers:Kd}=Y7e,un=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof un){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>H$)throw new TypeError(`version is longer than ${H$} characters`);Yt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?W$[z$.LOOSE]:W$[z$.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Fb||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Fb||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Fb||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Fb)return i}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Yt("SemVer.compare",this.version,this.options,e),!(e instanceof un)){if(typeof e=="string"&&e===this.version)return 0;e=new un(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof un||(e=new un(e,this.options)),Kd(this.major,e.major)||Kd(this.minor,e.minor)||Kd(this.patch,e.patch)}comparePre(e){if(e instanceof un||(e=new un(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Yt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Kd(r,n)}while(++t)}compareBuild(e){e instanceof un||(e=new un(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(Yt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r!==n)return Kd(r,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},J7e=(e,t,r)=>new un(e,r).compare(new un(t,r)),ul=J7e,Q7e=(e,t,r)=>ul(e,t,r)===0,X7e=Q7e,eAe=(e,t,r)=>ul(e,t,r)!==0,tAe=eAe,rAe=(e,t,r)=>ul(e,t,r)>0,nAe=rAe,iAe=(e,t,r)=>ul(e,t,r)>=0,oAe=iAe,sAe=(e,t,r)=>ul(e,t,r)<0,aAe=sAe,uAe=(e,t,r)=>ul(e,t,r)<=0,fAe=uAe,cAe=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return X7e(e,r,n);case"!=":return tAe(e,r,n);case">":return nAe(e,r,n);case">=":return oAe(e,r,n);case"<":return aAe(e,r,n);case"<=":return fAe(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}},mS=cAe,Gd=Symbol("SemVer ANY"),Jd=class{static get ANY(){return Gd}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Jd){if(e.loose===!!t.loose)return e;e=e.value}Yt("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Gd?this.value="":this.value=this.operator+this.semver.version,Yt("comp",this)}parse(e){let t=this.options.loose?V$[$$.COMPARATORLOOSE]:V$[$$.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new un(r[2],this.options.loose):this.semver=Gd}toString(){return this.value}test(e){if(Yt("Comparator.test",e,this.options.loose),this.semver===Gd||e===Gd)return!0;if(typeof e=="string")try{e=new un(e,this.options)}catch(t){return!1}return mS(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Jd))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new ol(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new ol(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),n=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),i=this.semver.version===e.semver.version,o=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=mS(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=mS(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||n||i&&o||a||c}},{re:V$,t:$$}=Xd,ol=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof ol)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new ol(e.raw,t);if(e instanceof Jd)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?On[cn.HYPHENRANGELOOSE]:On[cn.HYPHENRANGE];e=e.replace(r,MAe(this.options.includePrerelease)),Yt("hyphen replace",e),e=e.replace(On[cn.COMPARATORTRIM],lAe),Yt("comparator trim",e,On[cn.COMPARATORTRIM]),e=(e=(e=e.replace(On[cn.TILDETRIM],hAe)).replace(On[cn.CARETTRIM],dAe)).split(/\s+/).join(" ");let n=t?On[cn.COMPARATORLOOSE]:On[cn.COMPARATOR];return e.split(" ").map(i=>pAe(i,this.options)).join(" ").split(/\s+/).map(i=>xAe(i,this.options)).filter(this.options.loose?i=>!!i.match(n):()=>!0).map(i=>new Jd(i,this.options))}intersects(e,t){if(!(e instanceof ol))throw new TypeError("a Range is required");return this.set.some(r=>K$(r,t)&&e.set.some(n=>K$(n,t)&&r.every(i=>n.every(o=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new un(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(SAe(this.set[t],e,this.options))return!0;return!1}},{re:On,t:cn,comparatorTrimReplace:lAe,tildeTrimReplace:hAe,caretTrimReplace:dAe}=Xd,K$=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},pAe=(e,t)=>(Yt("comp",e,t),e=gAe(e,t),Yt("caret",e),e=vAe(e,t),Yt("tildes",e),e=yAe(e,t),Yt("xrange",e),e=wAe(e,t),Yt("stars",e),e),jn=e=>!e||e.toLowerCase()==="x"||e==="*",vAe=(e,t)=>e.trim().split(/\s+/).map(r=>mAe(r,t)).join(" "),mAe=(e,t)=>{let r=t.loose?On[cn.TILDELOOSE]:On[cn.TILDE];return e.replace(r,(n,i,o,a,c)=>{let v;return Yt("tilde",e,n,i,o,a,c),jn(i)?v="":jn(o)?v=`>=${i}.0.0 <${+i+1}.0.0-0`:jn(a)?v=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:c?(Yt("replaceTilde pr",c),v=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`):v=`>=${i}.${o}.${a} <${i}.${+o+1}.0-0`,Yt("tilde return",v),v})},gAe=(e,t)=>e.trim().split(/\s+/).map(r=>bAe(r,t)).join(" "),bAe=(e,t)=>{Yt("caret",e,t);let r=t.loose?On[cn.CARETLOOSE]:On[cn.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,a,c,v)=>{let y;return Yt("caret",e,i,o,a,c,v),jn(o)?y="":jn(a)?y=`>=${o}.0.0${n} <${+o+1}.0.0-0`:jn(c)?y=o==="0"?`>=${o}.${a}.0${n} <${o}.${+a+1}.0-0`:`>=${o}.${a}.0${n} <${+o+1}.0.0-0`:v?(Yt("replaceCaret pr",v),y=o==="0"?a==="0"?`>=${o}.${a}.${c}-${v} <${o}.${a}.${+c+1}-0`:`>=${o}.${a}.${c}-${v} <${o}.${+a+1}.0-0`:`>=${o}.${a}.${c}-${v} <${+o+1}.0.0-0`):(Yt("no pr"),y=o==="0"?a==="0"?`>=${o}.${a}.${c}${n} <${o}.${a}.${+c+1}-0`:`>=${o}.${a}.${c}${n} <${o}.${+a+1}.0-0`:`>=${o}.${a}.${c} <${+o+1}.0.0-0`),Yt("caret return",y),y})},yAe=(e,t)=>(Yt("replaceXRanges",e,t),e.split(/\s+/).map(r=>_Ae(r,t)).join(" ")),_Ae=(e,t)=>{e=e.trim();let r=t.loose?On[cn.XRANGELOOSE]:On[cn.XRANGE];return e.replace(r,(n,i,o,a,c,v)=>{Yt("xRange",e,n,i,o,a,c,v);let y=jn(o),w=y||jn(a),M=w||jn(c),S=M;return i==="="&&S&&(i=""),v=t.includePrerelease?"-0":"",y?n=i===">"||i==="<"?"<0.0.0-0":"*":i&&S?(w&&(a=0),c=0,i===">"?(i=">=",w?(o=+o+1,a=0,c=0):(a=+a+1,c=0)):i==="<="&&(i="<",w?o=+o+1:a=+a+1),i==="<"&&(v="-0"),n=`${i+o}.${a}.${c}${v}`):w?n=`>=${o}.0.0${v} <${+o+1}.0.0-0`:M&&(n=`>=${o}.${a}.0${v} <${o}.${+a+1}.0-0`),Yt("xRange return",n),n})},wAe=(e,t)=>(Yt("replaceStars",e,t),e.trim().replace(On[cn.STAR],"")),xAe=(e,t)=>(Yt("replaceGTE0",e,t),e.trim().replace(On[t.includePrerelease?cn.GTE0PRE:cn.GTE0],"")),MAe=e=>(t,r,n,i,o,a,c,v,y,w,M,S,R)=>`${r=jn(n)?"":jn(i)?`>=${n}.0.0${e?"-0":""}`:jn(o)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${v=jn(y)?"":jn(w)?`<${+y+1}.0.0-0`:jn(M)?`<${y}.${+w+1}.0-0`:S?`<=${y}.${w}.${M}-${S}`:e?`<${y}.${w}.${+M+1}-0`:`<=${v}`}`.trim(),SAe=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Yt(e[n].semver),e[n].semver!==Jd.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0},EAe=(e,t,r)=>{try{t=new ol(t,r)}catch(n){return!1}return t.test(e)},{MAX_LENGTH:AAe}=bS,{re:G$,t:Z$}=Xd,OAe=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof un)return e;if(typeof e!="string"||e.length>AAe||!(t.loose?G$[Z$.LOOSE]:G$[Z$.FULL]).test(e))return null;try{return new un(e,t)}catch(r){return null}},RAe=OAe,{re:Ub,t:Hb}=Xd,IAe=(e,t)=>{if(e instanceof un)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let n;for(;(n=Ub[Hb.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),Ub[Hb.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Ub[Hb.COERCERTL].lastIndex=-1}else r=e.match(Ub[Hb.COERCE]);return r===null?null:RAe(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function CAe(e){return String.fromCharCode(parseInt(e.slice(1),16))}function TAe(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function kAe(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,CAe))}function PAe(e){return decodeURIComponent(Array.from(atob(e),TAe).join(""))}function tK(e){return kAe(JSON.stringify(e))}function NAe(e){return JSON.parse(PAe(e))}function Zd(e){return typeof e=="undefined"}function qAe(e){return e===null}function rK(e){return qAe(e)||Zd(e)}function LAe(e){return rK(e)?!1:!Zd(e.jsonrpc)&&!Zd(e.id)&&(!Zd(e.result)||!Zd(e.error))}function BAe(e){return rK(e)?!1:typeof e=="number"&&Object.values(Vu).includes(e)}function gS(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var Dr={};function nK(e,t){return Object.assign(Dr,t),e}var DAe={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},ss=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,ss.prototype)}},sl=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=BAe(t)?t:Vu.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,sl.prototype)}},ep=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Qb=class extends Error{constructor(e,t,r,n){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=n,this.__proto__=Error,Object.setPrototypeOf(this,Qb.prototype)}},Kb=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function jAe(){return new ss(Co.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function iK(){return new ss(Co.ModalNotReady,"Modal is not ready.")}function FAe(){return new ss(Co.MalformedResponse,"Response from the Magic iframe is malformed.")}function UAe(e){return new ss(Co.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function HAe(e){let t=`Some extensions are incompatible with \`${Dr.sdkName}@${Dr.version}\`:`;return e.filter(r=>typeof r.compat!="undefined"&&r.compat!==null).forEach(r=>{let n=r.compat[Dr.sdkName];typeof n=="string"?t+=`
|
|
573
|
+
- Extension \`${r.name}\` supports version(s) \`${n}\``:n||(t+=`
|
|
574
|
+
- Extension \`${r.name}\` does not support ${Dr.platform} environments.`)}),new ss(Co.IncompatibleExtensions,t)}function WAe(e){let t=r=>{let n=r+1,i=n%10,o=n%100;return i===1&&o!==11?`${n}st`:i===2&&o!==12?`${n}nd`:i===3&&o!==13?`${n}rd`:`${n}th`};return new ss(Co.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
|
|
4
575
|
Expected: \`${e.expected}\`
|
|
5
|
-
Received: \`${e.received}\``)}function Rr(){return new Ye(Se.DuplicateIframe,"Duplicate iframes found.")}function eo(){return new Ye(Se.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function to(){return new Ye(Se.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${z.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function*ro(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var no=ro();function Ar(){return no.next().value}var Sr=Symbol("Payload pre-processed by Magic SDK");function Nr(e){return Object.defineProperty(e,Sr,{value:!0,enumerable:!1}),e}function io(e){return!!e[Sr]}function et(e){var t,n,o;return io(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=Ar(),e.method=(n=e.method)!=null?n:"noop",e.params=(o=e.params)!=null?o:[],Nr(e)),e}function V(e,t=[]){return Nr({params:t,method:e,jsonrpc:"2.0",id:Ar()})}var It=class{constructor(e){e instanceof It?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):Ki(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},oo=ei(ti()),ao=class extends oo.default{};function Tr(){let e=new ao;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...o)=>(e[t].apply(e,o),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var Or=Symbol("isPromiEvent");function bt(e){return!!e[Or]}function Lr(e){let t=Mr(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:o}=Tr(),s=Symbol("Promise.then"),c=Symbol("Promise.catch"),g=Symbol("Promise.finally"),p=(y,N)=>(...I)=>{let T=N[y].apply(N,I);return m(T)},m=y=>Object.assign(y,{[Or]:!0,[s]:y[s]||y.then,[c]:y[c]||y.catch,[g]:y[g]||y.finally,then:p(s,y),catch:p(c,y),finally:p(g,y),on:o("on",y),once:o("once",y),addListener:o("addListener",y),off:o("off",y),removeListener:o("removeListener",y),removeAllListeners:o("removeAllListeners",y),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),v=m(t.then(y=>(v.emit("done",y),v.emit("settled"),y),y=>{throw v.emit("error",y),v.emit("settled"),y}));return v}function Mr(e){return new Promise((t,n)=>{let o=e(t,n);Promise.resolve(o).catch(n)})}var be=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(_e.MAGIC_HANDLE_REQUEST,et(e)),n=Lr((s,c)=>{t.then(g=>{if(o(),g.hasError)c(new Le(g.payload.error));else if(g.hasResult)s(g.payload.result);else throw zi()}).catch(g=>{o(),c(g)})}),o=this.overlay.on(fe.MAGIC_HANDLE_EVENT,s=>{var c;let{response:g}=s.data;if(g.id===e.id&&((c=g.result)==null?void 0:c.event)){let{event:p,params:m=[]}=g.result;n.emit(p,...m)}});return n}createIntermediaryEvent(e,t){return n=>{let o=V(x.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(o)}}},so=class extends be{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:o}=e,s=V(this.sdk.testMode?x.LoginWithMagicLinkTestMode:x.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:o}]);return this.request(s)}loginWithSMS(e){let{phoneNumber:t}=e,n=V(this.sdk.testMode?x.LoginWithSmsTestMode:x.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t,showUI:n}=e,o=V(this.sdk.testMode?x.LoginWithEmailOTPTestMode:x.LoginWithEmailOTP,[{email:t,showUI:n}]);if(!n){let s=this.request(o);return s&&s.on("otp-input-sent",c=>{this.createIntermediaryEvent("verify-email-otp",o.id)(c)}),s}return this.request(o)}loginWithCredential(e){let t=e!=null?e:"";if(!e&&z.platform==="web"){t=window.location.search;let o=window.location.origin+window.location.pathname;window.history.replaceState(null,"",o)}let n=V(this.sdk.testMode?x.LoginWithCredentialTestMode:x.LoginWithCredential,[t]);return this.request(n)}},$r={};Qn($r,{clear:()=>uo,getItem:()=>je,iterate:()=>ho,key:()=>lo,keys:()=>fo,length:()=>co,removeItem:()=>Et,setItem:()=>tt});var ze;function ge(e){return(...t)=>de(this,null,function*(){return ze||(ze=yield z.configureStorage()),yield ze.ready(),ze[e](...t)})}var je=ge("getItem"),tt=ge("setItem"),Et=ge("removeItem"),uo=ge("clear"),co=ge("length"),lo=ge("key"),fo=ge("keys"),ho=ge("iterate");function po(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var wt="STORE_KEY_PRIVATE_KEY",rt="STORE_KEY_PUBLIC_JWK",Rt="ECDSA",Pr="P-256",mo={name:Rt,namedCurve:Pr},vo={name:Rt,namedCurve:Pr};function Dr(){Et(rt),Et(wt)}function go(){return de(this,null,function*(){let e=yield yo();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,n=yield je(wt);if(!n||!t){console.info("unable to find private key or webcrypto unsupported");return}let o={iat:Math.floor(new Date().getTime()/1e3),jti:po()},s={typ:"dpop+jwt",alg:"ES256",jwk:e},c={protected:pr(JSON.stringify(s)),claims:pr(JSON.stringify(o))},g=Io(`${c.protected}.${c.claims}`),p={name:Rt,hash:{name:"SHA-256"}},m=wo(new Uint8Array(yield t.sign(p,n,g)));return`${c.protected}.${c.claims}.${m}`})}function yo(){return de(this,null,function*(){if(!_o()){console.info("webcrypto is not supported");return}return(yield je(rt))||(yield Eo()),je(rt)})}function Eo(){return de(this,null,function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(mo,!0,["sign"]),o=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let s=yield t.importKey("jwk",o,vo,!1,["sign"]);yield tt(wt,s),yield tt(rt,e)})}function _o(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function pr(e){return Cr(bo(e))}function Io(e){return new TextEncoder().encode(e)}function Cr(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function bo(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function wo(e){let t="";return e.forEach(n=>{t+=String.fromCharCode(n)}),Cr(t)}var Ro=class extends be{getIdToken(e){let t=V(this.sdk.testMode?x.GetIdTokenTestMode:x.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=V(this.sdk.testMode?x.GenerateIdTokenTestMode:x.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=V(this.sdk.testMode?x.GetMetadataTestMode:x.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,o=V(this.sdk.testMode?x.UpdateEmailTestMode:x.UpdateEmail,[{email:t,showUI:n}]);return this.request(o)}isLoggedIn(){let e=V(this.sdk.testMode?x.IsLoggedInTestMode:x.IsLoggedIn);return this.request(e)}logout(){Dr();let e=V(this.sdk.testMode?x.LogoutTestMode:x.Logout);return this.request(e)}showSettings(){let e=V(this.sdk.testMode?x.UserSettingsTestMode:x.UserSettings);return this.request(e)}updatePhoneNumber(){let e=V(this.sdk.testMode?x.UpdatePhoneNumberTestMode:x.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=V(this.sdk.testMode?x.RecoverAccountTestMode:x.RecoverAccount,[e]);return this.request(t)}},Ao=class extends be{connectWithUI(){let e=V(x.RequestAccounts);return this.request(e)}showUI(){let e=V(x.ShowUI);return this.request(e)}getInfo(){let e=V(x.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=V(x.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){Dr();let e=V(x.Disconnect);return this.request(e)}},{createBoundEmitterMethod:Je,createChainingEmitterMethod:Te}=Tr(),So=class extends be{constructor(){super(...arguments),this.isMagic=!0,this.on=Te("on",this),this.once=Te("once",this),this.addListener=Te("addListener",this),this.off=Te("off",this),this.removeListener=Te("removeListener",this),this.removeAllListeners=Te("removeAllListeners",this),this.emit=Je("emit"),this.eventNames=Je("eventNames"),this.listeners=Je("listeners"),this.listenerCount=Je("listenerCount")}sendAsync(e,t){if(!t)throw Zi({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(_e.MAGIC_HANDLE_REQUEST,e.map(n=>{let o=et(n);return this.prefixPayloadMethodForTestMode(o),o})).then(n=>{t(null,n.map(o=>zn(yr({},o.payload),{error:o.hasError?new Le(o.payload.error):null})))});else{let n=et(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(_e.MAGIC_HANDLE_REQUEST,n).then(o=>{t(o.hasError?new Le(o.payload.error):null,o.payload)})}}send(e,t){if(typeof e=="string"){let o=V(e,Array.isArray(t)?t:[]);return this.request(o)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let n=eo();return n.log(),new It(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=V("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}};function ke(e,t){return t?new URL(e,t):new URL(e)}var mr=["request","overlay","sdk"];function No(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==be.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var xr=class extends be{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Lr,isPromiEvent:bt,encodeJSON:_r,decodeJSON:Yi,createJsonRpcRequestPayload:V,standardizeJsonRpcRequestPayload:et,storage:$r};let e=[this,...No(this)];mr.forEach(t=>{let n=e.map(g=>Object.getOwnPropertyDescriptor(g,t)),o=n.findIndex(g=>!!g),s=o>0,c=n[o];c&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:c,isPrototypeField:s}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Ji(t)}}))})}init(e){this.__is_initialized__||(mr.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:n,isPrototypeField:o}=this.__sdk_access_field_descriptors__.get(t);o?delete this[t]:Object.defineProperty(this,t,n)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:o}=e,s=o?` Use \`${o}\` instead.`:"",c=`\`${t}\` will be removed from this Extension in version \`${n}\`.${s}`;return new Ze(this,"DEPRECATION_NOTICE",c)}createWarning(e,t){return new Ze(this,e,t)}createError(e,t,n){return new it(this,e,t,n)}},To=class extends xr{},Ie=class extends xr{};Ie.Internal=To,Ie.Anonymous="anonymous extension";var Oo=class extends be{purchase(e){let t=V(x.NFTPurchase,[e]);return this.request(t)}};function vr(e){return e.compat&&e.compat[z.sdkName]!=null?typeof e.compat[z.sdkName]=="string"?Ci(Fi(z.version),e.compat[z.sdkName]):!!e.compat[z.sdkName]:!0}function Lo(e){var t;let n=(t=e==null?void 0:e.extensions)!=null?t:[],o={},s=[];if(Array.isArray(n)?n.forEach(c=>{vr(c)?(c.init(this),(c.name||c.name!==Ie.Anonymous)&&(this[c.name]=c),c instanceof Ie.Internal&&(yt(c.config)||(o[c.name]=c.config))):s.push(c)}):Object.keys(n).forEach(c=>{if(vr(n[c])){n[c].init(this);let g=n[c];this[c]=g,g instanceof Ie.Internal&&(yt(g.config)||(o[n[c].name]=g.config))}else s.push(n[c])}),s.length)throw Qi(s);return o}var Qe=class{constructor(e,t){this.apiKey=e;var n;if(!e)throw qi();z.platform==="react-native"&&(t==null?void 0:t.endpoint)&&to().log();let{defaultEndpoint:o,version:s}=z;this.testMode=!!(t!=null&&t.testMode),this.endpoint=ke((n=t==null?void 0:t.endpoint)!=null?n:o).origin,this.auth=new so(this),this.user=new Ro(this),this.wallet=new Ao(this),this.nft=new Oo(this),this.rpcProvider=new So(this);let c=Lo.call(this,t);this.parameters=_r(yr({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:ke(this.endpoint).host,sdk:Xi[z.sdkName],version:s,ext:yt(c)?void 0:c,locale:(t==null?void 0:t.locale)||"en_US"},z.bundleId?{bundleId:z.bundleId}:{}))}get overlay(){if(!Qe.__overlays__.has(this.parameters)){let e=new z.ViewController(this.endpoint,this.parameters);e.init(),Qe.__overlays__.set(this.parameters,e)}return Qe.__overlays__.get(this.parameters)}preload(){return de(this,null,function*(){yield this.overlay.ready})}},At=Qe;At.__overlays__=new Map;function Mo(e,t){return t&&Array.isArray(e)?e.find(n=>n.id===t):e}function $o(e,t){var n;let o=(n=t.data.response)==null?void 0:n.id,s=Mo(e,o);if(o&&s){let c=new It(s).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:o,response:c}}return{}}function Po(e,t){return de(this,null,function*(){let n=yield je("rt"),o;if(z.platform==="web")try{o=yield go()}catch(s){console.error("webcrypto error",s)}return o?n?{msgType:e,payload:t,jwt:o,rt:n}:{msgType:e,payload:t,jwt:o}:{msgType:e,payload:t}})}function Do(e){return de(this,null,function*(){!e.data.rt||(yield tt("rt",e.data.rt))})}var Ur=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return de(this,null,function*(){return Mr(n=>de(this,null,function*(){yield this.ready;let o=[],s=Array.isArray(t)?t.map(m=>m.id):[],c=yield Po(`${e}-${this.parameters}`,t);yield this._post(c);let g=m=>v=>{let{id:y,response:N}=$o(t,v);Do(v),y&&N&&Array.isArray(t)&&s.includes(y)?(o.push(N),o.length===t.length&&(m(),n(o))):y&&N&&!Array.isArray(t)&&y===t.id&&(m(),n(N))},p=this.on(fe.MAGIC_HANDLE_RESPONSE,g(()=>p()))}))})}on(e,t){let n=t.bind(window),o=s=>{s.data.msgType===`${e}-${this.parameters}`&&n(s)};return this.messageHandlers.add(o),()=>this.messageHandlers.delete(o)}waitForReady(){return new Promise(e=>{this.on(fe.MAGIC_OVERLAY_READY,()=>e())})}listen(){this.on(fe.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(fe.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var St={};Zt(St,{EthChainType:()=>rr,Extension:()=>Ie,ExtensionError:()=>it,ExtensionWarning:()=>Ze,MagicIncomingWindowMessage:()=>fe,MagicOutgoingWindowMessage:()=>_e,MagicPayloadMethod:()=>x,RPCError:()=>Le,RPCErrorCode:()=>Ne,SDKError:()=>he,SDKErrorCode:()=>le,SDKWarning:()=>Ye,SDKWarningCode:()=>Se,isPromiEvent:()=>bt});var st=tr(Fr()),Tt=tr(jr());var Co={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function xo(e){for(let[t,n]of Object.entries(Co))e.style[t]=n}function Uo(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(n=>n.src.includes(e)))}var at=class extends Ur{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(n=>{let o=()=>{if(Uo(encodeURIComponent(this.parameters)))Rr().log();else{let s=document.createElement("iframe");s.classList.add("magic-iframe"),s.dataset.magicIframeLabel=ke(this.endpoint).host,s.title="Secure Modal",s.src=ke(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,xo(s),document.body.appendChild(s),n(s)}};["loaded","interactive","complete"].includes(document.readyState)?o():window.addEventListener("load",o,!1)}),window.addEventListener("message",n=>{var o;if(n.origin===this.endpoint&&n.data&&n.data.msgType&&this.messageHandlers.size){n.data.response=(o=n.data.response)!=null?o:{};for(let s of this.messageHandlers.values())s(n)}})}showOverlay(){return Ae(this,null,function*(){let n=yield this.iframe;n.style.display="block",this.activeElement=document.activeElement,n.focus()})}hideOverlay(){return Ae(this,null,function*(){var o;let n=yield this.iframe;n.style.display="none",(o=this.activeElement)!=null&&o.focus&&this.activeElement.focus(),this.activeElement=null})}_post(n){return Ae(this,null,function*(){let o=yield this.iframe;if(o&&o.contentWindow)o.contentWindow.postMessage(n,this.endpoint);else throw wr()})}};var Bo=Object.assign(br(At,{platform:"web",sdkName:"magic-sdk",version:"13.6.2",defaultEndpoint:"https://auth.magic.link/",ViewController:at,configureStorage:()=>Ae(void 0,null,function*(){let e=st.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(Tt),yield e.setDriver([st.default.INDEXEDDB,st.default.LOCALSTORAGE,Tt._driver]),e})}),Jt({},St)),Fo=Bo;return kn(Go);})();
|
|
576
|
+
Received: \`${e.received}\``)}function oK(){return new ep(zu.DuplicateIframe,"Duplicate iframes found.")}function zAe(){return new ep(zu.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function VAe(){return new ep(zu.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${Dr.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function*$Ae(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var KAe=$Ae();function sK(){return KAe.next().value}var aK=Symbol("Payload pre-processed by Magic SDK");function uK(e){return Object.defineProperty(e,aK,{value:!0,enumerable:!1}),e}function GAe(e){return!!e[aK]}function Gb(e){var t,r,n;return GAe(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=sK(),e.method=(r=e.method)!=null?r:"noop",e.params=(n=e.params)!=null?n:[],uK(e)),e}function mr(e,t=[]){return uK({params:t,method:e,jsonrpc:"2.0",id:sK()})}var yS=class{constructor(e){e instanceof yS?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):LAe(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error!="undefined"&&this._error!==null}get hasResult(){return typeof this._result!="undefined"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},ZAe=z7e(V7e()),YAe=class extends ZAe.default{};function fK(){let e=new YAe;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...n)=>(e[t].apply(e,n),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var cK=Symbol("isPromiEvent");function _S(e){return!!e[cK]}function lK(e){let t=hK(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=fK(),i=Symbol("Promise.then"),o=Symbol("Promise.catch"),a=Symbol("Promise.finally"),c=(w,M)=>(...S)=>{let R=M[w].apply(M,S);return v(R)},v=w=>Object.assign(w,{[cK]:!0,[i]:w[i]||w.then,[o]:w[o]||w.catch,[a]:w[a]||w.finally,then:c(i,w),catch:c(o,w),finally:c(a,w),on:n("on",w),once:n("once",w),addListener:n("addListener",w),off:n("off",w),removeListener:n("removeListener",w),removeAllListeners:n("removeAllListeners",w),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),y=v(t.then(w=>(y.emit("done",w),y.emit("settled"),w),w=>{throw y.emit("error",w),y.emit("settled"),w}));return y}function hK(e){return new Promise((t,r)=>{let n=e(t,r);Promise.resolve(n).catch(r)})}var Hu=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(ua.MAGIC_HANDLE_REQUEST,Gb(e)),r=lK((i,o)=>{t.then(a=>{if(n(),a.hasError)o(new sl(a.payload.error));else if(a.hasResult)i(a.payload.result);else throw FAe()}).catch(a=>{n(),o(a)})}),n=this.overlay.on(Po.MAGIC_HANDLE_EVENT,i=>{var o;let{response:a}=i.data;if(a.id===e.id&&((o=a.result)==null?void 0:o.event)){let{event:c,params:v=[]}=a.result;r.emit(c,...v)}});return r}createIntermediaryEvent(e,t){return r=>{let n=mr(gt.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(n)}}},JAe=class extends Hu{loginWithMagicLink(e){let{email:t,showUI:r=!0,redirectURI:n}=e,i=mr(this.sdk.testMode?gt.LoginWithMagicLinkTestMode:gt.LoginWithMagicLink,[{email:t,showUI:r,redirectURI:n}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,r=mr(this.sdk.testMode?gt.LoginWithSmsTestMode:gt.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r}=e,n=mr(this.sdk.testMode?gt.LoginWithEmailOTPTestMode:gt.LoginWithEmailOTP,[{email:t,showUI:r}]);if(!r){let i=this.request(n);return i&&i.on("otp-input-sent",o=>{this.createIntermediaryEvent("verify-email-otp",n.id)(o)}),i}return this.request(n)}loginWithCredential(e){let t=e!=null?e:"";if(!e&&Dr.platform==="web"){t=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=mr(this.sdk.testMode?gt.LoginWithCredentialTestMode:gt.LoginWithCredential,[t]);return this.request(r)}},dK={};H7e(dK,{clear:()=>QAe,getItem:()=>os,iterate:()=>rOe,key:()=>eOe,keys:()=>tOe,length:()=>XAe,removeItem:()=>Zb,setItem:()=>al});var Wb;function sa(e){return(...t)=>fn(this,null,function*(){return Wb||(Wb=yield Dr.configureStorage()),yield Wb.ready(),Wb[e](...t)})}var os=sa("getItem"),al=sa("setItem"),Zb=sa("removeItem"),QAe=sa("clear"),XAe=sa("length"),eOe=sa("key"),tOe=sa("keys"),rOe=sa("iterate");function nOe(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var wS="STORE_KEY_PRIVATE_KEY",Yb="STORE_KEY_PUBLIC_JWK",xS="ECDSA",pK="P-256",iOe={name:xS,namedCurve:pK},oOe={name:xS,namedCurve:pK};function vK(){Zb(Yb),Zb(wS)}function sOe(){return fn(this,null,function*(){let e=yield aOe();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield os(wS);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:nOe()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},o={protected:Y$(JSON.stringify(i)),claims:Y$(JSON.stringify(n))},a=cOe(`${o.protected}.${o.claims}`),c={name:xS,hash:{name:"SHA-256"}},v=hOe(new Uint8Array(yield t.sign(c,r,a)));return`${o.protected}.${o.claims}.${v}`})}function aOe(){return fn(this,null,function*(){if(!fOe()){console.info("webcrypto is not supported");return}return(yield os(Yb))||(yield uOe()),os(Yb)})}function uOe(){return fn(this,null,function*(){let e=null,{subtle:t}=window.crypto,r=yield t.generateKey(iOe,!0,["sign"]),n=yield t.exportKey("jwk",r.privateKey);e=yield t.exportKey("jwk",r.publicKey);let i=yield t.importKey("jwk",n,oOe,!1,["sign"]);yield al(wS,i),yield al(Yb,e)})}function fOe(){let e=typeof window!="undefined"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function Y$(e){return mK(lOe(e))}function cOe(e){return new TextEncoder().encode(e)}function mK(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function lOe(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function hOe(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),mK(t)}var dOe=class extends Hu{getIdToken(e){let t=mr(this.sdk.testMode?gt.GetIdTokenTestMode:gt.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=mr(this.sdk.testMode?gt.GenerateIdTokenTestMode:gt.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=mr(this.sdk.testMode?gt.GetMetadataTestMode:gt.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:r=!0}=e,n=mr(this.sdk.testMode?gt.UpdateEmailTestMode:gt.UpdateEmail,[{email:t,showUI:r}]);return this.request(n)}isLoggedIn(){let e=mr(this.sdk.testMode?gt.IsLoggedInTestMode:gt.IsLoggedIn);return this.request(e)}logout(){vK();let e=mr(this.sdk.testMode?gt.LogoutTestMode:gt.Logout);return this.request(e)}showSettings(){let e=mr(this.sdk.testMode?gt.UserSettingsTestMode:gt.UserSettings);return this.request(e)}updatePhoneNumber(){let e=mr(this.sdk.testMode?gt.UpdatePhoneNumberTestMode:gt.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=mr(this.sdk.testMode?gt.RecoverAccountTestMode:gt.RecoverAccount,[e]);return this.request(t)}},pOe=class extends Hu{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){return fn(this,null,function*(){if(this.isMetaMaskBrowser())try{if(yield this.isWalletEnabled(Xr.MetaMask))return this.autoConnectIfWalletBrowser(Xr.MetaMask)}catch(n){console.error(n)}if(this.isCoinbaseWalletBrowser())try{if(yield this.isWalletEnabled(Xr.CoinbaseWallet))return this.autoConnectIfWalletBrowser(Xr.CoinbaseWallet)}catch(n){console.error(n)}let e=this.getUserEnv(),t=mr(gt.Login,[e]),r=this.request(t);return r.on(To.WalletSelected,n=>this.handleWalletSelected(Vb(Yd({},n),{showModal:!!n.showModal,payloadId:t.id}))),r})}getProvider(){return fn(this,null,function*(){var e,t;switch(yield os(this.localForageKey)){case Xr.MetaMask:return this.getMetaMaskProvider();case Xr.WalletConnect:if(!((e=this.sdk.thirdPartyWalletOptions)!=null&&e.walletConnect))throw new Error(ko.WalletConnectError);return this.getWalletConnectProvider(!1);case Xr.CoinbaseWallet:if(!((t=this.sdk.thirdPartyWalletOptions)!=null&&t.coinbaseWallet))throw new Error(ko.CoinbaseWalletError);return this.getCoinbaseProvider().provider;default:return this.sdk.rpcProvider}})}showUI(){let e=mr(gt.ShowUI);return this.request(e)}getInfo(){return fn(this,null,function*(){let e=yield os(this.localForageKey),t=mr(gt.GetInfo,[{walletType:e}]);return this.request(t)})}requestUserInfoWithUI(e){let t=mr(gt.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){return fn(this,null,function*(){vK();let e=yield os(this.localForageKey);if(e===Xr.WalletConnect)try{yield(yield this.getWalletConnectProvider(!1)).disconnect()}catch(r){console.error(r)}e===Xr.CoinbaseWallet&&this.getCoinbaseProvider().provider.disconnect(),Zb(this.localForageKey);let t=mr(gt.Disconnect);return this.request(t)})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(n=>n==null?void 0:n.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}getWalletConnectProvider(e){return fn(this,null,function*(){var t;let r=(t=this.sdk.thirdPartyWalletOptions)==null?void 0:t.walletConnect;if(!r)throw new Error(ko.WalletConnectError);let n=new RD(Vb(Yd({},r),{qrcode:e})),i=yield os(this.localForageKey),o=localStorage.getItem("walletconnect");return i&&o&&(yield n.enable()),n})}connectToWalletConnect(e,t){return fn(this,null,function*(){var r;if(!((r=this.sdk.thirdPartyWalletOptions)!=null&&r.walletConnect))throw new Error(ko.WalletConnectError);let n=yield this.getWalletConnectProvider(!!t);return n.connector.on(To.DisplayUri,(i,o)=>{if(!t){let a=o.params[0];this.createIntermediaryEvent(To.Uri,e)(a)}}),n.enable()})}isCoinbaseWalletInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(n=>n==null?void 0:n.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,t,r,n;let i=(t=(e=this.sdk.thirdPartyWalletOptions)==null?void 0:e.coinbaseWallet)==null?void 0:t.provider,o=(n=(r=this.sdk.thirdPartyWalletOptions)==null?void 0:r.coinbaseWallet)==null?void 0:n.sdk;if(!i||!o)throw new Error(ko.CoinbaseWalletError);let a=new gK.CoinbaseWalletSDK(Vb(Yd({},o),{overrideIsMetaMask:!1,headlessMode:!0})),c=a.getQrUrl();return{provider:a.makeWeb3Provider(i.jsonRpcUrl,i.chainId),qrCodeUrl:c}}connectToCoinbaseWallet(e){var t;if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let n=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=n}if(!((t=this.sdk.thirdPartyWalletOptions)!=null&&t.coinbaseWallet))throw new Error(ko.CoinbaseWalletError);let r=this.getCoinbaseProvider();return r.qrCodeUrl&&this.createIntermediaryEvent(To.Uri,e)(r.qrCodeUrl),r.provider.request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e,t,r){switch(e){case Xr.MetaMask:return this.connectToMetaMask();case Xr.WalletConnect:return this.connectToWalletConnect(t,r);case Xr.CoinbaseWallet:return this.connectToCoinbaseWallet(t);default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask", "coinbase_wallet", or "wallet_connect".`)}}isWalletEnabled(e){let t=mr("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return fn(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet,e.payloadId,e.showModal);yield al(this.localForageKey,e.wallet),this.createIntermediaryEvent(To.WalletConnected,e.payloadId)(t)}catch(t){this.createIntermediaryEvent(To.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return fn(this,null,function*(){let t;e===Xr.MetaMask&&(t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===Xr.CoinbaseWallet&&(t=yield this.getCoinbaseProvider().provider.request({method:"eth_requestAccounts"})),yield al(this.localForageKey,e);let r=mr(gt.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:zb,createChainingEmitterMethod:il}=fK(),vOe=class extends Hu{constructor(){super(...arguments),this.isMagic=!0,this.on=il("on",this),this.once=il("once",this),this.addListener=il("addListener",this),this.off=il("off",this),this.removeListener=il("removeListener",this),this.removeAllListeners=il("removeAllListeners",this),this.emit=zb("emit"),this.eventNames=zb("eventNames"),this.listeners=zb("listeners"),this.listenerCount=zb("listenerCount")}sendAsync(e,t){if(!t)throw WAe({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(ua.MAGIC_HANDLE_REQUEST,e.map(r=>{let n=Gb(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{t(null,r.map(n=>Vb(Yd({},n.payload),{error:n.hasError?new sl(n.payload.error):null})))});else{let r=Gb(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(ua.MAGIC_HANDLE_REQUEST,r).then(n=>{t(n.hasError?new sl(n.payload.error):null,n.payload)})}}send(e,t){if(typeof e=="string"){let n=mr(e,Array.isArray(t)?t:[]);return this.request(n)}if(Array.isArray(e)||!!t){this.sendAsync(e,t);return}let r=zAe();return r.log(),new yS(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=mr("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}};function Qd(e,t){return t?new URL(e,t):new URL(e)}var J$=["request","overlay","sdk"];function mOe(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==Hu.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var bK=class extends Hu{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:lK,isPromiEvent:_S,encodeJSON:tK,decodeJSON:NAe,createJsonRpcRequestPayload:mr,standardizeJsonRpcRequestPayload:Gb,storage:dK};let e=[this,...mOe(this)];J$.forEach(t=>{let r=e.map(a=>Object.getOwnPropertyDescriptor(a,t)),n=r.findIndex(a=>!!a),i=n>0,o=r[n];o&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:o,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw UAe(t)}}))})}init(e){this.__is_initialized__||(J$.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(t);n?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:n}=e,i=n?` Use \`${n}\` instead.`:"",o=`\`${t}\` will be removed from this Extension in version \`${r}\`.${i}`;return new Kb(this,"DEPRECATION_NOTICE",o)}createWarning(e,t){return new Kb(this,e,t)}createError(e,t,r){return new Qb(this,e,t,r)}},gOe=class extends bK{},Uu=class extends bK{};Uu.Internal=gOe,Uu.Anonymous="anonymous extension";var bOe=class extends Hu{purchase(e){let t=mr(gt.NFTPurchase,[e]);return this.request(t)}};function Q$(e){return e.compat&&e.compat[Dr.sdkName]!=null?typeof e.compat[Dr.sdkName]=="string"?EAe(IAe(Dr.version),e.compat[Dr.sdkName]):!!e.compat[Dr.sdkName]:!0}function yOe(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],n={},i=[];if(Array.isArray(r)?r.forEach(o=>{Q$(o)?(o.init(this),(o.name||o.name!==Uu.Anonymous)&&(this[o.name]=o),o instanceof Uu.Internal&&(gS(o.config)||(n[o.name]=o.config))):i.push(o)}):Object.keys(r).forEach(o=>{if(Q$(r[o])){r[o].init(this);let a=r[o];this[o]=a,a instanceof Uu.Internal&&(gS(a.config)||(n[r[o].name]=a.config))}else i.push(r[o])}),i.length)throw HAe(i);return n}var $b=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw jAe();Dr.platform==="react-native"&&(t==null?void 0:t.endpoint)&&VAe().log();let{defaultEndpoint:n,version:i,thirdPartyWalletOptions:o}=Dr;this.testMode=!!(t!=null&&t.testMode),this.endpoint=Qd((r=t==null?void 0:t.endpoint)!=null?r:n).origin,this.thirdPartyWalletOptions=o||(t==null?void 0:t.thirdPartyWalletOptions),this.auth=new JAe(this),this.user=new dOe(this),this.wallet=new pOe(this),this.nft=new bOe(this),this.rpcProvider=new vOe(this);let a=yOe.call(this,t);this.parameters=tK(Yd({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:Qd(this.endpoint).host,sdk:DAe[Dr.sdkName],version:i,ext:gS(a)?void 0:a,locale:(t==null?void 0:t.locale)||"en_US"},Dr.bundleId?{bundleId:Dr.bundleId}:{}))}get overlay(){if(!$b.__overlays__.has(this.parameters)){let e=new Dr.ViewController(this.endpoint,this.parameters);e.init(),$b.__overlays__.set(this.parameters,e)}return $b.__overlays__.get(this.parameters)}preload(){return fn(this,null,function*(){yield this.overlay.ready})}},MS=$b;MS.__overlays__=new Map;function _Oe(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function wOe(e,t){var r;let n=(r=t.data.response)==null?void 0:r.id,i=_Oe(e,n);if(n&&i){let o=new yS(i).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:n,response:o}}return{}}function xOe(e,t){return fn(this,null,function*(){let r=yield os("rt"),n;if(Dr.platform==="web")try{n=yield sOe()}catch(i){console.error("webcrypto error",i)}return n?r?{msgType:e,payload:t,jwt:n,rt:r}:{msgType:e,payload:t,jwt:n}:{msgType:e,payload:t}})}function MOe(e){return fn(this,null,function*(){!e.data.rt||(yield al("rt",e.data.rt))})}var yK=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return fn(this,null,function*(){return hK(r=>fn(this,null,function*(){yield this.ready;let n=[],i=Array.isArray(t)?t.map(v=>v.id):[],o=yield xOe(`${e}-${this.parameters}`,t);yield this._post(o);let a=v=>y=>{let{id:w,response:M}=wOe(t,y);MOe(y),w&&M&&Array.isArray(t)&&i.includes(w)?(n.push(M),n.length===t.length&&(v(),r(n))):w&&M&&!Array.isArray(t)&&w===t.id&&(v(),r(M))},c=this.on(Po.MAGIC_HANDLE_RESPONSE,a(()=>c()))}))})}on(e,t){let r=t.bind(window),n=i=>{i.data.msgType===`${e}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(e=>{this.on(Po.MAGIC_OVERLAY_READY,()=>e())})}listen(){this.on(Po.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Po.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}};var SS={};Sr(SS,{Errors:()=>ko,EthChainType:()=>kS,Events:()=>To,Extension:()=>Uu,ExtensionError:()=>Qb,ExtensionWarning:()=>Kb,MagicIncomingWindowMessage:()=>Po,MagicOutgoingWindowMessage:()=>ua,MagicPayloadMethod:()=>gt,RPCError:()=>sl,RPCErrorCode:()=>Vu,SDKError:()=>ss,SDKErrorCode:()=>Co,SDKWarning:()=>ep,SDKWarningCode:()=>zu,Wallets:()=>Xr,isPromiEvent:()=>_S});var ty=Hr(wK()),AS=Hr(MK());var SOe={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function EOe(e){for(let[t,r]of Object.entries(SOe))e.style[t]=r}function AOe(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find(r=>r.src.includes(e)))}var ey=class extends yK{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(r=>{let n=()=>{if(AOe(encodeURIComponent(this.parameters)))oK().log();else{let i=document.createElement("iframe");i.classList.add("magic-iframe"),i.dataset.magicIframeLabel=Qd(this.endpoint).host,i.title="Secure Modal",i.src=Qd(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,EOe(i),document.body.appendChild(i),r(i)}};["loaded","interactive","complete"].includes(document.readyState)?n():window.addEventListener("load",n,!1)}),window.addEventListener("message",r=>{var n;if(r.origin===this.endpoint&&r.data&&r.data.msgType&&this.messageHandlers.size){r.data.response=(n=r.data.response)!=null?n:{};for(let i of this.messageHandlers.values())i(r)}})}showOverlay(){return Wu(this,null,function*(){let r=yield this.iframe;r.style.display="block",this.activeElement=document.activeElement,r.focus()})}hideOverlay(){return Wu(this,null,function*(){var n;let r=yield this.iframe;r.style.display="none",(n=this.activeElement)!=null&&n.focus&&this.activeElement.focus(),this.activeElement=null})}_post(r){return Wu(this,null,function*(){let n=yield this.iframe;if(n&&n.contentWindow)n.contentWindow.postMessage(r,this.endpoint);else throw iK()})}};var OOe=Object.assign(nK(MS,{platform:"web",sdkName:"magic-sdk",version:"14.0.0-2f75fa3-2",defaultEndpoint:"https://auth.magic.link/",ViewController:ey,configureStorage:()=>Wu(void 0,null,function*(){let e=ty.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(AS),yield e.setDriver([ty.default.INDEXEDDB,ty.default.LOCALSTORAGE,AS._driver]),e})}),TS({},SS)),ROe=OOe;return Pt(IOe);})();
|
|
6
577
|
if (Magic && Magic.default != null) { Magic = Object.assign(Magic.default, Magic); delete Magic.default; }
|